mirror of
https://github.com/FRRouting/frr.git
synced 2025-04-30 05:27:16 +02:00
lib: expose comparision function to allow a typesafe conversion
The interface hash comparison function is needed in eigrpd. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
d736350986
commit
5f9e26069e
4
lib/if.c
4
lib/if.c
|
@ -44,7 +44,6 @@ static void if_set_name(struct interface *ifp, const char *name);
|
|||
static struct interface *if_lookup_by_ifindex(ifindex_t ifindex,
|
||||
vrf_id_t vrf_id);
|
||||
static struct interface *if_lookup_by_index_all_vrf(ifindex_t ifindex);
|
||||
static int if_cmp_func(const struct interface *, const struct interface *);
|
||||
static int if_cmp_index_func(const struct interface *ifp1,
|
||||
const struct interface *ifp2);
|
||||
RB_GENERATE(if_name_head, interface, name_entry, if_cmp_func);
|
||||
|
@ -136,8 +135,7 @@ int if_cmp_name_func(const char *p1, const char *p2)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int if_cmp_func(const struct interface *ifp1,
|
||||
const struct interface *ifp2)
|
||||
int if_cmp_func(const struct interface *ifp1, const struct interface *ifp2)
|
||||
{
|
||||
return if_cmp_name_func(ifp1->name, ifp2->name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue