diff options
author | Christian Franke <chris@opensourcerouting.org> | 2015-11-12 14:24:22 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2015-12-08 14:12:50 -0500 |
commit | acf9865f7fcec6a8d47df6ed7946a5e8ca398918 (patch) | |
tree | fac7d9ce2d2b6d984bde675641556e5063e8f655 /lib | |
parent | 9dfcca6122c9f4f3642241ff50029d7669af3999 (diff) | |
download | quagga-acf9865f7fcec6a8d47df6ed7946a5e8ca398918.tar.bz2 quagga-acf9865f7fcec6a8d47df6ed7946a5e8ca398918.tar.xz |
isisd: add support to import routes from other protocols
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
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 63742f39..936e9fcb 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 bc8aebc5..a517d795 100644 --- a/lib/prefix.h +++ b/lib/prefix.h @@ -170,6 +170,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 ba64553f..2479c81a 100644 --- a/lib/routemap.h +++ b/lib/routemap.h @@ -47,7 +47,8 @@ typedef enum RMAP_OSPF, RMAP_OSPF6, RMAP_BGP, - RMAP_ZEBRA + RMAP_ZEBRA, + RMAP_ISIS, } route_map_object_t; typedef enum |