+/* `match interface IFNAME' */
+/* Match function should return 1 if match is success else return
+ zero. */
+static route_map_result_t
+ospf6_routemap_rule_match_interface (void *rule, struct prefix *prefix,
+ route_map_object_t type, void *object)
+{
+ struct interface *ifp;
+ struct ospf6_external_info *ei;
+
+ if (type == RMAP_OSPF6)
+ {
+ ei = ((struct ospf6_route *) object)->route_option;
+ ifp = if_lookup_by_name ((char *)rule);
+
+ if (ifp != NULL
+ && ei->ifindex == ifp->ifindex)
+ return RMAP_MATCH;
+ }
+
+ return RMAP_NOMATCH;
+}
+
+/* Route map `interface' match statement. `arg' should be
+ interface name. */
+static void *
+ospf6_routemap_rule_match_interface_compile (const char *arg)
+{
+ return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
+}
+
+/* Free route map's compiled `interface' value. */
+static void
+ospf6_routemap_rule_match_interface_free (void *rule)
+{
+ XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
+}
+
+/* Route map commands for interface matching. */
+struct route_map_rule_cmd
+ospf6_routemap_rule_match_interface_cmd =
+{
+ "interface",
+ ospf6_routemap_rule_match_interface,
+ ospf6_routemap_rule_match_interface_compile,
+ ospf6_routemap_rule_match_interface_free
+};
+