#include "libfrr_trace.h"
DEFINE_MTYPE_STATIC(LIB, HASH, "Hash")
-DEFINE_MTYPE_STATIC(LIB, HASH_BACKET, "Hash Bucket")
+DEFINE_MTYPE_STATIC(LIB, HASH_BUCKET, "Hash Bucket")
DEFINE_MTYPE_STATIC(LIB, HASH_INDEX, "Hash Index")
static pthread_mutex_t _hashes_mtx = PTHREAD_MUTEX_INITIALIZER;
index = key & (hash->size - 1);
}
- bucket = XCALLOC(MTYPE_HASH_BACKET, sizeof(struct hash_bucket));
+ bucket = XCALLOC(MTYPE_HASH_BUCKET, sizeof(struct hash_bucket));
bucket->data = newdata;
bucket->key = key;
bucket->next = hash->index[index];
hash_update_ssq(hash, oldlen, newlen);
ret = bucket->data;
- XFREE(MTYPE_HASH_BACKET, bucket);
+ XFREE(MTYPE_HASH_BUCKET, bucket);
hash->count--;
break;
}
if (free_func)
(*free_func)(hb->data);
- XFREE(MTYPE_HASH_BACKET, hb);
+ XFREE(MTYPE_HASH_BUCKET, hb);
hash->count--;
}
hash->index[i] = NULL;
/* Data compare function. */
bool (*hash_cmp)(const void *, const void *);
- /* Backet alloc. */
+ /* Bucket alloc. */
unsigned long count;
struct hashstats stats;
}
}
-static void route_map_pentry_process_dependency(struct hash_bucket *backet,
+static void route_map_pentry_process_dependency(struct hash_bucket *bucket,
void *data)
{
char *rmap_name = NULL;
(struct route_map_pentry_dep *)data;
unsigned char family = pentry_dep->pentry->prefix.family;
- dep_data = (struct route_map_dep_data *)backet->data;
+ dep_data = (struct route_map_dep_data *)bucket->data;
if (!dep_data)
return;
return CMD_SUCCESS;
}
-static int ospf_print_vty_helper_dis_rtr_walkcb(struct hash_bucket *backet,
+static int ospf_print_vty_helper_dis_rtr_walkcb(struct hash_bucket *bucket,
void *arg)
{
- struct advRtr *rtr = backet->data;
+ struct advRtr *rtr = bucket->data;
struct vty *vty = (struct vty *)arg;
static unsigned int count;
static const char *const ospf_shortcut_mode_str[] = {
"default", "enable", "disable"
};
-static int ospf_vty_external_rt_walkcb(struct hash_bucket *backet,
+static int ospf_vty_external_rt_walkcb(struct hash_bucket *bucket,
void *arg)
{
- struct external_info *ei = backet->data;
+ struct external_info *ei = bucket->data;
struct vty *vty = (struct vty *)arg;
static unsigned int count;
return HASHWALK_CONTINUE;
}
-static int ospf_json_external_rt_walkcb(struct hash_bucket *backet,
+static int ospf_json_external_rt_walkcb(struct hash_bucket *bucket,
void *arg)
{
- struct external_info *ei = backet->data;
+ struct external_info *ei = bucket->data;
struct json_object *json = (struct json_object *)arg;
char buf[PREFIX2STR_BUFFER];
char exnalbuf[20];
return 0;
}
-static int ospf_cfg_write_helper_dis_rtr_walkcb(struct hash_bucket *backet,
+static int ospf_cfg_write_helper_dis_rtr_walkcb(struct hash_bucket *bucket,
void *arg)
{
- struct advRtr *rtr = backet->data;
+ struct advRtr *rtr = bucket->data;
struct vty *vty = (struct vty *)arg;
vty_out(vty, " graceful-restart helper-only %pI4\n",
}
}
-static void pim_show_vxlan_sg_hash_entry(struct hash_bucket *backet, void *arg)
+static void pim_show_vxlan_sg_hash_entry(struct hash_bucket *bucket, void *arg)
{
- pim_show_vxlan_sg_entry((struct pim_vxlan_sg *)backet->data,
+ pim_show_vxlan_sg_entry((struct pim_vxlan_sg *)bucket->data,
(struct pim_sg_cache_walk_data *)arg);
}
pim_vxlan_orig_mr_up_del(vxlan_sg);
}
-static void pim_vxlan_orig_mr_iif_update(struct hash_bucket *backet, void *arg)
+static void pim_vxlan_orig_mr_iif_update(struct hash_bucket *bucket, void *arg)
{
struct interface *ifp;
- struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+ struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
struct interface *old_iif = vxlan_sg->iif;
if (!pim_vxlan_is_orig_mroute(vxlan_sg))
* to the MLAG peer which may mroute it over the underlay if there are any
* interested receivers.
*/
-static void pim_vxlan_sg_peerlink_oif_update(struct hash_bucket *backet,
+static void pim_vxlan_sg_peerlink_oif_update(struct hash_bucket *bucket,
void *arg)
{
struct interface *new_oif = (struct interface *)arg;
- struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+ struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
if (!pim_vxlan_is_orig_mroute(vxlan_sg))
return;
}
}
-static void pim_vxlan_term_mr_cost_update(struct hash_bucket *backet, void *arg)
+static void pim_vxlan_term_mr_cost_update(struct hash_bucket *bucket, void *arg)
{
struct interface *old_peerlink_rif = (struct interface *)arg;
- struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+ struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
struct pim_upstream *up;
struct listnode *listnode;
struct pim_upstream *child;
old_peerlink_rif);
}
-static void pim_vxlan_sg_peerlink_rif_update(struct hash_bucket *backet,
+static void pim_vxlan_sg_peerlink_rif_update(struct hash_bucket *bucket,
void *arg)
{
- pim_vxlan_orig_mr_iif_update(backet, NULL);
- pim_vxlan_term_mr_cost_update(backet, arg);
+ pim_vxlan_orig_mr_iif_update(bucket, NULL);
+ pim_vxlan_term_mr_cost_update(bucket, arg);
}
static void pim_vxlan_set_peerlink_rif(struct pim_instance *pim,
}
}
-static void pim_vxlan_term_mr_oif_update(struct hash_bucket *backet, void *arg)
+static void pim_vxlan_term_mr_oif_update(struct hash_bucket *bucket, void *arg)
{
struct interface *ifp = (struct interface *)arg;
- struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)backet->data;
+ struct pim_vxlan_sg *vxlan_sg = (struct pim_vxlan_sg *)bucket->data;
if (pim_vxlan_is_orig_mroute(vxlan_sg))
return;
bool complete;
};
-static void fpm_enqueue_rmac_table(struct hash_bucket *backet, void *arg)
+static void fpm_enqueue_rmac_table(struct hash_bucket *bucket, void *arg)
{
struct fpm_rmac_arg *fra = arg;
- zebra_mac_t *zrmac = backet->data;
+ zebra_mac_t *zrmac = bucket->data;
struct zebra_if *zif = fra->zl3vni->vxlan_if->info;
const struct zebra_l2info_vxlan *vxl = &zif->l2info.vxl;
struct zebra_if *br_zif;
}
}
-static void fpm_enqueue_l3vni_table(struct hash_bucket *backet, void *arg)
+static void fpm_enqueue_l3vni_table(struct hash_bucket *bucket, void *arg)
{
struct fpm_rmac_arg *fra = arg;
- zebra_l3vni_t *zl3vni = backet->data;
+ zebra_l3vni_t *zl3vni = bucket->data;
fra->zl3vni = zl3vni;
hash_iterate(zl3vni->rmac_table, fpm_enqueue_rmac_table, zl3vni);
/*
* The next three function will handle RMAC table reset.
*/
-static void fpm_unset_rmac_table(struct hash_bucket *backet, void *arg)
+static void fpm_unset_rmac_table(struct hash_bucket *bucket, void *arg)
{
- zebra_mac_t *zrmac = backet->data;
+ zebra_mac_t *zrmac = bucket->data;
UNSET_FLAG(zrmac->flags, ZEBRA_MAC_FPM_SENT);
}
-static void fpm_unset_l3vni_table(struct hash_bucket *backet, void *arg)
+static void fpm_unset_l3vni_table(struct hash_bucket *bucket, void *arg)
{
- zebra_l3vni_t *zl3vni = backet->data;
+ zebra_l3vni_t *zl3vni = bucket->data;
hash_iterate(zl3vni->rmac_table, fpm_unset_rmac_table, zl3vni);
}
#define ZFPM_STATS_IVL_SECS 10
#define FPM_MAX_MAC_MSG_LEN 512
-static void zfpm_iterate_rmac_table(struct hash_bucket *backet, void *args);
+static void zfpm_iterate_rmac_table(struct hash_bucket *bucket, void *args);
/*
* Structure that holds state for iterating over all route_node
* Iterate over all the RMAC entries for the given L3VNI
* and enqueue the RMAC for FPM processing.
*/
-static void zfpm_trigger_rmac_update_wrapper(struct hash_bucket *backet,
+static void zfpm_trigger_rmac_update_wrapper(struct hash_bucket *bucket,
void *args)
{
- zebra_mac_t *zrmac = (zebra_mac_t *)backet->data;
+ zebra_mac_t *zrmac = (zebra_mac_t *)bucket->data;
zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)args;
zfpm_trigger_rmac_update(zrmac, zl3vni, false, "RMAC added");
* This function iterates over all the L3VNIs to trigger
* FPM updates for RMACs currently available.
*/
-static void zfpm_iterate_rmac_table(struct hash_bucket *backet, void *args)
+static void zfpm_iterate_rmac_table(struct hash_bucket *bucket, void *args)
{
- zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)backet->data;
+ zebra_l3vni_t *zl3vni = (zebra_l3vni_t *)bucket->data;
hash_iterate(zl3vni->rmac_table, zfpm_trigger_rmac_update_wrapper,
(void *)zl3vni);
zebra_vxlan_sg_do_ref(zvrf, local_vtep_ip, mcast_grp);
}
-static void zebra_vxlan_xg_pre_cleanup(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_xg_pre_cleanup(struct hash_bucket *bucket, void *arg)
{
- zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+ zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
/* increment the ref count against (*,G) to prevent them from being
* deleted
++vxlan_sg->ref_cnt;
}
-static void zebra_vxlan_xg_post_cleanup(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_xg_post_cleanup(struct hash_bucket *bucket, void *arg)
{
- zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+ zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
/* decrement the dummy ref count against (*,G) to delete them */
if (vxlan_sg->sg.src.s_addr == INADDR_ANY) {
}
}
-static void zebra_vxlan_sg_cleanup(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_sg_cleanup(struct hash_bucket *bucket, void *arg)
{
- zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+ zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
zebra_vxlan_sg_del(vxlan_sg);
}
hash_iterate(zvrf->vxlan_sg_table, zebra_vxlan_xg_post_cleanup, NULL);
}
-static void zebra_vxlan_sg_replay_send(struct hash_bucket *backet, void *arg)
+static void zebra_vxlan_sg_replay_send(struct hash_bucket *bucket, void *arg)
{
- zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)backet->data;
+ zebra_vxlan_sg_t *vxlan_sg = (zebra_vxlan_sg_t *)bucket->data;
zebra_vxlan_sg_send(vxlan_sg->zvrf, &vxlan_sg->sg,
vxlan_sg->sg_str, ZEBRA_VXLAN_SG_ADD);