summaryrefslogtreecommitdiff
path: root/lib/if.h
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2023-11-23 17:45:07 -0500
committerGitHub <noreply@github.com>2023-11-23 17:45:07 -0500
commit25f1b66fde6bee4051d57bf54202f83388ae4b57 (patch)
treebe471f8e0ab35f0e6cc86a7d43810745daeb9865 /lib/if.h
parent27be058232ad530e2446cb8a12de0a7d04d0a758 (diff)
parent6e7465c54e6be65ec88f88b4493fd073698cb39d (diff)
Merge pull request #14863 from opensourcerouting/if-connected-dlist
*: convert struct interface->connected to DLIST
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/if.h b/lib/if.h
index e932057583..560635f7c4 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -204,6 +204,8 @@ struct if_link_params {
#define INTERFACE_LINK_PARAMS_SIZE sizeof(struct if_link_params)
#define HAS_LINK_PARAMS(ifp) ((ifp)->link_params != NULL)
+PREDECL_DLIST(if_connected);
+
/* Interface structure */
struct interface {
RB_ENTRY(interface) name_entry, index_entry;
@@ -273,12 +275,8 @@ struct interface {
/* description of the interface. */
char *desc;
- /* Distribute list. */
- void *distribute_in;
- void *distribute_out;
-
/* Connected address list. */
- struct list *connected;
+ struct if_connected_head connected[1];
/* Neighbor connected address list. */
struct list *nbr_connected;
@@ -373,9 +371,6 @@ DECLARE_QOBJ_TYPE(interface);
if (vrf) \
RB_FOREACH (ifp, if_name_head, &vrf->ifaces_by_name)
-#define FOR_ALL_INTERFACES_ADDRESSES(ifp, connected, node) \
- for (ALL_LIST_ELEMENTS_RO(ifp->connected, node, connected))
-
/* called from the library code whenever interfaces are created/deleted
* note: interfaces may not be fully realized at that point; also they
* may not exist in the system (ifindex = IFINDEX_INTERNAL)
@@ -410,6 +405,8 @@ DECLARE_KOOH(if_down, (struct interface *ifp), (ifp));
/* Connected address structure. */
struct connected {
+ struct if_connected_item item;
+
/* Attached interface. */
struct interface *ifp;
@@ -459,6 +456,8 @@ struct connected {
uint32_t metric;
};
+DECLARE_DLIST(if_connected, struct connected, item);
+
/* Nbr Connected address structure. */
struct nbr_connected {
/* Attached interface. */