* ospf6_abr.[ch], ospf6_area.[ch]: Add area filter-list (in|out)
support and area import and export lists support.
diff --git a/ospf6d/ospf6_abr.c b/ospf6d/ospf6_abr.c
index 7eb8f09..833a1bc 100644
--- a/ospf6d/ospf6_abr.c
+++ b/ospf6d/ospf6_abr.c
@@ -29,6 +29,8 @@
#include "linklist.h"
#include "command.h"
#include "thread.h"
+#include "plist.h"
+#include "filter.h"
#include "ospf6_proto.h"
#include "ospf6_route.h"
@@ -340,6 +342,48 @@
}
}
+ /* Check export list */
+ if (EXPORT_NAME (area))
+ {
+ if (EXPORT_LIST (area) == NULL)
+ EXPORT_LIST (area) =
+ access_list_lookup (AFI_IP6, EXPORT_NAME (area));
+
+ if (EXPORT_LIST (area))
+ if (access_list_apply (EXPORT_LIST (area),
+ &route->prefix) == FILTER_DENY)
+ {
+ if (is_debug)
+ {
+ inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (&route->prefix)),
+ buf, sizeof(buf));
+ zlog_debug ("prefix %s was denied by export list", buf);
+ }
+ return;
+ }
+ }
+
+ /* Check filter-list */
+ if (PREFIX_NAME_OUT (area))
+ {
+ if (PREFIX_LIST_OUT (area) == NULL)
+ PREFIX_LIST_OUT (area) =
+ prefix_list_lookup(AFI_IP6, PREFIX_NAME_OUT (area));
+
+ if (PREFIX_LIST_OUT (area))
+ if (prefix_list_apply (PREFIX_LIST_OUT (area),
+ &route->prefix) != PREFIX_PERMIT)
+ {
+ if (is_debug)
+ {
+ inet_ntop (AF_INET, &(ADV_ROUTER_IN_PREFIX (&route->prefix)),
+ buf, sizeof (buf));
+ zlog_debug ("prefix %s was denied by filter-list out", buf);
+ }
+ return;
+ }
+ }
+
/* the route is going to be originated. store it in area's summary_table */
if (summary == NULL)
{
@@ -610,6 +654,40 @@
return;
}
+ /* Check import list */
+ if (IMPORT_NAME (oa))
+ {
+ if (IMPORT_LIST (oa) == NULL)
+ IMPORT_LIST (oa) = access_list_lookup (AFI_IP6, IMPORT_NAME (oa));
+
+ if (IMPORT_LIST (oa))
+ if (access_list_apply (IMPORT_LIST (oa), &prefix) == FILTER_DENY)
+ {
+ if (is_debug)
+ zlog_debug ("Prefix was denied by import-list");
+ if (old)
+ ospf6_route_remove (old, table);
+ return;
+ }
+ }
+
+ /* Check input prefix-list */
+ if (PREFIX_NAME_IN (oa))
+ {
+ if (PREFIX_LIST_IN (oa) == NULL)
+ PREFIX_LIST_IN (oa) = prefix_list_lookup (AFI_IP6, PREFIX_NAME_IN (oa));
+
+ if (PREFIX_LIST_IN (oa))
+ if (prefix_list_apply (PREFIX_LIST_IN (oa), &prefix) != PREFIX_PERMIT)
+ {
+ if (is_debug)
+ zlog_debug ("Prefix was denied by prefix-list");
+ if (old)
+ ospf6_route_remove (old, table);
+ return;
+ }
+ }
+
/* (5),(6),(7) the path preference is handled by the sorting
in the routing table. Always install the path by substituting
old route (if any). */
@@ -661,6 +739,24 @@
}
}
+void
+ospf6_abr_reimport (struct ospf6_area *oa)
+{
+ struct ospf6_lsa *lsa;
+ u_int16_t type;
+
+ type = htons (OSPF6_LSTYPE_INTER_ROUTER);
+ for (lsa = ospf6_lsdb_type_head (type, oa->lsdb); lsa;
+ lsa = ospf6_lsdb_type_next (type, lsa))
+ ospf6_abr_examin_summary (lsa, oa);
+
+ type = htons (OSPF6_LSTYPE_INTER_PREFIX);
+ for (lsa = ospf6_lsdb_type_head (type, oa->lsdb); lsa;
+ lsa = ospf6_lsdb_type_next (type, lsa))
+ ospf6_abr_examin_summary (lsa, oa);
+}
+
+
/* Display functions */
int