zebra: Expose vrf lookup by table id out of rt_netlink.c

The function rt_netlink.c is using to lookup the vrf by
passed in table id.

I'm also going to pretend that this function is not
so awful to run when we have a large number of routes
incoming.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2020-03-09 09:47:46 -04:00
parent 0f90b81558
commit 9d866c07c8
2 changed files with 2 additions and 1 deletions

View File

@ -290,7 +290,7 @@ static inline int proto2zebra(int proto, int family, bool is_nexthop)
/*
Pending: create an efficient table_id (in a tree/hash) based lookup)
*/
static vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)
vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id)
{
struct vrf *vrf;
struct zebra_vrf *zvrf;

View File

@ -92,6 +92,7 @@ extern int netlink_macfdb_read_specific_mac(struct zebra_ns *zns,
struct ethaddr *mac, uint16_t vid);
extern int netlink_neigh_read_specific_ip(struct ipaddr *ip,
struct interface *vlan_if);
extern vrf_id_t vrf_lookup_by_table(uint32_t table_id, ns_id_t ns_id);
#ifdef __cplusplus
}