summaryrefslogtreecommitdiff
path: root/lib/prefix.c
diff options
context:
space:
mode:
authorChristian Franke <chris@opensourcerouting.org>2015-11-12 14:24:22 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-03-29 20:26:28 -0400
commitf3ccedaa3e408eb0cb098579a4a3768255e82867 (patch)
tree1f23ae04af9682c51b45e24477408857a929b1b3 /lib/prefix.c
parent6ac446878fe25f3f34f856c3daff4e4021b8b70c (diff)
isisd: add support to import routes from other protocols
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Diffstat (limited to 'lib/prefix.c')
-rw-r--r--lib/prefix.c11
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)