+// SPDX-License-Identifier: GPL-2.0-or-later
/* BGP advertisement and adjacency
* Copyright (C) 1996, 97, 98, 99, 2000 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <zebra.h>
/* BGP advertise attribute is used for pack same attribute update into
one packet. To do that we maintain attribute hash in struct
peer. */
-struct bgp_advertise_attr *baa_new(void)
+struct bgp_advertise_attr *bgp_advertise_attr_new(void)
{
return XCALLOC(MTYPE_BGP_ADVERTISE_ATTR,
sizeof(struct bgp_advertise_attr));
}
-static void baa_free(struct bgp_advertise_attr *baa)
+void bgp_advertise_attr_free(struct bgp_advertise_attr *baa)
{
XFREE(MTYPE_BGP_ADVERTISE_ATTR, baa);
}
-static void *baa_hash_alloc(void *p)
+static void *bgp_advertise_attr_hash_alloc(void *p)
{
struct bgp_advertise_attr *ref = (struct bgp_advertise_attr *)p;
struct bgp_advertise_attr *baa;
- baa = baa_new();
+ baa = bgp_advertise_attr_new();
baa->attr = ref->attr;
return baa;
}
-unsigned int baa_hash_key(const void *p)
+unsigned int bgp_advertise_attr_hash_key(const void *p)
{
const struct bgp_advertise_attr *baa = p;
return attrhash_key_make(baa->attr);
}
-bool baa_hash_cmp(const void *p1, const void *p2)
+bool bgp_advertise_attr_hash_cmp(const void *p1, const void *p2)
{
const struct bgp_advertise_attr *baa1 = p1;
const struct bgp_advertise_attr *baa2 = p2;
baa->adv = adv->next;
}
-struct bgp_advertise_attr *bgp_advertise_intern(struct hash *hash,
- struct attr *attr)
+struct bgp_advertise_attr *bgp_advertise_attr_intern(struct hash *hash,
+ struct attr *attr)
{
struct bgp_advertise_attr ref;
struct bgp_advertise_attr *baa;
ref.attr = bgp_attr_intern(attr);
- baa = (struct bgp_advertise_attr *)hash_get(hash, &ref, baa_hash_alloc);
+ baa = (struct bgp_advertise_attr *)hash_get(
+ hash, &ref, bgp_advertise_attr_hash_alloc);
baa->refcnt++;
return baa;
}
-void bgp_advertise_unintern(struct hash *hash, struct bgp_advertise_attr *baa)
+void bgp_advertise_attr_unintern(struct hash *hash,
+ struct bgp_advertise_attr *baa)
{
if (baa->refcnt)
baa->refcnt--;
hash_release(hash, baa);
bgp_attr_unintern(&baa->attr);
}
- baa_free(baa);
+ bgp_advertise_attr_free(baa);
}
}
adj = XCALLOC(MTYPE_BGP_ADJ_IN, sizeof(struct bgp_adj_in));
adj->peer = peer_lock(peer); /* adj_in peer reference */
adj->attr = bgp_attr_intern(attr);
- adj->uptime = bgp_clock();
+ adj->uptime = monotime(NULL);
adj->addpath_rx_id = addpath_id;
BGP_ADJ_IN_ADD(dest, adj);
bgp_dest_lock_node(dest);