diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/prefix.c | 11 | ||||
| -rw-r--r-- | lib/prefix.h | 1 | ||||
| -rw-r--r-- | lib/routemap.h | 3 |
3 files changed, 14 insertions, 1 deletions
diff --git a/lib/prefix.c b/lib/prefix.c index 5f188f09f9..1614cd5603 100644 --- a/lib/prefix.c +++ b/lib/prefix.c @@ -187,6 +187,17 @@ prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen) return prefix_bit((const u_char *) &prefix->s6_addr, prefixlen); } +int +str2family(const char *string) +{ + if (!strcmp("ipv4", string)) + return AF_INET; + else if (!strcmp("ipv6", string)) + return AF_INET6; + else + return -1; +} + /* Address Famiy Identifier to Address Family converter. */ int afi2family (afi_t afi) diff --git a/lib/prefix.h b/lib/prefix.h index feacc2ae29..73ae0f25a7 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -167,6 +167,7 @@ union prefix46constptr #endif /*s6_addr32*/ /* Prototypes. */ +extern int str2family(const char *); extern int afi2family (afi_t); extern afi_t family2afi (int); diff --git a/lib/routemap.h b/lib/routemap.h index a90966b383..f5981a87f3 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -48,7 +48,8 @@ typedef enum RMAP_OSPF, RMAP_OSPF6, RMAP_BGP, - RMAP_ZEBRA + RMAP_ZEBRA, + RMAP_ISIS, } route_map_object_t; typedef enum |
