Skip to content

Commit

Permalink
Merge pull request #3832 from kooky/rename_backet
Browse files Browse the repository at this point in the history
Rename backet to bucket
  • Loading branch information
mwinter-osr committed Feb 26, 2019
2 parents 5a80b8c + 0026ac1 commit 51127bc
Show file tree
Hide file tree
Showing 34 changed files with 328 additions and 323 deletions.
4 changes: 2 additions & 2 deletions bfdd/bfd.c
Expand Up @@ -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 _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__)));

/* BFD hash for our discriminator. */
Expand Down Expand Up @@ -1516,7 +1516,7 @@ void bfd_initialize(void)
"BFD multihop hop hash");
}

static void _bfd_free(struct hash_backet *hb,
static void _bfd_free(struct hash_bucket *hb,
void *arg __attribute__((__unused__)))
{
struct bfd_session *bs = hb->data;
Expand Down
2 changes: 1 addition & 1 deletion bfdd/bfd.h
Expand Up @@ -557,7 +557,7 @@ bool bfd_mhop_insert(struct bfd_session *bs);
bool bfd_vrf_insert(struct bfd_vrf *vrf);
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_shop_iterate(hash_iter_func hif, void *arg);
void bfd_mhop_iterate(hash_iter_func hif, void *arg);
Expand Down
20 changes: 10 additions & 10 deletions bfdd/bfdd_vty.c
Expand Up @@ -52,7 +52,7 @@
static int bfdd_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_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,
const struct sockaddr_any *peer,
const struct sockaddr_any *local,
Expand All @@ -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(struct vty *vty, struct bfd_session *bs);
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_json_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_bucket *hb, void *arg);
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 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_json_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_bucket *hb, void *arg);
static void _display_peers_counter(struct vty *vty, bool use_json);
static struct bfd_session *
_find_peer_or_error(struct vty *vty, int argc, struct cmd_token **argv,
Expand Down Expand Up @@ -538,15 +538,15 @@ static void _display_peer_json(struct vty *vty, struct bfd_session *bs)
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 bfd_session *bs = hb->data;

_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 bfd_session *bs = hb->data;
Expand Down Expand Up @@ -621,15 +621,15 @@ static void _display_peer_counters_json(struct vty *vty, struct bfd_session *bs)
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 bfd_session *bs = hb->data;

_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 bfd_session *bs = hb->data;
Expand Down Expand Up @@ -970,7 +970,7 @@ DEFUN_NOSH(show_debugging_bfd,
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 bfd_session *bs = hb->data;
Expand Down
4 changes: 2 additions & 2 deletions bfdd/control.c
Expand Up @@ -65,7 +65,7 @@ static void control_handle_notify_add(struct bfd_control_socket *bcs,
struct bfd_control_msg *bcm);
static void control_handle_notify_del(struct bfd_control_socket *bcs,
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,
struct bfd_control_msg *bcm);
static void control_response(struct bfd_control_socket *bcs, uint16_t id,
Expand Down Expand Up @@ -630,7 +630,7 @@ static struct bfd_session *_notify_find_peer(struct bfd_peer_cfg *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_session *bs = hb->data;
Expand Down
8 changes: 4 additions & 4 deletions bgpd/bgp_aspath.c
Expand Up @@ -2077,22 +2077,22 @@ void aspath_print_vty(struct vty *vty, const char *format, struct aspath *as,
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 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);
}

/* Print all aspath and hash information. This function is used from
`show [ip] bgp paths' command. */
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,
vty);
}
6 changes: 3 additions & 3 deletions bgpd/bgp_attr.c
Expand Up @@ -592,9 +592,9 @@ static void attrhash_finish(void)
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,
inet_ntoa(attr->nexthop));
Expand All @@ -605,7 +605,7 @@ static void attr_show_all_iterator(struct hash_backet *backet, 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,
vty);
}
Expand Down
44 changes: 22 additions & 22 deletions bgpd/bgp_evpn.c
Expand Up @@ -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
* 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. */
if (is_rd_configured(vpn))
Expand All @@ -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
* 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. */
if (is_rd_configured(vpn))
Expand All @@ -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.
* 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 prefix_evpn p;

Expand All @@ -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.
* 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 prefix_evpn p;

Expand Down Expand Up @@ -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.
*/
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. */
delete_routes_for_vni(bgp, vpn);
Expand All @@ -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.
*/
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);
bgp_evpn_free(bgp, vpn);
Expand Down Expand Up @@ -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.
*/
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_vni_live(vpn))
Expand Down Expand Up @@ -4483,7 +4483,7 @@ void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw)
* L2-VNIs
*/
hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *,
(void (*)(struct hash_bucket *,
void *))withdraw_router_id_vni,
bgp);
} else {
Expand All @@ -4497,7 +4497,7 @@ void bgp_evpn_handle_router_id_update(struct bgp *bgp, int withdraw)
* new RD
*/
hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *,
(void (*)(struct hash_bucket *,
void *))update_router_id_vni,
bgp);
}
Expand All @@ -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)
{
hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *,
(void (*)(struct hash_bucket *,
void*))update_autort_vni,
bgp);
}
Expand Down Expand Up @@ -5382,10 +5382,10 @@ int bgp_evpn_local_macip_add(struct bgp *bgp, vni_t vni, struct ethaddr *mac,
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 bgpevpn *vpn = (struct bgpevpn *)backet->data;
struct bgpevpn *vpn = (struct bgpevpn *)bucket->data;
struct bgp *bgp_def = NULL;

bgp_def = bgp_get_default();
Expand Down Expand Up @@ -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 */
hash_iterate(bgp_def->vnihash,
(void (*)(struct hash_backet *,
(void (*)(struct hash_bucket *,
void *))link_l2vni_hash_to_l3vni,
bgp_vrf);

Expand Down Expand Up @@ -5804,7 +5804,7 @@ void bgp_evpn_flood_control_change(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,
bgp);
}
Expand All @@ -5816,7 +5816,7 @@ void bgp_evpn_cleanup_on_disable(struct bgp *bgp)
void bgp_evpn_cleanup(struct bgp *bgp)
{
hash_iterate(bgp->vnihash,
(void (*)(struct hash_backet *, void *))free_vni_entry,
(void (*)(struct hash_bucket *, void *))free_vni_entry,
bgp);

hash_free(bgp->import_rt_hash);
Expand Down

0 comments on commit 51127bc

Please sign in to comment.