]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/if.h
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / if.h
index 7b65bbd2e55a491adcf25e70b5474b349ebce275..166bfa92b52b610e7ae95ca1627018e72204ee11 100644 (file)
--- a/lib/if.h
+++ b/lib/if.h
@@ -297,31 +297,31 @@ DECLARE_QOBJ_TYPE(interface)
 
 #define IFNAME_RB_INSERT(vrf, ifp)                                             \
        if (RB_INSERT(if_name_head, &vrf->ifaces_by_name, (ifp)))              \
-               zlog_err(                                                      \
-                       "%s(%s): corruption detected -- interface with this "  \
-                       "name exists already in VRF %u!",                      \
-                       __func__, (ifp)->name, (ifp)->vrf_id);
+               flog_err(EC_LIB_INTERFACE,                                     \
+                        "%s(%s): corruption detected -- interface with this " \
+                        "name exists already in VRF %u!",                     \
+                        __func__, (ifp)->name, (ifp)->vrf_id);
 
 #define IFNAME_RB_REMOVE(vrf, ifp)                                             \
        if (RB_REMOVE(if_name_head, &vrf->ifaces_by_name, (ifp)) == NULL)      \
-               zlog_err(                                                      \
-                       "%s(%s): corruption detected -- interface with this "  \
-                       "name doesn't exist in VRF %u!",                       \
-                       __func__, (ifp)->name, (ifp)->vrf_id);
+               flog_err(EC_LIB_INTERFACE,                                     \
+                        "%s(%s): corruption detected -- interface with this " \
+                        "name doesn't exist in VRF %u!",                      \
+                        __func__, (ifp)->name, (ifp)->vrf_id);
 
 #define IFINDEX_RB_INSERT(vrf, ifp)                                            \
        if (RB_INSERT(if_index_head, &vrf->ifaces_by_index, (ifp)))            \
-               zlog_err(                                                      \
-                       "%s(%u): corruption detected -- interface with this "  \
-                       "ifindex exists already in VRF %u!",                   \
-                       __func__, (ifp)->ifindex, (ifp)->vrf_id);
+               flog_err(EC_LIB_INTERFACE,                                     \
+                        "%s(%u): corruption detected -- interface with this " \
+                        "ifindex exists already in VRF %u!",                  \
+                        __func__, (ifp)->ifindex, (ifp)->vrf_id);
 
 #define IFINDEX_RB_REMOVE(vrf, ifp)                                            \
        if (RB_REMOVE(if_index_head, &vrf->ifaces_by_index, (ifp)) == NULL)    \
-               zlog_err(                                                      \
-                       "%s(%u): corruption detected -- interface with this "  \
-                       "ifindex doesn't exist in VRF %u!",                    \
-                       __func__, (ifp)->ifindex, (ifp)->vrf_id);
+               flog_err(EC_LIB_INTERFACE,                                     \
+                        "%s(%u): corruption detected -- interface with this " \
+                        "ifindex doesn't exist in VRF %u!",                   \
+                        __func__, (ifp)->ifindex, (ifp)->vrf_id);
 
 #define FOR_ALL_INTERFACES(vrf, ifp)                                           \
        if (vrf)                                                               \
@@ -451,7 +451,7 @@ struct nbr_connected {
 #endif /* IFF_VIRTUAL */
 
 /* Prototypes. */
-extern int if_cmp_name_func(char *, char *);
+extern int if_cmp_name_func(const char *p1, const char *p2);
 
 /*
  * Passing in VRF_UNKNOWN is a valid thing to do, unless we
@@ -474,8 +474,7 @@ extern struct interface *if_lookup_prefix(struct prefix *prefix,
    by a '\0' character: */
 extern struct interface *if_lookup_by_name_all_vrf(const char *ifname);
 extern struct interface *if_lookup_by_name(const char *ifname, vrf_id_t vrf_id);
-extern struct interface *if_get_by_name(const char *ifname, vrf_id_t vrf_id,
-                                       int vty);
+extern struct interface *if_get_by_name(const char *ifname, vrf_id_t vrf_id);
 extern void if_set_index(struct interface *ifp, ifindex_t ifindex);
 
 /* Delete the interface, but do not free the structure, and leave it in the
@@ -493,10 +492,10 @@ extern int if_is_operative(struct interface *);
 extern int if_is_no_ptm_operative(struct interface *);
 extern int if_is_loopback(struct interface *);
 extern int if_is_vrf(struct interface *ifp);
+extern bool if_is_loopback_or_vrf(struct interface *ifp);
 extern int if_is_broadcast(struct interface *);
 extern int if_is_pointopoint(struct interface *);
 extern int if_is_multicast(struct interface *);
-extern void if_cmd_init(void);
 struct vrf;
 extern void if_terminate(struct vrf *vrf);
 extern void if_dump_all(void);
@@ -533,4 +532,8 @@ struct nbr_connected *nbr_connected_check(struct interface *, struct prefix *);
 struct if_link_params *if_link_params_get(struct interface *);
 void if_link_params_free(struct interface *);
 
+/* Northbound. */
+extern void if_cmd_init(void);
+extern const struct frr_yang_module_info frr_interface_info;
+
 #endif /* _ZEBRA_IF_H */