isisd: add support to import routes from other protocols
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
diff --git a/lib/prefix.c b/lib/prefix.c
index 63742f3..936e9fc 100644
--- a/lib/prefix.c
+++ b/lib/prefix.c
@@ -187,6 +187,17 @@
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 bc8aebc..a517d79 100644
--- a/lib/prefix.h
+++ b/lib/prefix.h
@@ -170,6 +170,7 @@
#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 ba64553..2479c81 100644
--- a/lib/routemap.h
+++ b/lib/routemap.h
@@ -47,7 +47,8 @@
RMAP_OSPF,
RMAP_OSPF6,
RMAP_BGP,
- RMAP_ZEBRA
+ RMAP_ZEBRA,
+ RMAP_ISIS,
} route_map_object_t;
typedef enum