diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-11 07:30:52 -0500 |
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-03-15 10:36:38 -0400 |
| commit | 92a57eb206d51a6e9a28c9ffa1066557a18da9b2 (patch) | |
| tree | c5f7e2a22b0de5059500a76385bdfd95d96d73a0 /lib | |
| parent | 1306c09a1b6996f7afa3ac651659c40146117834 (diff) | |
*: Refactor if_get_by_name to be VRF aware
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/if.c | 8 | ||||
| -rw-r--r-- | lib/if.h | 6 |
2 files changed, 3 insertions, 11 deletions
@@ -427,7 +427,7 @@ if_lookup_prefix (struct prefix *prefix, vrf_id_t vrf_id) /* Get interface by name if given name interface doesn't exist create one. */ struct interface * -if_get_by_name_vrf (const char *name, vrf_id_t vrf_id) +if_get_by_name (const char *name, vrf_id_t vrf_id) { struct interface *ifp; @@ -436,12 +436,6 @@ if_get_by_name_vrf (const char *name, vrf_id_t vrf_id) } struct interface * -if_get_by_name (const char *name) -{ - return if_get_by_name_vrf (name, VRF_DEFAULT); -} - -struct interface * if_get_by_name_len_vrf (const char *name, size_t namelen, vrf_id_t vrf_id, int vty) { struct interface *ifp; @@ -402,14 +402,12 @@ extern struct connected *if_lookup_address (void *matchaddr, int family, extern struct interface *if_lookup_prefix (struct prefix *prefix, vrf_id_t vrf_id); -/* These 2 functions are to be used when the ifname argument is terminated +/* These 3 functions are to be used when the ifname argument is terminated by a '\0' character: */ -extern struct interface *if_get_by_name (const char *ifname); - 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_vrf (const char *ifname, +extern struct interface *if_get_by_name (const char *ifname, vrf_id_t vrf_id); /* For these 2 functions, the namelen argument should be the precise length |
