diff options
Diffstat (limited to 'lib/prefix.c')
| -rw-r--r-- | lib/prefix.c | 11 |
1 files changed, 11 insertions, 0 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) |
