Merge pull request #3832 from kooky/rename_backet

Rename backet to bucket
This commit is contained in:
Martin Winter 2019-02-26 08:19:49 +07:00 committed by GitHub
commit 51127bc88c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
34 changed files with 328 additions and 323 deletions

View File

@ -1294,7 +1294,7 @@ static void _shop_key(struct bfd_session *bs, const struct bfd_shop_key *shop);
static void _shop_key2(struct bfd_session *bs, const struct bfd_shop_key *shop); static void _shop_key2(struct bfd_session *bs, const struct bfd_shop_key *shop);
static void _mhop_key(struct bfd_session *bs, const struct bfd_mhop_key *mhop); static void _mhop_key(struct bfd_session *bs, const struct bfd_mhop_key *mhop);
static void _bfd_free(struct hash_backet *hb, static void _bfd_free(struct hash_bucket *hb,
void *arg __attribute__((__unused__))); void *arg __attribute__((__unused__)));
/* BFD hash for our discriminator. */ /* BFD hash for our discriminator. */
@ -1516,7 +1516,7 @@ void bfd_initialize(void)
"BFD multihop hop hash"); "BFD multihop hop hash");
} }
static void _bfd_free(struct hash_backet *hb, static void _bfd_free(struct hash_bucket *hb,
void *arg __attribute__((__unused__))) void *arg __attribute__((__unused__)))
{ {
struct bfd_session *bs = hb->data; struct bfd_session *bs = hb->data;

View File

@ -557,7 +557,7 @@ bool bfd_mhop_insert(struct bfd_session *bs);
bool bfd_vrf_insert(struct bfd_vrf *vrf); bool bfd_vrf_insert(struct bfd_vrf *vrf);
bool bfd_iface_insert(struct bfd_iface *iface); bool bfd_iface_insert(struct bfd_iface *iface);
typedef void (*hash_iter_func)(struct hash_backet *hb, void *arg); typedef void (*hash_iter_func)(struct hash_bucket *hb, void *arg);
void bfd_id_iterate(hash_iter_func hif, void *arg); void bfd_id_iterate(hash_iter_func hif, void *arg);
void bfd_shop_iterate(hash_iter_func hif, void *arg); void bfd_shop_iterate(hash_iter_func hif, void *arg);
void bfd_mhop_iterate(hash_iter_func hif, void *arg); void bfd_mhop_iterate(hash_iter_func hif, void *arg);

View File

@ -52,7 +52,7 @@
static int bfdd_write_config(struct vty *vty); static int bfdd_write_config(struct vty *vty);
static int bfdd_peer_write_config(struct vty *vty); static int bfdd_peer_write_config(struct vty *vty);
static void _bfdd_peer_write_config(struct vty *vty, struct bfd_session *bs); static void _bfdd_peer_write_config(struct vty *vty, struct bfd_session *bs);
static void _bfdd_peer_write_config_iter(struct hash_backet *hb, void *arg); static void _bfdd_peer_write_config_iter(struct hash_bucket *hb, void *arg);
static int bfd_configure_peer(struct bfd_peer_cfg *bpc, bool mhop, static int bfd_configure_peer(struct bfd_peer_cfg *bpc, bool mhop,
const struct sockaddr_any *peer, const struct sockaddr_any *peer,
const struct sockaddr_any *local, const struct sockaddr_any *local,
@ -65,13 +65,13 @@ static struct json_object *_peer_json_header(struct bfd_session *bs);
static void _display_peer_json(struct vty *vty, struct bfd_session *bs); static void _display_peer_json(struct vty *vty, struct bfd_session *bs);
static void _display_peer(struct vty *vty, struct bfd_session *bs); static void _display_peer(struct vty *vty, struct bfd_session *bs);
static void _display_all_peers(struct vty *vty, bool use_json); static void _display_all_peers(struct vty *vty, bool use_json);
static void _display_peer_iter(struct hash_backet *hb, void *arg); static void _display_peer_iter(struct hash_bucket *hb, void *arg);
static void _display_peer_json_iter(struct hash_backet *hb, void *arg); static void _display_peer_json_iter(struct hash_bucket *hb, void *arg);
static void _display_peer_counter(struct vty *vty, struct bfd_session *bs); static void _display_peer_counter(struct vty *vty, struct bfd_session *bs);
static struct json_object *__display_peer_counters_json(struct bfd_session *bs); static struct json_object *__display_peer_counters_json(struct bfd_session *bs);
static void _display_peer_counters_json(struct vty *vty, struct bfd_session *bs); static void _display_peer_counters_json(struct vty *vty, struct bfd_session *bs);
static void _display_peer_counter_iter(struct hash_backet *hb, void *arg); static void _display_peer_counter_iter(struct hash_bucket *hb, void *arg);
static void _display_peer_counter_json_iter(struct hash_backet *hb, void *arg); static void _display_peer_counter_json_iter(struct hash_bucket *hb, void *arg);
static void _display_peers_counter(struct vty *vty, bool use_json); static void _display_peers_counter(struct vty *vty, bool use_json);
static struct bfd_session * static struct bfd_session *
_find_peer_or_error(struct vty *vty, int argc, struct cmd_token **argv, _find_peer_or_error(struct vty *vty, int argc, struct cmd_token **argv,
@ -538,7 +538,7 @@ static void _display_peer_json(struct vty *vty, struct bfd_session *bs)
json_object_free(jo); json_object_free(jo);
} }
static void _display_peer_iter(struct hash_backet *hb, void *arg) static void _display_peer_iter(struct hash_bucket *hb, void *arg)
{ {
struct vty *vty = arg; struct vty *vty = arg;
struct bfd_session *bs = hb->data; struct bfd_session *bs = hb->data;
@ -546,7 +546,7 @@ static void _display_peer_iter(struct hash_backet *hb, void *arg)
_display_peer(vty, bs); _display_peer(vty, bs);
} }
static void _display_peer_json_iter(struct hash_backet *hb, void *arg) static void _display_peer_json_iter(struct hash_bucket *hb, void *arg)
{ {
struct json_object *jo = arg, *jon = NULL; struct json_object *jo = arg, *jon = NULL;
struct bfd_session *bs = hb->data; struct bfd_session *bs = hb->data;
@ -621,7 +621,7 @@ static void _display_peer_counters_json(struct vty *vty, struct bfd_session *bs)
json_object_free(jo); json_object_free(jo);
} }
static void _display_peer_counter_iter(struct hash_backet *hb, void *arg) static void _display_peer_counter_iter(struct hash_bucket *hb, void *arg)
{ {
struct vty *vty = arg; struct vty *vty = arg;
struct bfd_session *bs = hb->data; struct bfd_session *bs = hb->data;
@ -629,7 +629,7 @@ static void _display_peer_counter_iter(struct hash_backet *hb, void *arg)
_display_peer_counter(vty, bs); _display_peer_counter(vty, bs);
} }
static void _display_peer_counter_json_iter(struct hash_backet *hb, void *arg) static void _display_peer_counter_json_iter(struct hash_bucket *hb, void *arg)
{ {
struct json_object *jo = arg, *jon = NULL; struct json_object *jo = arg, *jon = NULL;
struct bfd_session *bs = hb->data; struct bfd_session *bs = hb->data;
@ -970,7 +970,7 @@ DEFUN_NOSH(show_debugging_bfd,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void _bfdd_peer_write_config_iter(struct hash_backet *hb, void *arg) static void _bfdd_peer_write_config_iter(struct hash_bucket *hb, void *arg)
{ {
struct vty *vty = arg; struct vty *vty = arg;
struct bfd_session *bs = hb->data; struct bfd_session *bs = hb->data;

View File

@ -65,7 +65,7 @@ static void control_handle_notify_add(struct bfd_control_socket *bcs,
struct bfd_control_msg *bcm); struct bfd_control_msg *bcm);
static void control_handle_notify_del(struct bfd_control_socket *bcs, static void control_handle_notify_del(struct bfd_control_socket *bcs,
struct bfd_control_msg *bcm); struct bfd_control_msg *bcm);
static void _control_handle_notify(struct hash_backet *hb, void *arg); static void _control_handle_notify(struct hash_bucket *hb, void *arg);
static void control_handle_notify(struct bfd_control_socket *bcs, static void control_handle_notify(struct bfd_control_socket *bcs,
struct bfd_control_msg *bcm); struct bfd_control_msg *bcm);
static void control_response(struct bfd_control_socket *bcs, uint16_t id, static void control_response(struct bfd_control_socket *bcs, uint16_t id,
@ -630,7 +630,7 @@ static struct bfd_session *_notify_find_peer(struct bfd_peer_cfg *bpc)
return bs_peer_find(bpc); return bs_peer_find(bpc);
} }
static void _control_handle_notify(struct hash_backet *hb, void *arg) static void _control_handle_notify(struct hash_bucket *hb, void *arg)
{ {
struct bfd_control_socket *bcs = arg; struct bfd_control_socket *bcs = arg;
struct bfd_session *bs = hb->data; struct bfd_session *bs = hb->data;

View File

@ -2077,14 +2077,14 @@ void aspath_print_vty(struct vty *vty, const char *format, struct aspath *as,
vty_out(vty, "%s", suffix); vty_out(vty, "%s", suffix);
} }
static void aspath_show_all_iterator(struct hash_backet *backet, static void aspath_show_all_iterator(struct hash_bucket *bucket,
struct vty *vty) struct vty *vty)
{ {
struct aspath *as; struct aspath *as;
as = (struct aspath *)backet->data; as = (struct aspath *)bucket->data;
vty_out(vty, "[%p:%u] (%ld) ", (void *)backet, backet->key, as->refcnt); vty_out(vty, "[%p:%u] (%ld) ", (void *)bucket, bucket->key, as->refcnt);
vty_out(vty, "%s\n", as->str); vty_out(vty, "%s\n", as->str);
} }
@ -2092,7 +2092,7 @@ static void aspath_show_all_iterator(struct hash_backet *backet,
`show [ip] bgp paths' command. */ `show [ip] bgp paths' command. */
void aspath_print_all_vty(struct vty *vty) void aspath_print_all_vty(struct vty *vty)
{ {
hash_iterate(ashash, (void (*)(struct hash_backet *, hash_iterate(ashash, (void (*)(struct hash_bucket *,
void *))aspath_show_all_iterator, void *))aspath_show_all_iterator,
vty); vty);
} }

View File

@ -592,9 +592,9 @@ static void attrhash_finish(void)
attrhash = NULL; attrhash = NULL;
} }
static void attr_show_all_iterator(struct hash_backet *backet, struct vty *vty) static void attr_show_all_iterator(struct hash_bucket *bucket, struct vty *vty)
{ {
struct attr *attr = backet->data; struct attr *attr = bucket->data;
vty_out(vty, "attr[%ld] nexthop %s\n", attr->refcnt, vty_out(vty, "attr[%ld] nexthop %s\n", attr->refcnt,
inet_ntoa(attr->nexthop)); inet_ntoa(attr->nexthop));
@ -605,7 +605,7 @@ static void attr_show_all_iterator(struct hash_backet *backet, struct vty *vty)
void attr_show_all(struct vty *vty) void attr_show_all(struct vty *vty)
{ {
hash_iterate(attrhash, (void (*)(struct hash_backet *, hash_iterate(attrhash, (void (*)(struct hash_bucket *,
void *))attr_show_all_iterator, void *))attr_show_all_iterator,
vty); vty);
} }

View File

@ -3604,9 +3604,9 @@ static int delete_withdraw_vni_routes(struct bgp *bgp, struct bgpevpn *vpn)
* router-id. The routes in the per-VNI table are used to create routes in * router-id. The routes in the per-VNI table are used to create routes in
* the global table and schedule them. * the global table and schedule them.
*/ */
static void update_router_id_vni(struct hash_backet *backet, struct bgp *bgp) static void update_router_id_vni(struct hash_bucket *bucket, struct bgp *bgp)
{ {
struct bgpevpn *vpn = (struct bgpevpn *)backet->data; struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
/* Skip VNIs with configured RD. */ /* Skip VNIs with configured RD. */
if (is_rd_configured(vpn)) if (is_rd_configured(vpn))
@ -3622,9 +3622,9 @@ static void update_router_id_vni(struct hash_backet *backet, struct bgp *bgp)
* the router-id and is done only on the global route table, the routes * the router-id and is done only on the global route table, the routes
* are needed in the per-VNI table to re-advertise with new router id. * are needed in the per-VNI table to re-advertise with new router id.
*/ */
static void withdraw_router_id_vni(struct hash_backet *backet, struct bgp *bgp) static void withdraw_router_id_vni(struct hash_bucket *bucket, struct bgp *bgp)
{ {
struct bgpevpn *vpn = (struct bgpevpn *)backet->data; struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
/* Skip VNIs with configured RD. */ /* Skip VNIs with configured RD. */
if (is_rd_configured(vpn)) if (is_rd_configured(vpn))
@ -3637,9 +3637,9 @@ static void withdraw_router_id_vni(struct hash_backet *backet, struct bgp *bgp)
* Create RT-3 for a VNI and schedule for processing and advertisement. * Create RT-3 for a VNI and schedule for processing and advertisement.
* This is invoked upon flooding mode changing to head-end replication. * This is invoked upon flooding mode changing to head-end replication.
*/ */
static void create_advertise_type3(struct hash_backet *backet, void *data) static void create_advertise_type3(struct hash_bucket *bucket, void *data)
{ {
struct bgpevpn *vpn = backet->data; struct bgpevpn *vpn = bucket->data;
struct bgp *bgp = data; struct bgp *bgp = data;
struct prefix_evpn p; struct prefix_evpn p;
@ -3656,9 +3656,9 @@ static void create_advertise_type3(struct hash_backet *backet, void *data)
* Delete RT-3 for a VNI and schedule for processing and withdrawal. * Delete RT-3 for a VNI and schedule for processing and withdrawal.
* This is invoked upon flooding mode changing to drop BUM packets. * This is invoked upon flooding mode changing to drop BUM packets.
*/ */
static void delete_withdraw_type3(struct hash_backet *backet, void *data) static void delete_withdraw_type3(struct hash_bucket *bucket, void *data)
{ {
struct bgpevpn *vpn = backet->data; struct bgpevpn *vpn = bucket->data;
struct bgp *bgp = data; struct bgp *bgp = data;
struct prefix_evpn p; struct prefix_evpn p;
@ -4088,9 +4088,9 @@ static void evpn_mpattr_encode_type5(struct stream *s, struct prefix *p,
/* /*
* Cleanup specific VNI upon EVPN (advertise-all-vni) being disabled. * Cleanup specific VNI upon EVPN (advertise-all-vni) being disabled.
*/ */
static void cleanup_vni_on_disable(struct hash_backet *backet, struct bgp *bgp) static void cleanup_vni_on_disable(struct hash_bucket *bucket, struct bgp *bgp)
{ {
struct bgpevpn *vpn = (struct bgpevpn *)backet->data; struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
/* Remove EVPN routes and schedule for processing. */ /* Remove EVPN routes and schedule for processing. */
delete_routes_for_vni(bgp, vpn); delete_routes_for_vni(bgp, vpn);
@ -4104,9 +4104,9 @@ static void cleanup_vni_on_disable(struct hash_backet *backet, struct bgp *bgp)
/* /*
* Free a VNI entry; iterator function called during cleanup. * Free a VNI entry; iterator function called during cleanup.
*/ */
static void free_vni_entry(struct hash_backet *backet, struct bgp *bgp) static void free_vni_entry(struct hash_bucket *bucket, struct bgp *bgp)
{ {
struct bgpevpn *vpn = (struct bgpevpn *)backet->data; struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
delete_all_vni_routes(bgp, vpn); delete_all_vni_routes(bgp, vpn);
bgp_evpn_free(bgp, vpn); bgp_evpn_free(bgp, vpn);
@ -4175,9 +4175,9 @@ static void bgp_evpn_handle_export_rt_change_for_vrf(struct bgp *bgp_vrf)
/* /*
* Handle autort change for a given VNI. * Handle autort change for a given VNI.
*/ */
static void update_autort_vni(struct hash_backet *backet, struct bgp *bgp) static void update_autort_vni(struct hash_bucket *bucket, struct bgp *bgp)
{ {
struct bgpevpn *vpn = backet->data; struct bgpevpn *vpn = bucket->data;
if (!is_import_rt_configured(vpn)) { if (!is_import_rt_configured(vpn)) {
if (is_vni_live(vpn)) if (is_vni_live(vpn))
@ -4483,7 +4483,7 @@ void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw)
* L2-VNIs * L2-VNIs
*/ */
hash_iterate(bgp->vnihash, hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))withdraw_router_id_vni, void *))withdraw_router_id_vni,
bgp); bgp);
} else { } else {
@ -4497,7 +4497,7 @@ void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw)
* new RD * new RD
*/ */
hash_iterate(bgp->vnihash, hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))update_router_id_vni, void *))update_router_id_vni,
bgp); bgp);
} }
@ -4509,7 +4509,7 @@ void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw)
void bgp_evpn_handle_autort_change(struct bgp *bgp) void bgp_evpn_handle_autort_change(struct bgp *bgp)
{ {
hash_iterate(bgp->vnihash, hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void*))update_autort_vni, void*))update_autort_vni,
bgp); bgp);
} }
@ -5382,10 +5382,10 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
return 0; return 0;
} }
static void link_l2vni_hash_to_l3vni(struct hash_backet *backet, static void link_l2vni_hash_to_l3vni(struct hash_bucket *bucket,
struct bgp *bgp_vrf) struct bgp *bgp_vrf)
{ {
struct bgpevpn *vpn = (struct bgpevpn *)backet->data; struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
struct bgp *bgp_def = NULL; struct bgp *bgp_def = NULL;
bgp_def = bgp_get_default(); bgp_def = bgp_get_default();
@ -5471,7 +5471,7 @@ int bgp_evpn_local_l3vni_add(vni_t l3vni, vrf_id_t vrf_id, struct ethaddr *rmac,
/* link all corresponding l2vnis */ /* link all corresponding l2vnis */
hash_iterate(bgp_def->vnihash, hash_iterate(bgp_def->vnihash,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))link_l2vni_hash_to_l3vni, void *))link_l2vni_hash_to_l3vni,
bgp_vrf); bgp_vrf);
@ -5804,7 +5804,7 @@ void bgp_evpn_flood_control_change(struct bgp *bgp)
*/ */
void bgp_evpn_cleanup_on_disable(struct bgp *bgp) void bgp_evpn_cleanup_on_disable(struct bgp *bgp)
{ {
hash_iterate(bgp->vnihash, (void (*)(struct hash_backet *, hash_iterate(bgp->vnihash, (void (*)(struct hash_bucket *,
void *))cleanup_vni_on_disable, void *))cleanup_vni_on_disable,
bgp); bgp);
} }
@ -5816,7 +5816,7 @@ void bgp_evpn_cleanup_on_disable(struct bgp *bgp)
void bgp_evpn_cleanup(struct bgp *bgp) void bgp_evpn_cleanup(struct bgp *bgp)
{ {
hash_iterate(bgp->vnihash, hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *, void *))free_vni_entry, (void (*)(struct hash_bucket *, void *))free_vni_entry,
bgp); bgp);
hash_free(bgp->import_rt_hash); hash_free(bgp->import_rt_hash);

View File

@ -149,11 +149,11 @@ static void display_vrf_import_rt(struct vty *vty, struct vrf_irt_node *irt,
} }
} }
static void show_vrf_import_rt_entry(struct hash_backet *backet, void *args[]) static void show_vrf_import_rt_entry(struct hash_bucket *bucket, void *args[])
{ {
json_object *json = NULL; json_object *json = NULL;
struct vty *vty = NULL; struct vty *vty = NULL;
struct vrf_irt_node *irt = (struct vrf_irt_node *)backet->data; struct vrf_irt_node *irt = (struct vrf_irt_node *)bucket->data;
vty = (struct vty *)args[0]; vty = (struct vty *)args[0];
json = (struct json_object *)args[1]; json = (struct json_object *)args[1];
@ -256,11 +256,11 @@ static void display_import_rt(struct vty *vty, struct irt_node *irt,
} }
} }
static void show_import_rt_entry(struct hash_backet *backet, void *args[]) static void show_import_rt_entry(struct hash_bucket *bucket, void *args[])
{ {
json_object *json = NULL; json_object *json = NULL;
struct vty *vty = NULL; struct vty *vty = NULL;
struct irt_node *irt = (struct irt_node *)backet->data; struct irt_node *irt = (struct irt_node *)bucket->data;
vty = args[0]; vty = args[0];
json = args[1]; json = args[1];
@ -709,9 +709,9 @@ static void show_vni_routes(struct bgp *bgp, struct bgpevpn *vpn, int type,
} }
} }
static void show_vni_routes_hash(struct hash_backet *backet, void *arg) static void show_vni_routes_hash(struct hash_bucket *bucket, void *arg)
{ {
struct bgpevpn *vpn = (struct bgpevpn *)backet->data; struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
struct vni_walk_ctx *wctx = arg; struct vni_walk_ctx *wctx = arg;
struct vty *vty = wctx->vty; struct vty *vty = wctx->vty;
json_object *json = wctx->json; json_object *json = wctx->json;
@ -835,7 +835,7 @@ static void show_l3vni_entry(struct vty *vty, struct bgp *bgp,
} }
} }
static void show_es_entry(struct hash_backet *backet, void *args[]) static void show_es_entry(struct hash_bucket *bucket, void *args[])
{ {
char buf[ESI_STR_LEN]; char buf[ESI_STR_LEN];
char buf1[RD_ADDRSTRLEN]; char buf1[RD_ADDRSTRLEN];
@ -845,7 +845,7 @@ static void show_es_entry(struct hash_backet *backet, void *args[])
json_object *json = args[1]; json_object *json = args[1];
json_object *json_vteps = NULL; json_object *json_vteps = NULL;
struct listnode *node = NULL; struct listnode *node = NULL;
struct evpnes *es = (struct evpnes *)backet->data; struct evpnes *es = (struct evpnes *)bucket->data;
if (json) { if (json) {
json_vteps = json_object_new_array(); json_vteps = json_object_new_array();
@ -877,14 +877,14 @@ static void show_es_entry(struct hash_backet *backet, void *args[])
} }
} }
static void show_vni_entry(struct hash_backet *backet, void *args[]) static void show_vni_entry(struct hash_bucket *bucket, void *args[])
{ {
struct vty *vty; struct vty *vty;
json_object *json; json_object *json;
json_object *json_vni = NULL; json_object *json_vni = NULL;
json_object *json_import_rtl = NULL; json_object *json_import_rtl = NULL;
json_object *json_export_rtl = NULL; json_object *json_export_rtl = NULL;
struct bgpevpn *vpn = (struct bgpevpn *)backet->data; struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
char buf1[10]; char buf1[10];
char buf2[RD_ADDRSTRLEN]; char buf2[RD_ADDRSTRLEN];
char rt_buf[25]; char rt_buf[25];
@ -1969,7 +1969,7 @@ static void evpn_show_vrf_import_rts(struct vty *vty, struct bgp *bgp_def,
args[1] = json; args[1] = json;
hash_iterate(bgp_def->vrf_import_rt_hash, hash_iterate(bgp_def->vrf_import_rt_hash,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))show_vrf_import_rt_entry, void *))show_vrf_import_rt_entry,
args); args);
} }
@ -1987,7 +1987,7 @@ static void evpn_show_import_rts(struct vty *vty, struct bgp *bgp,
hash_iterate( hash_iterate(
bgp->import_rt_hash, bgp->import_rt_hash,
(void (*)(struct hash_backet *, void *))show_import_rt_entry, (void (*)(struct hash_bucket *, void *))show_import_rt_entry,
args); args);
} }
@ -2008,7 +2008,7 @@ static void evpn_show_routes_vni_all(struct vty *vty, struct bgp *bgp,
wctx.vty = vty; wctx.vty = vty;
wctx.vtep_ip = vtep_ip; wctx.vtep_ip = vtep_ip;
wctx.json = json; wctx.json = json;
hash_iterate(bgp->vnihash, (void (*)(struct hash_backet *, hash_iterate(bgp->vnihash, (void (*)(struct hash_bucket *,
void *))show_vni_routes_hash, void *))show_vni_routes_hash,
&wctx); &wctx);
} }
@ -2552,7 +2552,7 @@ static void evpn_show_all_es(struct vty *vty, struct bgp *bgp,
args[0] = vty; args[0] = vty;
args[1] = json; args[1] = json;
hash_iterate(bgp->esihash, hash_iterate(bgp->esihash,
(void (*)(struct hash_backet *, void *))show_es_entry, (void (*)(struct hash_bucket *, void *))show_es_entry,
args); args);
} }
@ -2612,7 +2612,7 @@ static void evpn_show_all_vnis(struct vty *vty, struct bgp *bgp,
args[0] = vty; args[0] = vty;
args[1] = json; args[1] = json;
hash_iterate(bgp->vnihash, hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *, void *))show_vni_entry, (void (*)(struct hash_bucket *, void *))show_vni_entry,
args); args);
/* print all L3 VNIs */ /* print all L3 VNIs */

View File

@ -85,7 +85,7 @@ static void pkat_del(void *pkat)
* *
* @return maximum time to wait until next update (0 if infinity) * @return maximum time to wait until next update (0 if infinity)
*/ */
static void peer_process(struct hash_backet *hb, void *arg) static void peer_process(struct hash_bucket *hb, void *arg)
{ {
struct pkat *pkat = hb->data; struct pkat *pkat = hb->data;

View File

@ -106,10 +106,10 @@ struct bgp_mac_find_internal {
const char *ifname; const char *ifname;
}; };
static void bgp_mac_find_ifp_internal(struct hash_backet *backet, void *arg) static void bgp_mac_find_ifp_internal(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_mac_find_internal *bmfi = arg; struct bgp_mac_find_internal *bmfi = arg;
struct bgp_self_mac *bsm = backet->data; struct bgp_self_mac *bsm = bucket->data;
struct listnode *node; struct listnode *node;
char *name; char *name;
@ -331,10 +331,10 @@ bool bgp_mac_entry_exists(struct prefix *p)
return true; return true;
} }
static void bgp_mac_show_mac_entry(struct hash_backet *backet, void *arg) static void bgp_mac_show_mac_entry(struct hash_bucket *bucket, void *arg)
{ {
struct vty *vty = arg; struct vty *vty = arg;
struct bgp_self_mac *bsm = backet->data; struct bgp_self_mac *bsm = bucket->data;
struct listnode *node; struct listnode *node;
char *name; char *name;
char buf_mac[ETHER_ADDR_STRLEN]; char buf_mac[ETHER_ADDR_STRLEN];

View File

@ -184,10 +184,10 @@ struct bgp_addr {
struct list *ifp_name_list; struct list *ifp_name_list;
}; };
static void show_address_entry(struct hash_backet *backet, void *args) static void show_address_entry(struct hash_bucket *bucket, void *args)
{ {
struct vty *vty = (struct vty *)args; struct vty *vty = (struct vty *)args;
struct bgp_addr *addr = (struct bgp_addr *)backet->data; struct bgp_addr *addr = (struct bgp_addr *)bucket->data;
char *name; char *name;
struct listnode *node; struct listnode *node;
@ -204,7 +204,7 @@ static void show_address_entry(struct hash_backet *backet, void *args)
void bgp_nexthop_show_address_hash(struct vty *vty, struct bgp *bgp) void bgp_nexthop_show_address_hash(struct vty *vty, struct bgp *bgp)
{ {
hash_iterate(bgp->address_hash, hash_iterate(bgp->address_hash,
(void (*)(struct hash_backet *, void *))show_address_entry, (void (*)(struct hash_bucket *, void *))show_address_entry,
vty); vty);
} }

View File

@ -72,9 +72,9 @@ struct bgp_pbr_rule_unique {
struct bgp_pbr_rule *bpr_found; struct bgp_pbr_rule *bpr_found;
}; };
static int bgp_pbr_rule_walkcb(struct hash_backet *backet, void *arg) static int bgp_pbr_rule_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_rule *bpr = (struct bgp_pbr_rule *)backet->data; struct bgp_pbr_rule *bpr = (struct bgp_pbr_rule *)bucket->data;
struct bgp_pbr_rule_unique *bpru = (struct bgp_pbr_rule_unique *) struct bgp_pbr_rule_unique *bpru = (struct bgp_pbr_rule_unique *)
arg; arg;
uint32_t unique = bpru->unique; uint32_t unique = bpru->unique;
@ -86,9 +86,9 @@ static int bgp_pbr_rule_walkcb(struct hash_backet *backet, void *arg)
return HASHWALK_CONTINUE; return HASHWALK_CONTINUE;
} }
static int bgp_pbr_action_walkcb(struct hash_backet *backet, void *arg) static int bgp_pbr_action_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_action *bpa = (struct bgp_pbr_action *)backet->data; struct bgp_pbr_action *bpa = (struct bgp_pbr_action *)bucket->data;
struct bgp_pbr_action_unique *bpau = (struct bgp_pbr_action_unique *) struct bgp_pbr_action_unique *bpau = (struct bgp_pbr_action_unique *)
arg; arg;
uint32_t unique = bpau->unique; uint32_t unique = bpau->unique;
@ -100,10 +100,10 @@ static int bgp_pbr_action_walkcb(struct hash_backet *backet, void *arg)
return HASHWALK_CONTINUE; return HASHWALK_CONTINUE;
} }
static int bgp_pbr_match_entry_walkcb(struct hash_backet *backet, void *arg) static int bgp_pbr_match_entry_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_match_entry *bpme = struct bgp_pbr_match_entry *bpme =
(struct bgp_pbr_match_entry *)backet->data; (struct bgp_pbr_match_entry *)bucket->data;
struct bgp_pbr_match_entry_unique *bpmeu = struct bgp_pbr_match_entry_unique *bpmeu =
(struct bgp_pbr_match_entry_unique *)arg; (struct bgp_pbr_match_entry_unique *)arg;
uint32_t unique = bpmeu->unique; uint32_t unique = bpmeu->unique;
@ -120,9 +120,9 @@ struct bgp_pbr_match_ipsetname {
struct bgp_pbr_match *bpm_found; struct bgp_pbr_match *bpm_found;
}; };
static int bgp_pbr_match_pername_walkcb(struct hash_backet *backet, void *arg) static int bgp_pbr_match_pername_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)backet->data; struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)bucket->data;
struct bgp_pbr_match_ipsetname *bpmi = struct bgp_pbr_match_ipsetname *bpmi =
(struct bgp_pbr_match_ipsetname *)arg; (struct bgp_pbr_match_ipsetname *)arg;
char *ipset_name = bpmi->ipsetname; char *ipset_name = bpmi->ipsetname;
@ -135,9 +135,9 @@ static int bgp_pbr_match_pername_walkcb(struct hash_backet *backet, void *arg)
return HASHWALK_CONTINUE; return HASHWALK_CONTINUE;
} }
static int bgp_pbr_match_iptable_walkcb(struct hash_backet *backet, void *arg) static int bgp_pbr_match_iptable_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)backet->data; struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)bucket->data;
struct bgp_pbr_match_iptable_unique *bpmiu = struct bgp_pbr_match_iptable_unique *bpmiu =
(struct bgp_pbr_match_iptable_unique *)arg; (struct bgp_pbr_match_iptable_unique *)arg;
uint32_t unique = bpmiu->unique; uint32_t unique = bpmiu->unique;
@ -154,9 +154,9 @@ struct bgp_pbr_match_unique {
struct bgp_pbr_match *bpm_found; struct bgp_pbr_match *bpm_found;
}; };
static int bgp_pbr_match_walkcb(struct hash_backet *backet, void *arg) static int bgp_pbr_match_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)backet->data; struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)bucket->data;
struct bgp_pbr_match_unique *bpmu = (struct bgp_pbr_match_unique *) struct bgp_pbr_match_unique *bpmu = (struct bgp_pbr_match_unique *)
arg; arg;
uint32_t unique = bpmu->unique; uint32_t unique = bpmu->unique;
@ -1504,9 +1504,9 @@ struct bgp_pbr_rule_remain {
struct bgp_pbr_rule *bpr_found; struct bgp_pbr_rule *bpr_found;
}; };
static int bgp_pbr_get_same_rule(struct hash_backet *backet, void *arg) static int bgp_pbr_get_same_rule(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_rule *r1 = (struct bgp_pbr_rule *)backet->data; struct bgp_pbr_rule *r1 = (struct bgp_pbr_rule *)bucket->data;
struct bgp_pbr_rule_remain *ctxt = struct bgp_pbr_rule_remain *ctxt =
(struct bgp_pbr_rule_remain *)arg; (struct bgp_pbr_rule_remain *)arg;
struct bgp_pbr_rule *r2; struct bgp_pbr_rule *r2;
@ -1543,9 +1543,9 @@ static int bgp_pbr_get_same_rule(struct hash_backet *backet, void *arg)
return HASHWALK_CONTINUE; return HASHWALK_CONTINUE;
} }
static int bgp_pbr_get_remaining_entry(struct hash_backet *backet, void *arg) static int bgp_pbr_get_remaining_entry(struct hash_bucket *bucket, void *arg)
{ {
struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)backet->data; struct bgp_pbr_match *bpm = (struct bgp_pbr_match *)bucket->data;
struct bgp_pbr_match_entry_remain *bpmer = struct bgp_pbr_match_entry_remain *bpmer =
(struct bgp_pbr_match_entry_remain *)arg; (struct bgp_pbr_match_entry_remain *)arg;
struct bgp_pbr_match *bpm_temp; struct bgp_pbr_match *bpm_temp;

View File

@ -11695,10 +11695,10 @@ DEFUN (clear_ip_bgp_dampening_address_mask,
NULL, 0); NULL, 0);
} }
static void show_bgp_peerhash_entry(struct hash_backet *backet, void *arg) static void show_bgp_peerhash_entry(struct hash_bucket *bucket, void *arg)
{ {
struct vty *vty = arg; struct vty *vty = arg;
struct peer *peer = backet->data; struct peer *peer = bucket->data;
char buf[SU_ADDRSTRLEN]; char buf[SU_ADDRSTRLEN];
vty_out(vty, "\tPeer: %s %s\n", peer->host, vty_out(vty, "\tPeer: %s %s\n", peer->host,

View File

@ -1393,9 +1393,9 @@ static int updgrp_policy_update_walkcb(struct update_group *updgrp, void *arg)
return UPDWALK_CONTINUE; return UPDWALK_CONTINUE;
} }
static int update_group_walkcb(struct hash_backet *backet, void *arg) static int update_group_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct update_group *updgrp = backet->data; struct update_group *updgrp = bucket->data;
struct updwalk_context *wctx = arg; struct updwalk_context *wctx = arg;
int ret = (*wctx->cb)(updgrp, wctx->context); int ret = (*wctx->cb)(updgrp, wctx->context);
return ret; return ret;

View File

@ -7613,10 +7613,10 @@ DEFUN (show_bgp_mac_hash,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void show_tip_entry(struct hash_backet *backet, void *args) static void show_tip_entry(struct hash_bucket *bucket, void *args)
{ {
struct vty *vty = (struct vty *)args; struct vty *vty = (struct vty *)args;
struct tip_addr *tip = (struct tip_addr *)backet->data; struct tip_addr *tip = (struct tip_addr *)bucket->data;
vty_out(vty, "addr: %s, count: %d\n", inet_ntoa(tip->addr), vty_out(vty, "addr: %s, count: %d\n", inet_ntoa(tip->addr),
tip->refcnt); tip->refcnt);
@ -7629,7 +7629,7 @@ static void bgp_show_martian_nexthops(struct vty *vty, struct bgp *bgp)
vty_out(vty, "Tunnel-ip database:\n"); vty_out(vty, "Tunnel-ip database:\n");
hash_iterate(bgp->tip_hash, hash_iterate(bgp->tip_hash,
(void (*)(struct hash_backet *, void *))show_tip_entry, (void (*)(struct hash_bucket *, void *))show_tip_entry,
vty); vty);
} }
@ -7784,7 +7784,7 @@ DEFUN (show_bgp_memory,
if ((count = mtype_stats_alloc(MTYPE_HASH_BACKET))) if ((count = mtype_stats_alloc(MTYPE_HASH_BACKET)))
vty_out(vty, "%ld hash buckets, using %s of memory\n", count, vty_out(vty, "%ld hash buckets, using %s of memory\n", count,
mtype_memstr(memstrbuf, sizeof(memstrbuf), mtype_memstr(memstrbuf, sizeof(memstrbuf),
count * sizeof(struct hash_backet))); count * sizeof(struct hash_bucket)));
if ((count = mtype_stats_alloc(MTYPE_BGP_REGEXP))) if ((count = mtype_stats_alloc(MTYPE_BGP_REGEXP)))
vty_out(vty, "%ld compiled regexes, using %s of memory\n", vty_out(vty, "%ld compiled regexes, using %s of memory\n",
count, mtype_memstr(memstrbuf, sizeof(memstrbuf), count, mtype_memstr(memstrbuf, sizeof(memstrbuf),
@ -11196,12 +11196,12 @@ DEFUN (show_ip_bgp_paths,
#include "hash.h" #include "hash.h"
static void community_show_all_iterator(struct hash_backet *backet, static void community_show_all_iterator(struct hash_bucket *bucket,
struct vty *vty) struct vty *vty)
{ {
struct community *com; struct community *com;
com = (struct community *)backet->data; com = (struct community *)bucket->data;
vty_out(vty, "[%p] (%ld) %s\n", (void *)com, com->refcnt, vty_out(vty, "[%p] (%ld) %s\n", (void *)com, com->refcnt,
community_str(com, false)); community_str(com, false));
} }
@ -11218,19 +11218,19 @@ DEFUN (show_ip_bgp_community_info,
vty_out(vty, "Address Refcnt Community\n"); vty_out(vty, "Address Refcnt Community\n");
hash_iterate(community_hash(), hash_iterate(community_hash(),
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))community_show_all_iterator, void *))community_show_all_iterator,
vty); vty);
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void lcommunity_show_all_iterator(struct hash_backet *backet, static void lcommunity_show_all_iterator(struct hash_bucket *bucket,
struct vty *vty) struct vty *vty)
{ {
struct lcommunity *lcom; struct lcommunity *lcom;
lcom = (struct lcommunity *)backet->data; lcom = (struct lcommunity *)bucket->data;
vty_out(vty, "[%p] (%ld) %s\n", (void *)lcom, lcom->refcnt, vty_out(vty, "[%p] (%ld) %s\n", (void *)lcom, lcom->refcnt,
lcommunity_str(lcom, false)); lcommunity_str(lcom, false));
} }
@ -11247,7 +11247,7 @@ DEFUN (show_ip_bgp_lcommunity_info,
vty_out(vty, "Address Refcnt Large-community\n"); vty_out(vty, "Address Refcnt Large-community\n");
hash_iterate(lcommunity_hash(), hash_iterate(lcommunity_hash(),
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))lcommunity_show_all_iterator, void *))lcommunity_show_all_iterator,
vty); vty);

View File

@ -559,18 +559,18 @@ static void move_to_queue(struct isis_lsp *lsp, struct neighbor_entry *n,
listnode_add(lsp->flooding_neighbors[type], neighbor_id); listnode_add(lsp->flooding_neighbors[type], neighbor_id);
} }
static void mark_neighbor_as_present(struct hash_backet *backet, void *arg) static void mark_neighbor_as_present(struct hash_bucket *bucket, void *arg)
{ {
struct neighbor_entry *n = backet->data; struct neighbor_entry *n = bucket->data;
n->present = true; n->present = true;
} }
static void handle_firsthops(struct hash_backet *backet, void *arg) static void handle_firsthops(struct hash_bucket *bucket, void *arg)
{ {
struct isis_lsp *lsp = arg; struct isis_lsp *lsp = arg;
struct fabricd *f = lsp->area->fabricd; struct fabricd *f = lsp->area->fabricd;
struct isis_vertex *vertex = backet->data; struct isis_vertex *vertex = bucket->data;
struct neighbor_entry *n; struct neighbor_entry *n;

View File

@ -352,10 +352,10 @@ static struct isis_vertex *isis_spf_add_root(struct isis_spftree *spftree,
return vertex; return vertex;
} }
static void vertex_add_parent_firsthop(struct hash_backet *backet, void *arg) static void vertex_add_parent_firsthop(struct hash_bucket *bucket, void *arg)
{ {
struct isis_vertex *vertex = arg; struct isis_vertex *vertex = arg;
struct isis_vertex *hop = backet->data; struct isis_vertex *hop = bucket->data;
hash_get(vertex->firsthops, hop, hash_alloc_intern); hash_get(vertex->firsthops, hop, hash_alloc_intern);
} }

View File

@ -409,7 +409,7 @@ int config_show_distribute(struct vty *vty, struct distribute_ctx *dist_ctxt)
{ {
unsigned int i; unsigned int i;
int has_print = 0; int has_print = 0;
struct hash_backet *mp; struct hash_bucket *mp;
struct distribute *dist; struct distribute *dist;
/* Output filter configuration. */ /* Output filter configuration. */
@ -512,7 +512,7 @@ int config_write_distribute(struct vty *vty,
unsigned int i; unsigned int i;
int j; int j;
int output, v6; int output, v6;
struct hash_backet *mp; struct hash_bucket *mp;
int write = 0; int write = 0;
for (i = 0; i < dist_ctxt->disthash->size; i++) for (i = 0; i < dist_ctxt->disthash->size; i++)

View File

@ -46,7 +46,7 @@ struct hash *hash_create_size(unsigned int size,
assert((size & (size - 1)) == 0); assert((size & (size - 1)) == 0);
hash = XCALLOC(MTYPE_HASH, sizeof(struct hash)); hash = XCALLOC(MTYPE_HASH, sizeof(struct hash));
hash->index = hash->index =
XCALLOC(MTYPE_HASH_INDEX, sizeof(struct hash_backet *) * size); XCALLOC(MTYPE_HASH_INDEX, sizeof(struct hash_bucket *) * size);
hash->size = size; hash->size = size;
hash->hash_key = hash_key; hash->hash_key = hash_key;
hash->hash_cmp = hash_cmp; hash->hash_cmp = hash_cmp;
@ -86,7 +86,7 @@ void *hash_alloc_intern(void *arg)
static void hash_expand(struct hash *hash) static void hash_expand(struct hash *hash)
{ {
unsigned int i, new_size; unsigned int i, new_size;
struct hash_backet *hb, *hbnext, **new_index; struct hash_bucket *hb, *hbnext, **new_index;
new_size = hash->size * 2; new_size = hash->size * 2;
@ -94,7 +94,7 @@ static void hash_expand(struct hash *hash)
return; return;
new_index = XCALLOC(MTYPE_HASH_INDEX, new_index = XCALLOC(MTYPE_HASH_INDEX,
sizeof(struct hash_backet *) * new_size); sizeof(struct hash_bucket *) * new_size);
if (new_index == NULL) if (new_index == NULL)
return; return;
@ -133,7 +133,7 @@ void *hash_get(struct hash *hash, void *data, void *(*alloc_func)(void *))
unsigned int key; unsigned int key;
unsigned int index; unsigned int index;
void *newdata; void *newdata;
struct hash_backet *backet; struct hash_bucket *bucket;
if (!alloc_func && !hash->count) if (!alloc_func && !hash->count)
return NULL; return NULL;
@ -141,10 +141,10 @@ void *hash_get(struct hash *hash, void *data, void *(*alloc_func)(void *))
key = (*hash->hash_key)(data); key = (*hash->hash_key)(data);
index = key & (hash->size - 1); index = key & (hash->size - 1);
for (backet = hash->index[index]; backet != NULL; for (bucket = hash->index[index]; bucket != NULL;
backet = backet->next) { bucket = bucket->next) {
if (backet->key == key && (*hash->hash_cmp)(backet->data, data)) if (bucket->key == key && (*hash->hash_cmp)(bucket->data, data))
return backet->data; return bucket->data;
} }
if (alloc_func) { if (alloc_func) {
@ -157,26 +157,26 @@ void *hash_get(struct hash *hash, void *data, void *(*alloc_func)(void *))
index = key & (hash->size - 1); index = key & (hash->size - 1);
} }
backet = XCALLOC(MTYPE_HASH_BACKET, sizeof(struct hash_backet)); bucket = XCALLOC(MTYPE_HASH_BACKET, sizeof(struct hash_bucket));
backet->data = newdata; bucket->data = newdata;
backet->key = key; bucket->key = key;
backet->next = hash->index[index]; bucket->next = hash->index[index];
hash->index[index] = backet; hash->index[index] = bucket;
hash->count++; hash->count++;
int oldlen = backet->next ? backet->next->len : 0; int oldlen = bucket->next ? bucket->next->len : 0;
int newlen = oldlen + 1; int newlen = oldlen + 1;
if (newlen == 1) if (newlen == 1)
hash->stats.empty--; hash->stats.empty--;
else else
backet->next->len = 0; bucket->next->len = 0;
backet->len = newlen; bucket->len = newlen;
hash_update_ssq(hash, oldlen, newlen); hash_update_ssq(hash, oldlen, newlen);
return backet->data; return bucket->data;
} }
return NULL; return NULL;
} }
@ -201,22 +201,22 @@ void *hash_release(struct hash *hash, void *data)
void *ret; void *ret;
unsigned int key; unsigned int key;
unsigned int index; unsigned int index;
struct hash_backet *backet; struct hash_bucket *bucket;
struct hash_backet *pp; struct hash_bucket *pp;
key = (*hash->hash_key)(data); key = (*hash->hash_key)(data);
index = key & (hash->size - 1); index = key & (hash->size - 1);
for (backet = pp = hash->index[index]; backet; backet = backet->next) { for (bucket = pp = hash->index[index]; bucket; bucket = bucket->next) {
if (backet->key == key if (bucket->key == key
&& (*hash->hash_cmp)(backet->data, data)) { && (*hash->hash_cmp)(bucket->data, data)) {
int oldlen = hash->index[index]->len; int oldlen = hash->index[index]->len;
int newlen = oldlen - 1; int newlen = oldlen - 1;
if (backet == pp) if (bucket == pp)
hash->index[index] = backet->next; hash->index[index] = bucket->next;
else else
pp->next = backet->next; pp->next = bucket->next;
if (hash->index[index]) if (hash->index[index])
hash->index[index]->len = newlen; hash->index[index]->len = newlen;
@ -225,26 +225,26 @@ void *hash_release(struct hash *hash, void *data)
hash_update_ssq(hash, oldlen, newlen); hash_update_ssq(hash, oldlen, newlen);
ret = backet->data; ret = bucket->data;
XFREE(MTYPE_HASH_BACKET, backet); XFREE(MTYPE_HASH_BACKET, bucket);
hash->count--; hash->count--;
return ret; return ret;
} }
pp = backet; pp = bucket;
} }
return NULL; return NULL;
} }
void hash_iterate(struct hash *hash, void (*func)(struct hash_backet *, void *), void hash_iterate(struct hash *hash, void (*func)(struct hash_bucket *, void *),
void *arg) void *arg)
{ {
unsigned int i; unsigned int i;
struct hash_backet *hb; struct hash_bucket *hb;
struct hash_backet *hbnext; struct hash_bucket *hbnext;
for (i = 0; i < hash->size; i++) for (i = 0; i < hash->size; i++)
for (hb = hash->index[i]; hb; hb = hbnext) { for (hb = hash->index[i]; hb; hb = hbnext) {
/* get pointer to next hash backet here, in case (*func) /* get pointer to next hash bucket here, in case (*func)
* decides to delete hb by calling hash_release * decides to delete hb by calling hash_release
*/ */
hbnext = hb->next; hbnext = hb->next;
@ -252,17 +252,17 @@ void hash_iterate(struct hash *hash, void (*func)(struct hash_backet *, void *),
} }
} }
void hash_walk(struct hash *hash, int (*func)(struct hash_backet *, void *), void hash_walk(struct hash *hash, int (*func)(struct hash_bucket *, void *),
void *arg) void *arg)
{ {
unsigned int i; unsigned int i;
struct hash_backet *hb; struct hash_bucket *hb;
struct hash_backet *hbnext; struct hash_bucket *hbnext;
int ret = HASHWALK_CONTINUE; int ret = HASHWALK_CONTINUE;
for (i = 0; i < hash->size; i++) { for (i = 0; i < hash->size; i++) {
for (hb = hash->index[i]; hb; hb = hbnext) { for (hb = hash->index[i]; hb; hb = hbnext) {
/* get pointer to next hash backet here, in case (*func) /* get pointer to next hash bucket here, in case (*func)
* decides to delete hb by calling hash_release * decides to delete hb by calling hash_release
*/ */
hbnext = hb->next; hbnext = hb->next;
@ -276,8 +276,8 @@ void hash_walk(struct hash *hash, int (*func)(struct hash_backet *, void *),
void hash_clean(struct hash *hash, void (*free_func)(void *)) void hash_clean(struct hash *hash, void (*free_func)(void *))
{ {
unsigned int i; unsigned int i;
struct hash_backet *hb; struct hash_bucket *hb;
struct hash_backet *next; struct hash_bucket *next;
for (i = 0; i < hash->size; i++) { for (i = 0; i < hash->size; i++) {
for (hb = hash->index[i]; hb; hb = next) { for (hb = hash->index[i]; hb; hb = next) {
@ -296,7 +296,7 @@ void hash_clean(struct hash *hash, void (*free_func)(void *))
hash->stats.empty = hash->size; hash->stats.empty = hash->size;
} }
static void hash_to_list_iter(struct hash_backet *hb, void *arg) static void hash_to_list_iter(struct hash_bucket *hb, void *arg)
{ {
struct list *list = arg; struct list *list = arg;

View File

@ -39,15 +39,20 @@ DECLARE_MTYPE(HASH_BACKET)
#define HASHWALK_CONTINUE 0 #define HASHWALK_CONTINUE 0
#define HASHWALK_ABORT -1 #define HASHWALK_ABORT -1
struct hash_backet { #if CONFDATE > 20200225
CPP_NOTICE("hash.h: time to remove hash_backet #define")
#endif
#define hash_backet hash_bucket
struct hash_bucket {
/* /*
* if this backet is the head of the linked listed, len denotes the * if this bucket is the head of the linked listed, len denotes the
* number of elements in the list * number of elements in the list
*/ */
int len; int len;
/* Linked list. */ /* Linked list. */
struct hash_backet *next; struct hash_bucket *next;
/* Hash key. */ /* Hash key. */
unsigned int key; unsigned int key;
@ -64,8 +69,8 @@ struct hashstats {
}; };
struct hash { struct hash {
/* Hash backet. */ /* Hash bucket. */
struct hash_backet **index; struct hash_bucket **index;
/* Hash table size. Must be power of 2 */ /* Hash table size. Must be power of 2 */
unsigned int size; unsigned int size;
@ -172,9 +177,9 @@ hash_create_size(unsigned int size, unsigned int (*hash_key)(void *),
* hash table to operate on * hash table to operate on
* *
* data * data
* data to insert or retrieve - A hash backet will not be created if * data to insert or retrieve - A hash bucket will not be created if
* the alloc_func returns a NULL pointer and nothing will be added to * the alloc_func returns a NULL pointer and nothing will be added to
* the hash. As such backet->data will always be non-NULL. * the hash. As such bucket->data will always be non-NULL.
* *
* alloc_func * alloc_func
* function to call if the item is not found in the hash table. This * function to call if the item is not found in the hash table. This
@ -243,7 +248,7 @@ extern void *hash_release(struct hash *hash, void *data);
* during the walk will cause undefined behavior in that some new entries * during the walk will cause undefined behavior in that some new entries
* will be walked and some will not. So do not do this. * will be walked and some will not. So do not do this.
* *
* The backet passed to func will have a non-NULL data pointer. * The bucket passed to func will have a non-NULL data pointer.
* *
* hash * hash
* hash table to operate on * hash table to operate on
@ -255,7 +260,7 @@ extern void *hash_release(struct hash *hash, void *data);
* arbitrary argument passed as the second parameter in each call to 'func' * arbitrary argument passed as the second parameter in each call to 'func'
*/ */
extern void hash_iterate(struct hash *hash, extern void hash_iterate(struct hash *hash,
void (*func)(struct hash_backet *, void *), void *arg); void (*func)(struct hash_bucket *, void *), void *arg);
/* /*
* Iterate over the elements in a hash table, stopping on condition. * Iterate over the elements in a hash table, stopping on condition.
@ -265,7 +270,7 @@ extern void hash_iterate(struct hash *hash,
* during the walk will cause undefined behavior in that some new entries * during the walk will cause undefined behavior in that some new entries
* will be walked and some will not. So do not do this. * will be walked and some will not. So do not do this.
* *
* The backet passed to func will have a non-NULL data pointer. * The bucket passed to func will have a non-NULL data pointer.
* *
* hash * hash
* hash table to operate on * hash table to operate on
@ -278,7 +283,7 @@ extern void hash_iterate(struct hash *hash,
* arbitrary argument passed as the second parameter in each call to 'func' * arbitrary argument passed as the second parameter in each call to 'func'
*/ */
extern void hash_walk(struct hash *hash, extern void hash_walk(struct hash *hash,
int (*func)(struct hash_backet *, void *), void *arg); int (*func)(struct hash_bucket *, void *), void *arg);
/* /*
* Remove all elements from a hash table. * Remove all elements from a hash table.

View File

@ -261,7 +261,7 @@ DEFUN (no_if_rmap,
int config_write_if_rmap(struct vty *vty) int config_write_if_rmap(struct vty *vty)
{ {
unsigned int i; unsigned int i;
struct hash_backet *mp; struct hash_bucket *mp;
int write = 0; int write = 0;
for (i = 0; i < ifrmaphash->size; i++) for (i = 0; i < ifrmaphash->size; i++)

View File

@ -1664,9 +1664,9 @@ static bool route_map_dep_hash_cmp(const void *p1, const void *p2)
== 0); == 0);
} }
static void route_map_clear_reference(struct hash_backet *backet, void *arg) static void route_map_clear_reference(struct hash_bucket *bucket, void *arg)
{ {
struct route_map_dep *dep = (struct route_map_dep *)backet->data; struct route_map_dep *dep = (struct route_map_dep *)bucket->data;
char *rmap_name; char *rmap_name;
if (arg) { if (arg) {
@ -1720,9 +1720,9 @@ static unsigned int route_map_dep_hash_make_key(void *p)
return (string_hash_make((char *)p)); return (string_hash_make((char *)p));
} }
static void route_map_print_dependency(struct hash_backet *backet, void *data) static void route_map_print_dependency(struct hash_bucket *bucket, void *data)
{ {
char *rmap_name = (char *)backet->data; char *rmap_name = (char *)bucket->data;
char *dep_name = (char *)data; char *dep_name = (char *)data;
zlog_debug("%s: Dependency for %s: %s", __FUNCTION__, dep_name, zlog_debug("%s: Dependency for %s: %s", __FUNCTION__, dep_name,
@ -1846,9 +1846,9 @@ static struct hash *route_map_get_dep_hash(route_map_event_t event)
return (upd8_hash); return (upd8_hash);
} }
static void route_map_process_dependency(struct hash_backet *backet, void *data) static void route_map_process_dependency(struct hash_bucket *bucket, void *data)
{ {
char *rmap_name = (char *)backet->data; char *rmap_name = (char *)bucket->data;
route_map_event_t type = (route_map_event_t)(ptrdiff_t)data; route_map_event_t type = (route_map_event_t)(ptrdiff_t)data;
if (rmap_debug) if (rmap_debug)

View File

@ -106,7 +106,7 @@ static void vty_out_cpu_thread_history(struct vty *vty,
a->types & (1 << THREAD_EXECUTE) ? 'X' : ' ', a->funcname); a->types & (1 << THREAD_EXECUTE) ? 'X' : ' ', a->funcname);
} }
static void cpu_record_hash_print(struct hash_backet *bucket, void *args[]) static void cpu_record_hash_print(struct hash_bucket *bucket, void *args[])
{ {
struct cpu_thread_history *totals = args[0]; struct cpu_thread_history *totals = args[0];
struct cpu_thread_history copy; struct cpu_thread_history copy;
@ -178,7 +178,7 @@ static void cpu_record_print(struct vty *vty, uint8_t filter)
if (m->cpu_record->count) if (m->cpu_record->count)
hash_iterate( hash_iterate(
m->cpu_record, m->cpu_record,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))cpu_record_hash_print, void *))cpu_record_hash_print,
args); args);
else else
@ -202,7 +202,7 @@ static void cpu_record_print(struct vty *vty, uint8_t filter)
vty_out_cpu_thread_history(vty, &tmp); vty_out_cpu_thread_history(vty, &tmp);
} }
static void cpu_record_hash_clear(struct hash_backet *bucket, void *args[]) static void cpu_record_hash_clear(struct hash_bucket *bucket, void *args[])
{ {
uint8_t *filter = args[0]; uint8_t *filter = args[0];
struct hash *cpu_record = args[1]; struct hash *cpu_record = args[1];
@ -229,7 +229,7 @@ static void cpu_record_clear(uint8_t filter)
void *args[2] = {tmp, m->cpu_record}; void *args[2] = {tmp, m->cpu_record};
hash_iterate( hash_iterate(
m->cpu_record, m->cpu_record,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))cpu_record_hash_clear, void *))cpu_record_hash_clear,
args); args);
} }

View File

@ -345,7 +345,7 @@ struct nhrp_cache_iterator_ctx {
void *ctx; void *ctx;
}; };
static void nhrp_cache_iterator(struct hash_backet *b, void *ctx) static void nhrp_cache_iterator(struct hash_bucket *b, void *ctx)
{ {
struct nhrp_cache_iterator_ctx *ic = ctx; struct nhrp_cache_iterator_ctx *ic = ctx;
ic->cb(b->data, ic->ctx); ic->cb(b->data, ic->ctx);

View File

@ -183,7 +183,7 @@ struct nhrp_vc_iterator_ctx {
void *ctx; void *ctx;
}; };
static void nhrp_vc_iterator(struct hash_backet *b, void *ctx) static void nhrp_vc_iterator(struct hash_bucket *b, void *ctx)
{ {
struct nhrp_vc_iterator_ctx *ic = ctx; struct nhrp_vc_iterator_ctx *ic = ctx;
ic->cb(b->data, ic->ctx); ic->cb(b->data, ic->ctx);

View File

@ -1020,10 +1020,10 @@ static void update_ext_prefix_sid(struct sr_node *srn, struct sr_prefix *srp)
* When change the FRR Self SRGB, update the NHLFE Input Label * When change the FRR Self SRGB, update the NHLFE Input Label
* for all Extended Prefix with SID index through hash_iterate() * for all Extended Prefix with SID index through hash_iterate()
*/ */
static void update_in_nhlfe(struct hash_backet *backet, void *args) static void update_in_nhlfe(struct hash_bucket *bucket, void *args)
{ {
struct listnode *node; struct listnode *node;
struct sr_node *srn = (struct sr_node *)backet->data; struct sr_node *srn = (struct sr_node *)bucket->data;
struct sr_prefix *srp; struct sr_prefix *srp;
struct sr_nhlfe new; struct sr_nhlfe new;
@ -1052,10 +1052,10 @@ static void update_in_nhlfe(struct hash_backet *backet, void *args)
* When SRGB has changed, update NHLFE Output Label for all Extended Prefix * When SRGB has changed, update NHLFE Output Label for all Extended Prefix
* with SID index which use the given SR-Node as nexthop though hash_iterate() * with SID index which use the given SR-Node as nexthop though hash_iterate()
*/ */
static void update_out_nhlfe(struct hash_backet *backet, void *args) static void update_out_nhlfe(struct hash_bucket *bucket, void *args)
{ {
struct listnode *node; struct listnode *node;
struct sr_node *srn = (struct sr_node *)backet->data; struct sr_node *srn = (struct sr_node *)bucket->data;
struct sr_node *srnext = (struct sr_node *)args; struct sr_node *srnext = (struct sr_node *)args;
struct sr_prefix *srp; struct sr_prefix *srp;
struct sr_nhlfe new; struct sr_nhlfe new;
@ -1192,7 +1192,7 @@ void ospf_sr_ri_lsa_update(struct ospf_lsa *lsa)
/* Update NHLFE if it is a neighbor SR node */ /* Update NHLFE if it is a neighbor SR node */
if (srn->neighbor == OspfSR.self) if (srn->neighbor == OspfSR.self)
hash_iterate(OspfSR.neighbors, hash_iterate(OspfSR.neighbors,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))update_out_nhlfe, void *))update_out_nhlfe,
(void *)srn); (void *)srn);
} }
@ -1531,10 +1531,10 @@ void ospf_sr_update_prefix(struct interface *ifp, struct prefix *p)
* Following functions are used to update MPLS LFIB after a SPF run * Following functions are used to update MPLS LFIB after a SPF run
*/ */
static void ospf_sr_nhlfe_update(struct hash_backet *backet, void *args) static void ospf_sr_nhlfe_update(struct hash_bucket *bucket, void *args)
{ {
struct sr_node *srn = (struct sr_node *)backet->data; struct sr_node *srn = (struct sr_node *)bucket->data;
struct listnode *node; struct listnode *node;
struct sr_prefix *srp; struct sr_prefix *srp;
struct sr_nhlfe old; struct sr_nhlfe old;
@ -1593,7 +1593,7 @@ static int ospf_sr_update_schedule(struct thread *t)
if (IS_DEBUG_OSPF_SR) if (IS_DEBUG_OSPF_SR)
zlog_debug("SR (%s): Start SPF update", __func__); zlog_debug("SR (%s): Start SPF update", __func__);
hash_iterate(OspfSR.neighbors, (void (*)(struct hash_backet *, hash_iterate(OspfSR.neighbors, (void (*)(struct hash_bucket *,
void *))ospf_sr_nhlfe_update, void *))ospf_sr_nhlfe_update,
NULL); NULL);
@ -1818,7 +1818,7 @@ DEFUN (sr_sid_label_range,
/* Update NHLFE entries */ /* Update NHLFE entries */
hash_iterate(OspfSR.neighbors, hash_iterate(OspfSR.neighbors,
(void (*)(struct hash_backet *, void *))update_in_nhlfe, (void (*)(struct hash_bucket *, void *))update_in_nhlfe,
NULL); NULL);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -1850,7 +1850,7 @@ DEFUN (no_sr_sid_label_range,
/* Update NHLFE entries */ /* Update NHLFE entries */
hash_iterate(OspfSR.neighbors, hash_iterate(OspfSR.neighbors,
(void (*)(struct hash_backet *, void *))update_in_nhlfe, (void (*)(struct hash_bucket *, void *))update_in_nhlfe,
NULL); NULL);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -2281,18 +2281,18 @@ static void show_sr_node(struct vty *vty, struct json_object *json,
vty_out(vty, "\n"); vty_out(vty, "\n");
} }
static void show_vty_srdb(struct hash_backet *backet, void *args) static void show_vty_srdb(struct hash_bucket *bucket, void *args)
{ {
struct vty *vty = (struct vty *)args; struct vty *vty = (struct vty *)args;
struct sr_node *srn = (struct sr_node *)backet->data; struct sr_node *srn = (struct sr_node *)bucket->data;
show_sr_node(vty, NULL, srn); show_sr_node(vty, NULL, srn);
} }
static void show_json_srdb(struct hash_backet *backet, void *args) static void show_json_srdb(struct hash_bucket *bucket, void *args)
{ {
struct json_object *json = (struct json_object *)args; struct json_object *json = (struct json_object *)args;
struct sr_node *srn = (struct sr_node *)backet->data; struct sr_node *srn = (struct sr_node *)bucket->data;
show_sr_node(NULL, json, srn); show_sr_node(NULL, json, srn);
} }
@ -2366,14 +2366,14 @@ DEFUN (show_ip_opsf_srdb,
/* No parameters have been provided, Iterate through all the SRDB */ /* No parameters have been provided, Iterate through all the SRDB */
if (uj) { if (uj) {
hash_iterate(OspfSR.neighbors, (void (*)(struct hash_backet *, hash_iterate(OspfSR.neighbors, (void (*)(struct hash_bucket *,
void *))show_json_srdb, void *))show_json_srdb,
(void *)json_node_array); (void *)json_node_array);
vty_out(vty, "%s\n", json_object_to_json_string_ext( vty_out(vty, "%s\n", json_object_to_json_string_ext(
json, JSON_C_TO_STRING_PRETTY)); json, JSON_C_TO_STRING_PRETTY));
json_object_free(json); json_object_free(json);
} else { } else {
hash_iterate(OspfSR.neighbors, (void (*)(struct hash_backet *, hash_iterate(OspfSR.neighbors, (void (*)(struct hash_bucket *,
void *))show_vty_srdb, void *))show_vty_srdb,
(void *)vty); (void *)vty);
} }

View File

@ -124,7 +124,7 @@ static void pbr_nh_delete(struct pbr_nexthop_cache **pnhc)
XFREE(MTYPE_PBR_NHG, *pnhc); XFREE(MTYPE_PBR_NHG, *pnhc);
} }
static void pbr_nh_delete_iterate(struct hash_backet *b, void *p) static void pbr_nh_delete_iterate(struct hash_bucket *b, void *p)
{ {
pbr_nh_delete((struct pbr_nexthop_cache **)&b->data); pbr_nh_delete((struct pbr_nexthop_cache **)&b->data);
} }
@ -319,7 +319,7 @@ static struct pbr_nexthop_cache *pbr_nht_lookup_nexthop(struct nexthop *nexthop)
} }
#endif #endif
static void pbr_nht_find_nhg_from_table_install(struct hash_backet *b, static void pbr_nht_find_nhg_from_table_install(struct hash_bucket *b,
void *data) void *data)
{ {
struct pbr_nexthop_group_cache *pnhgc = struct pbr_nexthop_group_cache *pnhgc =
@ -348,7 +348,7 @@ void pbr_nht_route_installed_for_table(uint32_t table_id)
&table_id); &table_id);
} }
static void pbr_nht_find_nhg_from_table_remove(struct hash_backet *b, static void pbr_nht_find_nhg_from_table_remove(struct hash_bucket *b,
void *data) void *data)
{ {
; ;
@ -657,7 +657,7 @@ struct pbr_nht_individual {
uint32_t valid; uint32_t valid;
}; };
static void pbr_nht_individual_nexthop_update_lookup(struct hash_backet *b, static void pbr_nht_individual_nexthop_update_lookup(struct hash_bucket *b,
void *data) void *data)
{ {
struct pbr_nexthop_cache *pnhc = b->data; struct pbr_nexthop_cache *pnhc = b->data;
@ -689,7 +689,7 @@ static void pbr_nht_individual_nexthop_update_lookup(struct hash_backet *b,
pnhi->valid += 1; pnhi->valid += 1;
} }
static void pbr_nht_nexthop_update_lookup(struct hash_backet *b, void *data) static void pbr_nht_nexthop_update_lookup(struct hash_bucket *b, void *data)
{ {
struct pbr_nexthop_group_cache *pnhgc = b->data; struct pbr_nexthop_group_cache *pnhgc = b->data;
struct pbr_nht_individual pnhi; struct pbr_nht_individual pnhi;
@ -822,7 +822,7 @@ bool pbr_nht_get_installed(const char *name)
return pnhgc->installed; return pnhgc->installed;
} }
static void pbr_nht_show_nhg_nexthops(struct hash_backet *b, void *data) static void pbr_nht_show_nhg_nexthops(struct hash_bucket *b, void *data)
{ {
struct pbr_nexthop_cache *pnhc = b->data; struct pbr_nexthop_cache *pnhc = b->data;
struct vty *vty = data; struct vty *vty = data;
@ -836,7 +836,7 @@ struct pbr_nht_show {
const char *name; const char *name;
}; };
static void pbr_nht_show_nhg(struct hash_backet *b, void *data) static void pbr_nht_show_nhg(struct hash_bucket *b, void *data)
{ {
struct pbr_nexthop_group_cache *pnhgc = b->data; struct pbr_nexthop_group_cache *pnhgc = b->data;
struct pbr_nht_show *pns = data; struct pbr_nht_show *pns = data;

View File

@ -2789,9 +2789,9 @@ struct pnc_cache_walk_data {
struct pim_instance *pim; struct pim_instance *pim;
}; };
static int pim_print_pnc_cache_walkcb(struct hash_backet *backet, void *arg) static int pim_print_pnc_cache_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct pim_nexthop_cache *pnc = backet->data; struct pim_nexthop_cache *pnc = bucket->data;
struct pnc_cache_walk_data *cwd = arg; struct pnc_cache_walk_data *cwd = arg;
struct vty *vty = cwd->vty; struct vty *vty = cwd->vty;
struct pim_instance *pim = cwd->pim; struct pim_instance *pim = cwd->pim;

View File

@ -266,10 +266,10 @@ void pim_resolve_upstream_nh(struct pim_instance *pim, struct prefix *nht_p)
} }
/* Update Upstream nexthop info based on Nexthop update received from Zebra.*/ /* Update Upstream nexthop info based on Nexthop update received from Zebra.*/
static int pim_update_upstream_nh_helper(struct hash_backet *backet, void *arg) static int pim_update_upstream_nh_helper(struct hash_bucket *bucket, void *arg)
{ {
struct pim_instance *pim = (struct pim_instance *)arg; struct pim_instance *pim = (struct pim_instance *)arg;
struct pim_upstream *up = (struct pim_upstream *)backet->data; struct pim_upstream *up = (struct pim_upstream *)bucket->data;
int vif_index = 0; int vif_index = 0;
enum pim_rpf_result rpf_result; enum pim_rpf_result rpf_result;

View File

@ -195,10 +195,10 @@ static void test_state_del_route(struct test_state *test,
XFREE(MTYPE_TMP, hash_entry_intern); XFREE(MTYPE_TMP, hash_entry_intern);
} }
static void verify_log(struct hash_backet *backet, void *arg) static void verify_log(struct hash_bucket *bucket, void *arg)
{ {
struct test_state *test = arg; struct test_state *test = arg;
struct prefix *hash_entry = backet->data; struct prefix *hash_entry = bucket->data;
struct prefix *dst_p = &hash_entry[0]; struct prefix *dst_p = &hash_entry[0];
struct prefix_ipv6 *src_p = (struct prefix_ipv6 *)&hash_entry[1]; struct prefix_ipv6 *src_p = (struct prefix_ipv6 *)&hash_entry[1];
struct route_node *rn = srcdest_rnode_lookup(test->table, dst_p, src_p); struct route_node *rn = srcdest_rnode_lookup(test->table, dst_p, src_p);
@ -209,9 +209,9 @@ static void verify_log(struct hash_backet *backet, void *arg)
route_unlock_node(rn); route_unlock_node(rn);
} }
static void dump_log(struct hash_backet *backet, void *arg) static void dump_log(struct hash_bucket *bucket, void *arg)
{ {
struct prefix *hash_entry = backet->data; struct prefix *hash_entry = bucket->data;
struct prefix_ipv6 *dst_p = (struct prefix_ipv6 *)&hash_entry[0]; struct prefix_ipv6 *dst_p = (struct prefix_ipv6 *)&hash_entry[0];
struct prefix_ipv6 *src_p = (struct prefix_ipv6 *)&hash_entry[1]; struct prefix_ipv6 *src_p = (struct prefix_ipv6 *)&hash_entry[1];
char *route_id = format_srcdest(dst_p, src_p); char *route_id = format_srcdest(dst_p, src_p);

View File

@ -85,8 +85,8 @@ static int nhlfe_nexthop_active_ipv6(zebra_nhlfe_t *nhlfe,
static int nhlfe_nexthop_active(zebra_nhlfe_t *nhlfe); static int nhlfe_nexthop_active(zebra_nhlfe_t *nhlfe);
static void lsp_select_best_nhlfe(zebra_lsp_t *lsp); static void lsp_select_best_nhlfe(zebra_lsp_t *lsp);
static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt); static void lsp_uninstall_from_kernel(struct hash_bucket *bucket, void *ctxt);
static void lsp_schedule(struct hash_backet *backet, void *ctxt); static void lsp_schedule(struct hash_bucket *bucket, void *ctxt);
static wq_item_status lsp_process(struct work_queue *wq, void *data); static wq_item_status lsp_process(struct work_queue *wq, void *data);
static void lsp_processq_del(struct work_queue *wq, void *data); static void lsp_processq_del(struct work_queue *wq, void *data);
static void lsp_processq_complete(struct work_queue *wq); static void lsp_processq_complete(struct work_queue *wq);
@ -853,11 +853,11 @@ static void lsp_select_best_nhlfe(zebra_lsp_t *lsp)
* Delete LSP forwarding entry from kernel, if installed. Called upon * Delete LSP forwarding entry from kernel, if installed. Called upon
* process exit. * process exit.
*/ */
static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt) static void lsp_uninstall_from_kernel(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_lsp_t *lsp; zebra_lsp_t *lsp;
lsp = (zebra_lsp_t *)backet->data; lsp = (zebra_lsp_t *)bucket->data;
if (CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED)) if (CHECK_FLAG(lsp->flags, LSP_FLAG_INSTALLED))
(void)dplane_lsp_delete(lsp); (void)dplane_lsp_delete(lsp);
} }
@ -866,11 +866,11 @@ static void lsp_uninstall_from_kernel(struct hash_backet *backet, void *ctxt)
* Schedule LSP forwarding entry for processing. Called upon changes * Schedule LSP forwarding entry for processing. Called upon changes
* that may impact LSPs such as nexthop / connected route changes. * that may impact LSPs such as nexthop / connected route changes.
*/ */
static void lsp_schedule(struct hash_backet *backet, void *ctxt) static void lsp_schedule(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_lsp_t *lsp; zebra_lsp_t *lsp;
lsp = (zebra_lsp_t *)backet->data; lsp = (zebra_lsp_t *)bucket->data;
(void)lsp_processq_add(lsp); (void)lsp_processq_add(lsp);
} }
@ -1492,7 +1492,7 @@ static json_object *lsp_json(zebra_lsp_t *lsp)
static struct list *hash_get_sorted_list(struct hash *hash, void *cmp) static struct list *hash_get_sorted_list(struct hash *hash, void *cmp)
{ {
unsigned int i; unsigned int i;
struct hash_backet *hb; struct hash_bucket *hb;
struct list *sorted_list = list_new(); struct list *sorted_list = list_new();
sorted_list->cmp = (int (*)(void *, void *))cmp; sorted_list->cmp = (int (*)(void *, void *))cmp;
@ -2550,12 +2550,12 @@ int mpls_lsp_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
* Uninstall all LDP NHLFEs for a particular LSP forwarding entry. * Uninstall all LDP NHLFEs for a particular LSP forwarding entry.
* If no other NHLFEs exist, the entry would be deleted. * If no other NHLFEs exist, the entry would be deleted.
*/ */
void mpls_ldp_lsp_uninstall_all(struct hash_backet *backet, void *ctxt) void mpls_ldp_lsp_uninstall_all(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_lsp_t *lsp; zebra_lsp_t *lsp;
struct hash *lsp_table; struct hash *lsp_table;
lsp = (zebra_lsp_t *)backet->data; lsp = (zebra_lsp_t *)bucket->data;
if (!lsp->nhlfe_list) if (!lsp->nhlfe_list)
return; return;

View File

@ -291,7 +291,7 @@ int mpls_lsp_uninstall(struct zebra_vrf *zvrf, enum lsp_types_t type,
* Uninstall all LDP NHLFEs for a particular LSP forwarding entry. * Uninstall all LDP NHLFEs for a particular LSP forwarding entry.
* If no other NHLFEs exist, the entry would be deleted. * If no other NHLFEs exist, the entry would be deleted.
*/ */
void mpls_ldp_lsp_uninstall_all(struct hash_backet *backet, void *ctxt); void mpls_ldp_lsp_uninstall_all(struct hash_bucket *bucket, void *ctxt);
/* /*
* Uninstall all LDP FEC-To-NHLFE (FTN) bindings of the given address-family. * Uninstall all LDP FEC-To-NHLFE (FTN) bindings of the given address-family.
@ -302,7 +302,7 @@ void mpls_ldp_ftn_uninstall_all(struct zebra_vrf *zvrf, int afi);
* Uninstall all Segment Routing NHLFEs for a particular LSP forwarding entry. * Uninstall all Segment Routing NHLFEs for a particular LSP forwarding entry.
* If no other NHLFEs exist, the entry would be deleted. * If no other NHLFEs exist, the entry would be deleted.
*/ */
void mpls_sr_lsp_uninstall_all(struct hash_backet *backet, void *ctxt); void mpls_sr_lsp_uninstall_all(struct hash_bucket *bucket, void *ctxt);
#if defined(HAVE_CUMULUS) #if defined(HAVE_CUMULUS)
/* /*

View File

@ -212,7 +212,7 @@ struct pbr_rule_unique_lookup {
vrf_id_t vrf_id; vrf_id_t vrf_id;
}; };
static int pbr_rule_lookup_unique_walker(struct hash_backet *b, void *data) static int pbr_rule_lookup_unique_walker(struct hash_bucket *b, void *data)
{ {
struct pbr_rule_unique_lookup *pul = data; struct pbr_rule_unique_lookup *pul = data;
struct zebra_pbr_rule *rule = b->data; struct zebra_pbr_rule *rule = b->data;
@ -461,7 +461,7 @@ void zebra_pbr_del_rule(struct zebra_pbr_rule *rule)
__PRETTY_FUNCTION__); __PRETTY_FUNCTION__);
} }
static void zebra_pbr_cleanup_rules(struct hash_backet *b, void *data) static void zebra_pbr_cleanup_rules(struct hash_bucket *b, void *data)
{ {
struct zebra_pbr_rule *rule = b->data; struct zebra_pbr_rule *rule = b->data;
int *sock = data; int *sock = data;
@ -473,7 +473,7 @@ static void zebra_pbr_cleanup_rules(struct hash_backet *b, void *data)
} }
} }
static void zebra_pbr_cleanup_ipset(struct hash_backet *b, void *data) static void zebra_pbr_cleanup_ipset(struct hash_bucket *b, void *data)
{ {
struct zebra_pbr_ipset *ipset = b->data; struct zebra_pbr_ipset *ipset = b->data;
int *sock = data; int *sock = data;
@ -484,7 +484,7 @@ static void zebra_pbr_cleanup_ipset(struct hash_backet *b, void *data)
} }
} }
static void zebra_pbr_cleanup_ipset_entry(struct hash_backet *b, void *data) static void zebra_pbr_cleanup_ipset_entry(struct hash_bucket *b, void *data)
{ {
struct zebra_pbr_ipset_entry *ipset = b->data; struct zebra_pbr_ipset_entry *ipset = b->data;
int *sock = data; int *sock = data;
@ -495,7 +495,7 @@ static void zebra_pbr_cleanup_ipset_entry(struct hash_backet *b, void *data)
} }
} }
static void zebra_pbr_cleanup_iptable(struct hash_backet *b, void *data) static void zebra_pbr_cleanup_iptable(struct hash_bucket *b, void *data)
{ {
struct zebra_pbr_iptable *iptable = b->data; struct zebra_pbr_iptable *iptable = b->data;
int *sock = data; int *sock = data;
@ -576,11 +576,11 @@ const char *zebra_pbr_ipset_type2str(uint32_t type)
"Unrecognized IPset Type"); "Unrecognized IPset Type");
} }
static int zebra_pbr_ipset_pername_walkcb(struct hash_backet *backet, void *arg) static int zebra_pbr_ipset_pername_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct pbr_ipset_name_lookup *pinl = struct pbr_ipset_name_lookup *pinl =
(struct pbr_ipset_name_lookup *)arg; (struct pbr_ipset_name_lookup *)arg;
struct zebra_pbr_ipset *zpi = (struct zebra_pbr_ipset *)backet->data; struct zebra_pbr_ipset *zpi = (struct zebra_pbr_ipset *)bucket->data;
if (!strncmp(pinl->ipset_name, zpi->ipset_name, if (!strncmp(pinl->ipset_name, zpi->ipset_name,
ZEBRA_IPSET_NAME_SIZE)) { ZEBRA_IPSET_NAME_SIZE)) {
@ -874,7 +874,7 @@ static void zebra_pbr_display_port(struct vty *vty, uint32_t filter_bm,
} }
} }
static int zebra_pbr_show_ipset_entry_walkcb(struct hash_backet *backet, static int zebra_pbr_show_ipset_entry_walkcb(struct hash_bucket *bucket,
void *arg) void *arg)
{ {
struct zebra_pbr_ipset_entry_unique_display *unique = struct zebra_pbr_ipset_entry_unique_display *unique =
@ -882,7 +882,7 @@ static int zebra_pbr_show_ipset_entry_walkcb(struct hash_backet *backet,
struct zebra_pbr_ipset *zpi = unique->zpi; struct zebra_pbr_ipset *zpi = unique->zpi;
struct vty *vty = unique->vty; struct vty *vty = unique->vty;
struct zebra_pbr_ipset_entry *zpie = struct zebra_pbr_ipset_entry *zpie =
(struct zebra_pbr_ipset_entry *)backet->data; (struct zebra_pbr_ipset_entry *)bucket->data;
uint64_t pkts = 0, bytes = 0; uint64_t pkts = 0, bytes = 0;
int ret = 0; int ret = 0;
@ -949,11 +949,11 @@ static int zebra_pbr_show_ipset_entry_walkcb(struct hash_backet *backet,
return HASHWALK_CONTINUE; return HASHWALK_CONTINUE;
} }
static int zebra_pbr_show_ipset_walkcb(struct hash_backet *backet, void *arg) static int zebra_pbr_show_ipset_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct zebra_pbr_env_display *uniqueipset = struct zebra_pbr_env_display *uniqueipset =
(struct zebra_pbr_env_display *)arg; (struct zebra_pbr_env_display *)arg;
struct zebra_pbr_ipset *zpi = (struct zebra_pbr_ipset *)backet->data; struct zebra_pbr_ipset *zpi = (struct zebra_pbr_ipset *)bucket->data;
struct zebra_pbr_ipset_entry_unique_display unique; struct zebra_pbr_ipset_entry_unique_display unique;
struct vty *vty = uniqueipset->vty; struct vty *vty = uniqueipset->vty;
struct zebra_ns *zns = uniqueipset->zns; struct zebra_ns *zns = uniqueipset->zns;
@ -1026,12 +1026,12 @@ struct pbr_rule_fwmark_lookup {
uint32_t fwmark; uint32_t fwmark;
}; };
static int zebra_pbr_rule_lookup_fwmark_walkcb(struct hash_backet *backet, static int zebra_pbr_rule_lookup_fwmark_walkcb(struct hash_bucket *bucket,
void *arg) void *arg)
{ {
struct pbr_rule_fwmark_lookup *iprule = struct pbr_rule_fwmark_lookup *iprule =
(struct pbr_rule_fwmark_lookup *)arg; (struct pbr_rule_fwmark_lookup *)arg;
struct zebra_pbr_rule *zpr = (struct zebra_pbr_rule *)backet->data; struct zebra_pbr_rule *zpr = (struct zebra_pbr_rule *)bucket->data;
if (iprule->fwmark == zpr->rule.filter.fwmark) { if (iprule->fwmark == zpr->rule.filter.fwmark) {
iprule->ptr = zpr; iprule->ptr = zpr;
@ -1117,10 +1117,10 @@ static void zebra_pbr_show_iptable_unit(struct zebra_pbr_iptable *iptable,
} }
} }
static int zebra_pbr_show_iptable_walkcb(struct hash_backet *backet, void *arg) static int zebra_pbr_show_iptable_walkcb(struct hash_bucket *bucket, void *arg)
{ {
struct zebra_pbr_iptable *iptable = struct zebra_pbr_iptable *iptable =
(struct zebra_pbr_iptable *)backet->data; (struct zebra_pbr_iptable *)bucket->data;
struct zebra_pbr_env_display *env = (struct zebra_pbr_env_display *)arg; struct zebra_pbr_env_display *env = (struct zebra_pbr_env_display *)arg;
struct vty *vty = env->vty; struct vty *vty = env->vty;
struct zebra_ns *zns = env->zns; struct zebra_ns *zns = env->zns;

View File

@ -65,19 +65,19 @@ DEFINE_MTYPE_STATIC(ZEBRA, NEIGH, "VNI Neighbor");
static int ip_prefix_send_to_client(vrf_id_t vrf_id, struct prefix *p, static int ip_prefix_send_to_client(vrf_id_t vrf_id, struct prefix *p,
uint16_t cmd); uint16_t cmd);
static void zvni_print_neigh(zebra_neigh_t *n, void *ctxt, json_object *json); static void zvni_print_neigh(zebra_neigh_t *n, void *ctxt, json_object *json);
static void zvni_print_neigh_hash(struct hash_backet *backet, void *ctxt); static void zvni_print_neigh_hash(struct hash_bucket *bucket, void *ctxt);
static void zvni_print_dad_neigh_hash(struct hash_backet *backet, void *ctxt); static void zvni_print_dad_neigh_hash(struct hash_bucket *bucket, void *ctxt);
static void zvni_print_neigh_hash_all_vni(struct hash_backet *backet, static void zvni_print_neigh_hash_all_vni(struct hash_bucket *bucket,
void **args); void **args);
static void zl3vni_print_nh(zebra_neigh_t *n, struct vty *vty, static void zl3vni_print_nh(zebra_neigh_t *n, struct vty *vty,
json_object *json); json_object *json);
static void zl3vni_print_rmac(zebra_mac_t *zrmac, struct vty *vty, static void zl3vni_print_rmac(zebra_mac_t *zrmac, struct vty *vty,
json_object *json); json_object *json);
static void zvni_print_mac(zebra_mac_t *mac, void *ctxt, json_object *json); static void zvni_print_mac(zebra_mac_t *mac, void *ctxt, json_object *json);
static void zvni_print_mac_hash(struct hash_backet *backet, void *ctxt); static void zvni_print_mac_hash(struct hash_bucket *bucket, void *ctxt);
static void zvni_print_mac_hash_all_vni(struct hash_backet *backet, void *ctxt); static void zvni_print_mac_hash_all_vni(struct hash_bucket *bucket, void *ctxt);
static void zvni_print(zebra_vni_t *zvni, void **ctxt); static void zvni_print(zebra_vni_t *zvni, void **ctxt);
static void zvni_print_hash(struct hash_backet *backet, void *ctxt[]); static void zvni_print_hash(struct hash_bucket *bucket, void *ctxt[]);
static int zvni_macip_send_msg_to_client(vni_t vni, struct ethaddr *macaddr, static int zvni_macip_send_msg_to_client(vni_t vni, struct ethaddr *macaddr,
struct ipaddr *ip, uint8_t flags, struct ipaddr *ip, uint8_t flags,
@ -117,7 +117,7 @@ static int zl3vni_nh_install(zebra_l3vni_t *zl3vni, zebra_neigh_t *n);
static int zl3vni_nh_uninstall(zebra_l3vni_t *zl3vni, zebra_neigh_t *n); static int zl3vni_nh_uninstall(zebra_l3vni_t *zl3vni, zebra_neigh_t *n);
/* l3-vni rmac related APIs */ /* l3-vni rmac related APIs */
static void zl3vni_print_rmac_hash(struct hash_backet *, void *); static void zl3vni_print_rmac_hash(struct hash_bucket *, void *);
static zebra_mac_t *zl3vni_rmac_lookup(zebra_l3vni_t *zl3vni, static zebra_mac_t *zl3vni_rmac_lookup(zebra_l3vni_t *zl3vni,
struct ethaddr *rmac); struct ethaddr *rmac);
static void *zl3vni_rmac_alloc(void *p); static void *zl3vni_rmac_alloc(void *p);
@ -155,7 +155,7 @@ static zebra_vni_t *zvni_map_vlan(struct interface *ifp,
struct interface *br_if, vlanid_t vid); struct interface *br_if, vlanid_t vid);
static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac); static int zvni_mac_install(zebra_vni_t *zvni, zebra_mac_t *mac);
static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac); static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac);
static void zvni_install_mac_hash(struct hash_backet *backet, void *ctxt); static void zvni_install_mac_hash(struct hash_bucket *bucket, void *ctxt);
static unsigned int vni_hash_keymake(void *p); static unsigned int vni_hash_keymake(void *p);
static void *zvni_alloc(void *p); static void *zvni_alloc(void *p);
@ -257,7 +257,7 @@ static uint32_t num_valid_macs(zebra_vni_t *zvni)
unsigned int i; unsigned int i;
uint32_t num_macs = 0; uint32_t num_macs = 0;
struct hash *hash; struct hash *hash;
struct hash_backet *hb; struct hash_bucket *hb;
zebra_mac_t *mac; zebra_mac_t *mac;
hash = zvni->mac_table; hash = zvni->mac_table;
@ -281,7 +281,7 @@ static uint32_t num_dup_detected_macs(zebra_vni_t *zvni)
unsigned int i; unsigned int i;
uint32_t num_macs = 0; uint32_t num_macs = 0;
struct hash *hash; struct hash *hash;
struct hash_backet *hb; struct hash_bucket *hb;
zebra_mac_t *mac; zebra_mac_t *mac;
hash = zvni->mac_table; hash = zvni->mac_table;
@ -303,7 +303,7 @@ static uint32_t num_dup_detected_neighs(zebra_vni_t *zvni)
unsigned int i; unsigned int i;
uint32_t num_neighs = 0; uint32_t num_neighs = 0;
struct hash *hash; struct hash *hash;
struct hash_backet *hb; struct hash_bucket *hb;
zebra_neigh_t *nbr; zebra_neigh_t *nbr;
hash = zvni->neigh_table; hash = zvni->neigh_table;
@ -674,14 +674,14 @@ static void zebra_vxlan_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf,
* display - just because we're dealing with IPv6 addresses that can * display - just because we're dealing with IPv6 addresses that can
* widely vary. * widely vary.
*/ */
static void zvni_find_neigh_addr_width(struct hash_backet *backet, void *ctxt) static void zvni_find_neigh_addr_width(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_neigh_t *n; zebra_neigh_t *n;
char buf[INET6_ADDRSTRLEN]; char buf[INET6_ADDRSTRLEN];
struct neigh_walk_ctx *wctx = ctxt; struct neigh_walk_ctx *wctx = ctxt;
int width; int width;
n = (zebra_neigh_t *)backet->data; n = (zebra_neigh_t *)bucket->data;
ipaddr2str(&n->ip, buf, sizeof(buf)); ipaddr2str(&n->ip, buf, sizeof(buf));
width = strlen(buf); width = strlen(buf);
@ -791,7 +791,7 @@ static void zvni_print_neigh(zebra_neigh_t *n, void *ctxt, json_object *json)
/* /*
* Print neighbor hash entry - called for display of all neighbors. * Print neighbor hash entry - called for display of all neighbors.
*/ */
static void zvni_print_neigh_hash(struct hash_backet *backet, void *ctxt) static void zvni_print_neigh_hash(struct hash_bucket *bucket, void *ctxt)
{ {
struct vty *vty; struct vty *vty;
json_object *json_vni = NULL, *json_row = NULL; json_object *json_vni = NULL, *json_row = NULL;
@ -803,7 +803,7 @@ static void zvni_print_neigh_hash(struct hash_backet *backet, void *ctxt)
vty = wctx->vty; vty = wctx->vty;
json_vni = wctx->json; json_vni = wctx->json;
n = (zebra_neigh_t *)backet->data; n = (zebra_neigh_t *)bucket->data;
if (json_vni) if (json_vni)
json_row = json_object_new_object(); json_row = json_object_new_object();
@ -887,7 +887,7 @@ static void zvni_print_neigh_hash(struct hash_backet *backet, void *ctxt)
/* /*
* Print neighbor hash entry in detail - called for display of all neighbors. * Print neighbor hash entry in detail - called for display of all neighbors.
*/ */
static void zvni_print_neigh_hash_detail(struct hash_backet *backet, void *ctxt) static void zvni_print_neigh_hash_detail(struct hash_bucket *bucket, void *ctxt)
{ {
struct vty *vty; struct vty *vty;
json_object *json_vni = NULL, *json_row = NULL; json_object *json_vni = NULL, *json_row = NULL;
@ -897,7 +897,7 @@ static void zvni_print_neigh_hash_detail(struct hash_backet *backet, void *ctxt)
vty = wctx->vty; vty = wctx->vty;
json_vni = wctx->json; json_vni = wctx->json;
n = (zebra_neigh_t *)backet->data; n = (zebra_neigh_t *)bucket->data;
if (!n) if (!n)
return; return;
@ -914,7 +914,7 @@ static void zvni_print_neigh_hash_detail(struct hash_backet *backet, void *ctxt)
/* /*
* Print neighbors for all VNI. * Print neighbors for all VNI.
*/ */
static void zvni_print_neigh_hash_all_vni(struct hash_backet *backet, static void zvni_print_neigh_hash_all_vni(struct hash_bucket *bucket,
void **args) void **args)
{ {
struct vty *vty; struct vty *vty;
@ -929,7 +929,7 @@ static void zvni_print_neigh_hash_all_vni(struct hash_backet *backet,
json = (json_object *)args[1]; json = (json_object *)args[1];
print_dup = (uint32_t)(uintptr_t)args[2]; print_dup = (uint32_t)(uintptr_t)args[2];
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
num_neigh = hashcount(zvni->neigh_table); num_neigh = hashcount(zvni->neigh_table);
@ -978,35 +978,35 @@ static void zvni_print_neigh_hash_all_vni(struct hash_backet *backet,
json_object_object_add(json, vni_str, json_vni); json_object_object_add(json, vni_str, json_vni);
} }
static void zvni_print_dad_neigh_hash(struct hash_backet *backet, void *ctxt) static void zvni_print_dad_neigh_hash(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_neigh_t *nbr; zebra_neigh_t *nbr;
nbr = (zebra_neigh_t *)backet->data; nbr = (zebra_neigh_t *)bucket->data;
if (!nbr) if (!nbr)
return; return;
if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE)) if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE))
zvni_print_neigh_hash(backet, ctxt); zvni_print_neigh_hash(bucket, ctxt);
} }
static void zvni_print_dad_neigh_hash_detail(struct hash_backet *backet, static void zvni_print_dad_neigh_hash_detail(struct hash_bucket *bucket,
void *ctxt) void *ctxt)
{ {
zebra_neigh_t *nbr; zebra_neigh_t *nbr;
nbr = (zebra_neigh_t *)backet->data; nbr = (zebra_neigh_t *)bucket->data;
if (!nbr) if (!nbr)
return; return;
if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE)) if (CHECK_FLAG(nbr->flags, ZEBRA_NEIGH_DUPLICATE))
zvni_print_neigh_hash_detail(backet, ctxt); zvni_print_neigh_hash_detail(bucket, ctxt);
} }
/* /*
* Print neighbors for all VNIs in detail. * Print neighbors for all VNIs in detail.
*/ */
static void zvni_print_neigh_hash_all_vni_detail(struct hash_backet *backet, static void zvni_print_neigh_hash_all_vni_detail(struct hash_bucket *bucket,
void **args) void **args)
{ {
struct vty *vty; struct vty *vty;
@ -1021,7 +1021,7 @@ static void zvni_print_neigh_hash_all_vni_detail(struct hash_backet *backet,
json = (json_object *)args[1]; json = (json_object *)args[1];
print_dup = (uint32_t)(uintptr_t)args[2]; print_dup = (uint32_t)(uintptr_t)args[2];
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
if (!zvni) { if (!zvni) {
if (json) if (json)
vty_out(vty, "{}\n"); vty_out(vty, "{}\n");
@ -1318,7 +1318,7 @@ static void zvni_print_mac(zebra_mac_t *mac, void *ctxt, json_object *json)
/* /*
* Print MAC hash entry - called for display of all MACs. * Print MAC hash entry - called for display of all MACs.
*/ */
static void zvni_print_mac_hash(struct hash_backet *backet, void *ctxt) static void zvni_print_mac_hash(struct hash_bucket *bucket, void *ctxt)
{ {
struct vty *vty; struct vty *vty;
json_object *json_mac_hdr = NULL, *json_mac = NULL; json_object *json_mac_hdr = NULL, *json_mac = NULL;
@ -1328,7 +1328,7 @@ static void zvni_print_mac_hash(struct hash_backet *backet, void *ctxt)
vty = wctx->vty; vty = wctx->vty;
json_mac_hdr = wctx->json; json_mac_hdr = wctx->json;
mac = (zebra_mac_t *)backet->data; mac = (zebra_mac_t *)bucket->data;
prefix_mac2str(&mac->macaddr, buf1, sizeof(buf1)); prefix_mac2str(&mac->macaddr, buf1, sizeof(buf1));
@ -1424,22 +1424,22 @@ static void zvni_print_mac_hash(struct hash_backet *backet, void *ctxt)
} }
/* Print Duplicate MAC */ /* Print Duplicate MAC */
static void zvni_print_dad_mac_hash(struct hash_backet *backet, void *ctxt) static void zvni_print_dad_mac_hash(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_mac_t *mac; zebra_mac_t *mac;
mac = (zebra_mac_t *)backet->data; mac = (zebra_mac_t *)bucket->data;
if (!mac) if (!mac)
return; return;
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_DUPLICATE)) if (CHECK_FLAG(mac->flags, ZEBRA_MAC_DUPLICATE))
zvni_print_mac_hash(backet, ctxt); zvni_print_mac_hash(bucket, ctxt);
} }
/* /*
* Print MAC hash entry in detail - called for display of all MACs. * Print MAC hash entry in detail - called for display of all MACs.
*/ */
static void zvni_print_mac_hash_detail(struct hash_backet *backet, void *ctxt) static void zvni_print_mac_hash_detail(struct hash_bucket *bucket, void *ctxt)
{ {
struct vty *vty; struct vty *vty;
json_object *json_mac_hdr = NULL; json_object *json_mac_hdr = NULL;
@ -1449,7 +1449,7 @@ static void zvni_print_mac_hash_detail(struct hash_backet *backet, void *ctxt)
vty = wctx->vty; vty = wctx->vty;
json_mac_hdr = wctx->json; json_mac_hdr = wctx->json;
mac = (zebra_mac_t *)backet->data; mac = (zebra_mac_t *)bucket->data;
if (!mac) if (!mac)
return; return;
@ -1460,23 +1460,23 @@ static void zvni_print_mac_hash_detail(struct hash_backet *backet, void *ctxt)
} }
/* Print Duplicate MAC in detail */ /* Print Duplicate MAC in detail */
static void zvni_print_dad_mac_hash_detail(struct hash_backet *backet, static void zvni_print_dad_mac_hash_detail(struct hash_bucket *bucket,
void *ctxt) void *ctxt)
{ {
zebra_mac_t *mac; zebra_mac_t *mac;
mac = (zebra_mac_t *)backet->data; mac = (zebra_mac_t *)bucket->data;
if (!mac) if (!mac)
return; return;
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_DUPLICATE)) if (CHECK_FLAG(mac->flags, ZEBRA_MAC_DUPLICATE))
zvni_print_mac_hash_detail(backet, ctxt); zvni_print_mac_hash_detail(bucket, ctxt);
} }
/* /*
* Print MACs for all VNI. * Print MACs for all VNI.
*/ */
static void zvni_print_mac_hash_all_vni(struct hash_backet *backet, void *ctxt) static void zvni_print_mac_hash_all_vni(struct hash_bucket *bucket, void *ctxt)
{ {
struct vty *vty; struct vty *vty;
json_object *json = NULL, *json_vni = NULL; json_object *json = NULL, *json_vni = NULL;
@ -1489,7 +1489,7 @@ static void zvni_print_mac_hash_all_vni(struct hash_backet *backet, void *ctxt)
vty = (struct vty *)wctx->vty; vty = (struct vty *)wctx->vty;
json = (struct json_object *)wctx->json; json = (struct json_object *)wctx->json;
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
wctx->zvni = zvni; wctx->zvni = zvni;
/*We are iterating over a new VNI, set the count to 0*/ /*We are iterating over a new VNI, set the count to 0*/
@ -1546,7 +1546,7 @@ static void zvni_print_mac_hash_all_vni(struct hash_backet *backet, void *ctxt)
/* /*
* Print MACs in detail for all VNI. * Print MACs in detail for all VNI.
*/ */
static void zvni_print_mac_hash_all_vni_detail(struct hash_backet *backet, static void zvni_print_mac_hash_all_vni_detail(struct hash_bucket *bucket,
void *ctxt) void *ctxt)
{ {
struct vty *vty; struct vty *vty;
@ -1560,7 +1560,7 @@ static void zvni_print_mac_hash_all_vni_detail(struct hash_backet *backet,
vty = (struct vty *)wctx->vty; vty = (struct vty *)wctx->vty;
json = (struct json_object *)wctx->json; json = (struct json_object *)wctx->json;
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
if (!zvni) { if (!zvni) {
if (json) if (json)
vty_out(vty, "{}\n"); vty_out(vty, "{}\n");
@ -1609,7 +1609,7 @@ static void zvni_print_mac_hash_all_vni_detail(struct hash_backet *backet,
} }
} }
static void zl3vni_print_nh_hash(struct hash_backet *backet, void *ctx) static void zl3vni_print_nh_hash(struct hash_bucket *bucket, void *ctx)
{ {
struct nh_walk_ctx *wctx = NULL; struct nh_walk_ctx *wctx = NULL;
struct vty *vty = NULL; struct vty *vty = NULL;
@ -1624,7 +1624,7 @@ static void zl3vni_print_nh_hash(struct hash_backet *backet, void *ctx)
json_vni = wctx->json; json_vni = wctx->json;
if (json_vni) if (json_vni)
json_nh = json_object_new_object(); json_nh = json_object_new_object();
n = (zebra_neigh_t *)backet->data; n = (zebra_neigh_t *)bucket->data;
if (!json_vni) { if (!json_vni) {
vty_out(vty, "%-15s %-17s\n", vty_out(vty, "%-15s %-17s\n",
@ -1642,7 +1642,7 @@ static void zl3vni_print_nh_hash(struct hash_backet *backet, void *ctx)
} }
} }
static void zl3vni_print_nh_hash_all_vni(struct hash_backet *backet, static void zl3vni_print_nh_hash_all_vni(struct hash_bucket *bucket,
void **args) void **args)
{ {
struct vty *vty = NULL; struct vty *vty = NULL;
@ -1656,7 +1656,7 @@ static void zl3vni_print_nh_hash_all_vni(struct hash_backet *backet,
vty = (struct vty *)args[0]; vty = (struct vty *)args[0];
json = (struct json_object *)args[1]; json = (struct json_object *)args[1];
zl3vni = (zebra_l3vni_t *)backet->data; zl3vni = (zebra_l3vni_t *)bucket->data;
num_nh = hashcount(zl3vni->nh_table); num_nh = hashcount(zl3vni->nh_table);
if (!num_nh) if (!num_nh)
@ -1681,7 +1681,7 @@ static void zl3vni_print_nh_hash_all_vni(struct hash_backet *backet,
json_object_object_add(json, vni_str, json_vni); json_object_object_add(json, vni_str, json_vni);
} }
static void zl3vni_print_rmac_hash_all_vni(struct hash_backet *backet, static void zl3vni_print_rmac_hash_all_vni(struct hash_bucket *bucket,
void **args) void **args)
{ {
struct vty *vty = NULL; struct vty *vty = NULL;
@ -1695,7 +1695,7 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_backet *backet,
vty = (struct vty *)args[0]; vty = (struct vty *)args[0];
json = (struct json_object *)args[1]; json = (struct json_object *)args[1];
zl3vni = (zebra_l3vni_t *)backet->data; zl3vni = (zebra_l3vni_t *)bucket->data;
num_rmacs = hashcount(zl3vni->rmac_table); num_rmacs = hashcount(zl3vni->rmac_table);
if (!num_rmacs) if (!num_rmacs)
@ -1724,7 +1724,7 @@ static void zl3vni_print_rmac_hash_all_vni(struct hash_backet *backet,
json_object_object_add(json, vni_str, json_vni); json_object_object_add(json, vni_str, json_vni);
} }
static void zl3vni_print_rmac_hash(struct hash_backet *backet, void *ctx) static void zl3vni_print_rmac_hash(struct hash_bucket *bucket, void *ctx)
{ {
zebra_mac_t *zrmac = NULL; zebra_mac_t *zrmac = NULL;
struct rmac_walk_ctx *wctx = NULL; struct rmac_walk_ctx *wctx = NULL;
@ -1738,7 +1738,7 @@ static void zl3vni_print_rmac_hash(struct hash_backet *backet, void *ctx)
json = wctx->json; json = wctx->json;
if (json) if (json)
json_rmac = json_object_new_object(); json_rmac = json_object_new_object();
zrmac = (zebra_mac_t *)backet->data; zrmac = (zebra_mac_t *)bucket->data;
if (!json) { if (!json) {
vty_out(vty, "%-17s %-21s\n", vty_out(vty, "%-17s %-21s\n",
@ -1904,7 +1904,7 @@ static void zvni_print(zebra_vni_t *zvni, void **ctxt)
} }
/* print a L3 VNI hash entry */ /* print a L3 VNI hash entry */
static void zl3vni_print_hash(struct hash_backet *backet, void *ctx[]) static void zl3vni_print_hash(struct hash_bucket *bucket, void *ctx[])
{ {
struct vty *vty = NULL; struct vty *vty = NULL;
json_object *json = NULL; json_object *json = NULL;
@ -1914,7 +1914,7 @@ static void zl3vni_print_hash(struct hash_backet *backet, void *ctx[])
vty = (struct vty *)ctx[0]; vty = (struct vty *)ctx[0];
json = (json_object *)ctx[1]; json = (json_object *)ctx[1];
zl3vni = (zebra_l3vni_t *)backet->data; zl3vni = (zebra_l3vni_t *)bucket->data;
if (!json) { if (!json) {
vty_out(vty, "%-10u %-4s %-21s %-8lu %-8lu %-15s %-37s\n", vty_out(vty, "%-10u %-4s %-21s %-8lu %-8lu %-15s %-37s\n",
@ -1950,7 +1950,7 @@ struct zvni_evpn_show {
}; };
/* print a L3 VNI hash entry in detail*/ /* print a L3 VNI hash entry in detail*/
static void zl3vni_print_hash_detail(struct hash_backet *backet, void *data) static void zl3vni_print_hash_detail(struct hash_bucket *bucket, void *data)
{ {
struct vty *vty = NULL; struct vty *vty = NULL;
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
@ -1964,7 +1964,7 @@ static void zl3vni_print_hash_detail(struct hash_backet *backet, void *data)
if (json) if (json)
use_json = true; use_json = true;
zl3vni = (zebra_l3vni_t *)backet->data; zl3vni = (zebra_l3vni_t *)bucket->data;
zebra_vxlan_print_vni(vty, zes->zvrf, zl3vni->vni, use_json); zebra_vxlan_print_vni(vty, zes->zvrf, zl3vni->vni, use_json);
vty_out(vty, "\n"); vty_out(vty, "\n");
@ -1974,7 +1974,7 @@ static void zl3vni_print_hash_detail(struct hash_backet *backet, void *data)
/* /*
* Print a VNI hash entry - called for display of all VNIs. * Print a VNI hash entry - called for display of all VNIs.
*/ */
static void zvni_print_hash(struct hash_backet *backet, void *ctxt[]) static void zvni_print_hash(struct hash_bucket *bucket, void *ctxt[])
{ {
struct vty *vty; struct vty *vty;
zebra_vni_t *zvni; zebra_vni_t *zvni;
@ -1990,7 +1990,7 @@ static void zvni_print_hash(struct hash_backet *backet, void *ctxt[])
vty = ctxt[0]; vty = ctxt[0];
json = ctxt[1]; json = ctxt[1];
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
zvtep = zvni->vteps; zvtep = zvni->vteps;
while (zvtep) { while (zvtep) {
@ -2038,7 +2038,7 @@ static void zvni_print_hash(struct hash_backet *backet, void *ctxt[])
/* /*
* Print a VNI hash entry in detail - called for display of all VNIs. * Print a VNI hash entry in detail - called for display of all VNIs.
*/ */
static void zvni_print_hash_detail(struct hash_backet *backet, void *data) static void zvni_print_hash_detail(struct hash_bucket *bucket, void *data)
{ {
struct vty *vty; struct vty *vty;
zebra_vni_t *zvni; zebra_vni_t *zvni;
@ -2052,7 +2052,7 @@ static void zvni_print_hash_detail(struct hash_backet *backet, void *data)
if (json) if (json)
use_json = true; use_json = true;
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
zebra_vxlan_print_vni(vty, zes->zvrf, zvni->vni, use_json); zebra_vxlan_print_vni(vty, zes->zvrf, zvni->vni, use_json);
vty_out(vty, "\n"); vty_out(vty, "\n");
@ -2224,10 +2224,10 @@ static int zvni_neigh_del(zebra_vni_t *zvni, zebra_neigh_t *n)
/* /*
* Free neighbor hash entry (callback) * Free neighbor hash entry (callback)
*/ */
static void zvni_neigh_del_hash_entry(struct hash_backet *backet, void *arg) static void zvni_neigh_del_hash_entry(struct hash_bucket *bucket, void *arg)
{ {
struct neigh_walk_ctx *wctx = arg; struct neigh_walk_ctx *wctx = arg;
zebra_neigh_t *n = backet->data; zebra_neigh_t *n = bucket->data;
if (((wctx->flags & DEL_LOCAL_NEIGH) && (n->flags & ZEBRA_NEIGH_LOCAL)) if (((wctx->flags & DEL_LOCAL_NEIGH) && (n->flags & ZEBRA_NEIGH_LOCAL))
|| ((wctx->flags & DEL_REMOTE_NEIGH) || ((wctx->flags & DEL_REMOTE_NEIGH)
@ -2557,12 +2557,12 @@ static int zvni_neigh_probe(zebra_vni_t *zvni, zebra_neigh_t *n)
/* /*
* Install neighbor hash entry - called upon access VLAN change. * Install neighbor hash entry - called upon access VLAN change.
*/ */
static void zvni_install_neigh_hash(struct hash_backet *backet, void *ctxt) static void zvni_install_neigh_hash(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_neigh_t *n; zebra_neigh_t *n;
struct neigh_walk_ctx *wctx = ctxt; struct neigh_walk_ctx *wctx = ctxt;
n = (zebra_neigh_t *)backet->data; n = (zebra_neigh_t *)bucket->data;
if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE)) if (CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE))
zvni_neigh_install(wctx->zvni, n); zvni_neigh_install(wctx->zvni, n);
@ -2819,7 +2819,7 @@ static int zvni_gw_macip_del(struct interface *ifp, zebra_vni_t *zvni,
return 0; return 0;
} }
static void zvni_gw_macip_del_for_vni_hash(struct hash_backet *backet, static void zvni_gw_macip_del_for_vni_hash(struct hash_bucket *bucket,
void *ctxt) void *ctxt)
{ {
zebra_vni_t *zvni = NULL; zebra_vni_t *zvni = NULL;
@ -2830,7 +2830,7 @@ static void zvni_gw_macip_del_for_vni_hash(struct hash_backet *backet,
struct interface *ifp; struct interface *ifp;
/* Add primary SVI MAC*/ /* Add primary SVI MAC*/
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
ifp = zvni->vxlan_if; ifp = zvni->vxlan_if;
if (!ifp) if (!ifp)
@ -2859,7 +2859,7 @@ static void zvni_gw_macip_del_for_vni_hash(struct hash_backet *backet,
return; return;
} }
static void zvni_gw_macip_add_for_vni_hash(struct hash_backet *backet, static void zvni_gw_macip_add_for_vni_hash(struct hash_bucket *bucket,
void *ctxt) void *ctxt)
{ {
zebra_vni_t *zvni = NULL; zebra_vni_t *zvni = NULL;
@ -2869,7 +2869,7 @@ static void zvni_gw_macip_add_for_vni_hash(struct hash_backet *backet,
struct interface *vrr_if = NULL; struct interface *vrr_if = NULL;
struct interface *ifp = NULL; struct interface *ifp = NULL;
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
ifp = zvni->vxlan_if; ifp = zvni->vxlan_if;
if (!ifp) if (!ifp)
@ -2899,7 +2899,7 @@ static void zvni_gw_macip_add_for_vni_hash(struct hash_backet *backet,
return; return;
} }
static void zvni_svi_macip_del_for_vni_hash(struct hash_backet *backet, static void zvni_svi_macip_del_for_vni_hash(struct hash_bucket *bucket,
void *ctxt) void *ctxt)
{ {
zebra_vni_t *zvni = NULL; zebra_vni_t *zvni = NULL;
@ -2909,7 +2909,7 @@ static void zvni_svi_macip_del_for_vni_hash(struct hash_backet *backet,
struct interface *ifp; struct interface *ifp;
/* Add primary SVI MAC*/ /* Add primary SVI MAC*/
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
if (!zvni) if (!zvni)
return; return;
@ -3320,10 +3320,10 @@ static int zvni_mac_del(zebra_vni_t *zvni, zebra_mac_t *mac)
/* /*
* Free MAC hash entry (callback) * Free MAC hash entry (callback)
*/ */
static void zvni_mac_del_hash_entry(struct hash_backet *backet, void *arg) static void zvni_mac_del_hash_entry(struct hash_bucket *bucket, void *arg)
{ {
struct mac_walk_ctx *wctx = arg; struct mac_walk_ctx *wctx = arg;
zebra_mac_t *mac = backet->data; zebra_mac_t *mac = bucket->data;
if (((wctx->flags & DEL_LOCAL_MAC) && (mac->flags & ZEBRA_MAC_LOCAL)) if (((wctx->flags & DEL_LOCAL_MAC) && (mac->flags & ZEBRA_MAC_LOCAL))
|| ((wctx->flags & DEL_REMOTE_MAC) || ((wctx->flags & DEL_REMOTE_MAC)
@ -3664,12 +3664,12 @@ static int zvni_mac_uninstall(zebra_vni_t *zvni, zebra_mac_t *mac)
/* /*
* Install MAC hash entry - called upon access VLAN change. * Install MAC hash entry - called upon access VLAN change.
*/ */
static void zvni_install_mac_hash(struct hash_backet *backet, void *ctxt) static void zvni_install_mac_hash(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_mac_t *mac; zebra_mac_t *mac;
struct mac_walk_ctx *wctx = ctxt; struct mac_walk_ctx *wctx = ctxt;
mac = (zebra_mac_t *)backet->data; mac = (zebra_mac_t *)bucket->data;
if (CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE)) if (CHECK_FLAG(mac->flags, ZEBRA_MAC_REMOTE))
zvni_mac_install(wctx->zvni, mac); zvni_mac_install(wctx->zvni, mac);
@ -4142,13 +4142,13 @@ static int zvni_vtep_uninstall(zebra_vni_t *zvni, struct in_addr *vtep_ip)
* Install or uninstall flood entries in the kernel corresponding to * Install or uninstall flood entries in the kernel corresponding to
* remote VTEPs. This is invoked upon change to BUM handling. * remote VTEPs. This is invoked upon change to BUM handling.
*/ */
static void zvni_handle_flooding_remote_vteps(struct hash_backet *backet, static void zvni_handle_flooding_remote_vteps(struct hash_bucket *bucket,
void *zvrf) void *zvrf)
{ {
zebra_vni_t *zvni; zebra_vni_t *zvni;
zebra_vtep_t *zvtep; zebra_vtep_t *zvtep;
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
if (!zvni) if (!zvni)
return; return;
@ -4163,13 +4163,13 @@ static void zvni_handle_flooding_remote_vteps(struct hash_backet *backet,
/* /*
* Cleanup VNI/VTEP and update kernel * Cleanup VNI/VTEP and update kernel
*/ */
static void zvni_cleanup_all(struct hash_backet *backet, void *arg) static void zvni_cleanup_all(struct hash_bucket *bucket, void *arg)
{ {
zebra_vni_t *zvni = NULL; zebra_vni_t *zvni = NULL;
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
struct zebra_vrf *zvrf = (struct zebra_vrf *)arg; struct zebra_vrf *zvrf = (struct zebra_vrf *)arg;
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
/* remove from l3-vni list */ /* remove from l3-vni list */
if (zvrf->l3vni) if (zvrf->l3vni)
@ -4189,11 +4189,11 @@ static void zvni_cleanup_all(struct hash_backet *backet, void *arg)
} }
/* cleanup L3VNI */ /* cleanup L3VNI */
static void zl3vni_cleanup_all(struct hash_backet *backet, void *args) static void zl3vni_cleanup_all(struct hash_bucket *bucket, void *args)
{ {
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
zl3vni = (zebra_l3vni_t *)backet->data; zl3vni = (zebra_l3vni_t *)bucket->data;
zebra_vxlan_process_l3vni_oper_down(zl3vni); zebra_vxlan_process_l3vni_oper_down(zl3vni);
} }
@ -4944,9 +4944,9 @@ static void zebra_vxlan_process_l3vni_oper_down(zebra_l3vni_t *zl3vni)
zl3vni_send_del_to_client(zl3vni); zl3vni_send_del_to_client(zl3vni);
} }
static void zvni_add_to_l3vni_list(struct hash_backet *backet, void *ctxt) static void zvni_add_to_l3vni_list(struct hash_bucket *bucket, void *ctxt)
{ {
zebra_vni_t *zvni = (zebra_vni_t *)backet->data; zebra_vni_t *zvni = (zebra_vni_t *)bucket->data;
zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)ctxt; zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)ctxt;
if (zvni->vrf_id == zl3vni_vrf_id(zl3vni)) if (zvni->vrf_id == zl3vni_vrf_id(zl3vni))
@ -5007,24 +5007,24 @@ static int zebra_vxlan_handle_vni_transition(struct zebra_vrf *zvrf, vni_t vni,
} }
/* delete and uninstall rmac hash entry */ /* delete and uninstall rmac hash entry */
static void zl3vni_del_rmac_hash_entry(struct hash_backet *backet, void *ctx) static void zl3vni_del_rmac_hash_entry(struct hash_bucket *bucket, void *ctx)
{ {
zebra_mac_t *zrmac = NULL; zebra_mac_t *zrmac = NULL;
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
zrmac = (zebra_mac_t *)backet->data; zrmac = (zebra_mac_t *)bucket->data;
zl3vni = (zebra_l3vni_t *)ctx; zl3vni = (zebra_l3vni_t *)ctx;
zl3vni_rmac_uninstall(zl3vni, zrmac); zl3vni_rmac_uninstall(zl3vni, zrmac);
zl3vni_rmac_del(zl3vni, zrmac); zl3vni_rmac_del(zl3vni, zrmac);
} }
/* delete and uninstall nh hash entry */ /* delete and uninstall nh hash entry */
static void zl3vni_del_nh_hash_entry(struct hash_backet *backet, void *ctx) static void zl3vni_del_nh_hash_entry(struct hash_bucket *bucket, void *ctx)
{ {
zebra_neigh_t *n = NULL; zebra_neigh_t *n = NULL;
zebra_l3vni_t *zl3vni = NULL; zebra_l3vni_t *zl3vni = NULL;
n = (zebra_neigh_t *)backet->data; n = (zebra_neigh_t *)bucket->data;
zl3vni = (zebra_l3vni_t *)ctx; zl3vni = (zebra_l3vni_t *)ctx;
zl3vni_nh_uninstall(zl3vni, n); zl3vni_nh_uninstall(zl3vni, n);
zl3vni_nh_del(zl3vni, n); zl3vni_nh_del(zl3vni, n);
@ -5770,7 +5770,7 @@ void zebra_vxlan_print_rmacs_all_l3vni(struct vty *vty, bool use_json)
args[0] = vty; args[0] = vty;
args[1] = json; args[1] = json;
hash_iterate(zrouter.l3vni_table, hash_iterate(zrouter.l3vni_table,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))zl3vni_print_rmac_hash_all_vni, void *))zl3vni_print_rmac_hash_all_vni,
args); args);
@ -5887,7 +5887,7 @@ void zebra_vxlan_print_nh_all_l3vni(struct vty *vty, bool use_json)
args[0] = vty; args[0] = vty;
args[1] = json; args[1] = json;
hash_iterate(zrouter.l3vni_table, hash_iterate(zrouter.l3vni_table,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))zl3vni_print_nh_hash_all_vni, void *))zl3vni_print_nh_hash_all_vni,
args); args);
@ -6048,7 +6048,7 @@ void zebra_vxlan_print_neigh_all_vni(struct vty *vty, struct zebra_vrf *zvrf,
args[2] = (void *)(ptrdiff_t)print_dup; args[2] = (void *)(ptrdiff_t)print_dup;
hash_iterate(zvrf->vni_table, hash_iterate(zvrf->vni_table,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))zvni_print_neigh_hash_all_vni, void *))zvni_print_neigh_hash_all_vni,
args); args);
if (use_json) { if (use_json) {
@ -6079,7 +6079,7 @@ void zebra_vxlan_print_neigh_all_vni_detail(struct vty *vty,
args[2] = (void *)(ptrdiff_t)print_dup; args[2] = (void *)(ptrdiff_t)print_dup;
hash_iterate(zvrf->vni_table, hash_iterate(zvrf->vni_table,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))zvni_print_neigh_hash_all_vni_detail, void *))zvni_print_neigh_hash_all_vni_detail,
args); args);
if (use_json) { if (use_json) {
@ -6641,7 +6641,7 @@ int zebra_vxlan_clear_dup_detect_vni_ip(struct vty *vty,
return CMD_SUCCESS; return CMD_SUCCESS;
} }
static void zvni_clear_dup_mac_hash(struct hash_backet *backet, void *ctxt) static void zvni_clear_dup_mac_hash(struct hash_bucket *bucket, void *ctxt)
{ {
struct mac_walk_ctx *wctx = ctxt; struct mac_walk_ctx *wctx = ctxt;
zebra_mac_t *mac; zebra_mac_t *mac;
@ -6649,7 +6649,7 @@ static void zvni_clear_dup_mac_hash(struct hash_backet *backet, void *ctxt)
struct listnode *node = NULL; struct listnode *node = NULL;
zebra_neigh_t *nbr = NULL; zebra_neigh_t *nbr = NULL;
mac = (zebra_mac_t *)backet->data; mac = (zebra_mac_t *)bucket->data;
if (!mac) if (!mac)
return; return;
@ -6696,14 +6696,14 @@ static void zvni_clear_dup_mac_hash(struct hash_backet *backet, void *ctxt)
} }
} }
static void zvni_clear_dup_neigh_hash(struct hash_backet *backet, void *ctxt) static void zvni_clear_dup_neigh_hash(struct hash_bucket *bucket, void *ctxt)
{ {
struct neigh_walk_ctx *wctx = ctxt; struct neigh_walk_ctx *wctx = ctxt;
zebra_neigh_t *nbr; zebra_neigh_t *nbr;
zebra_vni_t *zvni; zebra_vni_t *zvni;
char buf[INET6_ADDRSTRLEN]; char buf[INET6_ADDRSTRLEN];
nbr = (zebra_neigh_t *)backet->data; nbr = (zebra_neigh_t *)bucket->data;
if (!nbr) if (!nbr)
return; return;
@ -6736,7 +6736,7 @@ static void zvni_clear_dup_neigh_hash(struct hash_backet *backet, void *ctxt)
} }
} }
static void zvni_clear_dup_detect_hash_vni_all(struct hash_backet *backet, static void zvni_clear_dup_detect_hash_vni_all(struct hash_bucket *bucket,
void **args) void **args)
{ {
struct vty *vty; struct vty *vty;
@ -6745,7 +6745,7 @@ static void zvni_clear_dup_detect_hash_vni_all(struct hash_backet *backet,
struct mac_walk_ctx m_wctx; struct mac_walk_ctx m_wctx;
struct neigh_walk_ctx n_wctx; struct neigh_walk_ctx n_wctx;
zvni = (zebra_vni_t *)backet->data; zvni = (zebra_vni_t *)bucket->data;
if (!zvni) if (!zvni)
return; return;
@ -6783,7 +6783,7 @@ int zebra_vxlan_clear_dup_detect_vni_all(struct vty *vty,
args[1] = zvrf; args[1] = zvrf;
hash_iterate(zvrf->vni_table, hash_iterate(zvrf->vni_table,
(void (*)(struct hash_backet *, void *)) (void (*)(struct hash_bucket *, void *))
zvni_clear_dup_detect_hash_vni_all, args); zvni_clear_dup_detect_hash_vni_all, args);
return CMD_SUCCESS; return CMD_SUCCESS;
@ -7009,12 +7009,12 @@ void zebra_vxlan_print_vnis(struct vty *vty, struct zebra_vrf *zvrf,
/* Display all L2-VNIs */ /* Display all L2-VNIs */
hash_iterate(zvrf->vni_table, hash_iterate(zvrf->vni_table,
(void (*)(struct hash_backet *, void *))zvni_print_hash, (void (*)(struct hash_bucket *, void *))zvni_print_hash,
args); args);
/* Display all L3-VNIs */ /* Display all L3-VNIs */
hash_iterate(zrouter.l3vni_table, hash_iterate(zrouter.l3vni_table,
(void (*)(struct hash_backet *, void *))zl3vni_print_hash, (void (*)(struct hash_bucket *, void *))zl3vni_print_hash,
args); args);
if (use_json) { if (use_json) {
@ -7092,13 +7092,13 @@ void zebra_vxlan_print_vnis_detail(struct vty *vty, struct zebra_vrf *zvrf,
zes.zvrf = zvrf; zes.zvrf = zvrf;
/* Display all L2-VNIs */ /* Display all L2-VNIs */
hash_iterate(zvrf->vni_table, (void (*)(struct hash_backet *, hash_iterate(zvrf->vni_table, (void (*)(struct hash_bucket *,
void *))zvni_print_hash_detail, void *))zvni_print_hash_detail,
&zes); &zes);
/* Display all L3-VNIs */ /* Display all L3-VNIs */
hash_iterate(zrouter.l3vni_table, hash_iterate(zrouter.l3vni_table,
(void (*)(struct hash_backet *, (void (*)(struct hash_bucket *,
void *))zl3vni_print_hash_detail, void *))zl3vni_print_hash_detail,
&zes); &zes);