]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: use more const
authorMark Stapp <mjs@voltanet.io>
Mon, 19 Apr 2021 18:26:57 +0000 (14:26 -0400)
committerMark Stapp <mjs.ietf@gmail.com>
Mon, 19 Jul 2021 14:36:12 +0000 (10:36 -0400)
Use const in many more evpn apis, especially for macaddr,
ipaddr arguments.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
13 files changed:
zebra/rt.h
zebra/rt_netlink.c
zebra/rt_netlink.h
zebra/rtread_netlink.c
zebra/rtread_sysctl.c
zebra/zebra_evpn.c
zebra/zebra_evpn.h
zebra/zebra_evpn_mac.c
zebra/zebra_evpn_mac.h
zebra/zebra_evpn_mh.c
zebra/zebra_evpn_mh.h
zebra/zebra_evpn_neigh.c
zebra/zebra_evpn_neigh.h

index f79ddbe95837f969b48a6c299aceb24357b9c883..929a44ade721d0ed26036d3ce9da7e17f721c57c 100644 (file)
@@ -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);
index 38f8140db2a714642a17565f361f8823abab270e..a64ec52dda3887c46b97957ad2c23d5e0a5abae3 100644 (file)
@@ -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;
index 4e41ff984bb4bf94528d0716826fdb2115e4c93d..93c06e555b02daddf1c3fda228e29e0c9f0ed212 100644 (file)
@@ -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);
 
index fbca47351dca4582e8dad00b8a5268b47e3ee056..f70b006acd3cf77741388ca2bb7ec2fbe43245e8 100644 (file)
@@ -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);
 }
index 74c6825ba1225bb4d3dafcc6edc6d9b3e914c55b..594f7c2dd910df89ec89cf3befe811d9a299b0e2 100644 (file)
@@ -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)
 {
 }
 
index 8e73e86139eeef0fa8f7b11749dcbb6f23f5592d..2c9f1dca59ec0e169cc5d14f8417ad9b83e1b41e 100644 (file)
@@ -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;
index f7837d09a8d69fa249cdb6c04b7f54bc021ad39a..774627a15d80d15acce2ca7c70dd042b1bfda914 100644 (file)
@@ -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);
 
index 26694245f1bb58c6e482561dd0a1f81c60162d6b..c503b56dbcfa65e020a664edbe700f8afe0ec2d9 100644 (file)
@@ -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;
index 5d17e283ae79c9f28b6ead51fcdd1208d6320b76..e90082e50bcfd23fb12f54f91505bbe2bda686b5 100644 (file)
@@ -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);
index eb57338a8eca566c564e4194bc41ab15e3726f61..8ba62280f03f9109be1e05f609153e21e211cdde 100644 (file)
@@ -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;
 
index 8bb9e0280255c9d9c60926732847bd3625632262..a828056f1fa02c9d2cf4652659534f1eee3be349 100644 (file)
@@ -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);
index e58144d0c90876a12592aafa6739457f6822eae4..839e8d9ebce61e50f425b773dce6862655fc6558 100644 (file)
@@ -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;
index fdfe6dc1d01386be23a3f9fb7632571b65de68e5..3735a833fdbdbfc8d1cc78f24c8aec5d5fb4ca1b 100644 (file)
@@ -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