]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Revert my http://hasso.linux.ee/zebra/ht-ifrmap-14042003.patch patch. Used
authorhasso <hasso>
Sat, 24 May 2003 21:41:49 +0000 (21:41 +0000)
committerhasso <hasso>
Sat, 24 May 2003 21:41:49 +0000 (21:41 +0000)
same idea as in lib/distribute.c to allow extract.pl to pick up commands
for vtysh.

lib/Makefile.am
lib/if_rmap.c [new file with mode: 0644]
lib/if_rmap.h [new file with mode: 0644]
ripngd/Makefile.am
ripngd/ripng_ifrmap.c [deleted file]
ripngd/ripng_ifrmap.h [deleted file]
ripngd/ripngd.c
vtysh/Makefile.am
vtysh/extract.pl

index 7576cc81ce0643448db4f7f1223d0bbe48454283..026806035b69800e5218f903baf29829f590d61d 100644 (file)
@@ -10,7 +10,7 @@ libzebra_a_SOURCES = \
        print_version.c checksum.c vector.c linklist.c vty.c command.c \
        sockunion.c prefix.c thread.c if.c memory.c buffer.c table.c hash.c \
        filter.c routemap.c distribute.c stream.c str.c log.c plist.c \
-       zclient.c sockopt.c smux.c md5.c keychain.c
+       zclient.c sockopt.c smux.c md5.c if_rmap.c keychain.c
 
 libzebra_a_DEPENDENCIES = @LIB_REGEX@
 
@@ -20,7 +20,7 @@ noinst_HEADERS = \
        buffer.h command.h filter.h getopt.h hash.h if.h linklist.h log.h \
        memory.h network.h prefix.h routemap.h distribute.h sockunion.h \
        str.h stream.h table.h thread.h vector.h version.h vty.h zebra.h \
-       plist.h zclient.h sockopt.h smux.h md5-gnu.h keychain.h
+       plist.h zclient.h sockopt.h smux.h md5-gnu.h if_rmap.h keychain.h
 
 EXTRA_DIST = regex.c regex-gnu.h
 
diff --git a/lib/if_rmap.c b/lib/if_rmap.c
new file mode 100644 (file)
index 0000000..4227102
--- /dev/null
@@ -0,0 +1,306 @@
+/* route-map for interface.
+ * Copyright (C) 1999 Kunihiro Ishiguro
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * GNU Zebra is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Zebra; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+
+#include <zebra.h>
+
+#include "hash.h"
+#include "command.h"
+#include "memory.h"
+#include "if.h"
+#include "if_rmap.h"
+
+struct hash *ifrmaphash;
+
+/* Hook functions. */
+void (*if_rmap_add_hook) (struct if_rmap *) = NULL;
+void (*if_rmap_delete_hook) (struct if_rmap *) = NULL;
+\f
+struct if_rmap *
+if_rmap_new ()
+{
+  struct if_rmap *new;
+
+  new = XCALLOC (MTYPE_IF_RMAP, sizeof (struct if_rmap));
+
+  return new;
+}
+
+void
+if_rmap_free (struct if_rmap *if_rmap)
+{
+  if (if_rmap->ifname)
+    free (if_rmap->ifname);
+
+  if (if_rmap->routemap[IF_RMAP_IN])
+    free (if_rmap->routemap[IF_RMAP_IN]);
+  if (if_rmap->routemap[IF_RMAP_OUT])
+    free (if_rmap->routemap[IF_RMAP_OUT]);
+
+  XFREE (MTYPE_IF_RMAP, if_rmap);
+}
+
+struct if_rmap *
+if_rmap_lookup (char *ifname)
+{
+  struct if_rmap key;
+  struct if_rmap *if_rmap;
+
+  key.ifname = ifname;
+
+  if_rmap = hash_lookup (ifrmaphash, &key);
+  
+  return if_rmap;
+}
+
+void
+if_rmap_hook_add (void (*func) (struct if_rmap *))
+{
+  if_rmap_add_hook = func;
+}
+
+void
+if_rmap_hook_delete (void (*func) (struct if_rmap *))
+{
+  if_rmap_delete_hook = func;
+}
+
+void *
+if_rmap_hash_alloc (struct if_rmap *arg)
+{
+  struct if_rmap *if_rmap;
+
+  if_rmap = if_rmap_new ();
+  if_rmap->ifname = strdup (arg->ifname);
+
+  return if_rmap;
+}
+
+struct if_rmap *
+if_rmap_get (char *ifname)
+{
+  struct if_rmap key;
+
+  key.ifname = ifname;
+
+  return (struct if_rmap *) hash_get (ifrmaphash, &key, if_rmap_hash_alloc);
+}
+
+unsigned int
+if_rmap_hash_make (struct if_rmap *if_rmap)
+{
+  unsigned int key;
+  int i;
+
+  key = 0;
+  for (i = 0; i < strlen (if_rmap->ifname); i++)
+    key += if_rmap->ifname[i];
+
+  return key;
+}
+
+int
+if_rmap_hash_cmp (struct if_rmap *if_rmap1, struct if_rmap *if_rmap2)
+{
+  if (strcmp (if_rmap1->ifname, if_rmap2->ifname) == 0)
+    return 1;
+  return 0;
+}
+\f
+struct if_rmap *
+if_rmap_set (char *ifname, enum if_rmap_type type, char *routemap_name)
+{
+  struct if_rmap *if_rmap;
+
+  if_rmap = if_rmap_get (ifname);
+
+  if (type == IF_RMAP_IN)
+    {
+      if (if_rmap->routemap[IF_RMAP_IN])
+       free (if_rmap->routemap[IF_RMAP_IN]);
+      if_rmap->routemap[IF_RMAP_IN] = strdup (routemap_name);
+    }
+  if (type == IF_RMAP_OUT)
+    {
+      if (if_rmap->routemap[IF_RMAP_OUT])
+       free (if_rmap->routemap[IF_RMAP_OUT]);
+      if_rmap->routemap[IF_RMAP_OUT] = strdup (routemap_name);
+    }
+
+  if (if_rmap_add_hook)
+    (*if_rmap_add_hook) (if_rmap);
+  
+  return if_rmap;
+}
+
+int
+if_rmap_unset (char *ifname, enum if_rmap_type type, char *routemap_name)
+{
+  struct if_rmap *if_rmap;
+
+  if_rmap = if_rmap_lookup (ifname);
+  if (!if_rmap)
+    return 0;
+
+  if (type == IF_RMAP_IN)
+    {
+      if (!if_rmap->routemap[IF_RMAP_IN])
+       return 0;
+      if (strcmp (if_rmap->routemap[IF_RMAP_IN], routemap_name) != 0)
+       return 0;
+
+      free (if_rmap->routemap[IF_RMAP_IN]);
+      if_rmap->routemap[IF_RMAP_IN] = NULL;      
+    }
+
+  if (type == IF_RMAP_OUT)
+    {
+      if (!if_rmap->routemap[IF_RMAP_OUT])
+       return 0;
+      if (strcmp (if_rmap->routemap[IF_RMAP_OUT], routemap_name) != 0)
+       return 0;
+
+      free (if_rmap->routemap[IF_RMAP_OUT]);
+      if_rmap->routemap[IF_RMAP_OUT] = NULL;      
+    }
+
+  if (if_rmap_delete_hook)
+    (*if_rmap_delete_hook) (if_rmap);
+
+  if (if_rmap->routemap[IF_RMAP_IN] == NULL &&
+      if_rmap->routemap[IF_RMAP_OUT] == NULL)
+    {
+      hash_release (ifrmaphash, if_rmap);
+      if_rmap_free (if_rmap);
+    }
+
+  return 1;
+}
+
+DEFUN (if_rmap,
+       if_rmap_cmd,
+       "route-map RMAP_NAME (in|out) IFNAME",
+       "Route map set\n"
+       "Route map name\n"
+       "Route map set for input filtering\n"
+       "Route map set for output filtering\n"
+       "Route map interface name\n")
+{
+  enum if_rmap_type type;
+  struct if_rmap *if_rmap;
+
+  if (strncmp (argv[1], "i", 1) == 0)
+    type = IF_RMAP_IN;
+  else if (strncmp (argv[1], "o", 1) == 0)
+    type = IF_RMAP_OUT;
+  else
+    {
+      vty_out (vty, "route-map direction must be [in|out]%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  if_rmap = if_rmap_set (argv[2], type, argv[0]);
+
+  return CMD_SUCCESS;
+}       
+
+DEFUN (no_if_rmap,
+       no_if_rmap_cmd,
+       "no route-map ROUTEMAP_NAME (in|out) IFNAME",
+       NO_STR
+       "Route map unset\n"
+       "Route map name\n"
+       "Route map for input filtering\n"
+       "Route map for output filtering\n"
+       "Route map interface name\n")
+{
+  int ret;
+  enum if_rmap_type type;
+
+  if (strncmp (argv[1], "i", 1) == 0)
+    type = IF_RMAP_IN;
+  else if (strncmp (argv[1], "o", 1) == 0)
+    type = IF_RMAP_OUT;
+  else
+    {
+      vty_out (vty, "route-map direction must be [in|out]%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  ret = if_rmap_unset (argv[2], type, argv[0]);
+  if (! ret)
+    {
+      vty_out (vty, "route-map doesn't exist%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  return CMD_SUCCESS;
+}       
+\f
+/* Configuration write function. */
+int
+config_write_if_rmap (struct vty *vty)
+{
+  int i;
+  struct hash_backet *mp;
+  int write = 0;
+
+  for (i = 0; i < ifrmaphash->size; i++)
+    for (mp = ifrmaphash->index[i]; mp; mp = mp->next)
+      {
+       struct if_rmap *if_rmap;
+
+       if_rmap = mp->data;
+
+       if (if_rmap->routemap[IF_RMAP_IN])
+         {
+           vty_out (vty, " route-map %s in %s%s", 
+                    if_rmap->routemap[IF_RMAP_IN],
+                    if_rmap->ifname,
+                    VTY_NEWLINE);
+           write++;
+         }
+
+       if (if_rmap->routemap[IF_RMAP_OUT])
+         {
+           vty_out (vty, " route-map %s out %s%s", 
+                    if_rmap->routemap[IF_RMAP_OUT],
+                    if_rmap->ifname,
+                    VTY_NEWLINE);
+           write++;
+         }
+      }
+  return write;
+}
+
+void
+if_rmap_reset ()
+{
+  hash_clean (ifrmaphash, (void (*) (void *)) if_rmap_free);
+}
+
+void
+if_rmap_init (int node)
+{
+  ifrmaphash = hash_create (if_rmap_hash_make, if_rmap_hash_cmp);
+  if (node == RIPNG_NODE) {
+    install_element (RIPNG_NODE, &if_rmap_cmd);
+    install_element (RIPNG_NODE, &no_if_rmap_cmd);
+  }
+}
diff --git a/lib/if_rmap.h b/lib/if_rmap.h
new file mode 100644 (file)
index 0000000..a9355ab
--- /dev/null
@@ -0,0 +1,47 @@
+/* route-map for interface.
+ * Copyright (C) 1999 Kunihiro Ishiguro
+ *
+ * This file is part of GNU Zebra.
+ *
+ * GNU Zebra is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2, or (at your option) any
+ * later version.
+ *
+ * GNU Zebra is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GNU Zebra; see the file COPYING.  If not, write to the Free
+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.  
+ */
+
+#ifndef _ZEBRA_IF_RMAP_H
+#define _ZEBRA_IF_RMAP_H
+
+enum if_rmap_type
+{
+  IF_RMAP_IN,
+  IF_RMAP_OUT,
+  IF_RMAP_MAX
+};
+
+struct if_rmap
+{
+  /* Name of the interface. */
+  char *ifname;
+
+  char *routemap[IF_RMAP_MAX];
+};
+
+void if_rmap_init (int);
+void if_rmap_reset (void);
+void if_rmap_hook_add (void (*) (struct if_rmap *));
+void if_rmap_hook_delete (void (*) (struct if_rmap *));
+struct if_rmap *if_rmap_lookup (char *);
+int config_write_if_rmap (struct vty *);
+
+#endif /* _ZEBRA_IF_RMAP_H */
index 90b8b65ccfbbba4b132564d432ee8206e38cfdbf..2835aa24059a223f2e185a9894a390740d0d7c3c 100644 (file)
@@ -9,10 +9,10 @@ sbin_PROGRAMS = ripngd
 
 libripng_a_SOURCES = \
        ripng_interface.c ripngd.c ripng_zebra.c ripng_route.c ripng_debug.c \
-       ripng_routemap.c ripng_ifrmap.c
+       ripng_routemap.c
 
 noinst_HEADERS = \
-       ripng_debug.h ripng_route.h ripngd.h ripng_ifrmap.h
+       ripng_debug.h ripng_route.h ripngd.h
 
 ripngd_SOURCES = \
        ripng_main.c $(libripng_a_SOURCES)
diff --git a/ripngd/ripng_ifrmap.c b/ripngd/ripng_ifrmap.c
deleted file mode 100644 (file)
index d358690..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-/* route-map for interface.
- * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.  
- */
-
-#include <zebra.h>
-
-#include "hash.h"
-#include "command.h"
-#include "memory.h"
-#include "if.h"
-#include "ripng_ifrmap.h"
-
-struct hash *ifrmaphash;
-
-/* Hook functions. */
-void (*if_rmap_add_hook) (struct if_rmap *) = NULL;
-void (*if_rmap_delete_hook) (struct if_rmap *) = NULL;
-\f
-struct if_rmap *
-if_rmap_new ()
-{
-  struct if_rmap *new;
-
-  new = XCALLOC (MTYPE_IF_RMAP, sizeof (struct if_rmap));
-
-  return new;
-}
-
-void
-if_rmap_free (struct if_rmap *if_rmap)
-{
-  if (if_rmap->ifname)
-    free (if_rmap->ifname);
-
-  if (if_rmap->routemap[IF_RMAP_IN])
-    free (if_rmap->routemap[IF_RMAP_IN]);
-  if (if_rmap->routemap[IF_RMAP_OUT])
-    free (if_rmap->routemap[IF_RMAP_OUT]);
-
-  XFREE (MTYPE_IF_RMAP, if_rmap);
-}
-
-struct if_rmap *
-if_rmap_lookup (char *ifname)
-{
-  struct if_rmap key;
-  struct if_rmap *if_rmap;
-
-  key.ifname = ifname;
-
-  if_rmap = hash_lookup (ifrmaphash, &key);
-  
-  return if_rmap;
-}
-
-void
-if_rmap_hook_add (void (*func) (struct if_rmap *))
-{
-  if_rmap_add_hook = func;
-}
-
-void
-if_rmap_hook_delete (void (*func) (struct if_rmap *))
-{
-  if_rmap_delete_hook = func;
-}
-
-void *
-if_rmap_hash_alloc (struct if_rmap *arg)
-{
-  struct if_rmap *if_rmap;
-
-  if_rmap = if_rmap_new ();
-  if_rmap->ifname = strdup (arg->ifname);
-
-  return if_rmap;
-}
-
-struct if_rmap *
-if_rmap_get (char *ifname)
-{
-  struct if_rmap key;
-
-  key.ifname = ifname;
-
-  return (struct if_rmap *) hash_get (ifrmaphash, &key, if_rmap_hash_alloc);
-}
-
-unsigned int
-if_rmap_hash_make (struct if_rmap *if_rmap)
-{
-  unsigned int key;
-  int i;
-
-  key = 0;
-  for (i = 0; i < strlen (if_rmap->ifname); i++)
-    key += if_rmap->ifname[i];
-
-  return key;
-}
-
-int
-if_rmap_hash_cmp (struct if_rmap *if_rmap1, struct if_rmap *if_rmap2)
-{
-  if (strcmp (if_rmap1->ifname, if_rmap2->ifname) == 0)
-    return 1;
-  return 0;
-}
-\f
-struct if_rmap *
-if_rmap_set (char *ifname, enum if_rmap_type type, char *routemap_name)
-{
-  struct if_rmap *if_rmap;
-
-  if_rmap = if_rmap_get (ifname);
-
-  if (type == IF_RMAP_IN)
-    {
-      if (if_rmap->routemap[IF_RMAP_IN])
-       free (if_rmap->routemap[IF_RMAP_IN]);
-      if_rmap->routemap[IF_RMAP_IN] = strdup (routemap_name);
-    }
-  if (type == IF_RMAP_OUT)
-    {
-      if (if_rmap->routemap[IF_RMAP_OUT])
-       free (if_rmap->routemap[IF_RMAP_OUT]);
-      if_rmap->routemap[IF_RMAP_OUT] = strdup (routemap_name);
-    }
-
-  if (if_rmap_add_hook)
-    (*if_rmap_add_hook) (if_rmap);
-  
-  return if_rmap;
-}
-
-int
-if_rmap_unset (char *ifname, enum if_rmap_type type, char *routemap_name)
-{
-  struct if_rmap *if_rmap;
-
-  if_rmap = if_rmap_lookup (ifname);
-  if (!if_rmap)
-    return 0;
-
-  if (type == IF_RMAP_IN)
-    {
-      if (!if_rmap->routemap[IF_RMAP_IN])
-       return 0;
-      if (strcmp (if_rmap->routemap[IF_RMAP_IN], routemap_name) != 0)
-       return 0;
-
-      free (if_rmap->routemap[IF_RMAP_IN]);
-      if_rmap->routemap[IF_RMAP_IN] = NULL;      
-    }
-
-  if (type == IF_RMAP_OUT)
-    {
-      if (!if_rmap->routemap[IF_RMAP_OUT])
-       return 0;
-      if (strcmp (if_rmap->routemap[IF_RMAP_OUT], routemap_name) != 0)
-       return 0;
-
-      free (if_rmap->routemap[IF_RMAP_OUT]);
-      if_rmap->routemap[IF_RMAP_OUT] = NULL;      
-    }
-
-  if (if_rmap_delete_hook)
-    (*if_rmap_delete_hook) (if_rmap);
-
-  if (if_rmap->routemap[IF_RMAP_IN] == NULL &&
-      if_rmap->routemap[IF_RMAP_OUT] == NULL)
-    {
-      hash_release (ifrmaphash, if_rmap);
-      if_rmap_free (if_rmap);
-    }
-
-  return 1;
-}
-
-DEFUN (ripng_if_rmap,
-       ripng_if_rmap_cmd,
-       "route-map RMAP_NAME (in|out) IFNAME",
-       "Route map set\n"
-       "Route map name\n"
-       "Route map set for input filtering\n"
-       "Route map set for output filtering\n"
-       "Route map interface name\n")
-{
-  enum if_rmap_type type;
-  struct if_rmap *if_rmap;
-
-  if (strncmp (argv[1], "i", 1) == 0)
-    type = IF_RMAP_IN;
-  else if (strncmp (argv[1], "o", 1) == 0)
-    type = IF_RMAP_OUT;
-  else
-    {
-      vty_out (vty, "route-map direction must be [in|out]%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  if_rmap = if_rmap_set (argv[2], type, argv[0]);
-
-  return CMD_SUCCESS;
-}       
-
-DEFUN (no_ripng_if_rmap,
-       no_ripng_if_rmap_cmd,
-       "no route-map ROUTEMAP_NAME (in|out) IFNAME",
-       NO_STR
-       "Route map unset\n"
-       "Route map name\n"
-       "Route map for input filtering\n"
-       "Route map for output filtering\n"
-       "Route map interface name\n")
-{
-  int ret;
-  enum if_rmap_type type;
-
-  if (strncmp (argv[1], "i", 1) == 0)
-    type = IF_RMAP_IN;
-  else if (strncmp (argv[1], "o", 1) == 0)
-    type = IF_RMAP_OUT;
-  else
-    {
-      vty_out (vty, "route-map direction must be [in|out]%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  ret = if_rmap_unset (argv[2], type, argv[0]);
-  if (! ret)
-    {
-      vty_out (vty, "route-map doesn't exist%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-  return CMD_SUCCESS;
-}       
-\f
-/* Configuration write function. */
-int
-config_write_if_rmap (struct vty *vty)
-{
-  int i;
-  struct hash_backet *mp;
-  int write = 0;
-
-  for (i = 0; i < ifrmaphash->size; i++)
-    for (mp = ifrmaphash->index[i]; mp; mp = mp->next)
-      {
-       struct if_rmap *if_rmap;
-
-       if_rmap = mp->data;
-
-       if (if_rmap->routemap[IF_RMAP_IN])
-         {
-           vty_out (vty, " route-map %s in %s%s", 
-                    if_rmap->routemap[IF_RMAP_IN],
-                    if_rmap->ifname,
-                    VTY_NEWLINE);
-           write++;
-         }
-
-       if (if_rmap->routemap[IF_RMAP_OUT])
-         {
-           vty_out (vty, " route-map %s out %s%s", 
-                    if_rmap->routemap[IF_RMAP_OUT],
-                    if_rmap->ifname,
-                    VTY_NEWLINE);
-           write++;
-         }
-      }
-  return write;
-}
-
-void
-if_rmap_reset ()
-{
-  hash_clean (ifrmaphash, (void (*) (void *)) if_rmap_free);
-}
-
-void
-if_rmap_init (void)
-{
-  ifrmaphash = hash_create (if_rmap_hash_make, if_rmap_hash_cmp);
-
-  install_element (RIPNG_NODE, &ripng_if_rmap_cmd);
-  install_element (RIPNG_NODE, &no_ripng_if_rmap_cmd);
-}
diff --git a/ripngd/ripng_ifrmap.h b/ripngd/ripng_ifrmap.h
deleted file mode 100644 (file)
index c8bc223..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/* route-map for interface.
- * Copyright (C) 1999 Kunihiro Ishiguro
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2, or (at your option) any
- * later version.
- *
- * GNU Zebra is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GNU Zebra; see the file COPYING.  If not, write to the Free
- * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- * 02111-1307, USA.  
- */
-
-#ifndef _ZEBRA_IF_RMAP_H
-#define _ZEBRA_IF_RMAP_H
-
-enum if_rmap_type
-{
-  IF_RMAP_IN,
-  IF_RMAP_OUT,
-  IF_RMAP_MAX
-};
-
-struct if_rmap
-{
-  /* Name of the interface. */
-  char *ifname;
-
-  char *routemap[IF_RMAP_MAX];
-};
-
-void if_rmap_init (void);
-void if_rmap_reset (void);
-void if_rmap_hook_add (void (*) (struct if_rmap *));
-void if_rmap_hook_delete (void (*) (struct if_rmap *));
-struct if_rmap *if_rmap_lookup (char *);
-int config_write_if_rmap (struct vty *);
-
-#endif /* _ZEBRA_IF_RMAP_H */
index d8c34e80617bdee893219a2bb28db187c7b292ee..e7cefaf0fc93ff1a8f4e8d962f4dab7801ce19b5 100644 (file)
 #include "distribute.h"
 #include "plist.h"
 #include "routemap.h"
+#include "if_rmap.h"
 
 #include "ripngd/ripngd.h"
 #include "ripngd/ripng_route.h"
 #include "ripngd/ripng_debug.h"
-#include "ripngd/ripng_ifrmap.h"
 
 #define min(a, b) ((a) < (b) ? (a) : (b))
 
@@ -2520,7 +2520,7 @@ ripng_init ()
   route_map_add_hook (ripng_routemap_update);
   route_map_delete_hook (ripng_routemap_update);
 
-  if_rmap_init ();
+  if_rmap_init (RIPNG_NODE);
   if_rmap_hook_add (ripng_if_rmap_update);
   if_rmap_hook_delete (ripng_if_rmap_update);
 }
index e6e92f1af275374e4263f55ab0ef5b05ef8aebfe..89156f90e354951ce3667aeabcbfaed03001f972 100644 (file)
@@ -16,9 +16,9 @@ sysconf_DATA = vtysh.conf.sample
 EXTRA_DIST = extract.pl vtysh.conf.sample
 
 rebuild4:
-       ./extract.pl ../zebra/*.c ../ripd/*.c ../ospfd/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c ../lib/distribute.c > vtysh_cmd.c
+       ./extract.pl ../zebra/*.c ../ripd/*.c ../ospfd/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c ../lib/distribute.c ../lib/if_rmap.c > vtysh_cmd.c
 
 rebuild:
-       ./extract.pl ../zebra/*.c ../ripd/*.c ../ripngd/*.c ../ospfd/*.c ../ospf6d/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c ../lib/distribute.c > vtysh_cmd.c
+       ./extract.pl ../zebra/*.c ../ripd/*.c ../ripngd/*.c ../ospfd/*.c ../ospf6d/*.c ../bgpd/*.c ../lib/keychain.c ../lib/routemap.c ../lib/filter.c ../lib/plist.c ../lib/distribute.c ../lib/if_rmap.c > vtysh_cmd.c
 
 vtysh_cmd.c: rebuild
index 4a49a6219dfbca2b9e6c105be9bd43a8b695bf8c..ca88cf7bb1dc600fd16fe065621694b24ed1c758 100755 (executable)
@@ -108,6 +108,9 @@ foreach (@ARGV) {
                  $protocol = "VTYSH_RIPD";
               }
            }
+           if ($file =~ /if_rmap.c/) {
+              $protocol = "VTYSH_RIPNGD";
+           }
         } else {
            ($protocol) = ($file =~ /\/([a-z0-9]+)/);
            $protocol = "VTYSH_" . uc $protocol;