[lib] Centralise Zserv route type information, auto-generate redist strings

2006-05-23 Paul Jakma <paul.jakma@sun.com>

	* route_types.txt: New file, table of ZEBRA_ROUTE definitions.
	* route_types.awk: New script, to parse previous and generate
	  (for now) redistribute string defines.
	* Makefile.am: build route_types.h using previous two, ala
	  memtypes.h, include the script and table file in EXTRA_DIST.
	* command.h: pull in route_types.h, add a REDIST_STR define.
diff --git a/lib/Makefile.am b/lib/Makefile.am
index ec7ca00..315e919 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -14,7 +14,7 @@
 	zclient.c sockopt.c smux.c md5.c if_rmap.c keychain.c privs.c \
 	sigevent.c pqueue.c jhash.c memtypes.c workqueue.c
 
-BUILT_SOURCES = memtypes.h
+BUILT_SOURCES = memtypes.h route_types.h
 
 libzebra_la_DEPENDENCIES = @LIB_REGEX@
 
@@ -27,9 +27,12 @@
 	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.h if_rmap.h keychain.h \
 	privs.h sigevent.h pqueue.h jhash.h zassert.h memtypes.h \
-	privs.h sigevent.h pqueue.h jhash.h zassert.h memtypes.h workqueue.h
+	workqueue.h route_types.h
 
-EXTRA_DIST = regex.c regex-gnu.h memtypes.awk
+EXTRA_DIST = regex.c regex-gnu.h memtypes.awk route_types.awk route_types.txt
 
 memtypes.h: $(srcdir)/memtypes.c $(srcdir)/memtypes.awk
-	($(GAWK) -f $(srcdir)/memtypes.awk $(srcdir)/memtypes.c > memtypes.h)
+	($(GAWK) -f $(srcdir)/memtypes.awk $(srcdir)/memtypes.c > $@)
+
+route_types.h: $(srcdir)/route_types.txt $(srcdir)/route_types.awk
+	($(GAWK) -f $(srcdir)/route_types.awk $(srcdir)/route_types.txt > $@)