summaryrefslogtreecommitdiff
path: root/lib/if.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/if.h b/lib/if.h
index 1d32c2b088..f52e7cb200 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -399,16 +399,12 @@ struct connected {
/*
The ZEBRA_IFC_REAL flag should be set if and only if this address
exists in the kernel and is actually usable. (A case where it exists
- but
- is not yet usable would be IPv6 with DAD)
+ but is not yet usable would be IPv6 with DAD)
The ZEBRA_IFC_CONFIGURED flag should be set if and only if this
- address
- was configured by the user from inside quagga.
+ address was configured by the user from inside frr.
The ZEBRA_IFC_QUEUED flag should be set if and only if the address
- exists
- in the kernel. It may and should be set although the address might
- not be
- usable yet. (compare with ZEBRA_IFC_REAL)
+ exists in the kernel. It may and should be set although the
+ address might not be usable yet. (compare with ZEBRA_IFC_REAL)
The ZEBRA_IFC_DOWN flag is used to record that an address is
present, but down/unavailable.
*/
@@ -515,8 +511,7 @@ extern void if_update_to_new_vrf(struct interface *, vrf_id_t vrf_id);
extern struct interface *if_lookup_by_index(ifindex_t, vrf_id_t vrf_id);
extern struct interface *if_vrf_lookup_by_index_next(ifindex_t ifindex,
vrf_id_t vrf_id);
-extern struct interface *if_lookup_by_index_all_vrf(ifindex_t);
-extern struct interface *if_lookup_exact_address(const void *matchaddr,
+extern struct interface *if_lookup_address_local(const void *matchaddr,
int family, vrf_id_t vrf_id);
extern struct connected *if_lookup_address(const void *matchaddr, int family,
vrf_id_t vrf_id);
@@ -525,6 +520,12 @@ extern struct interface *if_lookup_prefix(const struct prefix *prefix,
size_t if_lookup_by_hwaddr(const uint8_t *hw_addr, size_t addrsz,
struct interface ***result, vrf_id_t vrf_id);
+static inline bool if_address_is_local(const void *matchaddr, int family,
+ vrf_id_t vrf_id)
+{
+ return if_lookup_address_local(matchaddr, family, vrf_id) != NULL;
+}
+
struct vrf;
extern struct interface *if_lookup_by_name_vrf(const char *name, struct vrf *vrf);
extern struct interface *if_lookup_by_name(const char *ifname, vrf_id_t vrf_id);
@@ -547,9 +548,9 @@ extern int if_is_up(const struct interface *ifp);
extern int if_is_running(const struct interface *ifp);
extern int if_is_operative(const struct interface *ifp);
extern int if_is_no_ptm_operative(const struct interface *ifp);
-extern int if_is_loopback(const struct interface *ifp);
+extern int if_is_loopback_exact(const struct interface *ifp);
extern int if_is_vrf(const struct interface *ifp);
-extern bool if_is_loopback_or_vrf(const struct interface *ifp);
+extern bool if_is_loopback(const struct interface *ifp);
extern int if_is_broadcast(const struct interface *ifp);
extern int if_is_pointopoint(const struct interface *ifp);
extern int if_is_multicast(const struct interface *ifp);