diff options
author | Mark Stapp <mjs@voltanet.io> | 2021-04-19 20:26:57 +0200 |
---|---|---|
committer | Mark Stapp <mjs.ietf@gmail.com> | 2021-07-19 16:36:12 +0200 |
commit | 1a3bd37f7c29fca429d7ef79ace80cd6db1d5563 (patch) | |
tree | dace8bbf2ea7ec7fc1216563ebb9f1d00b61ac8a | |
parent | zebra: add workqueue support for EVPN updates (diff) | |
download | frr-1a3bd37f7c29fca429d7ef79ace80cd6db1d5563.tar.xz frr-1a3bd37f7c29fca429d7ef79ace80cd6db1d5563.zip |
zebra: use more const
Use const in many more evpn apis, especially for macaddr,
ipaddr arguments.
Signed-off-by: Mark Stapp <mjs@voltanet.io>
-rw-r--r-- | zebra/rt.h | 4 | ||||
-rw-r--r-- | zebra/rt_netlink.c | 14 | ||||
-rw-r--r-- | zebra/rt_netlink.h | 5 | ||||
-rw-r--r-- | zebra/rtread_netlink.c | 6 | ||||
-rw-r--r-- | zebra/rtread_sysctl.c | 4 | ||||
-rw-r--r-- | zebra/zebra_evpn.c | 20 | ||||
-rw-r--r-- | zebra/zebra_evpn.h | 10 | ||||
-rw-r--r-- | zebra/zebra_evpn_mac.c | 41 | ||||
-rw-r--r-- | zebra/zebra_evpn_mac.h | 40 | ||||
-rw-r--r-- | zebra/zebra_evpn_mh.c | 2 | ||||
-rw-r--r-- | zebra/zebra_evpn_mh.h | 4 | ||||
-rw-r--r-- | zebra/zebra_evpn_neigh.c | 39 | ||||
-rw-r--r-- | zebra/zebra_evpn_neigh.h | 33 |
13 files changed, 119 insertions, 103 deletions
diff --git a/zebra/rt.h b/zebra/rt.h index f79ddbe95..929a44ade 100644 --- a/zebra/rt.h +++ b/zebra/rt.h @@ -93,10 +93,10 @@ extern void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp, struct interface *br_if); extern void macfdb_read_specific_mac(struct zebra_ns *zns, struct interface *br_if, - struct ethaddr *mac, vlanid_t vid); + const struct ethaddr *mac, vlanid_t vid); extern void neigh_read(struct zebra_ns *zns); extern void neigh_read_for_vlan(struct zebra_ns *zns, struct interface *ifp); -extern void neigh_read_specific_ip(struct ipaddr *ip, +extern void neigh_read_specific_ip(const struct ipaddr *ip, struct interface *vlan_if); extern void route_read(struct zebra_ns *zns); extern int kernel_upd_mac_nh(uint32_t nh_id, struct in_addr vtep_ip); diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 38f8140db..a64ec52dd 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -3466,10 +3466,9 @@ int netlink_macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp, /* Request for MAC FDB for a specific MAC address in VLAN from the kernel */ static int netlink_request_specific_mac_in_bridge(struct zebra_ns *zns, - int family, - int type, + int family, int type, struct interface *br_if, - struct ethaddr *mac, + const struct ethaddr *mac, vlanid_t vid) { struct { @@ -3506,7 +3505,7 @@ static int netlink_request_specific_mac_in_bridge(struct zebra_ns *zns, int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, struct interface *br_if, - struct ethaddr *mac, vlanid_t vid) + const struct ethaddr *mac, vlanid_t vid) { int ret = 0; struct zebra_dplane_info dp_info; @@ -3946,7 +3945,8 @@ int netlink_neigh_read_for_vlan(struct zebra_ns *zns, struct interface *vlan_if) * read using netlink interface. */ static int netlink_request_specific_neigh_in_vlan(struct zebra_ns *zns, - int type, struct ipaddr *ip, + int type, + const struct ipaddr *ip, ifindex_t ifindex) { struct { @@ -3983,8 +3983,8 @@ static int netlink_request_specific_neigh_in_vlan(struct zebra_ns *zns, return netlink_request(&zns->netlink_cmd, &req); } -int netlink_neigh_read_specific_ip(struct ipaddr *ip, - struct interface *vlan_if) +int netlink_neigh_read_specific_ip(const struct ipaddr *ip, + struct interface *vlan_if) { int ret = 0; struct zebra_ns *zns; diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h index 4e41ff984..93c06e555 100644 --- a/zebra/rt_netlink.h +++ b/zebra/rt_netlink.h @@ -99,8 +99,9 @@ extern int netlink_neigh_read_for_vlan(struct zebra_ns *zns, struct interface *vlan_if); extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns, struct interface *br_if, - struct ethaddr *mac, uint16_t vid); -extern int netlink_neigh_read_specific_ip(struct ipaddr *ip, + const struct ethaddr *mac, + uint16_t vid); +extern int netlink_neigh_read_specific_ip(const struct ipaddr *ip, struct interface *vlan_if); extern vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id); diff --git a/zebra/rtread_netlink.c b/zebra/rtread_netlink.c index fbca47351..f70b006ac 100644 --- a/zebra/rtread_netlink.c +++ b/zebra/rtread_netlink.c @@ -46,9 +46,9 @@ void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp, } void macfdb_read_specific_mac(struct zebra_ns *zns, struct interface *br_if, - struct ethaddr *mac, vlanid_t vid) + const struct ethaddr *mac, vlanid_t vid) { -netlink_macfdb_read_specific_mac(zns, br_if, mac, vid); + netlink_macfdb_read_specific_mac(zns, br_if, mac, vid); } void neigh_read(struct zebra_ns *zns) @@ -61,7 +61,7 @@ void neigh_read_for_vlan(struct zebra_ns *zns, struct interface *vlan_if) netlink_neigh_read_for_vlan(zns, vlan_if); } -void neigh_read_specific_ip(struct ipaddr *ip, struct interface *vlan_if) +void neigh_read_specific_ip(const struct ipaddr *ip, struct interface *vlan_if) { netlink_neigh_read_specific_ip(ip, vlan_if); } diff --git a/zebra/rtread_sysctl.c b/zebra/rtread_sysctl.c index 74c6825ba..594f7c2dd 100644 --- a/zebra/rtread_sysctl.c +++ b/zebra/rtread_sysctl.c @@ -88,7 +88,7 @@ void macfdb_read_for_bridge(struct zebra_ns *zns, struct interface *ifp, } void macfdb_read_specific_mac(struct zebra_ns *zns, struct interface *br_if, - struct ethaddr *mac, vlanid_t vid) + const struct ethaddr *mac, vlanid_t vid) { } @@ -100,7 +100,7 @@ void neigh_read_for_vlan(struct zebra_ns *zns, struct interface *vlan_if) { } -void neigh_read_specific_ip(struct ipaddr *ip, struct interface *vlan_if) +void neigh_read_specific_ip(const struct ipaddr *ip, struct interface *vlan_if) { } diff --git a/zebra/zebra_evpn.c b/zebra/zebra_evpn.c index 8e73e8613..2c9f1dca5 100644 --- a/zebra/zebra_evpn.c +++ b/zebra/zebra_evpn.c @@ -1330,10 +1330,12 @@ void zebra_evpn_cleanup_all(struct hash_bucket *bucket, void *arg) zebra_evpn_del(zevpn); } -static void -zebra_evpn_process_sync_macip_add(zebra_evpn_t *zevpn, struct ethaddr *macaddr, - uint16_t ipa_len, struct ipaddr *ipaddr, - uint8_t flags, uint32_t seq, esi_t *esi) +static void zebra_evpn_process_sync_macip_add(zebra_evpn_t *zevpn, + const struct ethaddr *macaddr, + uint16_t ipa_len, + const struct ipaddr *ipaddr, + uint8_t flags, uint32_t seq, + const esi_t *esi) { struct sync_mac_ip_ctx ctx; char ipbuf[INET6_ADDRSTRLEN]; @@ -1380,10 +1382,10 @@ zebra_evpn_process_sync_macip_add(zebra_evpn_t *zevpn, struct ethaddr *macaddr, /************************** remote mac-ip handling **************************/ /* Process a remote MACIP add from BGP. */ -void zebra_evpn_rem_macip_add(vni_t vni, struct ethaddr *macaddr, - uint16_t ipa_len, struct ipaddr *ipaddr, +void zebra_evpn_rem_macip_add(vni_t vni, const struct ethaddr *macaddr, + uint16_t ipa_len, const struct ipaddr *ipaddr, uint8_t flags, uint32_t seq, - struct in_addr vtep_ip, esi_t *esi) + struct in_addr vtep_ip, const esi_t *esi) { zebra_evpn_t *zevpn; zebra_vtep_t *zvtep; @@ -1458,8 +1460,8 @@ void zebra_evpn_rem_macip_add(vni_t vni, struct ethaddr *macaddr, } /* Process a remote MACIP delete from BGP. */ -void zebra_evpn_rem_macip_del(vni_t vni, struct ethaddr *macaddr, - uint16_t ipa_len, struct ipaddr *ipaddr, +void zebra_evpn_rem_macip_del(vni_t vni, const struct ethaddr *macaddr, + uint16_t ipa_len, const struct ipaddr *ipaddr, struct in_addr vtep_ip) { zebra_evpn_t *zevpn; diff --git a/zebra/zebra_evpn.h b/zebra/zebra_evpn.h index f7837d09a..774627a15 100644 --- a/zebra/zebra_evpn.h +++ b/zebra/zebra_evpn.h @@ -204,12 +204,12 @@ int zebra_evpn_vtep_uninstall(zebra_evpn_t *zevpn, struct in_addr *vtep_ip); void zebra_evpn_handle_flooding_remote_vteps(struct hash_bucket *bucket, void *zvrf); void zebra_evpn_cleanup_all(struct hash_bucket *bucket, void *arg); -void zebra_evpn_rem_macip_add(vni_t vni, struct ethaddr *macaddr, - uint16_t ipa_len, struct ipaddr *ipaddr, +void zebra_evpn_rem_macip_add(vni_t vni, const struct ethaddr *macaddr, + uint16_t ipa_len, const struct ipaddr *ipaddr, uint8_t flags, uint32_t seq, - struct in_addr vtep_ip, esi_t *esi); -void zebra_evpn_rem_macip_del(vni_t vni, struct ethaddr *macaddr, - uint16_t ipa_len, struct ipaddr *ipaddr, + struct in_addr vtep_ip, const esi_t *esi); +void zebra_evpn_rem_macip_del(vni_t vni, const struct ethaddr *macaddr, + uint16_t ipa_len, const struct ipaddr *ipaddr, struct in_addr vtep_ip); void zebra_evpn_cfg_cleanup(struct hash_bucket *bucket, void *ctxt); diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index 26694245f..c503b56db 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -986,8 +986,8 @@ void zebra_evpn_print_mac_hash_detail(struct hash_bucket *bucket, void *ctxt) /* * Inform BGP about local MACIP. */ -int zebra_evpn_macip_send_msg_to_client(vni_t vni, struct ethaddr *macaddr, - struct ipaddr *ip, uint8_t flags, +int zebra_evpn_macip_send_msg_to_client(vni_t vni, const struct ethaddr *macaddr, + const struct ipaddr *ip, uint8_t flags, uint32_t seq, int state, struct zebra_evpn_es *es, uint16_t cmd) { @@ -1095,7 +1095,8 @@ static void *zebra_evpn_mac_alloc(void *p) /* * Add MAC entry. */ -zebra_mac_t *zebra_evpn_mac_add(zebra_evpn_t *zevpn, struct ethaddr *macaddr) +zebra_mac_t *zebra_evpn_mac_add(zebra_evpn_t *zevpn, + const struct ethaddr *macaddr) { zebra_mac_t tmp_mac; zebra_mac_t *mac = NULL; @@ -1254,7 +1255,8 @@ void zebra_evpn_mac_del_all(zebra_evpn_t *zevpn, int uninstall, int upd_client, /* * Look up MAC hash entry. */ -zebra_mac_t *zebra_evpn_mac_lookup(zebra_evpn_t *zevpn, struct ethaddr *mac) +zebra_mac_t *zebra_evpn_mac_lookup(zebra_evpn_t *zevpn, + const struct ethaddr *mac) { zebra_mac_t tmp; zebra_mac_t *pmac; @@ -1269,7 +1271,7 @@ zebra_mac_t *zebra_evpn_mac_lookup(zebra_evpn_t *zevpn, struct ethaddr *mac) /* * Inform BGP about local MAC addition. */ -int zebra_evpn_mac_send_add_to_client(vni_t vni, struct ethaddr *macaddr, +int zebra_evpn_mac_send_add_to_client(vni_t vni, const struct ethaddr *macaddr, uint32_t mac_flags, uint32_t seq, struct zebra_evpn_es *es) { @@ -1303,7 +1305,7 @@ int zebra_evpn_mac_send_add_to_client(vni_t vni, struct ethaddr *macaddr, /* * Inform BGP about local MAC deletion. */ -int zebra_evpn_mac_send_del_to_client(vni_t vni, struct ethaddr *macaddr, +int zebra_evpn_mac_send_del_to_client(vni_t vni, const struct ethaddr *macaddr, uint32_t flags, bool force) { if (!force) { @@ -1563,7 +1565,7 @@ void zebra_evpn_sync_mac_del(zebra_mac_t *mac) static inline bool zebra_evpn_mac_is_bgp_seq_ok(zebra_evpn_t *zevpn, zebra_mac_t *mac, uint32_t seq, uint16_t ipa_len, - struct ipaddr *ipaddr, + const struct ipaddr *ipaddr, bool sync) { char ipbuf[INET6_ADDRSTRLEN]; @@ -1627,11 +1629,10 @@ static inline bool zebra_evpn_mac_is_bgp_seq_ok(zebra_evpn_t *zevpn, return true; } -zebra_mac_t * -zebra_evpn_proc_sync_mac_update(zebra_evpn_t *zevpn, struct ethaddr *macaddr, - uint16_t ipa_len, struct ipaddr *ipaddr, - uint8_t flags, uint32_t seq, esi_t *esi, - struct sync_mac_ip_ctx *ctx) +zebra_mac_t *zebra_evpn_proc_sync_mac_update( + zebra_evpn_t *zevpn, const struct ethaddr *macaddr, uint16_t ipa_len, + const struct ipaddr *ipaddr, uint8_t flags, uint32_t seq, + const esi_t *esi, struct sync_mac_ip_ctx *ctx) { zebra_mac_t *mac; bool inform_bgp = false; @@ -1959,10 +1960,12 @@ void zebra_evpn_print_dad_mac_hash_detail(struct hash_bucket *bucket, } int zebra_evpn_mac_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf, - struct ethaddr *macaddr, uint16_t ipa_len, - struct ipaddr *ipaddr, zebra_mac_t **macp, - struct in_addr vtep_ip, uint8_t flags, - uint32_t seq, esi_t *esi) + const struct ethaddr *macaddr, + uint16_t ipa_len, + const struct ipaddr *ipaddr, + zebra_mac_t **macp, struct in_addr vtep_ip, + uint8_t flags, uint32_t seq, + const esi_t *esi) { char buf1[INET6_ADDRSTRLEN]; bool sticky; @@ -2127,7 +2130,7 @@ int zebra_evpn_mac_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf, int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn, struct interface *ifp, - struct ethaddr *macaddr, vlanid_t vid, + const struct ethaddr *macaddr, vlanid_t vid, bool sticky, bool local_inactive, bool dp_static, zebra_mac_t *mac) { @@ -2447,8 +2450,8 @@ int zebra_evpn_del_local_mac(zebra_evpn_t *zevpn, zebra_mac_t *mac, } int zebra_evpn_mac_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn, - struct ipaddr *ip, zebra_mac_t **macp, - struct ethaddr *macaddr, vlanid_t vlan_id, + const struct ipaddr *ip, zebra_mac_t **macp, + const struct ethaddr *macaddr, vlanid_t vlan_id, bool def_gw) { zebra_mac_t *mac; diff --git a/zebra/zebra_evpn_mac.h b/zebra/zebra_evpn_mac.h index 5d17e283a..e90082e50 100644 --- a/zebra/zebra_evpn_mac.h +++ b/zebra/zebra_evpn_mac.h @@ -229,11 +229,14 @@ int zebra_evpn_rem_mac_uninstall(zebra_evpn_t *zevi, zebra_mac_t *mac, int zebra_evpn_rem_mac_install(zebra_evpn_t *zevi, zebra_mac_t *mac, bool was_static); void zebra_evpn_deref_ip2mac(zebra_evpn_t *zevi, zebra_mac_t *mac); -zebra_mac_t *zebra_evpn_mac_lookup(zebra_evpn_t *zevi, struct ethaddr *mac); -zebra_mac_t *zebra_evpn_mac_add(zebra_evpn_t *zevi, struct ethaddr *macaddr); +zebra_mac_t *zebra_evpn_mac_lookup(zebra_evpn_t *zevi, + const struct ethaddr *mac); +zebra_mac_t *zebra_evpn_mac_add(zebra_evpn_t *zevi, + const struct ethaddr *macaddr); int zebra_evpn_mac_del(zebra_evpn_t *zevi, zebra_mac_t *mac); -int zebra_evpn_macip_send_msg_to_client(uint32_t id, struct ethaddr *macaddr, - struct ipaddr *ip, uint8_t flags, +int zebra_evpn_macip_send_msg_to_client(uint32_t id, + const struct ethaddr *macaddr, + const struct ipaddr *ip, uint8_t flags, uint32_t seq, int state, struct zebra_evpn_es *es, uint16_t cmd); void zebra_evpn_print_mac(zebra_mac_t *mac, void *ctxt, json_object *json); @@ -246,38 +249,39 @@ void zebra_evpn_mac_send_add_del_to_client(zebra_mac_t *mac, bool old_bgp_ready, void zebra_evpn_mac_del_all(zebra_evpn_t *zevi, int uninstall, int upd_client, uint32_t flags); -int zebra_evpn_mac_send_add_to_client(vni_t vni, struct ethaddr *macaddr, +int zebra_evpn_mac_send_add_to_client(vni_t vni, const struct ethaddr *macaddr, uint32_t mac_flags, uint32_t seq, struct zebra_evpn_es *es); -int zebra_evpn_mac_send_del_to_client(vni_t vni, struct ethaddr *macaddr, +int zebra_evpn_mac_send_del_to_client(vni_t vni, const struct ethaddr *macaddr, uint32_t flags, bool force); void zebra_evpn_send_mac_list_to_client(zebra_evpn_t *zevi); -zebra_mac_t * -zebra_evpn_proc_sync_mac_update(zebra_evpn_t *zevi, struct ethaddr *macaddr, - uint16_t ipa_len, struct ipaddr *ipaddr, - uint8_t flags, uint32_t seq, esi_t *esi, - struct sync_mac_ip_ctx *ctx); +zebra_mac_t *zebra_evpn_proc_sync_mac_update( + zebra_evpn_t *zevi, const struct ethaddr *macaddr, uint16_t ipa_len, + const struct ipaddr *ipaddr, uint8_t flags, uint32_t seq, + const esi_t *esi, struct sync_mac_ip_ctx *ctx); void zebra_evpn_sync_mac_del(zebra_mac_t *mac); void zebra_evpn_rem_mac_del(zebra_evpn_t *zevi, zebra_mac_t *mac); void zebra_evpn_print_dad_mac_hash(struct hash_bucket *bucket, void *ctxt); void zebra_evpn_print_dad_mac_hash_detail(struct hash_bucket *bucket, void *ctxt); int zebra_evpn_mac_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf, - struct ethaddr *macaddr, uint16_t ipa_len, - struct ipaddr *ipaddr, zebra_mac_t **macp, - struct in_addr vtep_ip, uint8_t flags, - uint32_t seq, esi_t *esi); + const struct ethaddr *macaddr, + uint16_t ipa_len, + const struct ipaddr *ipaddr, + zebra_mac_t **macp, struct in_addr vtep_ip, + uint8_t flags, uint32_t seq, + const esi_t *esi); int zebra_evpn_add_update_local_mac(struct zebra_vrf *zvrf, zebra_evpn_t *zevpn, struct interface *ifp, - struct ethaddr *macaddr, vlanid_t vid, + const struct ethaddr *macaddr, vlanid_t vid, bool sticky, bool local_inactive, bool dp_static, zebra_mac_t *mac); int zebra_evpn_del_local_mac(zebra_evpn_t *zevpn, zebra_mac_t *mac, bool clear_static); int zebra_evpn_mac_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn, - struct ipaddr *ip, zebra_mac_t **macp, - struct ethaddr *macaddr, vlanid_t vlan_id, + const struct ipaddr *ip, zebra_mac_t **macp, + const struct ethaddr *macaddr, vlanid_t vlan_id, bool def_gw); void zebra_evpn_mac_svi_add(struct interface *ifp, zebra_evpn_t *zevpn); void zebra_evpn_mac_svi_del(struct interface *ifp, zebra_evpn_t *zevpn); diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index eb57338a8..8ba62280f 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -2541,7 +2541,7 @@ bool zebra_evpn_es_mac_ref_entry(zebra_mac_t *mac, struct zebra_evpn_es *es) return true; } -bool zebra_evpn_es_mac_ref(zebra_mac_t *mac, esi_t *esi) +bool zebra_evpn_es_mac_ref(zebra_mac_t *mac, const esi_t *esi) { struct zebra_evpn_es *es; diff --git a/zebra/zebra_evpn_mh.h b/zebra/zebra_evpn_mh.h index 8bb9e0280..a828056f1 100644 --- a/zebra/zebra_evpn_mh.h +++ b/zebra/zebra_evpn_mh.h @@ -338,8 +338,8 @@ extern void zebra_evpn_es_evi_show_vni(struct vty *vty, bool uj, vni_t vni, int detail); extern void zebra_evpn_es_mac_deref_entry(zebra_mac_t *mac); extern bool zebra_evpn_es_mac_ref_entry(zebra_mac_t *mac, - struct zebra_evpn_es *es); -extern bool zebra_evpn_es_mac_ref(zebra_mac_t *mac, esi_t *esi); + struct zebra_evpn_es *es); +extern bool zebra_evpn_es_mac_ref(zebra_mac_t *mac, const esi_t *esi); extern struct zebra_evpn_es *zebra_evpn_es_find(const esi_t *esi); extern void zebra_evpn_interface_init(void); extern int zebra_evpn_mh_if_write(struct vty *vty, struct interface *ifp); diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c index e58144d0c..839e8d9eb 100644 --- a/zebra/zebra_evpn_neigh.c +++ b/zebra/zebra_evpn_neigh.c @@ -204,7 +204,7 @@ static void *zebra_evpn_neigh_alloc(void *p) } static void zebra_evpn_local_neigh_ref_mac(zebra_neigh_t *n, - struct ethaddr *macaddr, + const struct ethaddr *macaddr, zebra_mac_t *mac, bool send_mac_update) { @@ -284,8 +284,8 @@ static void zebra_evpn_sync_neigh_dp_install(zebra_neigh_t *n, /* * Inform BGP about local neighbor addition. */ -int zebra_evpn_neigh_send_add_to_client(vni_t vni, struct ipaddr *ip, - struct ethaddr *macaddr, +int zebra_evpn_neigh_send_add_to_client(vni_t vni, const struct ipaddr *ip, + const struct ethaddr *macaddr, zebra_mac_t *zmac, uint32_t neigh_flags, uint32_t seq) { @@ -497,7 +497,7 @@ static void zebra_evpn_local_neigh_deref_mac(zebra_neigh_t *n, } bool zebra_evpn_neigh_is_bgp_seq_ok(zebra_evpn_t *zevpn, zebra_neigh_t *n, - struct ethaddr *macaddr, uint32_t seq, + const struct ethaddr *macaddr, uint32_t seq, bool sync) { uint32_t tmp_seq; @@ -543,8 +543,8 @@ bool zebra_evpn_neigh_is_bgp_seq_ok(zebra_evpn_t *zevpn, zebra_neigh_t *n, * Add neighbor entry. */ static zebra_neigh_t *zebra_evpn_neigh_add(zebra_evpn_t *zevpn, - struct ipaddr *ip, - struct ethaddr *mac, + const struct ipaddr *ip, + const struct ethaddr *mac, zebra_mac_t *zmac, uint32_t n_flags) { zebra_neigh_t tmp_n; @@ -615,8 +615,8 @@ void zebra_evpn_sync_neigh_del(zebra_neigh_t *n) zebra_neigh_t * zebra_evpn_proc_sync_neigh_update(zebra_evpn_t *zevpn, zebra_neigh_t *n, - uint16_t ipa_len, struct ipaddr *ipaddr, - uint8_t flags, uint32_t seq, esi_t *esi, + uint16_t ipa_len, const struct ipaddr *ipaddr, + uint8_t flags, uint32_t seq, const esi_t *esi, struct sync_mac_ip_ctx *ctx) { struct interface *ifp = NULL; @@ -895,7 +895,8 @@ void zebra_evpn_neigh_del_all(zebra_evpn_t *zevpn, int uninstall, /* * Look up neighbor hash entry. */ -zebra_neigh_t *zebra_evpn_neigh_lookup(zebra_evpn_t *zevpn, struct ipaddr *ip) +zebra_neigh_t *zebra_evpn_neigh_lookup(zebra_evpn_t *zevpn, + const struct ipaddr *ip) { zebra_neigh_t tmp; zebra_neigh_t *n; @@ -1254,9 +1255,9 @@ zebra_evpn_dup_addr_detect_for_neigh(struct zebra_vrf *zvrf, zebra_neigh_t *nbr, } int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp, - struct ipaddr *ip, struct ethaddr *macaddr, - bool is_router, bool local_inactive, - bool dp_static) + const struct ipaddr *ip, + const struct ethaddr *macaddr, bool is_router, + bool local_inactive, bool dp_static) { struct zebra_vrf *zvrf; zebra_neigh_t *n = NULL; @@ -1596,7 +1597,8 @@ int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp, } int zebra_evpn_remote_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp, - struct ipaddr *ip, struct ethaddr *macaddr, + const struct ipaddr *ip, + const struct ethaddr *macaddr, uint16_t state) { zebra_neigh_t *n = NULL; @@ -2048,9 +2050,9 @@ void zebra_evpn_print_dad_neigh_hash_detail(struct hash_bucket *bucket, void zebra_evpn_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf, - struct ipaddr *ipaddr, zebra_mac_t *mac, - struct in_addr vtep_ip, uint8_t flags, - uint32_t seq) + const struct ipaddr *ipaddr, + zebra_mac_t *mac, struct in_addr vtep_ip, + uint8_t flags, uint32_t seq) { zebra_neigh_t *n; int update_neigh = 0; @@ -2241,7 +2243,8 @@ int zebra_evpn_neigh_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn, void zebra_evpn_neigh_remote_uninstall(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf, zebra_neigh_t *n, - zebra_mac_t *mac, struct ipaddr *ipaddr) + zebra_mac_t *mac, + const struct ipaddr *ipaddr) { if (zvrf->dad_freeze && CHECK_FLAG(n->flags, ZEBRA_NEIGH_DUPLICATE) && CHECK_FLAG(n->flags, ZEBRA_NEIGH_REMOTE) @@ -2274,7 +2277,7 @@ void zebra_evpn_neigh_remote_uninstall(zebra_evpn_t *zevpn, } } -int zebra_evpn_neigh_del_ip(zebra_evpn_t *zevpn, struct ipaddr *ip) +int zebra_evpn_neigh_del_ip(zebra_evpn_t *zevpn, const struct ipaddr *ip) { zebra_neigh_t *n; zebra_mac_t *zmac; diff --git a/zebra/zebra_evpn_neigh.h b/zebra/zebra_evpn_neigh.h index fdfe6dc1d..3735a833f 100644 --- a/zebra/zebra_evpn_neigh.h +++ b/zebra/zebra_evpn_neigh.h @@ -217,26 +217,27 @@ int remote_neigh_count(zebra_mac_t *zmac); int zebra_evpn_rem_neigh_install(zebra_evpn_t *zevpn, zebra_neigh_t *n, bool was_static); void zebra_evpn_install_neigh_hash(struct hash_bucket *bucket, void *ctxt); -int zebra_evpn_neigh_send_add_to_client(vni_t vni, struct ipaddr *ip, - struct ethaddr *macaddr, +int zebra_evpn_neigh_send_add_to_client(vni_t vni, const struct ipaddr *ip, + const struct ethaddr *macaddr, zebra_mac_t *zmac, uint32_t neigh_flags, uint32_t seq); int zebra_evpn_neigh_send_del_to_client(vni_t vni, struct ipaddr *ip, struct ethaddr *macaddr, uint32_t flags, int state, bool force); bool zebra_evpn_neigh_is_bgp_seq_ok(zebra_evpn_t *zevpn, zebra_neigh_t *n, - struct ethaddr *macaddr, uint32_t seq, + const struct ethaddr *macaddr, uint32_t seq, bool sync); int zebra_evpn_neigh_del(zebra_evpn_t *zevpn, zebra_neigh_t *n); void zebra_evpn_sync_neigh_del(zebra_neigh_t *n); zebra_neigh_t * zebra_evpn_proc_sync_neigh_update(zebra_evpn_t *zevpn, zebra_neigh_t *n, - uint16_t ipa_len, struct ipaddr *ipaddr, - uint8_t flags, uint32_t seq, esi_t *esi, + uint16_t ipa_len, const struct ipaddr *ipaddr, + uint8_t flags, uint32_t seq, const esi_t *esi, struct sync_mac_ip_ctx *ctx); void zebra_evpn_neigh_del_all(zebra_evpn_t *zevpn, int uninstall, int upd_client, uint32_t flags); -zebra_neigh_t *zebra_evpn_neigh_lookup(zebra_evpn_t *zevpn, struct ipaddr *ip); +zebra_neigh_t *zebra_evpn_neigh_lookup(zebra_evpn_t *zevpn, + const struct ipaddr *ip); int zebra_evpn_rem_neigh_install(zebra_evpn_t *zevpn, zebra_neigh_t *n, bool was_static); @@ -251,11 +252,12 @@ void zebra_evpn_process_neigh_on_local_mac_change(zebra_evpn_t *zevpn, void zebra_evpn_process_neigh_on_remote_mac_del(zebra_evpn_t *zevpn, zebra_mac_t *zmac); int zebra_evpn_local_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp, - struct ipaddr *ip, struct ethaddr *macaddr, - bool is_router, bool local_inactive, - bool dp_static); + const struct ipaddr *ip, + const struct ethaddr *macaddr, bool is_router, + bool local_inactive, bool dp_static); int zebra_evpn_remote_neigh_update(zebra_evpn_t *zevpn, struct interface *ifp, - struct ipaddr *ip, struct ethaddr *macaddr, + const struct ipaddr *ip, + const struct ethaddr *macaddr, uint16_t state); void zebra_evpn_send_neigh_to_client(zebra_evpn_t *zevpn); void zebra_evpn_clear_dup_neigh_hash(struct hash_bucket *bucket, void *ctxt); @@ -268,15 +270,16 @@ void zebra_evpn_print_dad_neigh_hash_detail(struct hash_bucket *bucket, void *ctxt); void zebra_evpn_neigh_remote_macip_add(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf, - struct ipaddr *ipaddr, zebra_mac_t *mac, - struct in_addr vtep_ip, uint8_t flags, - uint32_t seq); + const struct ipaddr *ipaddr, + zebra_mac_t *mac, struct in_addr vtep_ip, + uint8_t flags, uint32_t seq); int zebra_evpn_neigh_gw_macip_add(struct interface *ifp, zebra_evpn_t *zevpn, struct ipaddr *ip, zebra_mac_t *mac); void zebra_evpn_neigh_remote_uninstall(zebra_evpn_t *zevpn, struct zebra_vrf *zvrf, zebra_neigh_t *n, - zebra_mac_t *mac, struct ipaddr *ipaddr); -int zebra_evpn_neigh_del_ip(zebra_evpn_t *zevpn, struct ipaddr *ip); + zebra_mac_t *mac, + const struct ipaddr *ipaddr); +int zebra_evpn_neigh_del_ip(zebra_evpn_t *zevpn, const struct ipaddr *ip); #ifdef __cplusplus |