diff --git a/ripngd/.cvsignore b/ripngd/.cvsignore
new file mode 100644
index 0000000..cd9e083
--- /dev/null
+++ b/ripngd/.cvsignore
@@ -0,0 +1,7 @@
+Makefile
+*.o
+ripngd
+ripngd.conf
+tags
+TAGS
+.deps
diff --git a/ripngd/ChangeLog b/ripngd/ChangeLog
new file mode 100644
index 0000000..07e3d76
--- /dev/null
+++ b/ripngd/ChangeLog
@@ -0,0 +1,216 @@
+2002-07-07  Kunihiro Ishiguro  <kunihiro@ipinfusion.com>
+
+	* zebra-0.93 released.
+
+2001-08-28  NOGUCHI Kay <kay@v6.access.co.jp>
+
+	* ripngd.c (no_ripng_route): route_unlock_node () is not needed.
+
+2001-08-26  NOGUCHI Kay <kay@v6.access.co.jp>
+
+	* ripngd.h (struct ripng_interface): Add passive interface option.
+
+2001-08-19  Kunihiro Ishiguro  <kunihiro@ipinfusion.com>
+
+	* zebra-0.92a released.
+
+2001-08-15  Kunihiro Ishiguro  <kunihiro@ipinfusion.com>
+
+	* zebra-0.92 released.
+
+2001-08-07  Akira Kato <kato@wide.ad.jp>
+
+	* ripngd.c (ripng_timers): "timers basic" argument is fixed.
+
+2001-02-01  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* zebra-0.91 is released.
+
+2001-01-09  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* zebra-0.90 is released.
+
+2001-01-01  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.h (RIPNG_VTYSH_PATH): Change "/tmp/ripngd" to
+	"/tmp/.ripngd".
+
+2000-10-02  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* zebra-0.89 is released.
+
+2000-09-20  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_send_packet): Use CMSG_SPACE instead of sizeof
+	hack.  Revert privious alignment patch.
+
+2000-09-20  URA Hiroshi <ura@hiru.aoba.yokohama.jp>
+
+	* ripngd.c (ripng_send_packet): Fix an alignment bug. Thus ripngd
+	can't send packets.
+
+2000-09-10  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripng_interface.c (ripng_interface_address_delete): Connected
+	address delete treatment added.
+
+2000-08-22  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripng_routemap.c (route_set_metric_compile): When checking '-'
+	character, argv[1] should be argv[0].  Reported by SHIRASAKI
+	Yasuhiro <yasuhiro@ocn.v6.ntt.net>.
+
+2000-08-17  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* zebra-0.88 is released.
+
+2000-06-06  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_route_process): Clear prefix_ipv6 before using
+	it.
+	(ripng_redistribute_delete): Fix bug of missing
+	route_unlock_node() when redistribute route is not found.
+	(ripng_redistribute_delete): Make it sure that timers are off.
+	(ripng_redistribute_delete): Likewise.
+
+2000-01-19  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_route_process): Fix bug of mis-checking of same
+	route.
+	(show_ipv6_ripng): Include ifindex to "show ipv6 ripng" output.
+
+1999-11-12  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_output_process): Use MINMTU when mtu value is
+	not available.
+
+1999-11-05  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_output_process): Calculate max RTE count from
+	interface MTU value.
+
+1999-09-29  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_distribute_update): Fix bug of updating
+	access-list and prefix-list.
+
+1999-09-07  URA Hiroshi <ura@hiru.aoba.yokohama.jp>
+
+	* ripngd.c (ripng_recv_packet): Change CMSG_DATA cast from (u_char
+	*) to (int *).  (u_char *) does not work for NetBSD-currnet on
+	SparcStation 10.
+
+1999-08-15  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_request_process): When request packet comes,
+	check RIPng process is enabled on the interface.
+	(ripng_redistribute_withdraw): Delete routes when `no
+	redistribute' is executed.
+
+1999-08-13  Yasuhiro Ohara  <yasu@sfc.wide.ad.jp>
+
+	* ripng_zebra.c (ripng_redistribute_ospf6_cmd): Add OSPF6
+	redistribute command.
+
+1999-07-21  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (default_information_originate): Add
+	default-information command.
+
+1999-07-19  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_route_process): rip_add_route() and
+	rip_delete_route() are deleted.  Both functions are integrated
+	into ripng_route_process().
+	(ripng_request_process): Proper reply for request message.
+
+	* ripng_routemap.c: New file added.
+
+1999-07-18  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_nexthop_rte): RIPng next hop routine is
+	rewritten.
+	(show_ipv6_ripng): Change `show ip ripng' to `show ipv6 ripng'.
+	(ripng_response_process): RIPng incoming packet's hop count check
+	added.
+	(ripng_response_process): Add strict RTE checking.
+
+1999-07-03  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_add_route): Fix metric compare bug.
+
+1999-06-25  itojun@iijlab.net
+
+	* ripngd.c (ripng_distribute_in): "distribute in" filter in ripngd
+	actually work.
+
+1999-05-25  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_zebra): Send each ripng information by separate
+	zebra packet.
+
+1999-05-15  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripng_interface.c (if_add_multicast): Change log to zlog.
+
+1999-05-10  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripng_interface.c (ripng_zebra_get_interface): Add function.
+
+	* ripng_zebra.c (redistribute_ripng): Delete function because
+	redistirbute the routes to the zebra daemon is now default
+	behavior.
+
+1999-05-09  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.conf.sample: Change network to route statement.
+
+1999-03-25  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c: Old non Advanced API version ripng_send_packet and
+	ripng_recv_packet is removed.
+	* ripng_radix.c: File removed.
+
+1998-12-15  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* Now I assume KAME support Advanced API and use sendmsg/recvmsg.
+
+1998-12-13  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripng_interface.c: Delete old ifa (interface address) related
+	functions.
+
+1998-12-10  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripng_debug.[ch]: New file.
+
+	* ripngd.c (ripng_supply): Do not send header only RIPng packet.
+	Change `network' statement to `route' statement.
+	(ripng_request_process): Reply to RIPng REQUEST packet.
+
+1998-12-09  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripngd.c (ripng_config_write): Delete vector v argument.
+	* ripng_zebra.c (zebra_config_write): Likewise.
+	* ripng_interface.c (interface_config_write): Likewise.
+
+1998-12-07  Kunihiro Ishiguro  <kunihiro@zebra.org>
+
+	* ripng_route.h: New file.
+
+	* ripng_interface.c:  Delete #include <linux/in6.h>.
+	ripng_main.c: likewise.
+	ripng_radix.c: likewise.
+	ripng_route.c: likewise.
+	ripng_zebra.c: likewise.
+	ripngd.c: likewise.
+
+1998-12-06  Yasuhiro Ohara <yasu@sfc.wide.ad.jp>
+
+	* ripngd.h (IPV6_ADD_MEMBERSHIP): If IPV6_ADD_MEMBERSHIP is not
+	defined. Define IPV6_ADD_MEMBERSHIP as IPV6_JOIN_GROUP.
+
+1998-09-15  HEO SeonMeyong  <seirios@matrix.iri.co.jp>
+
+	* all Hydrangea define is changed to KAME.
+
diff --git a/ripngd/Makefile.am b/ripngd/Makefile.am
new file mode 100644
index 0000000..2835aa2
--- /dev/null
+++ b/ripngd/Makefile.am
@@ -0,0 +1,37 @@
+## Process this file with automake to produce Makefile.in.
+
+INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
+DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
+INSTALL_SDATA=@INSTALL@ -m 600
+
+noinst_LIBRARIES = libripng.a
+sbin_PROGRAMS = ripngd
+
+libripng_a_SOURCES = \
+	ripng_interface.c ripngd.c ripng_zebra.c ripng_route.c ripng_debug.c \
+	ripng_routemap.c
+
+noinst_HEADERS = \
+	ripng_debug.h ripng_route.h ripngd.h
+
+ripngd_SOURCES = \
+	ripng_main.c $(libripng_a_SOURCES)
+
+ripngd_LDADD = ../lib/libzebra.a
+
+sysconf_DATA = ripngd.conf.sample
+
+EXTRA_DIST = $(sysconf_DATA)
+
+install-sysconfDATA: $(sysconf_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+	@list='$(sysconf_DATA)'; for p in $$list; do \
+	  if test -f $(srcdir)/$$p; then \
+	    echo " $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  else if test -f $$p; then \
+	    echo " $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  fi; fi; \
+	done
diff --git a/ripngd/Makefile.in b/ripngd/Makefile.in
new file mode 100644
index 0000000..61e0df2
--- /dev/null
+++ b/ripngd/Makefile.in
@@ -0,0 +1,487 @@
+# Makefile.in generated by automake 1.7 from Makefile.am.
+# @configure_input@
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGPD = @BGPD@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CURSES = @CURSES@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+IF_METHOD = @IF_METHOD@
+IF_PROC = @IF_PROC@
+
+INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+IPFORWARD = @IPFORWARD@
+KERNEL_METHOD = @KERNEL_METHOD@
+LDFLAGS = @LDFLAGS@
+LIBPAM = @LIBPAM@
+LIBS = @LIBS@
+LIB_IPV6 = @LIB_IPV6@
+LIB_REGEX = @LIB_REGEX@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MULTIPATH_NUM = @MULTIPATH_NUM@
+OBJEXT = @OBJEXT@
+OSPF6D = @OSPF6D@
+OSPFD = @OSPFD@
+OTHER_METHOD = @OTHER_METHOD@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RIPD = @RIPD@
+RIPNGD = @RIPNGD@
+RTREAD_METHOD = @RTREAD_METHOD@
+RT_METHOD = @RT_METHOD@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+VTYSH = @VTYSH@
+ZEBRA = @ZEBRA@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+INSTALL_SDATA = @INSTALL@ -m 600
+
+noinst_LIBRARIES = libripng.a
+sbin_PROGRAMS = ripngd
+
+libripng_a_SOURCES = \
+	ripng_interface.c ripngd.c ripng_zebra.c ripng_route.c ripng_debug.c \
+	ripng_routemap.c
+
+
+noinst_HEADERS = \
+	ripng_debug.h ripng_route.h ripngd.h
+
+
+ripngd_SOURCES = \
+	ripng_main.c $(libripng_a_SOURCES)
+
+
+ripngd_LDADD = ../lib/libzebra.a
+
+sysconf_DATA = ripngd.conf.sample
+
+EXTRA_DIST = $(sysconf_DATA)
+subdir = ripngd
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+
+libripng_a_AR = $(AR) cru
+libripng_a_LIBADD =
+am_libripng_a_OBJECTS = ripng_interface.$(OBJEXT) ripngd.$(OBJEXT) \
+	ripng_zebra.$(OBJEXT) ripng_route.$(OBJEXT) \
+	ripng_debug.$(OBJEXT) ripng_routemap.$(OBJEXT)
+libripng_a_OBJECTS = $(am_libripng_a_OBJECTS)
+sbin_PROGRAMS = ripngd$(EXEEXT)
+PROGRAMS = $(sbin_PROGRAMS)
+
+am__objects_1 = ripng_interface.$(OBJEXT) ripngd.$(OBJEXT) \
+	ripng_zebra.$(OBJEXT) ripng_route.$(OBJEXT) \
+	ripng_debug.$(OBJEXT) ripng_routemap.$(OBJEXT)
+am_ripngd_OBJECTS = ripng_main.$(OBJEXT) $(am__objects_1)
+ripngd_OBJECTS = $(am_ripngd_OBJECTS)
+ripngd_DEPENDENCIES = ../lib/libzebra.a
+ripngd_LDFLAGS =
+
+DEFAULT_INCLUDES =  -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ripng_debug.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/ripng_interface.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/ripng_main.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/ripng_route.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/ripng_routemap.Po \
+@AMDEP_TRUE@	./$(DEPDIR)/ripng_zebra.Po ./$(DEPDIR)/ripngd.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(libripng_a_SOURCES) $(ripngd_SOURCES)
+DATA = $(sysconf_DATA)
+
+HEADERS = $(noinst_HEADERS)
+
+DIST_COMMON = $(noinst_HEADERS) ChangeLog Makefile.am Makefile.in
+SOURCES = $(libripng_a_SOURCES) $(ripngd_SOURCES)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  ripngd/Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+
+clean-noinstLIBRARIES:
+	-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libripng.a: $(libripng_a_OBJECTS) $(libripng_a_DEPENDENCIES) 
+	-rm -f libripng.a
+	$(libripng_a_AR) libripng.a $(libripng_a_OBJECTS) $(libripng_a_LIBADD)
+	$(RANLIB) libripng.a
+sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(sbindir)
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
+	  p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+	  if test -f $$p \
+	  ; then \
+	    f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+	   echo " $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \
+	   $(INSTALL_PROGRAM_ENV) $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f || exit 1; \
+	  else :; fi; \
+	done
+
+uninstall-sbinPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sbin_PROGRAMS)'; for p in $$list; do \
+	  f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+	  echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
+	  rm -f $(DESTDIR)$(sbindir)/$$f; \
+	done
+
+clean-sbinPROGRAMS:
+	-test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
+ripngd$(EXEEXT): $(ripngd_OBJECTS) $(ripngd_DEPENDENCIES) 
+	@rm -f ripngd$(EXEEXT)
+	$(LINK) $(ripngd_LDFLAGS) $(ripngd_OBJECTS) $(ripngd_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT) core *.core
+
+distclean-compile:
+	-rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripng_debug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripng_interface.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripng_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripng_route.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripng_routemap.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripng_zebra.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ripngd.Po@am__quote@
+
+distclean-depend:
+	-rm -rf ./$(DEPDIR)
+
+.c.o:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
+@am__fastdepCC_TRUE@	then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
+
+.c.obj:
+@am__fastdepCC_TRUE@	if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
+@am__fastdepCC_TRUE@	  -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`; \
+@am__fastdepCC_TRUE@	then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
+@am__fastdepCC_TRUE@	else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
+@am__fastdepCC_TRUE@	fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'`
+uninstall-info-am:
+sysconfDATA_INSTALL = $(INSTALL_DATA)
+
+uninstall-sysconfDATA:
+	@$(NORMAL_UNINSTALL)
+	@list='$(sysconf_DATA)'; for p in $$list; do \
+	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+	  echo " rm -f $(DESTDIR)$(sysconfdir)/$$f"; \
+	  rm -f $(DESTDIR)$(sysconfdir)/$$f; \
+	done
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$tags$$unique" \
+	  || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	     $$tags $$unique
+
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(CTAGS_ARGS)$$tags$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$tags $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+	list='$(DISTFILES)'; for file in $$list; do \
+	  case $$file in \
+	    $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+	  esac; \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    dir="/$$dir"; \
+	    $(mkinstalldirs) "$(distdir)$$dir"; \
+	  else \
+	    dir=''; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+	    fi; \
+	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS)
+
+installdirs:
+	$(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(sysconfdir)
+
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  INSTALL_STRIP_FLAG=-s \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-noinstLIBRARIES clean-sbinPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+
+distclean-am: clean-am distclean-compile distclean-depend \
+	distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-sbinPROGRAMS install-sysconfDATA
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-sbinPROGRAMS \
+	uninstall-sysconfDATA
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-noinstLIBRARIES clean-sbinPROGRAMS ctags distclean \
+	distclean-compile distclean-depend distclean-generic \
+	distclean-tags distdir dvi dvi-am info info-am install \
+	install-am install-data install-data-am install-exec \
+	install-exec-am install-info install-info-am install-man \
+	install-sbinPROGRAMS install-strip install-sysconfDATA \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-info-am uninstall-sbinPROGRAMS \
+	uninstall-sysconfDATA
+
+
+install-sysconfDATA: $(sysconf_DATA)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)
+	@list='$(sysconf_DATA)'; for p in $$list; do \
+	  if test -f $(srcdir)/$$p; then \
+	    echo " $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $(srcdir)/$$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  else if test -f $$p; then \
+	    echo " $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p"; \
+	    $(INSTALL_SDATA) $$p $(DESTDIR)$(sysconfdir)/$$p; \
+	  fi; fi; \
+	done
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/ripngd/ripng_debug.c b/ripngd/ripng_debug.c
new file mode 100644
index 0000000..51314bc
--- /dev/null
+++ b/ripngd/ripng_debug.c
@@ -0,0 +1,292 @@
+/*
+ * RIPng debug output routines
+ * Copyright (C) 1998 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 "command.h"
+#include "ripngd/ripng_debug.h"
+
+/* For debug statement. */
+unsigned long ripng_debug_event = 0;
+unsigned long ripng_debug_packet = 0;
+unsigned long ripng_debug_zebra = 0;
+
+DEFUN (show_debugging_ripng,
+       show_debugging_ripng_cmd,
+       "show debugging ripng",
+       SHOW_STR
+       "RIPng configuration\n"
+       "Debugging information\n")
+{
+  vty_out (vty, "Zebra debugging status:%s", VTY_NEWLINE);
+
+  if (IS_RIPNG_DEBUG_EVENT)
+    vty_out (vty, "  RIPng event debugging is on%s", VTY_NEWLINE);
+
+  if (IS_RIPNG_DEBUG_PACKET)
+    {
+      if (IS_RIPNG_DEBUG_SEND && IS_RIPNG_DEBUG_RECV)
+	{
+	  vty_out (vty, "  RIPng packet%s debugging is on%s",
+		   IS_RIPNG_DEBUG_DETAIL ? " detail" : "",
+		   VTY_NEWLINE);
+	}
+      else
+	{
+	  if (IS_RIPNG_DEBUG_SEND)
+	    vty_out (vty, "  RIPng packet send%s debugging is on%s",
+		     IS_RIPNG_DEBUG_DETAIL ? " detail" : "",
+		     VTY_NEWLINE);
+	  else
+	    vty_out (vty, "  RIPng packet receive%s debugging is on%s",
+		     IS_RIPNG_DEBUG_DETAIL ? " detail" : "",
+		     VTY_NEWLINE);
+	}
+    }
+
+  if (IS_RIPNG_DEBUG_ZEBRA)
+    vty_out (vty, "  RIPng zebra debugging is on%s", VTY_NEWLINE);
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (debug_ripng_events,
+       debug_ripng_events_cmd,
+       "debug ripng events",
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng events\n")
+{
+  ripng_debug_event = RIPNG_DEBUG_EVENT;
+  return CMD_WARNING;
+}
+
+DEFUN (debug_ripng_packet,
+       debug_ripng_packet_cmd,
+       "debug ripng packet",
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng packet\n")
+{
+  ripng_debug_packet = RIPNG_DEBUG_PACKET;
+  ripng_debug_packet |= RIPNG_DEBUG_SEND;
+  ripng_debug_packet |= RIPNG_DEBUG_RECV;
+  return CMD_SUCCESS;
+}
+
+DEFUN (debug_ripng_packet_direct,
+       debug_ripng_packet_direct_cmd,
+       "debug ripng packet (recv|send)",
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng packet\n"
+       "Debug option set for receive packet\n"
+       "Debug option set for send packet\n")
+{
+  ripng_debug_packet |= RIPNG_DEBUG_PACKET;
+  if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
+    ripng_debug_packet |= RIPNG_DEBUG_SEND;
+  if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
+    ripng_debug_packet |= RIPNG_DEBUG_RECV;
+  ripng_debug_packet &= ~RIPNG_DEBUG_DETAIL;
+  return CMD_SUCCESS;
+}
+
+DEFUN (debug_ripng_packet_detail,
+       debug_ripng_packet_detail_cmd,
+       "debug ripng packet (recv|send) detail",
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng packet\n"
+       "Debug option set for receive packet\n"
+       "Debug option set for send packet\n"
+       "Debug option set detaied information\n")
+{
+  ripng_debug_packet |= RIPNG_DEBUG_PACKET;
+  if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
+    ripng_debug_packet |= RIPNG_DEBUG_SEND;
+  if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
+    ripng_debug_packet |= RIPNG_DEBUG_RECV;
+  ripng_debug_packet |= RIPNG_DEBUG_DETAIL;
+  return CMD_SUCCESS;
+}
+
+DEFUN (debug_ripng_zebra,
+       debug_ripng_zebra_cmd,
+       "debug ripng zebra",
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng and zebra communication\n")
+{
+  ripng_debug_zebra = RIPNG_DEBUG_ZEBRA;
+  return CMD_WARNING;
+}
+
+DEFUN (no_debug_ripng_events,
+       no_debug_ripng_events_cmd,
+       "no debug ripng events",
+       NO_STR
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng events\n")
+{
+  ripng_debug_event = 0;
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_ripng_packet,
+       no_debug_ripng_packet_cmd,
+       "no debug ripng packet",
+       NO_STR
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng packet\n")
+{
+  ripng_debug_packet = 0;
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_ripng_packet_direct,
+       no_debug_ripng_packet_direct_cmd,
+       "no debug ripng packet (recv|send)",
+       NO_STR
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng packet\n"
+       "Debug option set for receive packet\n"
+       "Debug option set for send packet\n")
+{
+  if (strncmp ("send", argv[0], strlen (argv[0])) == 0)
+    {
+      if (IS_RIPNG_DEBUG_RECV)
+       ripng_debug_packet &= ~RIPNG_DEBUG_SEND;
+      else
+       ripng_debug_packet = 0;
+    }
+  else if (strncmp ("recv", argv[0], strlen (argv[0])) == 0)
+    {
+      if (IS_RIPNG_DEBUG_SEND)
+       ripng_debug_packet &= ~RIPNG_DEBUG_RECV;
+      else
+       ripng_debug_packet = 0;
+    }
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_debug_ripng_zebra,
+       no_debug_ripng_zebra_cmd,
+       "no debug ripng zebra",
+       NO_STR
+       DEBUG_STR
+       "RIPng configuration\n"
+       "Debug option set for ripng and zebra communication\n")
+{
+  ripng_debug_zebra = 0;
+  return CMD_WARNING;
+}
+
+/* Debug node. */
+struct cmd_node debug_node =
+{
+  DEBUG_NODE,
+  ""				/* Debug node has no interface. */
+};
+
+int
+config_write_debug (struct vty *vty)
+{
+  int write = 0;
+
+  if (IS_RIPNG_DEBUG_EVENT)
+    {
+      vty_out (vty, "debug ripng events%s", VTY_NEWLINE);
+      write++;
+    }
+  if (IS_RIPNG_DEBUG_PACKET)
+    {
+      if (IS_RIPNG_DEBUG_SEND && IS_RIPNG_DEBUG_RECV)
+	{
+	  vty_out (vty, "debug ripng packet%s%s",
+		   IS_RIPNG_DEBUG_DETAIL ? " detail" : "",
+		   VTY_NEWLINE);
+	  write++;
+	}
+      else
+	{
+	  if (IS_RIPNG_DEBUG_SEND)
+	    vty_out (vty, "debug ripng packet send%s%s",
+		     IS_RIPNG_DEBUG_DETAIL ? " detail" : "",
+		     VTY_NEWLINE);
+	  else
+	    vty_out (vty, "debug ripng packet recv%s%s",
+		     IS_RIPNG_DEBUG_DETAIL ? " detail" : "",
+		     VTY_NEWLINE);
+	  write++;
+	}
+    }
+  if (IS_RIPNG_DEBUG_ZEBRA)
+    {
+      vty_out (vty, "debug ripng zebra%s", VTY_NEWLINE);
+      write++;
+    }
+  return write;
+}
+
+void
+ripng_debug_reset ()
+{
+  ripng_debug_event = 0;
+  ripng_debug_packet = 0;
+  ripng_debug_zebra = 0;
+}
+
+void
+ripng_debug_init ()
+{
+  ripng_debug_event = 0;
+  ripng_debug_packet = 0;
+  ripng_debug_zebra = 0;
+
+  install_node (&debug_node, config_write_debug);
+
+  install_element (VIEW_NODE, &show_debugging_ripng_cmd);
+
+  install_element (ENABLE_NODE, &show_debugging_ripng_cmd);
+  install_element (ENABLE_NODE, &debug_ripng_events_cmd);
+  install_element (ENABLE_NODE, &debug_ripng_packet_cmd);
+  install_element (ENABLE_NODE, &debug_ripng_packet_direct_cmd);
+  install_element (ENABLE_NODE, &debug_ripng_packet_detail_cmd);
+  install_element (ENABLE_NODE, &debug_ripng_zebra_cmd);
+  install_element (ENABLE_NODE, &no_debug_ripng_events_cmd);
+  install_element (ENABLE_NODE, &no_debug_ripng_packet_cmd);
+  install_element (ENABLE_NODE, &no_debug_ripng_packet_direct_cmd);
+  install_element (ENABLE_NODE, &no_debug_ripng_zebra_cmd);
+
+  install_element (CONFIG_NODE, &debug_ripng_events_cmd);
+  install_element (CONFIG_NODE, &debug_ripng_packet_cmd);
+  install_element (CONFIG_NODE, &debug_ripng_packet_direct_cmd);
+  install_element (CONFIG_NODE, &debug_ripng_packet_detail_cmd);
+  install_element (CONFIG_NODE, &debug_ripng_zebra_cmd);
+  install_element (CONFIG_NODE, &no_debug_ripng_events_cmd);
+  install_element (CONFIG_NODE, &no_debug_ripng_packet_cmd);
+  install_element (CONFIG_NODE, &no_debug_ripng_packet_direct_cmd);
+  install_element (CONFIG_NODE, &no_debug_ripng_zebra_cmd);
+}
diff --git a/ripngd/ripng_debug.h b/ripngd/ripng_debug.h
new file mode 100644
index 0000000..6713a15
--- /dev/null
+++ b/ripngd/ripng_debug.h
@@ -0,0 +1,52 @@
+/*
+ * RIPng debug output routines
+ * Copyright (C) 1998, 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_RIPNG_DEBUG_H
+#define _ZEBRA_RIPNG_DEBUG_H
+
+/* Debug flags. */
+#define RIPNG_DEBUG_EVENT   0x01
+
+#define RIPNG_DEBUG_PACKET  0x01
+#define RIPNG_DEBUG_SEND    0x20
+#define RIPNG_DEBUG_RECV    0x40
+#define RIPNG_DEBUG_DETAIL  0x80
+
+#define RIPNG_DEBUG_ZEBRA   0x01
+
+/* Debug related macro. */
+#define IS_RIPNG_DEBUG_EVENT  (ripng_debug_event & RIPNG_DEBUG_EVENT)
+
+#define IS_RIPNG_DEBUG_PACKET (ripng_debug_packet & RIPNG_DEBUG_PACKET)
+#define IS_RIPNG_DEBUG_SEND   (ripng_debug_packet & RIPNG_DEBUG_SEND)
+#define IS_RIPNG_DEBUG_RECV   (ripng_debug_packet & RIPNG_DEBUG_RECV)
+#define IS_RIPNG_DEBUG_DETAIL (ripng_debug_packet & RIPNG_DEBUG_DETAIL)
+
+#define IS_RIPNG_DEBUG_ZEBRA  (ripng_debug_zebra & RIPNG_DEBUG_ZEBRA)
+
+extern unsigned long ripng_debug_event;
+extern unsigned long ripng_debug_packet;
+extern unsigned long ripng_debug_zebra;
+
+void ripng_debug_init ();
+
+#endif /* _ZEBRA_RIPNG_DEBUG_H */
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c
new file mode 100644
index 0000000..c177381
--- /dev/null
+++ b/ripngd/ripng_interface.c
@@ -0,0 +1,835 @@
+/*
+ * Interface related function for RIPng.
+ * Copyright (C) 1998 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 "linklist.h"
+#include "if.h"
+#include "prefix.h"
+#include "memory.h"
+#include "network.h"
+#include "filter.h"
+#include "log.h"
+#include "stream.h"
+#include "zclient.h"
+#include "command.h"
+#include "table.h"
+#include "thread.h"
+
+#include "ripngd/ripngd.h"
+#include "ripngd/ripng_debug.h"
+
+/* If RFC2133 definition is used. */
+#ifndef IPV6_JOIN_GROUP
+#define IPV6_JOIN_GROUP  IPV6_ADD_MEMBERSHIP 
+#endif
+#ifndef IPV6_LEAVE_GROUP
+#define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP 
+#endif
+
+/* Static utility function. */
+static void ripng_enable_apply (struct interface *);
+static void ripng_passive_interface_apply (struct interface *);
+
+/* Join to the all rip routers multicast group. */
+int
+ripng_multicast_join (struct interface *ifp)
+{
+  int ret;
+  struct ipv6_mreq mreq;
+
+  memset (&mreq, 0, sizeof (mreq));
+  inet_pton(AF_INET6, RIPNG_GROUP, &mreq.ipv6mr_multiaddr);
+  mreq.ipv6mr_interface = ifp->ifindex;
+
+  ret = setsockopt (ripng->sock, IPPROTO_IPV6, IPV6_JOIN_GROUP,
+		    (char *) &mreq, sizeof (mreq));
+  if (ret < 0)
+    zlog_warn ("can't setsockopt IPV6_JOIN_GROUP: %s", strerror (errno));
+
+  if (IS_RIPNG_DEBUG_EVENT)
+    zlog_info ("RIPng %s join to all-rip-routers multicast group", ifp->name);
+
+  return ret;
+}
+
+/* Leave from the all rip routers multicast group. */
+int
+ripng_multicast_leave (struct interface *ifp)
+{
+  int ret;
+  struct ipv6_mreq mreq;
+
+  memset (&mreq, 0, sizeof (mreq));
+  inet_pton(AF_INET6, RIPNG_GROUP, &mreq.ipv6mr_multiaddr);
+  mreq.ipv6mr_interface = ifp->ifindex;
+
+  ret = setsockopt (ripng->sock, IPPROTO_IPV6, IPV6_LEAVE_GROUP,
+		    (char *) &mreq, sizeof (mreq));
+  if (ret < 0)
+    zlog_warn ("can't setsockopt IPV6_LEAVE_GROUP: %s\n", strerror (errno));
+
+  if (IS_RIPNG_DEBUG_EVENT)
+    zlog_info ("RIPng %s leave from all-rip-routers multicast group",
+	       ifp->name);
+
+  return ret;
+}
+
+/* Check max mtu size. */
+int
+ripng_check_max_mtu ()
+{
+  listnode node;
+  struct interface *ifp;
+  int mtu;
+
+  mtu = 0;
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      if (mtu < ifp->mtu)
+	mtu = ifp->mtu;
+    }
+  return mtu;
+}
+
+int
+ripng_if_down (struct interface *ifp)
+{
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+  struct ripng_interface *ri;
+
+  if (ripng->table)
+    {
+      for (rp = route_top (ripng->table); rp; rp = route_next (rp))
+	if ((rinfo = rp->info) != NULL)
+	  {
+	    /* Routes got through this interface. */
+	    if (rinfo->ifindex == ifp->ifindex
+		&& rinfo->type == ZEBRA_ROUTE_RIPNG
+		&& rinfo->sub_type == RIPNG_ROUTE_RTE)
+	      {
+		ripng_zebra_ipv6_delete ((struct prefix_ipv6 *) &rp->p,
+					 &rinfo->nexthop,
+					 rinfo->ifindex);
+
+		RIPNG_TIMER_OFF (rinfo->t_timeout);
+		RIPNG_TIMER_OFF (rinfo->t_garbage_collect);
+	      
+		rp->info = NULL;
+		route_unlock_node (rp);
+	      
+		ripng_info_free (rinfo);
+	      }
+	    else
+	      {
+		/* All redistributed routes got through this interface. */
+		if (rinfo->ifindex == ifp->ifindex)
+		  ripng_redistribute_delete (rinfo->type, rinfo->sub_type,
+					     (struct prefix_ipv6 *) &rp->p,
+					     rinfo->ifindex);
+	      }
+	  }
+    }
+
+  ri = ifp->info;
+  
+  if (ripng && ri->running)
+   {
+     if (IS_RIPNG_DEBUG_EVENT)
+       zlog_info ("turn off %s", ifp->name);
+
+     /* Leave from multicast group. */
+     ripng_multicast_leave (ifp);
+
+     ri->running = 0;
+   }
+
+  return 0;
+}
+
+/* Inteface link up message processing. */
+int
+ripng_interface_up (int command, struct zclient *zclient, zebra_size_t length)
+{
+  struct stream *s;
+  struct interface *ifp;
+
+  /* zebra_interface_state_read() updates interface structure in iflist. */
+  s = zclient->ibuf;
+  ifp = zebra_interface_state_read (s);
+
+  if (ifp == NULL)
+    return 0;
+
+  if (IS_RIPNG_DEBUG_ZEBRA)
+    zlog_info ("interface up %s index %d flags %ld metric %d mtu %d",
+	       ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+
+  /* Check if this interface is RIPng enabled or not. */
+  ripng_enable_apply (ifp);
+
+  /* Check for a passive interface. */
+  ripng_passive_interface_apply (ifp);
+
+  /* Apply distribute list to the all interface. */
+  ripng_distribute_update_interface (ifp);
+
+  return 0;
+}
+
+/* Inteface link down message processing. */
+int
+ripng_interface_down (int command, struct zclient *zclient,
+		      zebra_size_t length)
+{
+  struct stream *s;
+  struct interface *ifp;
+
+  /* zebra_interface_state_read() updates interface structure in iflist. */
+  s = zclient->ibuf;
+  ifp = zebra_interface_state_read (s);
+
+  if (ifp == NULL)
+    return 0;
+
+  ripng_if_down (ifp);
+
+  if (IS_RIPNG_DEBUG_ZEBRA)
+    zlog_info ("interface down %s index %d flags %ld metric %d mtu %d",
+	       ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+
+  return 0;
+}
+
+/* Inteface addition message from zebra. */
+int
+ripng_interface_add (int command, struct zclient *zclient, zebra_size_t length)
+{
+  struct interface *ifp;
+
+  ifp = zebra_interface_add_read (zclient->ibuf);
+
+  if (IS_RIPNG_DEBUG_ZEBRA)
+    zlog_info ("RIPng interface add %s index %d flags %ld metric %d mtu %d",
+	       ifp->name, ifp->ifindex, ifp->flags, ifp->metric, ifp->mtu);
+
+  /* Check is this interface is RIP enabled or not.*/
+  ripng_enable_apply (ifp);
+
+  /* Apply distribute list to the interface. */
+  ripng_distribute_update_interface (ifp);
+
+  /* Check interface routemap. */
+  ripng_if_rmap_update_interface (ifp);
+
+  return 0;
+}
+
+int
+ripng_interface_delete (int command, struct zclient *zclient,
+			zebra_size_t length)
+{
+  return 0;
+}
+
+int
+ripng_interface_address_add (int command, struct zclient *zclient,
+			     zebra_size_t length)
+{
+  struct connected *c;
+  struct prefix *p;
+  char buf[INET6_ADDRSTRLEN];
+
+  c = zebra_interface_address_add_read (zclient->ibuf);
+
+  if (c == NULL)
+    return 0;
+
+  p = c->address;
+
+  if (p->family == AF_INET6)
+    {
+      if (IS_RIPNG_DEBUG_ZEBRA)
+	zlog_info ("RIPng connected address %s/%d add",
+		   inet_ntop (AF_INET6, &p->u.prefix6, buf, INET6_ADDRSTRLEN),
+		   p->prefixlen);
+      
+      /* Check is this interface is RIP enabled or not.*/
+      ripng_enable_apply (c->ifp);
+    }
+
+  return 0;
+}
+
+int
+ripng_interface_address_delete (int command, struct zclient *zclient,
+				zebra_size_t length)
+{
+  struct connected *ifc;
+  struct prefix *p;
+  char buf[INET6_ADDRSTRLEN];
+
+  ifc = zebra_interface_address_delete_read (zclient->ibuf);
+  
+  if (ifc)
+    {
+      p = ifc->address;
+
+      if (p->family == AF_INET6)
+	{
+	  if (IS_RIPNG_DEBUG_ZEBRA)
+	    zlog_info ("RIPng connected address %s/%d delete",
+		       inet_ntop (AF_INET6, &p->u.prefix6, buf,
+				  INET6_ADDRSTRLEN),
+		       p->prefixlen);
+
+	  /* Check is this interface is RIP enabled or not.*/
+	  ripng_enable_apply (ifc->ifp);
+	}
+      connected_free (ifc);
+    }
+
+  return 0;
+}
+
+/* RIPng enable interface vector. */
+vector ripng_enable_if;
+
+/* RIPng enable network table. */
+struct route_table *ripng_enable_network;
+
+/* Lookup RIPng enable network. */
+int
+ripng_enable_network_lookup (struct interface *ifp)
+{
+  listnode listnode;
+  struct connected *connected;
+
+  for (listnode = listhead (ifp->connected); listnode; nextnode (listnode))
+    if ((connected = getdata (listnode)) != NULL)
+      {
+	struct prefix *p; 
+	struct route_node *node;
+
+	p = connected->address;
+
+	if (p->family == AF_INET6)
+	  {
+	    node = route_node_match (ripng_enable_network, p);
+	    if (node)
+	      {
+		route_unlock_node (node);
+		return 1;
+	      }
+	  }
+      }
+  return -1;
+}
+
+/* Add RIPng enable network. */
+int
+ripng_enable_network_add (struct prefix *p)
+{
+  struct route_node *node;
+
+  node = route_node_get (ripng_enable_network, p);
+
+  if (node->info)
+    {
+      route_unlock_node (node);
+      return -1;
+    }
+  else
+    node->info = "enabled";
+
+  return 1;
+}
+
+/* Delete RIPng enable network. */
+int
+ripng_enable_network_delete (struct prefix *p)
+{
+  struct route_node *node;
+
+  node = route_node_lookup (ripng_enable_network, p);
+  if (node)
+    {
+      node->info = NULL;
+
+      /* Unlock info lock. */
+      route_unlock_node (node);
+
+      /* Unlock lookup lock. */
+      route_unlock_node (node);
+
+      return 1;
+    }
+  return -1;
+}
+
+/* Lookup function. */
+int
+ripng_enable_if_lookup (char *ifname)
+{
+  int i;
+  char *str;
+
+  for (i = 0; i < vector_max (ripng_enable_if); i++)
+    if ((str = vector_slot (ripng_enable_if, i)) != NULL)
+      if (strcmp (str, ifname) == 0)
+	return i;
+  return -1;
+}
+
+/* Add interface to ripng_enable_if. */
+int
+ripng_enable_if_add (char *ifname)
+{
+  int ret;
+
+  ret = ripng_enable_if_lookup (ifname);
+  if (ret >= 0)
+    return -1;
+
+  vector_set (ripng_enable_if, strdup (ifname));
+
+  return 1;
+}
+
+/* Delete interface from ripng_enable_if. */
+int
+ripng_enable_if_delete (char *ifname)
+{
+  int index;
+  char *str;
+
+  index = ripng_enable_if_lookup (ifname);
+  if (index < 0)
+    return -1;
+
+  str = vector_slot (ripng_enable_if, index);
+  free (str);
+  vector_unset (ripng_enable_if, index);
+
+  return 1;
+}
+
+/* Wake up interface. */
+int
+ripng_interface_wakeup (struct thread *t)
+{
+  struct interface *ifp;
+  struct ripng_interface *ri;
+
+  /* Get interface. */
+  ifp = THREAD_ARG (t);
+
+  ri = ifp->info;
+  ri->t_wakeup = NULL;
+
+  /* Join to multicast group. */
+  ripng_multicast_join (ifp);
+
+  /* Send RIP request to the interface. */
+  ripng_request (ifp);
+
+  return 0;
+}
+
+/* Check RIPng is enabed on this interface. */
+void
+ripng_enable_apply (struct interface *ifp)
+{
+  int ret;
+  struct ripng_interface *ri = NULL;
+
+  /* Check interface. */
+  if (if_is_loopback (ifp))
+    return;
+
+  if (! if_is_up (ifp))
+    return;
+  
+  ri = ifp->info;
+
+  /* Check network configuration. */
+  ret = ripng_enable_network_lookup (ifp);
+
+  /* If the interface is matched. */
+  if (ret > 0)
+    ri->enable_network = 1;
+  else
+    ri->enable_network = 0;
+
+  /* Check interface name configuration. */
+  ret = ripng_enable_if_lookup (ifp->name);
+  if (ret >= 0)
+    ri->enable_interface = 1;
+  else
+    ri->enable_interface = 0;
+
+  /* Update running status of the interface. */
+  if (ri->enable_network || ri->enable_interface)
+    {
+      if (! ri->running)
+	{
+	  if (IS_RIPNG_DEBUG_EVENT)
+	    zlog_info ("RIPng turn on %s", ifp->name);
+
+	  /* Add interface wake up thread. */
+	  if (! ri->t_wakeup)
+	    ri->t_wakeup = thread_add_timer (master, ripng_interface_wakeup,
+					     ifp, 1);
+#if 0
+	  /* Join to multicast group. */
+	  ripng_multicast_join (ifp);
+
+	  /* Send RIP request to the interface. */
+	  ripng_request (ifp);
+#endif /* 0 */
+
+	  ri->running = 1;
+	}
+    }
+  else
+    {
+      if (ri->running)
+	{
+	  if (IS_RIPNG_DEBUG_EVENT)
+	    zlog_info ("RIPng turn off %s", ifp->name);
+
+	  /* Leave from multicast group. */
+	  ripng_multicast_leave (ifp);
+
+	  ri->running = 0;
+	}
+    }
+}
+
+/* Set distribute list to all interfaces. */
+static void
+ripng_enable_apply_all ()
+{
+  struct interface *ifp;
+  listnode node;
+
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      ripng_enable_apply (ifp);
+    }
+}
+
+/* Vector to store passive-interface name. */
+vector Vripng_passive_interface;
+
+/* Utility function for looking up passive interface settings. */
+int
+ripng_passive_interface_lookup (char *ifname)
+{
+  int i;
+  char *str;
+
+  for (i = 0; i < vector_max (Vripng_passive_interface); i++)
+    if ((str = vector_slot (Vripng_passive_interface, i)) != NULL)
+      if (strcmp (str, ifname) == 0)
+	return i;
+  return -1;
+}
+
+void
+ripng_passive_interface_apply (struct interface *ifp)
+{
+  int ret;
+  struct ripng_interface *ri;
+
+  ri = ifp->info;
+
+  ret = ripng_passive_interface_lookup (ifp->name);
+  if (ret < 0)
+    ri->passive = 0;
+  else
+    ri->passive = 1;
+}
+
+void
+ripng_passive_interface_apply_all (void)
+{
+  struct interface *ifp;
+  listnode node;
+
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      ripng_passive_interface_apply (ifp);
+    }
+}
+
+/* Passive interface. */
+int
+ripng_passive_interface_set (struct vty *vty, char *ifname)
+{
+  if (ripng_passive_interface_lookup (ifname) >= 0)
+    return CMD_WARNING;
+
+  vector_set (Vripng_passive_interface, strdup (ifname));
+
+  ripng_passive_interface_apply_all ();
+
+  return CMD_SUCCESS;
+}
+
+int
+ripng_passive_interface_unset (struct vty *vty, char *ifname)
+{
+  int i;
+  char *str;
+
+  i = ripng_passive_interface_lookup (ifname);
+  if (i < 0)
+    return CMD_WARNING;
+
+  str = vector_slot (Vripng_passive_interface, i);
+  free (str);
+  vector_unset (Vripng_passive_interface, i);
+
+  ripng_passive_interface_apply_all ();
+
+  return CMD_SUCCESS;
+}
+
+/* Free all configured RIP passive-interface settings. */
+void
+ripng_passive_interface_clean (void)
+{
+  int i;
+  char *str;
+
+  for (i = 0; i < vector_max (Vripng_passive_interface); i++)
+    if ((str = vector_slot (Vripng_passive_interface, i)) != NULL)
+      {
+	free (str);
+	vector_slot (Vripng_passive_interface, i) = NULL;
+      }
+  ripng_passive_interface_apply_all ();
+}
+
+/* Write RIPng enable network and interface to the vty. */
+int
+ripng_network_write (struct vty *vty)
+{
+  int i;
+  char *str;
+  char *ifname;
+  struct route_node *node;
+  char buf[BUFSIZ];
+
+  /* Write enable network. */
+  for (node = route_top (ripng_enable_network); node; node = route_next (node))
+    if (node->info)
+      {
+	struct prefix *p = &node->p;
+	vty_out (vty, " network %s/%d%s", 
+		 inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ),
+		 p->prefixlen,
+		 VTY_NEWLINE);
+
+      }
+  
+  /* Write enable interface. */
+  for (i = 0; i < vector_max (ripng_enable_if); i++)
+    if ((str = vector_slot (ripng_enable_if, i)) != NULL)
+      vty_out (vty, " network %s%s", str,
+	       VTY_NEWLINE);
+
+  /* Write passive interface. */
+  for (i = 0; i < vector_max (Vripng_passive_interface); i++)
+    if ((ifname = vector_slot (Vripng_passive_interface, i)) != NULL)
+      vty_out (vty, " passive-interface %s%s", ifname, VTY_NEWLINE);
+
+  return 0;
+}
+
+/* RIPng enable on specified interface or matched network. */
+DEFUN (ripng_network,
+       ripng_network_cmd,
+       "network IF_OR_ADDR",
+       "RIPng enable on specified interface or network.\n"
+       "Interface or address")
+{
+  int ret;
+  struct prefix p;
+
+  ret = str2prefix (argv[0], &p);
+
+  /* Given string is IPv6 network or interface name. */
+  if (ret)
+    ret = ripng_enable_network_add (&p);
+  else
+    ret = ripng_enable_if_add (argv[0]);
+
+  if (ret < 0)
+    {
+      vty_out (vty, "There is same network configuration %s%s", argv[0],
+	       VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  ripng_enable_apply_all ();
+
+  return CMD_SUCCESS;
+}
+
+/* RIPng enable on specified interface or matched network. */
+DEFUN (no_ripng_network,
+       no_ripng_network_cmd,
+       "no network IF_OR_ADDR",
+       NO_STR
+       "RIPng enable on specified interface or network.\n"
+       "Interface or address")
+{
+  int ret;
+  struct prefix p;
+
+  ret = str2prefix (argv[0], &p);
+
+  /* Given string is interface name. */
+  if (ret)
+    ret = ripng_enable_network_delete (&p);
+  else
+    ret = ripng_enable_if_delete (argv[0]);
+
+  if (ret < 0)
+    {
+      vty_out (vty, "can't find network %s%s", argv[0],
+	       VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  
+  ripng_enable_apply_all ();
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (ripng_passive_interface,
+       ripng_passive_interface_cmd,
+       "passive-interface IFNAME",
+       "Suppress routing updates on an interface\n"
+       "Interface name\n")
+{
+  return ripng_passive_interface_set (vty, argv[0]);
+}
+
+DEFUN (no_ripng_passive_interface,
+       no_ripng_passive_interface_cmd,
+       "no passive-interface IFNAME",
+       NO_STR
+       "Suppress routing updates on an interface\n"
+       "Interface name\n")
+{
+  return ripng_passive_interface_unset (vty, argv[0]);
+}
+
+struct ripng_interface *
+ri_new ()
+{
+  struct ripng_interface *ri;
+  ri = XCALLOC (MTYPE_IF, sizeof (struct ripng_interface));
+  return ri;
+}
+
+int
+ripng_if_new_hook (struct interface *ifp)
+{
+  ifp->info = ri_new ();
+  return 0;
+}
+
+/* Configuration write function for ripngd. */
+int
+interface_config_write (struct vty *vty)
+{
+  listnode node;
+  struct interface *ifp;
+  struct ripng_interface *ri;
+  int write = 0;
+
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      ri = ifp->info;
+
+      vty_out (vty, "interface %s%s", ifp->name,
+	       VTY_NEWLINE);
+      if (ifp->desc)
+	vty_out (vty, " description %s%s", ifp->desc,
+		 VTY_NEWLINE);
+
+      vty_out (vty, "!%s", VTY_NEWLINE);
+
+      write++;
+    }
+  return write;
+}
+
+/* ripngd's interface node. */
+struct cmd_node interface_node =
+{
+  INTERFACE_NODE,
+  "%s(config-if)# ",
+};
+
+/* Initialization of interface. */
+void
+ripng_if_init ()
+{
+  /* Interface initialize. */
+  iflist = list_new ();
+  if_add_hook (IF_NEW_HOOK, ripng_if_new_hook);
+
+  /* RIPng enable network init. */
+  ripng_enable_network = route_table_init ();
+
+  /* RIPng enable interface init. */
+  ripng_enable_if = vector_init (1);
+
+  /* RIPng passive interface. */
+  Vripng_passive_interface = vector_init (1);
+
+  /* Install interface node. */
+  install_node (&interface_node, interface_config_write);
+
+  install_element (CONFIG_NODE, &interface_cmd);
+  install_element (INTERFACE_NODE, &config_end_cmd);
+  install_element (INTERFACE_NODE, &config_exit_cmd);
+  install_element (INTERFACE_NODE, &config_help_cmd);
+  install_element (INTERFACE_NODE, &interface_desc_cmd);
+  install_element (INTERFACE_NODE, &no_interface_desc_cmd);
+
+  install_element (RIPNG_NODE, &ripng_network_cmd);
+  install_element (RIPNG_NODE, &no_ripng_network_cmd);
+  install_element (RIPNG_NODE, &ripng_passive_interface_cmd);
+  install_element (RIPNG_NODE, &no_ripng_passive_interface_cmd);
+}
diff --git a/ripngd/ripng_main.c b/ripngd/ripng_main.c
new file mode 100644
index 0000000..aec74bb
--- /dev/null
+++ b/ripngd/ripng_main.c
@@ -0,0 +1,252 @@
+/*
+ * RIPngd main routine.
+ * Copyright (C) 1998, 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 "version.h"
+#include "getopt.h"
+#include "vector.h"
+#include "vty.h"
+#include "command.h"
+#include "thread.h"
+#include "log.h"
+#include "prefix.h"
+#include "if.h"
+
+#include "ripngd/ripngd.h"
+
+/* Configuration filename and directory. */
+char config_current[] = RIPNG_DEFAULT_CONFIG;
+char config_default[] = SYSCONFDIR RIPNG_DEFAULT_CONFIG;
+
+/* RIPngd options. */
+struct option longopts[] = 
+{
+  { "daemon",      no_argument,       NULL, 'd'},
+  { "config_file", required_argument, NULL, 'f'},
+  { "pid_file",    required_argument, NULL, 'i'},
+  { "log_mode",    no_argument,       NULL, 'l'},
+  { "help",        no_argument,       NULL, 'h'},
+  { "vty_addr",    required_argument, NULL, 'A'},
+  { "vty_port",    required_argument, NULL, 'P'},
+  { "retain",      no_argument,       NULL, 'r'},
+  { "version",     no_argument,       NULL, 'v'},
+  { 0 }
+};
+
+/* RIPngd program name */
+
+/* Route retain mode flag. */
+int retain_mode = 0;
+
+/* Master of threads. */
+struct thread_master *master;
+
+/* Process ID saved for use by init system */
+char *pid_file = PATH_RIPNGD_PID;
+
+/* Help information display. */
+static void
+usage (char *progname, int status)
+{
+  if (status != 0)
+    fprintf (stderr, "Try `%s --help' for more information.\n", progname);
+  else
+    {    
+      printf ("Usage : %s [OPTION...]\n\
+Daemon which manages RIPng.\n\n\
+-d, --daemon       Runs in daemon mode\n\
+-f, --config_file  Set configuration file name\n\
+-i, --pid_file     Set process identifier file name\n\
+-l. --log_mode     Set verbose log mode flag\n\
+-A, --vty_addr     Set vty's bind address\n\
+-P, --vty_port     Set vty's port number\n\
+-r, --retain       When program terminates, retain added route by ripngd.\n\
+-v, --version      Print program version\n\
+-h, --help         Display this help and exit\n\
+\n\
+Report bugs to %s\n", progname, ZEBRA_BUG_ADDRESS);
+    }
+  exit (status);
+}
+
+/* SIGHUP handler. */
+void 
+sighup (int sig)
+{
+  zlog (NULL, LOG_INFO, "SIGHUP received");
+}
+
+/* SIGINT handler. */
+void
+sigint (int sig)
+{
+  zlog (NULL, LOG_INFO, "Terminating on signal");
+
+  if (! retain_mode)
+    ripng_terminate ();
+
+  exit (0);
+}
+
+/* SIGUSR1 handler. */
+void
+sigusr1 (int sig)
+{
+  zlog_rotate (NULL);
+}
+
+/* Signale wrapper. */
+RETSIGTYPE *
+signal_set (int signo, void (*func)(int))
+{
+  int ret;
+  struct sigaction sig;
+  struct sigaction osig;
+
+  sig.sa_handler = func;
+  sigemptyset (&sig.sa_mask);
+  sig.sa_flags = 0;
+#ifdef SA_RESTART
+  sig.sa_flags |= SA_RESTART;
+#endif /* SA_RESTART */
+
+  ret = sigaction (signo, &sig, &osig);
+
+  if (ret < 0) 
+    return (SIG_ERR);
+  else
+    return (osig.sa_handler);
+}
+
+/* Initialization of signal handles. */
+void
+signal_init ()
+{
+  signal_set (SIGHUP, sighup);
+  signal_set (SIGINT, sigint);
+  signal_set (SIGTERM, sigint);
+  signal_set (SIGPIPE, SIG_IGN);
+  signal_set (SIGUSR1, sigusr1);
+}
+
+/* RIPngd main routine. */
+int
+main (int argc, char **argv)
+{
+  char *p;
+  char *vty_addr = NULL;
+  int vty_port = 0;
+  int daemon_mode = 0;
+  char *config_file = NULL;
+  char *progname;
+  struct thread thread;
+
+  /* Set umask before anything for security */
+  umask (0027);
+
+  /* get program name */
+  progname = ((p = strrchr (argv[0], '/')) ? ++p : argv[0]);
+
+  zlog_default = openzlog(progname, ZLOG_NOLOG, ZLOG_RIPNG,
+			  LOG_CONS|LOG_NDELAY|LOG_PID, LOG_DAEMON);
+
+  while (1) 
+    {
+      int opt;
+
+      opt = getopt_long (argc, argv, "dlf:hA:P:v", longopts, 0);
+    
+      if (opt == EOF)
+	break;
+
+      switch (opt) 
+	{
+	case 0:
+	  break;
+	case 'd':
+	  daemon_mode = 1;
+	  break;
+	case 'l':
+	  /* log_mode = 1; */
+	  break;
+	case 'f':
+	  config_file = optarg;
+	  break;
+	case 'A':
+	  vty_addr = optarg;
+	  break;
+        case 'i':
+          pid_file = optarg;
+          break;
+	case 'P':
+	  vty_port = atoi (optarg);
+	  break;
+	case 'r':
+	  retain_mode = 1;
+	  break;
+	case 'v':
+	  print_version (progname);
+	  exit (0);
+	  break;
+	case 'h':
+	  usage (progname, 0);
+	  break;
+	default:
+	  usage (progname, 1);
+	  break;
+	}
+    }
+
+  master = thread_master_create ();
+
+  /* Library inits. */
+  signal_init ();
+  cmd_init (1);
+  vty_init ();
+
+  /* RIPngd inits. */
+  ripng_init ();
+  zebra_init ();
+  sort_node ();
+
+  /* Get configuration file. */
+  vty_read_config (config_file, config_current, config_default);
+
+  /* Change to the daemon program. */
+  if (daemon_mode)
+    daemon (0, 0);
+
+  /* Create VTY socket */
+  vty_serv_sock (vty_addr,
+		 vty_port ? vty_port : RIPNG_VTY_PORT, RIPNG_VTYSH_PATH);
+
+  /* Process id file create. */
+  pid_output (pid_file);
+
+  /* Fetch next active thread. */
+  while (thread_fetch (master, &thread))
+    thread_call (&thread);
+
+  /* Not reached. */
+  exit (0);
+}
diff --git a/ripngd/ripng_route.c b/ripngd/ripng_route.c
new file mode 100644
index 0000000..27475f0
--- /dev/null
+++ b/ripngd/ripng_route.c
@@ -0,0 +1,157 @@
+/*
+ * RIPng routes function.
+ * Copyright (C) 1998 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 "prefix.h"
+#include "table.h"
+#include "memory.h"
+#include "if.h"
+
+#include "ripngd/ripngd.h"
+#include "ripngd/ripng_route.h"
+
+struct ripng_aggregate *
+ripng_aggregate_new ()
+{
+  struct ripng_aggregate *new;
+
+  new = XCALLOC (MTYPE_RIPNG_AGGREGATE, sizeof (struct ripng_aggregate));
+  return new;
+}
+
+void
+ripng_aggregate_free (struct ripng_aggregate *aggregate)
+{
+  XFREE (MTYPE_RIPNG_AGGREGATE, aggregate);
+}
+
+/* Aggregate count increment check. */
+void
+ripng_aggregate_increment (struct route_node *child, struct ripng_info *rinfo)
+{
+  struct route_node *np;
+  struct ripng_aggregate *aggregate;
+
+  for (np = child; np; np = np->parent)
+    if ((aggregate = np->aggregate) != NULL)
+      {
+	aggregate->count++;
+	rinfo->suppress++;
+      }
+}
+
+/* Aggregate count decrement check. */
+void
+ripng_aggregate_decrement (struct route_node *child, struct ripng_info *rinfo)
+{
+  struct route_node *np;
+  struct ripng_aggregate *aggregate;
+
+  for (np = child; np; np = np->parent)
+    if ((aggregate = np->aggregate) != NULL)
+      {
+	aggregate->count--;
+	rinfo->suppress--;
+      }
+}
+
+/* RIPng routes treatment. */
+int
+ripng_aggregate_add (struct prefix *p)
+{
+  struct route_node *top;
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+  struct ripng_aggregate *aggregate;
+  struct ripng_aggregate *sub;
+
+  /* Get top node for aggregation. */
+  top = route_node_get (ripng->table, p);
+
+  /* Allocate new aggregate. */
+  aggregate = ripng_aggregate_new ();
+  aggregate->metric = 1;
+
+  top->aggregate = aggregate;
+
+  /* Suppress routes match to the aggregate. */
+  for (rp = route_lock_node (top); rp; rp = route_next_until (rp, top))
+    {
+      /* Suppress normal route. */
+      if ((rinfo = rp->info) != NULL)
+	{
+	  aggregate->count++;
+	  rinfo->suppress++;
+	}
+      /* Suppress aggregate route.  This may not need. */
+      if (rp != top && (sub = rp->aggregate) != NULL)
+	{
+	  aggregate->count++;
+	  sub->suppress++;
+	}
+    }
+
+  return 0;
+}
+
+/* Delete RIPng static route. */
+int
+ripng_aggregate_delete (struct prefix *p)
+{
+  struct route_node *top;
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+  struct ripng_aggregate *aggregate;
+  struct ripng_aggregate *sub;
+
+  /* Get top node for aggregation. */
+  top = route_node_get (ripng->table, p);
+
+  /* Allocate new aggregate. */
+  aggregate = top->aggregate;
+
+  /* Suppress routes match to the aggregate. */
+  for (rp = route_lock_node (top); rp; rp = route_next_until (rp, top))
+    {
+      /* Suppress normal route. */
+      if ((rinfo = rp->info) != NULL)
+	{
+	  aggregate->count--;
+	  rinfo->suppress--;
+	}
+
+      if (rp != top && (sub = rp->aggregate) != NULL)
+	{
+	  aggregate->count--;
+	  sub->suppress--;
+	}
+    }
+
+  top->aggregate = NULL;
+  ripng_aggregate_free (aggregate);
+
+  route_unlock_node (top);
+  route_unlock_node (top);
+
+  return 0;
+}
diff --git a/ripngd/ripng_route.h b/ripngd/ripng_route.h
new file mode 100644
index 0000000..283d826
--- /dev/null
+++ b/ripngd/ripng_route.h
@@ -0,0 +1,53 @@
+/*
+ * RIPng daemon
+ * Copyright (C) 1998 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_RIPNG_ROUTE_H
+#define _ZEBRA_RIPNG_ROUTE_H
+
+struct ripng_aggregate
+{
+  /* Aggregate route count. */
+  unsigned int count;
+
+  /* Suppressed route count. */
+  unsigned int suppress;
+
+  /* Metric of this route.  */
+  u_char metric;		
+
+  /* Tag field of RIPng packet.*/
+  u_short tag;		
+};
+
+void
+ripng_aggregate_increment (struct route_node *rp, struct ripng_info *rinfo);
+
+void
+ripng_aggregate_decrement (struct route_node *rp, struct ripng_info *rinfo);
+
+int
+ripng_aggregate_add (struct prefix *p);
+
+int
+ripng_aggregate_delete (struct prefix *p);
+
+#endif /* _ZEBRA_RIPNG_ROUTE_H */
diff --git a/ripngd/ripng_routemap.c b/ripngd/ripng_routemap.c
new file mode 100644
index 0000000..f237e6b
--- /dev/null
+++ b/ripngd/ripng_routemap.c
@@ -0,0 +1,342 @@
+/* RIPng routemap.
+ * 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 "if.h"
+#include "memory.h"
+#include "prefix.h"
+#include "routemap.h"
+#include "command.h"
+
+#include "ripngd/ripngd.h"
+
+#if 0
+/* `match interface IFNAME' */
+route_map_result_t
+route_match_interface (void *rule, struct prefix *prefix,
+		       route_map_object_t type, void *object)
+{
+  struct ripng_info *rinfo;
+  struct interface *ifp;
+  char *ifname;
+
+  if (type == ROUTE_MAP_RIPNG)
+    {
+      ifname = rule;
+      ifp = if_lookup_by_name(ifname);
+
+      if (!ifp)
+	return RM_NOMATCH;
+
+      rinfo = object;
+
+      if (rinfo->ifindex == ifp->ifindex)
+	return RM_MATCH;
+      else
+	return RM_NOMATCH;
+    }
+  return RM_NOMATCH;
+}
+
+void *
+route_match_interface_compile (char *arg)
+{
+  return XSTRDUP (MTYPE_ROUTE_MAP_COMPILED, arg);
+}
+
+void
+route_match_interface_free (void *rule)
+{
+  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
+}
+
+struct route_map_rule_cmd route_match_interface_cmd =
+{
+  "interface",
+  route_match_interface,
+  route_match_interface_compile,
+  route_match_interface_free
+};
+#endif /* 0 */
+
+struct rip_metric_modifier
+{
+  enum 
+  {
+    metric_increment,
+    metric_decrement,
+    metric_absolute
+  } type;
+
+  u_char metric;
+};
+
+route_map_result_t
+route_set_metric (void *rule, struct prefix *prefix, 
+		  route_map_object_t type, void *object)
+{
+  if (type == RMAP_RIPNG)
+    {
+      struct rip_metric_modifier *mod;
+      struct ripng_info *rinfo;
+
+      mod = rule;
+      rinfo = object;
+
+      if (mod->type == metric_increment)
+	rinfo->metric += mod->metric;
+      else if (mod->type == metric_decrement)
+	rinfo->metric -= mod->metric;
+      else if (mod->type == metric_absolute)
+	rinfo->metric = mod->metric;
+
+      if (rinfo->metric < 1)
+	rinfo->metric = 1;
+      if (rinfo->metric > RIPNG_METRIC_INFINITY)
+	rinfo->metric = RIPNG_METRIC_INFINITY;
+
+      rinfo->metric_set = 1;
+    }
+  return RMAP_OKAY;
+}
+
+void *
+route_set_metric_compile (char *arg)
+{
+  int len;
+  char *pnt;
+  int type;
+  long metric;
+  char *endptr = NULL;
+  struct rip_metric_modifier *mod;
+
+  len = strlen (arg);
+  pnt = arg;
+
+  if (len == 0)
+    return NULL;
+
+  /* Examine first character. */
+  if (arg[0] == '+')
+    {
+      type = metric_increment;
+      pnt++;
+    }
+  else if (arg[0] == '-')
+    {
+      type = metric_decrement;
+      pnt++;
+    }
+  else
+    type = metric_absolute;
+
+  /* Check beginning with digit string. */
+  if (*pnt < '0' || *pnt > '9')
+    return NULL;
+
+  /* Convert string to integer. */
+  metric = strtol (pnt, &endptr, 10);
+
+  if (metric == LONG_MAX || *endptr != '\0')
+    return NULL;
+  if (metric < 0 || metric > RIPNG_METRIC_INFINITY)
+    return NULL;
+
+  mod = XMALLOC (MTYPE_ROUTE_MAP_COMPILED, 
+		 sizeof (struct rip_metric_modifier));
+  mod->type = type;
+  mod->metric = metric;
+
+  return mod;
+}
+
+void
+route_set_metric_free (void *rule)
+{
+  XFREE (MTYPE_ROUTE_MAP_COMPILED, rule);
+}
+
+struct route_map_rule_cmd route_set_metric_cmd = 
+{
+  "metric",
+  route_set_metric,
+  route_set_metric_compile,
+  route_set_metric_free,
+};
+
+int
+ripng_route_match_add (struct vty *vty, struct route_map_index *index,
+		       char *command, char *arg)
+{
+  int ret;
+
+  ret = route_map_add_match (index, command, arg);
+  if (ret)
+    {
+      switch (ret)
+	{
+	case RMAP_RULE_MISSING:
+	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	case RMAP_COMPILE_ERROR:
+	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	}
+    }
+  return CMD_SUCCESS;
+}
+
+int
+ripng_route_match_delete (struct vty *vty, struct route_map_index *index,
+			  char *command, char *arg)
+{
+  int ret;
+
+  ret = route_map_delete_match (index, command, arg);
+  if (ret)
+    {
+      switch (ret)
+	{
+	case RMAP_RULE_MISSING:
+	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	case RMAP_COMPILE_ERROR:
+	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	}
+    }
+  return CMD_SUCCESS;
+}
+
+int
+ripng_route_set_add (struct vty *vty, struct route_map_index *index,
+		     char *command, char *arg)
+{
+  int ret;
+
+  ret = route_map_add_set (index, command, arg);
+  if (ret)
+    {
+      switch (ret)
+	{
+	case RMAP_RULE_MISSING:
+	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	case RMAP_COMPILE_ERROR:
+	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	}
+    }
+  return CMD_SUCCESS;
+}
+
+int
+ripng_route_set_delete (struct vty *vty, struct route_map_index *index,
+			char *command, char *arg)
+{
+  int ret;
+
+  ret = route_map_delete_set (index, command, arg);
+  if (ret)
+    {
+      switch (ret)
+	{
+	case RMAP_RULE_MISSING:
+	  vty_out (vty, "Can't find rule.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	case RMAP_COMPILE_ERROR:
+	  vty_out (vty, "Argument is malformed.%s", VTY_NEWLINE);
+	  return CMD_WARNING;
+	  break;
+	}
+    }
+  return CMD_SUCCESS;
+}
+
+#if 0
+DEFUN (match_interface,
+       match_interface_cmd,
+       "match interface WORD",
+       "Match value\n"
+       "Interface\n"
+       "Interface name\n")
+{
+  return ripng_route_match_add (vty, vty->index, "interface", argv[0]);
+}
+
+DEFUN (no_match_interface,
+       no_match_interface_cmd,
+       "no match interface WORD",
+       NO_STR
+       "Match value\n"
+       "Interface\n"
+       "Interface name\n")
+{
+  return ripng_route_match_delete (vty, vty->index, "interface", argv[0]);
+}
+#endif /* 0 */
+
+DEFUN (set_metric,
+       set_metric_cmd,
+       "set metric <0-4294967295>",
+       "Set value\n"
+       "Metric\n"
+       "METRIC value\n")
+{
+  return ripng_route_set_add (vty, vty->index, "metric", argv[0]);
+}
+
+DEFUN (no_set_metric,
+       no_set_metric_cmd,
+       "no set metric <0-4294967295>",
+       NO_STR
+       "Set value\n"
+       "Metric\n"
+       "METRIC value\n")
+{
+  return ripng_route_set_delete (vty, vty->index, "metric", argv[0]);
+}
+
+void
+ripng_route_map_init ()
+{
+  route_map_init ();
+  route_map_init_vty ();
+
+  /* route_map_install_match (&route_match_interface_cmd); */
+  route_map_install_set (&route_set_metric_cmd);
+
+  /*
+  install_element (RMAP_NODE, &match_interface_cmd);
+  install_element (RMAP_NODE, &no_match_interface_cmd);
+  */
+
+  install_element (RMAP_NODE, &set_metric_cmd);
+  install_element (RMAP_NODE, &no_set_metric_cmd);
+}
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
new file mode 100644
index 0000000..4d8a48d
--- /dev/null
+++ b/ripngd/ripng_zebra.c
@@ -0,0 +1,877 @@
+/*
+ * RIPngd and zebra interface.
+ * Copyright (C) 1998, 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 "command.h"
+#include "prefix.h"
+#include "stream.h"
+#include "routemap.h"
+#include "zclient.h"
+#include "log.h"
+
+#include "ripngd/ripngd.h"
+
+/* All information about zebra. */
+struct zclient *zclient = NULL;
+
+/* Callback prototypes for zebra client service. */
+int ripng_interface_up (int, struct zclient *, zebra_size_t);
+int ripng_interface_down (int, struct zclient *, zebra_size_t);
+int ripng_interface_add (int, struct zclient *, zebra_size_t);
+int ripng_interface_delete (int, struct zclient *, zebra_size_t);
+int ripng_interface_address_add (int, struct zclient *, zebra_size_t);
+int ripng_interface_address_delete (int, struct zclient *, zebra_size_t);
+
+void
+ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop,
+		      unsigned int ifindex)
+{
+  struct zapi_ipv6 api;
+
+  if (zclient->redist[ZEBRA_ROUTE_RIPNG])
+    {
+      api.type = ZEBRA_ROUTE_RIPNG;
+      api.flags = 0;
+      api.message = 0;
+      SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
+      api.nexthop_num = 1;
+      api.nexthop = &nexthop;
+      SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
+      api.ifindex_num = 1;
+      api.ifindex = &ifindex;
+
+      zapi_ipv6_add (zclient, p, &api);
+    }
+}
+
+void
+ripng_zebra_ipv6_delete (struct prefix_ipv6 *p, struct in6_addr *nexthop,
+			 unsigned int ifindex)
+{
+  struct zapi_ipv6 api;
+
+  if (zclient->redist[ZEBRA_ROUTE_RIPNG])
+    {
+      api.type = ZEBRA_ROUTE_RIPNG;
+      api.flags = 0;
+      api.message = 0;
+      SET_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP);
+      api.nexthop_num = 1;
+      api.nexthop = &nexthop;
+      SET_FLAG (api.message, ZAPI_MESSAGE_IFINDEX);
+      api.ifindex_num = 1;
+      api.ifindex = &ifindex;
+
+      zapi_ipv6_delete (zclient, p, &api);
+    }
+}
+
+/* Zebra route add and delete treatment. */
+int
+ripng_zebra_read_ipv6 (int command, struct zclient *zclient,
+		       zebra_size_t length)
+{
+  struct stream *s;
+  struct zapi_ipv6 api;
+  unsigned long ifindex;
+  struct in6_addr nexthop;
+  struct prefix_ipv6 p;
+
+  s = zclient->ibuf;
+  ifindex = 0;
+  memset (&nexthop, 0, sizeof (struct in6_addr));
+
+  /* Type, flags, message. */
+  api.type = stream_getc (s);
+  api.flags = stream_getc (s);
+  api.message = stream_getc (s);
+
+  /* IPv6 prefix. */
+  memset (&p, 0, sizeof (struct prefix_ipv6));
+  p.family = AF_INET6;
+  p.prefixlen = stream_getc (s);
+  stream_get (&p.prefix, s, PSIZE (p.prefixlen));
+
+  /* Nexthop, ifindex, distance, metric. */
+  if (CHECK_FLAG (api.message, ZAPI_MESSAGE_NEXTHOP))
+    {
+      api.nexthop_num = stream_getc (s);
+      stream_get (&nexthop, s, 16);
+    }
+  if (CHECK_FLAG (api.message, ZAPI_MESSAGE_IFINDEX))
+    {
+      api.ifindex_num = stream_getc (s);
+      ifindex = stream_getl (s);
+    }
+  if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE))
+    api.distance = stream_getc (s);
+  else
+    api.distance = 0;
+  if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC))
+    api.metric = stream_getl (s);
+  else
+    api.metric = 0;
+
+  if (command == ZEBRA_IPV6_ROUTE_ADD)
+    ripng_redistribute_add (api.type, 0, &p, ifindex);
+  else
+    ripng_redistribute_delete (api.type, 0, &p, ifindex);
+
+  return 0;
+}
+
+int
+ripng_redistribute_unset (int type)
+{
+  if (! zclient->redist[type])
+    return CMD_SUCCESS;
+
+  zclient->redist[type] = 0;
+
+  if (zclient->sock > 0)
+    zebra_redistribute_send (ZEBRA_REDISTRIBUTE_DELETE, zclient->sock, type);
+
+  ripng_redistribute_withdraw (type);
+  
+  return CMD_SUCCESS;
+}
+
+void
+ripng_redistribute_metric_set (int type, int metric)
+{
+  ripng->route_map[type].metric_config = 1;
+  ripng->route_map[type].metric = metric;
+}
+
+void
+ripng_redistribute_metric_unset (int type)
+{
+  ripng->route_map[type].metric_config = 0;
+  ripng->route_map[type].metric = 0;
+}
+
+void
+ripng_redistribute_routemap_set (int type, char *name)
+{
+  if (ripng->route_map[type].name)
+    free (ripng->route_map[type].name);
+
+  ripng->route_map[type].name = strdup (name);
+  ripng->route_map[type].map = route_map_lookup_by_name (name);
+}
+
+void
+ripng_redistribute_routemap_unset (int type)
+{
+  if (ripng->route_map[type].name)
+    free (ripng->route_map[type].name);
+
+  ripng->route_map[type].name = NULL;
+  ripng->route_map[type].map = NULL;
+}
+
+
+DEFUN (router_zebra,
+       router_zebra_cmd,
+       "router zebra",
+       "Enable a routing process\n"
+       "Make connection to zebra daemon\n")
+{
+  vty->node = ZEBRA_NODE;
+  zclient->enable = 1;
+  zclient_start (zclient);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_router_zebra,
+       no_router_zebra_cmd,
+       "no router zebra",
+       NO_STR
+       "Disable a routing process\n"
+       "Stop connection to zebra daemon\n")
+{
+  zclient->enable = 0;
+  zclient_stop (zclient);
+  return CMD_SUCCESS;
+}
+
+DEFUN (ripng_redistribute_ripng,
+       ripng_redistribute_ripng_cmd,
+       "redistribute ripng",
+       "Redistribute information from another routing protocol\n"
+       "RIPng route\n")
+{
+  zclient->redist[ZEBRA_ROUTE_RIPNG] = 1;
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_redistribute_ripng,
+       no_ripng_redistribute_ripng_cmd,
+       "no redistribute ripng",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "RIPng route\n")
+{
+  zclient->redist[ZEBRA_ROUTE_RIPNG] = 0;
+  return CMD_SUCCESS;
+}
+
+DEFUN (ripng_redistribute_static,
+       ripng_redistribute_static_cmd,
+       "redistribute static",
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n")
+{
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_STATIC);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_redistribute_static,
+       no_ripng_redistribute_static_cmd,
+       "no redistribute static",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n")
+{
+  ripng_redistribute_metric_unset (ZEBRA_ROUTE_STATIC);
+  ripng_redistribute_routemap_unset (ZEBRA_ROUTE_STATIC);
+  return ripng_redistribute_unset (ZEBRA_ROUTE_STATIC);
+}
+
+DEFUN (ripng_redistribute_kernel,
+       ripng_redistribute_kernel_cmd,
+       "redistribute kernel",
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n")
+{
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_KERNEL);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_redistribute_kernel,
+       no_ripng_redistribute_kernel_cmd,
+       "no redistribute kernel",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n")
+{
+  ripng_redistribute_metric_unset (ZEBRA_ROUTE_KERNEL);
+  ripng_redistribute_routemap_unset (ZEBRA_ROUTE_KERNEL);
+  return ripng_redistribute_unset (ZEBRA_ROUTE_KERNEL);
+}
+
+DEFUN (ripng_redistribute_connected,
+       ripng_redistribute_connected_cmd,
+       "redistribute connected",
+       "Redistribute information from another routing protocol\n"
+       "Connected\n")
+{
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_CONNECT);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_redistribute_connected,
+       no_ripng_redistribute_connected_cmd,
+       "no redistribute connected",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Connected\n")
+{
+  ripng_redistribute_metric_unset (ZEBRA_ROUTE_CONNECT);
+  ripng_redistribute_routemap_unset (ZEBRA_ROUTE_CONNECT);
+  return ripng_redistribute_unset (ZEBRA_ROUTE_CONNECT);
+}
+
+DEFUN (ripng_redistribute_bgp,
+       ripng_redistribute_bgp_cmd,
+       "redistribute bgp",
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n")
+{
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_BGP);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_redistribute_bgp,
+       no_ripng_redistribute_bgp_cmd,
+       "no redistribute bgp",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n")
+{
+  ripng_redistribute_metric_unset (ZEBRA_ROUTE_BGP);
+  ripng_redistribute_routemap_unset (ZEBRA_ROUTE_BGP);
+  return ripng_redistribute_unset (ZEBRA_ROUTE_BGP);
+}
+
+DEFUN (ripng_redistribute_ospf6,
+       ripng_redistribute_ospf6_cmd,
+       "redistribute ospf6",
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n")
+{
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_OSPF6);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_redistribute_ospf6,
+       no_ripng_redistribute_ospf6_cmd,
+       "no redistribute ospf6",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n")
+{
+  ripng_redistribute_metric_unset (ZEBRA_ROUTE_OSPF6);
+  ripng_redistribute_routemap_unset (ZEBRA_ROUTE_OSPF6);
+  return ripng_redistribute_unset (ZEBRA_ROUTE_OSPF6);
+}
+
+DEFUN (ripng_redistribute_kernel_metric,
+       ripng_redistribute_kernel_metric_cmd,
+       "redistribute kernel metric <0-16>",
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n"
+       "Metric\n"
+       "Metric value\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_KERNEL, atoi (argv[0]));
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_KERNEL);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_kernel,
+       no_ripng_redistribute_kernel_metric_cmd,
+       "no redistribute kernel metric",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n"
+       "Metric\n")
+
+ALIAS (no_ripng_redistribute_kernel,
+       no_ripng_redistribute_kernel_metric_val_cmd,
+       "no redistribute kernel metric <0-16>",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n"
+       "Metric\n"
+       "Metric value\n")
+
+DEFUN (ripng_redistribute_connected_metric,
+       ripng_redistribute_connected_metric_cmd,
+       "redistribute connected metric <0-16>",
+       "Redistribute information from another routing protocol\n"
+       "Connected\n"
+       "Metric\n"
+       "Metric value\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_CONNECT, atoi (argv[0]));
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_CONNECT);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_connected,
+       no_ripng_redistribute_connected_metric_cmd,
+       "no redistribute connected metric",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Connected\n"
+       "Metric\n")
+
+ALIAS (no_ripng_redistribute_connected,
+       no_ripng_redistribute_connected_metric_val_cmd,
+       "no redistribute connected metric <0-16>",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Connected\n"
+       "Metric\n"
+       "Metric value\n")
+
+DEFUN (ripng_redistribute_static_metric,
+       ripng_redistribute_static_metric_cmd,
+       "redistribute static metric <0-16>",
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n"
+       "Metric\n"
+       "Metric value\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_STATIC, atoi (argv[0]));
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_STATIC);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_static,
+       no_ripng_redistribute_static_metric_cmd,
+       "no redistribute static metric",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n"
+       "Metric\n")
+
+ALIAS (no_ripng_redistribute_static,
+       no_ripng_redistribute_static_metric_val_cmd,
+       "no redistribute static metric <0-16>",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n"
+       "Metric\n"
+       "Metric value\n")
+
+DEFUN (ripng_redistribute_ospf6_metric,
+       ripng_redistribute_ospf6_metric_cmd,
+       "redistribute ospf6 metric <0-16>",
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n"
+       "Metric\n"
+       "Metric value\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_OSPF6, atoi (argv[0]));
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_OSPF6);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_ospf6,
+       no_ripng_redistribute_ospf6_metric_cmd,
+       "no redistribute ospf6 metric",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n"
+       "Metric\n")
+
+ALIAS (no_ripng_redistribute_ospf6,
+       no_ripng_redistribute_ospf6_metric_val_cmd,
+       "no redistribute ospf6 metric <0-16>",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n"
+       "Metric\n"
+       "Metric value\n")
+
+DEFUN (ripng_redistribute_bgp_metric,
+       ripng_redistribute_bgp_metric_cmd,
+       "redistribute bgp metric <0-16>",
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n"
+       "Metric\n"
+       "Metric value\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_BGP, atoi (argv[0]));
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_BGP);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_bgp,
+       no_ripng_redistribute_bgp_metric_cmd,
+       "no redistribute bgp metric",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n"
+       "Metric\n")
+
+ALIAS (no_ripng_redistribute_bgp,
+       no_ripng_redistribute_bgp_metric_val_cmd,
+       "no redistribute bgp metric <0-16>",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n"
+       "Metric\n"
+       "Metric value\n")
+
+DEFUN (ripng_redistribute_kernel_routemap,
+       ripng_redistribute_kernel_routemap_cmd,
+       "redistribute kernel route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_KERNEL, argv[0]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_KERNEL);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_kernel,
+       no_ripng_redistribute_kernel_routemap_cmd,
+       "no redistribute kernel route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_connected_routemap,
+       ripng_redistribute_connected_routemap_cmd,
+       "redistribute connected route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Connected\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_CONNECT, argv[0]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_CONNECT);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_connected,
+       no_ripng_redistribute_connected_routemap_cmd,
+       "no redistribute connected route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Connected\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_static_routemap,
+       ripng_redistribute_static_routemap_cmd,
+       "redistribute static route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_STATIC, argv[0]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_STATIC);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_static,
+       no_ripng_redistribute_static_routemap_cmd,
+       "no redistribute static route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_ospf6_routemap,
+       ripng_redistribute_ospf6_routemap_cmd,
+       "redistribute ospf6 route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_OSPF6, argv[0]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_OSPF6);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_ospf6,
+       no_ripng_redistribute_ospf6_routemap_cmd,
+       "no redistribute ospf6 route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_bgp_routemap,
+       ripng_redistribute_bgp_routemap_cmd,
+       "redistribute bgp route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_BGP, argv[0]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_BGP);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_bgp,
+       no_ripng_redistribute_bgp_routemap_cmd,
+       "no redistribute bgp route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_kernel_metric_routemap,
+       ripng_redistribute_kernel_metric_routemap_cmd,
+       "redistribute kernel metric <0-16> route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_KERNEL, atoi (argv[0]));
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_KERNEL, argv[1]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_KERNEL);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_kernel,
+       no_ripng_redistribute_kernel_metric_routemap_cmd,
+       "no redistribute kernel metric <0-16> route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Kernel routes\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_connected_metric_routemap,
+       ripng_redistribute_connected_metric_routemap_cmd,
+       "redistribute connected metric <0-16> route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Connected\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_CONNECT, atoi (argv[0]));
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_CONNECT, argv[1]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_CONNECT);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_connected,
+       no_ripng_redistribute_connected_metric_routemap_cmd,
+       "no redistribute connected metric <0-16> route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Connected\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_static_metric_routemap,
+       ripng_redistribute_static_metric_routemap_cmd,
+       "redistribute static metric <0-16> route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_STATIC, atoi (argv[0]));
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_STATIC, argv[1]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_STATIC);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_static,
+       no_ripng_redistribute_static_metric_routemap_cmd,
+       "no redistribute static metric <0-16> route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Static routes\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_ospf6_metric_routemap,
+       ripng_redistribute_ospf6_metric_routemap_cmd,
+       "redistribute ospf6 metric <0-16> route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_OSPF6, atoi (argv[0]));
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_OSPF6, argv[1]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_OSPF6);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_ospf6,
+       no_ripng_redistribute_ospf6_metric_routemap_cmd,
+       "no redistribute ospf6 metric <0-16> route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "IPv6 Open Shortest Path First (OSPFv3)\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+DEFUN (ripng_redistribute_bgp_metric_routemap,
+       ripng_redistribute_bgp_metric_routemap_cmd,
+       "redistribute bgp metric <0-16> route-map WORD",
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+{
+  ripng_redistribute_metric_set (ZEBRA_ROUTE_BGP, atoi (argv[0]));
+  ripng_redistribute_routemap_set (ZEBRA_ROUTE_BGP, argv[1]);
+  zclient_redistribute_set (zclient, ZEBRA_ROUTE_BGP);
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_redistribute_bgp,
+       no_ripng_redistribute_bgp_metric_routemap_cmd,
+       "no redistribute bgp metric <0-16> route-map WORD",
+       NO_STR
+       "Redistribute information from another routing protocol\n"
+       "Border Gateway Protocol (BGP)\n"
+       "Metric\n"
+       "Metric value\n"
+       "Route map reference\n"
+       "Pointer to route-map entries\n")
+
+void
+ripng_redistribute_write (struct vty *vty)
+{
+  int i;
+  char *str[] = { "system", "kernel", "connected", "static", "rip",
+		  "ripng", "ospf", "ospf6", "bgp"};
+
+  for (i = 0; i < ZEBRA_ROUTE_MAX; i++)
+    if (i != zclient->redist_default && zclient->redist[i])
+      {
+	if (ripng->route_map[i].metric_config)
+	  {
+	    if (ripng->route_map[i].name)
+	      vty_out (vty, " redistribute %s metric %d route-map %s%s",
+		       str[i], ripng->route_map[i].metric,
+		       ripng->route_map[i].name, VTY_NEWLINE);
+	    else
+	      vty_out (vty, " redistribute %s metric %d%s",
+		       str[i], ripng->route_map[i].metric, VTY_NEWLINE);
+	  }
+	else
+	  {
+	    if (ripng->route_map[i].name)
+	      vty_out (vty, " redistribute %s route-map %s%s",
+		       str[i], ripng->route_map[i].name, VTY_NEWLINE);
+	    else
+	      vty_out (vty, " redistribute %s%s", str[i], VTY_NEWLINE);
+	  }
+      }
+}
+
+/* RIPng configuration write function. */
+int
+zebra_config_write (struct vty *vty)
+{
+  if (! zclient->enable)
+    {
+      vty_out (vty, "no router zebra%s", VTY_NEWLINE);
+      return 1;
+    }
+  else if (! zclient->redist[ZEBRA_ROUTE_RIPNG])
+    {
+      vty_out (vty, "router zebra%s", VTY_NEWLINE);
+      vty_out (vty, " no redistribute ripng%s", VTY_NEWLINE);
+      return 1;
+    }
+  return 0;
+}
+
+/* Zebra node structure. */
+struct cmd_node zebra_node =
+{
+  ZEBRA_NODE,
+  "%s(config-router)# ",
+};
+
+/* Initialize zebra structure and it's commands. */
+void
+zebra_init ()
+{
+  /* Allocate zebra structure. */
+  zclient = zclient_new ();
+  zclient_init (zclient, ZEBRA_ROUTE_RIPNG);
+
+  zclient->interface_up = ripng_interface_up;
+  zclient->interface_down = ripng_interface_down;
+  zclient->interface_add = ripng_interface_add;
+  zclient->interface_delete = ripng_interface_delete;
+  zclient->interface_address_add = ripng_interface_address_add;
+  zclient->interface_address_delete = ripng_interface_address_delete;
+  zclient->ipv6_route_add = ripng_zebra_read_ipv6;
+  zclient->ipv6_route_delete = ripng_zebra_read_ipv6;
+  
+  /* Install zebra node. */
+  install_node (&zebra_node, zebra_config_write);
+
+  /* Install command element for zebra node. */ 
+  install_element (CONFIG_NODE, &router_zebra_cmd);
+  install_element (CONFIG_NODE, &no_router_zebra_cmd);
+  install_default (ZEBRA_NODE);
+  install_element (ZEBRA_NODE, &ripng_redistribute_ripng_cmd);
+  install_element (ZEBRA_NODE, &no_ripng_redistribute_ripng_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_static_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_static_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_kernel_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_kernel_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_connected_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_connected_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_bgp_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_bgp_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_ospf6_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_ospf6_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_kernel_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_kernel_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_kernel_metric_val_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_connected_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_connected_metric_cmd);
+  install_element (RIPNG_NODE,
+		   &no_ripng_redistribute_connected_metric_val_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_static_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_static_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_static_metric_val_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_ospf6_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_ospf6_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_ospf6_metric_val_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_bgp_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_bgp_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_bgp_metric_val_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_kernel_routemap_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_kernel_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_connected_routemap_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_connected_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_static_routemap_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_static_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_ospf6_routemap_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_ospf6_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_bgp_routemap_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_bgp_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_kernel_metric_routemap_cmd);
+  install_element (RIPNG_NODE,
+		   &no_ripng_redistribute_kernel_metric_routemap_cmd);
+  install_element (RIPNG_NODE,
+		   &ripng_redistribute_connected_metric_routemap_cmd);
+  install_element (RIPNG_NODE,
+		   &no_ripng_redistribute_connected_metric_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_static_metric_routemap_cmd);
+  install_element (RIPNG_NODE,
+		   &no_ripng_redistribute_static_metric_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_ospf6_metric_routemap_cmd);
+  install_element (RIPNG_NODE,
+		   &no_ripng_redistribute_ospf6_metric_routemap_cmd);
+  install_element (RIPNG_NODE, &ripng_redistribute_bgp_metric_routemap_cmd);
+  install_element (RIPNG_NODE, &no_ripng_redistribute_bgp_metric_routemap_cmd);
+}
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
new file mode 100644
index 0000000..81f0eca
--- /dev/null
+++ b/ripngd/ripngd.c
@@ -0,0 +1,2526 @@
+/* RIPng daemon
+ * Copyright (C) 1998, 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>
+
+/* For struct udphdr. */
+#include <netinet/udp.h>
+
+#include "prefix.h"
+#include "filter.h"
+#include "log.h"
+#include "thread.h"
+#include "memory.h"
+#include "if.h"
+#include "stream.h"
+#include "table.h"
+#include "command.h"
+#include "sockopt.h"
+#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"
+
+#define min(a, b) ((a) < (b) ? (a) : (b))
+
+/* RIPng structure which includes many parameters related to RIPng
+   protocol. If ripng couldn't active or ripng doesn't configured,
+   ripng->fd must be negative value. */
+struct ripng *ripng = NULL;
+
+enum
+{
+  ripng_all_route,
+  ripng_changed_route,
+  ripng_split_horizon,
+  ripng_no_split_horizon
+};
+
+/* Prototypes. */
+void
+ripng_output_process (struct interface *, struct sockaddr_in6 *, int, int);
+
+int
+ripng_triggered_update (struct thread *);
+
+/* RIPng next hop specification. */
+struct ripng_nexthop
+{
+  enum ripng_nexthop_type
+  {
+    RIPNG_NEXTHOP_UNSPEC,
+    RIPNG_NEXTHOP_ADDRESS
+  } flag;
+  struct in6_addr address;
+};
+
+/* Utility function for making IPv6 address string. */
+const char *
+inet6_ntop (struct in6_addr *p)
+{
+  static char buf[INET6_ADDRSTRLEN];
+
+  inet_ntop (AF_INET6, p, buf, INET6_ADDRSTRLEN);
+
+  return buf;
+}
+
+/* Allocate new ripng information. */
+struct ripng_info *
+ripng_info_new ()
+{
+  struct ripng_info *new;
+
+  new = XCALLOC (MTYPE_RIPNG_ROUTE, sizeof (struct ripng_info));
+  return new;
+}
+
+/* Free ripng information. */
+void
+ripng_info_free (struct ripng_info *rinfo)
+{
+  XFREE (MTYPE_RIPNG_ROUTE, rinfo);
+}
+
+static int
+setsockopt_so_recvbuf (int sock, int size)
+{
+  int ret;
+
+  ret = setsockopt (sock, SOL_SOCKET, SO_RCVBUF, (char *) &size, sizeof (int));
+  if (ret < 0)
+    zlog (NULL, LOG_ERR, "can't setsockopt SO_RCVBUF");
+  return ret;
+}
+
+/* Create ripng socket. */
+int 
+ripng_make_socket (void)
+{
+  int ret;
+  int sock;
+  struct sockaddr_in6 ripaddr;
+
+  sock = socket (AF_INET6, SOCK_DGRAM, 0);
+  if (sock < 0)
+    {
+      zlog (NULL, LOG_ERR, "Can't make ripng socket");
+      return sock;
+    }
+
+  ret = setsockopt_so_recvbuf (sock, 8096);
+  if (ret < 0)
+    return ret;
+  ret = setsockopt_ipv6_pktinfo (sock, 1);
+  if (ret < 0)
+    return ret;
+  ret = setsockopt_ipv6_multicast_hops (sock, 255);
+  if (ret < 0)
+    return ret;
+  ret = setsockopt_ipv6_multicast_loop (sock, 0);
+  if (ret < 0)
+    return ret;
+  ret = setsockopt_ipv6_hoplimit (sock, 1);
+  if (ret < 0)
+    return ret;
+
+  memset (&ripaddr, 0, sizeof (ripaddr));
+  ripaddr.sin6_family = AF_INET6;
+#ifdef SIN6_LEN
+  ripaddr.sin6_len = sizeof (struct sockaddr_in6);
+#endif /* SIN6_LEN */
+  ripaddr.sin6_port = htons (RIPNG_PORT_DEFAULT);
+
+  ret = bind (sock, (struct sockaddr *) &ripaddr, sizeof (ripaddr));
+  if (ret < 0)
+    {
+      zlog (NULL, LOG_ERR, "Can't bind ripng socket: %s.", strerror (errno));
+      return ret;
+    }
+  return sock;
+}
+
+/* Send RIPng packet. */
+int
+ripng_send_packet (caddr_t buf, int bufsize, struct sockaddr_in6 *to, 
+		   struct interface *ifp)
+{
+  int ret;
+  struct msghdr msg;
+  struct iovec iov;
+  struct cmsghdr  *cmsgptr;
+  char adata [256];
+  struct in6_pktinfo *pkt;
+  struct sockaddr_in6 addr;
+
+#ifdef DEBUG
+  if (to)
+    zlog_info ("DEBUG RIPng: send to %s", inet6_ntop (&to->sin6_addr));
+  zlog_info ("DEBUG RIPng: send if %s", ifp->name);
+  zlog_info ("DEBUG RIPng: send packet size %d", bufsize);
+#endif /* DEBUG */
+
+  memset (&addr, 0, sizeof (struct sockaddr_in6));
+  addr.sin6_family = AF_INET6;
+#ifdef SIN6_LEN
+  addr.sin6_len = sizeof (struct sockaddr_in6);
+#endif /* SIN6_LEN */
+  addr.sin6_flowinfo = htonl (RIPNG_PRIORITY_DEFAULT);
+
+  /* When destination is specified. */
+  if (to != NULL)
+    {
+      addr.sin6_addr = to->sin6_addr;
+      addr.sin6_port = to->sin6_port;
+    }
+  else
+    {
+      inet_pton(AF_INET6, RIPNG_GROUP, &addr.sin6_addr);
+      addr.sin6_port = htons (RIPNG_PORT_DEFAULT);
+    }
+
+  msg.msg_name = (void *) &addr;
+  msg.msg_namelen = sizeof (struct sockaddr_in6);
+  msg.msg_iov = &iov;
+  msg.msg_iovlen = 1;
+  msg.msg_control = (void *) adata;
+  msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo));
+
+  iov.iov_base = buf;
+  iov.iov_len = bufsize;
+
+  cmsgptr = (struct cmsghdr *)adata;
+  cmsgptr->cmsg_len = CMSG_LEN(sizeof (struct in6_pktinfo));
+  cmsgptr->cmsg_level = IPPROTO_IPV6;
+  cmsgptr->cmsg_type = IPV6_PKTINFO;
+
+  pkt = (struct in6_pktinfo *) CMSG_DATA (cmsgptr);
+  memset (&pkt->ipi6_addr, 0, sizeof (struct in6_addr));
+  pkt->ipi6_ifindex = ifp->ifindex;
+
+  ret = sendmsg (ripng->sock, &msg, 0);
+
+  if (ret < 0)
+    zlog_warn ("RIPng send fail on %s: %s", ifp->name, strerror (errno));
+
+  return ret;
+}
+
+/* Receive UDP RIPng packet from socket. */
+int
+ripng_recv_packet (int sock, u_char *buf, int bufsize,
+		   struct sockaddr_in6 *from, unsigned int *ifindex, 
+		   int *hoplimit)
+{
+  int ret;
+  struct msghdr msg;
+  struct iovec iov;
+  struct cmsghdr  *cmsgptr;
+  struct in6_addr dst;
+
+  /* Ancillary data.  This store cmsghdr and in6_pktinfo.  But at this
+     point I can't determine size of cmsghdr */
+  char adata[1024];
+
+  /* Fill in message and iovec. */
+  msg.msg_name = (void *) from;
+  msg.msg_namelen = sizeof (struct sockaddr_in6);
+  msg.msg_iov = &iov;
+  msg.msg_iovlen = 1;
+  msg.msg_control = (void *) adata;
+  msg.msg_controllen = sizeof adata;
+  iov.iov_base = buf;
+  iov.iov_len = bufsize;
+
+  /* If recvmsg fail return minus value. */
+  ret = recvmsg (sock, &msg, 0);
+  if (ret < 0)
+    return ret;
+
+  for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL;
+       cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) 
+    {
+      /* I want interface index which this packet comes from. */
+      if (cmsgptr->cmsg_level == IPPROTO_IPV6 &&
+	  cmsgptr->cmsg_type == IPV6_PKTINFO) 
+	{
+	  struct in6_pktinfo *ptr;
+	  
+	  ptr = (struct in6_pktinfo *) CMSG_DATA (cmsgptr);
+	  *ifindex = ptr->ipi6_ifindex;
+	  dst = ptr->ipi6_addr;
+
+	  if (*ifindex == 0)
+	    zlog_warn ("Interface index returned by IPV6_PKTINFO is zero");
+        }
+
+      /* Incoming packet's multicast hop limit. */
+      if (cmsgptr->cmsg_level == IPPROTO_IPV6 &&
+	  cmsgptr->cmsg_type == IPV6_HOPLIMIT)
+	*hoplimit = *((int *) CMSG_DATA (cmsgptr));
+    }
+
+  /* Hoplimit check shold be done when destination address is
+     multicast address. */
+  if (! IN6_IS_ADDR_MULTICAST (&dst))
+    *hoplimit = -1;
+
+  return ret;
+}
+
+/* Dump rip packet */
+void
+ripng_packet_dump (struct ripng_packet *packet, int size, char *sndrcv)
+{
+  caddr_t lim;
+  struct rte *rte;
+  char *command_str;
+
+  /* Set command string. */
+  if (packet->command == RIPNG_REQUEST)
+    command_str = "request";
+  else if (packet->command == RIPNG_RESPONSE)
+    command_str = "response";
+  else
+    command_str = "unknown";
+
+  /* Dump packet header. */
+  zlog_info ("%s %s version %d packet size %d", 
+	     sndrcv, command_str, packet->version, size);
+
+  /* Dump each routing table entry. */
+  rte = packet->rte;
+
+  for (lim = (caddr_t) packet + size; (caddr_t) rte < lim; rte++)
+    {
+      if (rte->metric == RIPNG_METRIC_NEXTHOP)
+	zlog_info ("  nexthop %s/%d", inet6_ntop (&rte->addr), rte->prefixlen);
+      else
+	zlog_info ("  %s/%d metric %d tag %d", 
+		   inet6_ntop (&rte->addr), rte->prefixlen, 
+		   rte->metric, ntohs (rte->tag));
+    }
+}
+
+/* RIPng next hop address RTE (Route Table Entry). */
+void
+ripng_nexthop_rte (struct rte *rte,
+		   struct sockaddr_in6 *from,
+		   struct ripng_nexthop *nexthop)
+{
+  char buf[INET6_BUFSIZ];
+
+  /* Logging before checking RTE. */
+  if (IS_RIPNG_DEBUG_RECV)
+    zlog_info ("RIPng nexthop RTE address %s tag %d prefixlen %d",
+	       inet6_ntop (&rte->addr), ntohs (rte->tag), rte->prefixlen);
+
+  /* RFC2080 2.1.1 Next Hop: 
+   The route tag and prefix length in the next hop RTE must be
+   set to zero on sending and ignored on receiption.  */
+  if (ntohs (rte->tag) != 0)
+    zlog_warn ("RIPng nexthop RTE with non zero tag value %d from %s",
+	       ntohs (rte->tag), inet6_ntop (&from->sin6_addr));
+
+  if (rte->prefixlen != 0)
+    zlog_warn ("RIPng nexthop RTE with non zero prefixlen value %d from %s",
+	       rte->prefixlen, inet6_ntop (&from->sin6_addr));
+
+  /* Specifying a value of 0:0:0:0:0:0:0:0 in the prefix field of a
+   next hop RTE indicates that the next hop address should be the
+   originator of the RIPng advertisement.  An address specified as a
+   next hop must be a link-local address.  */
+  if (IN6_IS_ADDR_UNSPECIFIED (&rte->addr))
+    {
+      nexthop->flag = RIPNG_NEXTHOP_UNSPEC;
+      memset (&nexthop->address, 0, sizeof (struct in6_addr));
+      return;
+    }
+
+  if (IN6_IS_ADDR_LINKLOCAL (&rte->addr))
+    {
+      nexthop->flag = RIPNG_NEXTHOP_ADDRESS;
+      IPV6_ADDR_COPY (&nexthop->address, &rte->addr);
+      return;
+    }
+
+  /* The purpose of the next hop RTE is to eliminate packets being
+   routed through extra hops in the system.  It is particularly useful
+   when RIPng is not being run on all of the routers on a network.
+   Note that next hop RTE is "advisory".  That is, if the provided
+   information is ignored, a possibly sub-optimal, but absolutely
+   valid, route may be taken.  If the received next hop address is not
+   a link-local address, it should be treated as 0:0:0:0:0:0:0:0.  */
+  zlog_warn ("RIPng nexthop RTE with non link-local address %s from %s",
+	     inet6_ntop (&rte->addr),
+	     inet_ntop (AF_INET6, &from->sin6_addr, buf, INET6_BUFSIZ));
+
+  nexthop->flag = RIPNG_NEXTHOP_UNSPEC;
+  memset (&nexthop->address, 0, sizeof (struct in6_addr));
+
+  return;
+}
+
+/* If ifp has same link-local address then return 1. */
+int
+ripng_lladdr_check (struct interface *ifp, struct in6_addr *addr)
+{
+  listnode listnode;
+  struct connected *connected;
+  struct prefix *p;
+
+  for (listnode = listhead (ifp->connected); listnode; nextnode (listnode))
+    if ((connected = getdata (listnode)) != NULL)
+      {
+	p = connected->address;
+
+	if (p->family == AF_INET6 &&
+	    IN6_IS_ADDR_LINKLOCAL (&p->u.prefix6) &&
+	    IN6_ARE_ADDR_EQUAL (&p->u.prefix6, addr))
+	  return 1;
+      }
+  return 0;
+}
+
+/* RIPng route garbage collect timer. */
+int
+ripng_garbage_collect (struct thread *t)
+{
+  struct ripng_info *rinfo;
+  struct route_node *rp;
+
+  rinfo = THREAD_ARG (t);
+  rinfo->t_garbage_collect = NULL;
+
+  /* Off timeout timer. */
+  RIPNG_TIMER_OFF (rinfo->t_timeout);
+  
+  /* Get route_node pointer. */
+  rp = rinfo->rp;
+
+  /* Delete this route from the kernel. */
+  ripng_zebra_ipv6_delete ((struct prefix_ipv6 *)&rp->p, 
+			   &rinfo->nexthop, rinfo->ifindex);
+  rinfo->flags &= ~RIPNG_RTF_FIB;
+
+  /* Aggregate count decrement. */
+  ripng_aggregate_decrement (rp, rinfo);
+
+  /* Unlock route_node. */
+  rp->info = NULL;
+  route_unlock_node (rp);
+
+  /* Free RIPng routing information. */
+  ripng_info_free (rinfo);
+
+  return 0;
+}
+
+/* Timeout RIPng routes. */
+int
+ripng_timeout (struct thread *t)
+{
+  struct ripng_info *rinfo;
+  struct route_node *rp;
+
+  rinfo = THREAD_ARG (t);
+  rinfo->t_timeout = NULL;
+
+  /* Get route_node pointer. */
+  rp = rinfo->rp;
+
+  /* - The garbage-collection timer is set for 120 seconds. */
+  RIPNG_TIMER_ON (rinfo->t_garbage_collect, ripng_garbage_collect, 
+		  ripng->garbage_time);
+
+  /* - The metric for the route is set to 16 (infinity).  This causes
+     the route to be removed from service. */
+  rinfo->metric = RIPNG_METRIC_INFINITY;
+
+  /* - The route change flag is to indicate that this entry has been
+     changed. */
+  rinfo->flags |= RIPNG_RTF_CHANGED;
+
+  /* - The output process is signalled to trigger a response. */
+  ripng_event (RIPNG_TRIGGERED_UPDATE, 0);
+
+  return 0;
+}
+
+void
+ripng_timeout_update (struct ripng_info *rinfo)
+{
+  if (rinfo->metric != RIPNG_METRIC_INFINITY)
+    {
+      RIPNG_TIMER_OFF (rinfo->t_timeout);
+      RIPNG_TIMER_ON (rinfo->t_timeout, ripng_timeout, ripng->timeout_time);
+    }
+}
+
+/* Process RIPng route according to RFC2080. */
+void
+ripng_route_process (struct rte *rte, struct sockaddr_in6 *from,
+		     struct ripng_nexthop *ripng_nexthop,
+		     struct interface *ifp)
+{
+  struct prefix_ipv6 p;
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+  struct ripng_interface *ri;
+  struct in6_addr *nexthop;
+  u_char oldmetric;
+  int same = 0;
+
+  /* Make prefix structure. */
+  memset (&p, 0, sizeof (struct prefix_ipv6));
+  p.family = AF_INET6;
+  /* p.prefix = rte->addr; */
+  IPV6_ADDR_COPY (&p.prefix, &rte->addr);
+  p.prefixlen = rte->prefixlen;
+
+  /* Make sure mask is applied. */
+  /* XXX We have to check the prefix is valid or not before call
+     apply_mask_ipv6. */
+  apply_mask_ipv6 (&p);
+
+  /* Apply input filters. */
+  ri = ifp->info;
+
+  if (ri->list[RIPNG_FILTER_IN])
+    {
+      if (access_list_apply (ri->list[RIPNG_FILTER_IN], &p) == FILTER_DENY)
+	{
+	  if (IS_RIPNG_DEBUG_PACKET)
+	    zlog_info ("RIPng %s/%d is filtered by distribute in",
+		       inet6_ntop (&p.prefix), p.prefixlen);
+	  return;
+	}
+    }
+  if (ri->prefix[RIPNG_FILTER_IN])
+    {
+      if (prefix_list_apply (ri->prefix[RIPNG_FILTER_IN], &p) == PREFIX_DENY)
+	{
+	  if (IS_RIPNG_DEBUG_PACKET)
+	    zlog_info ("RIPng %s/%d is filtered by prefix-list in",
+		       inet6_ntop (&p.prefix), p.prefixlen);
+	  return;
+	}
+    }
+
+  /* Modify entry. */
+  if (ri->routemap[RIPNG_FILTER_IN])
+    {
+      int ret;
+      struct ripng_info newinfo;
+
+      memset (&rinfo, 0, sizeof (struct ripng_info));
+      newinfo.metric = rte->metric;
+
+      ret = route_map_apply (ri->routemap[RIPNG_FILTER_IN], 
+			     (struct prefix *)&p, RMAP_RIPNG, &newinfo);
+
+      if (ret == RMAP_DENYMATCH)
+	{
+	  if (IS_RIPNG_DEBUG_PACKET)
+	    zlog_info ("RIPng %s/%d is filtered by route-map in",
+		       inet6_ntop (&p.prefix), p.prefixlen);
+	  return;
+	}
+
+      rte->metric = newinfo.metric;
+    }
+
+  /* Set nexthop pointer. */
+  if (ripng_nexthop->flag == RIPNG_NEXTHOP_ADDRESS)
+    nexthop = &ripng_nexthop->address;
+  else
+    nexthop = &from->sin6_addr;
+
+  /* Lookup RIPng routing table. */
+  rp = route_node_get (ripng->table, (struct prefix *) &p);
+
+  if (rp->info == NULL)
+    {
+      /* Now, check to see whether there is already an explicit route
+	 for the destination prefix.  If there is no such route, add
+	 this route to the routing table, unless the metric is
+	 infinity (there is no point in adding a route which
+	 unusable). */
+      if (rte->metric != RIPNG_METRIC_INFINITY)
+	{
+	  rinfo = ripng_info_new ();
+	  
+	  /* - Setting the destination prefix and length to those in
+	     the RTE. */
+	  rp->info = rinfo;
+	  rinfo->rp = rp;
+
+	  /* - Setting the metric to the newly calculated metric (as
+	     described above). */
+	  rinfo->metric = rte->metric;
+	  rinfo->tag = ntohs (rte->tag);
+
+	  /* - Set the next hop address to be the address of the router
+	     from which the datagram came or the next hop address
+	     specified by a next hop RTE. */
+	  IPV6_ADDR_COPY (&rinfo->nexthop, nexthop);
+	  IPV6_ADDR_COPY (&rinfo->from, &from->sin6_addr);
+	  rinfo->ifindex = ifp->ifindex;
+
+	  /* - Initialize the timeout for the route.  If the
+	     garbage-collection timer is running for this route, stop it. */
+	  ripng_timeout_update (rinfo);
+
+	  /* - Set the route change flag. */
+	  rinfo->flags |= RIPNG_RTF_CHANGED;
+
+	  /* - Signal the output process to trigger an update (see section
+	     2.5). */
+	  ripng_event (RIPNG_TRIGGERED_UPDATE, 0);
+
+	  /* Finally, route goes into the kernel. */
+	  rinfo->type = ZEBRA_ROUTE_RIPNG;
+	  rinfo->sub_type = RIPNG_ROUTE_RTE;
+
+	  ripng_zebra_ipv6_add (&p, &rinfo->nexthop, rinfo->ifindex);
+	  rinfo->flags |= RIPNG_RTF_FIB;
+
+	  /* Aggregate check. */
+	  ripng_aggregate_increment (rp, rinfo);
+	}
+    }
+  else
+    {
+      rinfo = rp->info;
+	  
+      /* If there is an existing route, compare the next hop address
+	 to the address of the router from which the datagram came.
+	 If this datagram is from the same router as the existing
+	 route, reinitialize the timeout.  */
+      same = (IN6_ARE_ADDR_EQUAL (&rinfo->from, &from->sin6_addr) 
+	      && (rinfo->ifindex == ifp->ifindex));
+
+      if (same)
+	ripng_timeout_update (rinfo);
+
+      /* Next, compare the metrics.  If the datagram is from the same
+	 router as the existing route, and the new metric is different
+	 than the old one; or, if the new metric is lower than the old
+	 one; do the following actions: */
+      if ((same && rinfo->metric != rte->metric) ||
+	  rte->metric < rinfo->metric)
+	{
+	  /* - Adopt the route from the datagram.  That is, put the
+	     new metric in, and adjust the next hop address (if
+	     necessary). */
+	  oldmetric = rinfo->metric;
+	  rinfo->metric = rte->metric;
+	  rinfo->tag = ntohs (rte->tag);
+
+	  if (! IN6_ARE_ADDR_EQUAL (&rinfo->nexthop, nexthop))
+	    {
+	      ripng_zebra_ipv6_delete (&p, &rinfo->nexthop, rinfo->ifindex);
+	      ripng_zebra_ipv6_add (&p, nexthop, ifp->ifindex);
+	      rinfo->flags |= RIPNG_RTF_FIB;
+
+	      IPV6_ADDR_COPY (&rinfo->nexthop, nexthop);
+	    }
+	  IPV6_ADDR_COPY (&rinfo->from, &from->sin6_addr);
+	  rinfo->ifindex = ifp->ifindex;
+
+	  /* - Set the route change flag and signal the output process
+	     to trigger an update. */
+	  rinfo->flags |= RIPNG_RTF_CHANGED;
+	  ripng_event (RIPNG_TRIGGERED_UPDATE, 0);
+
+	  /* - If the new metric is infinity, start the deletion
+	     process (described above); */
+	  if (rinfo->metric == RIPNG_METRIC_INFINITY)
+	    {
+	      /* If the new metric is infinity, the deletion process
+		 begins for the route, which is no longer used for
+		 routing packets.  Note that the deletion process is
+		 started only when the metric is first set to
+		 infinity.  If the metric was already infinity, then a
+		 new deletion process is not started. */
+	      if (oldmetric != RIPNG_METRIC_INFINITY)
+		{
+		  /* - The garbage-collection timer is set for 120 seconds. */
+		  RIPNG_TIMER_ON (rinfo->t_garbage_collect, 
+				  ripng_garbage_collect, ripng->garbage_time);
+		  RIPNG_TIMER_OFF (rinfo->t_timeout);
+
+		  /* - The metric for the route is set to 16
+		     (infinity).  This causes the route to be removed
+		     from service.*/
+		  /* - The route change flag is to indicate that this
+		     entry has been changed. */
+		  /* - The output process is signalled to trigger a
+                     response. */
+		  ;  /* Above processes are already done previously. */
+		}
+	    }
+	  else
+	    {
+	      /* otherwise, re-initialize the timeout. */
+	      ripng_timeout_update (rinfo);
+
+	      /* Should a new route to this network be established
+		 while the garbage-collection timer is running, the
+		 new route will replace the one that is about to be
+		 deleted.  In this case the garbage-collection timer
+		 must be cleared. */
+	      RIPNG_TIMER_OFF (rinfo->t_garbage_collect);
+	    }
+	}
+      /* Unlock tempolary lock of the route. */
+      route_unlock_node (rp);
+    }
+}
+
+/* Add redistributed route to RIPng table. */
+void
+ripng_redistribute_add (int type, int sub_type, struct prefix_ipv6 *p, 
+			unsigned int ifindex)
+{
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+
+  /* Redistribute route  */
+  if (IN6_IS_ADDR_LINKLOCAL (&p->prefix))
+    return;
+  if (IN6_IS_ADDR_LOOPBACK (&p->prefix))
+    return;
+
+  rp = route_node_get (ripng->table, (struct prefix *) p);
+  rinfo = rp->info;
+
+  if (rinfo)
+    {
+      RIPNG_TIMER_OFF (rinfo->t_timeout);
+      RIPNG_TIMER_OFF (rinfo->t_garbage_collect);
+      route_unlock_node (rp);
+    }
+  else
+    {
+      rinfo = ripng_info_new ();
+      ripng_aggregate_increment (rp, rinfo);
+    }
+
+  rinfo->type = type;
+  rinfo->sub_type = sub_type;
+  rinfo->ifindex = ifindex;
+  rinfo->metric = 1;
+  rinfo->flags |= RIPNG_RTF_FIB;
+
+  rinfo->rp = rp;
+  rp->info = rinfo;
+}
+
+/* Delete redistributed route to RIPng table. */
+void
+ripng_redistribute_delete (int type, int sub_type, struct prefix_ipv6 *p, 
+			   unsigned int ifindex)
+{
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+
+  if (IN6_IS_ADDR_LINKLOCAL (&p->prefix))
+    return;
+  if (IN6_IS_ADDR_LOOPBACK (&p->prefix))
+    return;
+
+  rp = route_node_lookup (ripng->table, (struct prefix *) p);
+
+  if (rp)
+    {
+      rinfo = rp->info;
+
+      if (rinfo != NULL
+	  && rinfo->type == type 
+	  && rinfo->sub_type == sub_type 
+	  && rinfo->ifindex == ifindex)
+	{
+	  rp->info = NULL;
+
+	  RIPNG_TIMER_OFF (rinfo->t_timeout);
+	  RIPNG_TIMER_OFF (rinfo->t_garbage_collect);
+	  
+	  ripng_info_free (rinfo);
+
+	  route_unlock_node (rp);
+	}
+
+      /* For unlock route_node_lookup (). */
+      route_unlock_node (rp);
+    }
+}
+
+/* Withdraw redistributed route. */
+void
+ripng_redistribute_withdraw (int type)
+{
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+
+  for (rp = route_top (ripng->table); rp; rp = route_next (rp))
+    if ((rinfo = rp->info) != NULL)
+      {
+	if (rinfo->type == type)
+	  {
+	    rp->info = NULL;
+
+	    RIPNG_TIMER_OFF (rinfo->t_timeout);
+	    RIPNG_TIMER_OFF (rinfo->t_garbage_collect);
+
+	    ripng_info_free (rinfo);
+
+	    route_unlock_node (rp);
+	  }
+      }
+}
+
+/* RIP routing information. */
+void
+ripng_response_process (struct ripng_packet *packet, int size, 
+			struct sockaddr_in6 *from, struct interface *ifp,
+			int hoplimit)
+{
+  caddr_t lim;
+  struct rte *rte;
+  struct ripng_nexthop nexthop;
+
+  /* RFC2080 2.4.2  Response Messages:
+   The Response must be ignored if it is not from the RIPng port.  */
+  if (ntohs (from->sin6_port) != RIPNG_PORT_DEFAULT)
+    {
+      zlog_warn ("RIPng packet comes from non RIPng port %d from %s",
+		 ntohs (from->sin6_port), inet6_ntop (&from->sin6_addr));
+      return;
+    }
+
+  /* The datagram's IPv6 source address should be checked to see
+   whether the datagram is from a valid neighbor; the source of the
+   datagram must be a link-local address.  */
+  if (! IN6_IS_ADDR_LINKLOCAL(&from->sin6_addr))
+   {
+      zlog_warn ("RIPng packet comes from non link local address %s",
+		 inet6_ntop (&from->sin6_addr));
+      return;
+    }
+
+  /* It is also worth checking to see whether the response is from one
+   of the router's own addresses.  Interfaces on broadcast networks
+   may receive copies of their own multicasts immediately.  If a
+   router processes its own output as new input, confusion is likely,
+   and such datagrams must be ignored. */
+  if (ripng_lladdr_check (ifp, &from->sin6_addr))
+    {
+      zlog_warn ("RIPng packet comes from my own link local address %s",
+		 inet6_ntop (&from->sin6_addr));
+      return;
+    }
+
+  /* As an additional check, periodic advertisements must have their
+   hop counts set to 255, and inbound, multicast packets sent from the
+   RIPng port (i.e. periodic advertisement or triggered update
+   packets) must be examined to ensure that the hop count is 255. */
+  if (hoplimit >= 0 && hoplimit != 255)
+    {
+      zlog_warn ("RIPng packet comes with non 255 hop count %d from %s",
+		 hoplimit, inet6_ntop (&from->sin6_addr));
+      return;
+    }
+
+  /* Reset nexthop. */
+  memset (&nexthop, 0, sizeof (struct ripng_nexthop));
+  nexthop.flag = RIPNG_NEXTHOP_UNSPEC;
+
+  /* Set RTE pointer. */
+  rte = packet->rte;
+
+  for (lim = ((caddr_t) packet) + size; (caddr_t) rte < lim; rte++) 
+    {
+      /* First of all, we have to check this RTE is next hop RTE or
+         not.  Next hop RTE is completely different with normal RTE so
+         we need special treatment. */
+      if (rte->metric == RIPNG_METRIC_NEXTHOP)
+	{
+	  ripng_nexthop_rte (rte, from, &nexthop);
+	  continue;
+	}
+
+      /* RTE information validation. */
+
+      /* - is the destination prefix valid (e.g., not a multicast
+         prefix and not a link-local address) A link-local address
+         should never be present in an RTE. */
+      if (IN6_IS_ADDR_MULTICAST (&rte->addr))
+	{
+	  zlog_warn ("Destination prefix is a multicast address %s/%d [%d]",
+		     inet6_ntop (&rte->addr), rte->prefixlen, rte->metric);
+	  continue;
+	}
+      if (IN6_IS_ADDR_LINKLOCAL (&rte->addr))
+	{
+	  zlog_warn ("Destination prefix is a link-local address %s/%d [%d]",
+		     inet6_ntop (&rte->addr), rte->prefixlen, rte->metric);
+	  continue;
+	}
+      if (IN6_IS_ADDR_LOOPBACK (&rte->addr))
+	{
+	  zlog_warn ("Destination prefix is a loopback address %s/%d [%d]",
+		     inet6_ntop (&rte->addr), rte->prefixlen, rte->metric);
+	  continue;
+	}
+
+      /* - is the prefix length valid (i.e., between 0 and 128,
+         inclusive) */
+      if (rte->prefixlen > 128)
+	{
+	  zlog_warn ("Invalid prefix length %s/%d from %s%%%s",
+		     inet6_ntop (&rte->addr), rte->prefixlen,
+		     inet6_ntop (&from->sin6_addr), ifp->name);
+	  continue;
+	}
+
+      /* - is the metric valid (i.e., between 1 and 16, inclusive) */
+      if (! (rte->metric >= 1 && rte->metric <= 16))
+	{
+	  zlog_warn ("Invalid metric %d from %s%%%s", rte->metric,
+		     inet6_ntop (&from->sin6_addr), ifp->name);
+	  continue;
+	}
+
+      /* Metric calculation. */
+      rte->metric += ifp->metric;
+      if (rte->metric > RIPNG_METRIC_INFINITY)
+	rte->metric = RIPNG_METRIC_INFINITY;
+
+      /* Routing table updates. */
+      ripng_route_process (rte, from, &nexthop, ifp);
+    }
+}
+
+/* Response to request message. */
+void
+ripng_request_process (struct ripng_packet *packet,int size, 
+		       struct sockaddr_in6 *from, struct interface *ifp)
+{
+  caddr_t lim;
+  struct rte *rte;
+  struct prefix_ipv6 p;
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+  struct ripng_interface *ri;
+
+  /* Check RIPng process is enabled on this interface. */
+  ri = ifp->info;
+  if (! ri->running)
+    return;
+
+  /* When passive interface is specified, suppress responses */
+  if (ri->passive)
+    return;
+
+  lim = ((caddr_t) packet) + size;
+  rte = packet->rte;
+
+  /* The Request is processed entry by entry.  If there are no
+     entries, no response is given. */
+  if (lim == (caddr_t) rte)
+    return;
+
+  /* There is one special case.  If there is exactly one entry in the
+     request, and it has a destination prefix of zero, a prefix length
+     of zero, and a metric of infinity (i.e., 16), then this is a
+     request to send the entire routing table.  In that case, a call
+     is made to the output process to send the routing table to the
+     requesting address/port. */
+  if (lim == ((caddr_t) (rte + 1)) &&
+      IN6_IS_ADDR_UNSPECIFIED (&rte->addr) &&
+      rte->prefixlen == 0 &&
+      rte->metric == RIPNG_METRIC_INFINITY)
+    {	
+      /* All route with split horizon */
+      ripng_output_process (ifp, from, ripng_all_route, ripng_split_horizon);
+    }
+  else
+    {
+      /* Except for this special case, processing is quite simple.
+	 Examine the list of RTEs in the Request one by one.  For each
+	 entry, look up the destination in the router's routing
+	 database and, if there is a route, put that route's metric in
+	 the metric field of the RTE.  If there is no explicit route
+	 to the specified destination, put infinity in the metric
+	 field.  Once all the entries have been filled in, change the
+	 command from Request to Response and send the datagram back
+	 to the requestor. */
+      memset (&p, 0, sizeof (struct prefix_ipv6));
+      p.family = AF_INET6;
+
+      for (; ((caddr_t) rte) < lim; rte++)
+	{
+	  p.prefix = rte->addr;
+	  p.prefixlen = rte->prefixlen;
+	  apply_mask_ipv6 (&p);
+	  
+	  rp = route_node_lookup (ripng->table, (struct prefix *) &p);
+
+	  if (rp)
+	    {
+	      rinfo = rp->info;
+	      rte->metric = rinfo->metric;
+	      route_unlock_node (rp);
+	    }
+	  else
+	    rte->metric = RIPNG_METRIC_INFINITY;
+	}
+      packet->command = RIPNG_RESPONSE;
+
+      ripng_send_packet ((caddr_t) packet, size, from, ifp);
+    }
+}
+
+/* First entry point of reading RIPng packet. */
+int
+ripng_read (struct thread *thread)
+{
+  int len;
+  int sock;
+  struct sockaddr_in6 from;
+  struct ripng_packet *packet;
+  unsigned int ifindex;
+  struct interface *ifp;
+  int hoplimit = -1;
+
+  /* Check ripng is active and alive. */
+  assert (ripng != NULL);
+  assert (ripng->sock >= 0);
+
+  /* Fetch thread data and set read pointer to empty for event
+     managing.  `sock' sould be same as ripng->sock. */
+  sock = THREAD_FD (thread);
+  ripng->t_read = NULL;
+
+  /* Add myself to the next event. */
+  ripng_event (RIPNG_READ, sock);
+
+  /* Read RIPng packet. */
+  len = ripng_recv_packet (sock, STREAM_DATA (ripng->ibuf), 
+			   STREAM_SIZE (ripng->ibuf), &from, &ifindex,
+			   &hoplimit);
+  if (len < 0) 
+    {
+      zlog_warn ("RIPng recvfrom failed: %s.", strerror (errno));
+      return len;
+    }
+
+  /* Check RTE boundary.  RTE size (Packet length - RIPng header size
+     (4)) must be multiple size of one RTE size (20). */
+  if (((len - 4) % 20) != 0)
+    {
+      zlog_warn ("RIPng invalid packet size %d from %s", len,
+		 inet6_ntop (&from.sin6_addr));
+      return 0;
+    }
+
+  packet = (struct ripng_packet *) STREAM_DATA (ripng->ibuf);
+  ifp = if_lookup_by_index (ifindex);
+
+  /* RIPng packet received. */
+  if (IS_RIPNG_DEBUG_EVENT)
+    zlog_info ("RIPng packet received from %s port %d on %s",
+	       inet6_ntop (&from.sin6_addr), ntohs (from.sin6_port), 
+	       ifp ? ifp->name : "unknown");
+
+  /* Logging before packet checking. */
+  if (IS_RIPNG_DEBUG_RECV)
+    ripng_packet_dump (packet, len, "RECV");
+
+  /* Packet comes from unknown interface. */
+  if (ifp == NULL)
+    {
+      zlog_warn ("RIPng packet comes from unknown interface %d", ifindex);
+      return 0;
+    }
+
+  /* Packet version mismatch checking. */
+  if (packet->version != ripng->version) 
+    {
+      zlog_warn ("RIPng packet version %d doesn't fit to my version %d", 
+		 packet->version, ripng->version);
+      return 0;
+    }
+
+  /* Process RIPng packet. */
+  switch (packet->command)
+    {
+    case RIPNG_REQUEST:
+      ripng_request_process (packet, len, &from, ifp);
+      break;
+    case RIPNG_RESPONSE:
+      ripng_response_process (packet, len, &from, ifp, hoplimit);
+      break;
+    default:
+      zlog_warn ("Invalid RIPng command %d", packet->command);
+      break;
+    }
+  return 0;
+}
+
+/* Walk down the RIPng routing table then clear changed flag. */
+void
+ripng_clear_changed_flag ()
+{
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+
+  for (rp = route_top (ripng->table); rp; rp = route_next (rp))
+    if ((rinfo = rp->info) != NULL)
+      if (rinfo->flags & RIPNG_RTF_CHANGED)
+	rinfo->flags &= ~RIPNG_RTF_CHANGED;
+}
+
+/* Regular update of RIPng route.  Send all routing formation to RIPng
+   enabled interface. */
+int
+ripng_update (struct thread *t)
+{
+  listnode node;
+  struct interface *ifp;
+  struct ripng_interface *ri;
+
+  /* Clear update timer thread. */
+  ripng->t_update = NULL;
+
+  /* Logging update event. */
+  if (IS_RIPNG_DEBUG_EVENT)
+    zlog_info ("RIPng update timer expired!");
+
+  /* Supply routes to each interface. */
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      ri = ifp->info;
+
+      if (if_is_loopback (ifp) || ! if_is_up (ifp))
+	continue;
+
+      if (! ri->running)
+	continue;
+
+      /* When passive interface is specified, suppress announce to the
+         interface. */
+      if (ri->passive)
+	continue;
+
+#if RIPNG_ADVANCED
+      if (ri->ri_send == RIPNG_SEND_OFF)
+	{
+	  if (IS_RIPNG_DEBUG_EVENT)
+	    zlog (NULL, LOG_INFO, 
+		  "[Event] RIPng send to if %d is suppressed by config",
+		 ifp->ifindex);
+	  continue;
+	}
+#endif /* RIPNG_ADVANCED */
+
+      ripng_output_process (ifp, NULL, ripng_all_route, ripng_split_horizon);
+    }
+
+  /* Triggered updates may be suppressed if a regular update is due by
+     the time the triggered update would be sent. */
+  if (ripng->t_triggered_interval)
+    {
+      thread_cancel (ripng->t_triggered_interval);
+      ripng->t_triggered_interval = NULL;
+    }
+  ripng->trigger = 0;
+
+  /* Reset flush event. */
+  ripng_event (RIPNG_UPDATE_EVENT, 0);
+
+  return 0;
+}
+
+/* Triggered update interval timer. */
+int
+ripng_triggered_interval (struct thread *t)
+{
+  ripng->t_triggered_interval = NULL;
+
+  if (ripng->trigger)
+    {
+      ripng->trigger = 0;
+      ripng_triggered_update (t);
+    }
+  return 0;
+}     
+
+/* Execute triggered update. */
+int
+ripng_triggered_update (struct thread *t)
+{
+  listnode node;
+  struct interface *ifp;
+  struct ripng_interface *ri;
+  int interval;
+
+  ripng->t_triggered_update = NULL;
+
+  /* Cancel interval timer. */
+  if (ripng->t_triggered_interval)
+    {
+      thread_cancel (ripng->t_triggered_interval);
+      ripng->t_triggered_interval = NULL;
+    }
+  ripng->trigger = 0;
+
+  /* Logging triggered update. */
+  if (IS_RIPNG_DEBUG_EVENT)
+    zlog_info ("RIPng triggered update!");
+
+  /* Split Horizon processing is done when generating triggered
+     updates as well as normal updates (see section 2.6). */
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      ri = ifp->info;
+
+      if (if_is_loopback (ifp) || ! if_is_up (ifp))
+	continue;
+
+      if (! ri->running)
+	continue;
+
+      /* When passive interface is specified, suppress announce to the
+         interface. */
+      if (ri->passive)
+	continue;
+
+      ripng_output_process (ifp, NULL, ripng_changed_route,
+			    ripng_split_horizon);
+    }
+
+  /* Once all of the triggered updates have been generated, the route
+     change flags should be cleared. */
+  ripng_clear_changed_flag ();
+
+  /* After a triggered update is sent, a timer should be set for a
+     random interval between 1 and 5 seconds.  If other changes that
+     would trigger updates occur before the timer expires, a single
+     update is triggered when the timer expires. */
+  interval = (random () % 5) + 1;
+
+  ripng->t_triggered_interval = 
+    thread_add_timer (master, ripng_triggered_interval, NULL, interval);
+
+  return 0;
+}
+
+/* Write routing table entry to the stream and return next index of
+   the routing table entry in the stream. */
+int
+ripng_write_rte (int num, struct stream *s, struct prefix_ipv6 *p,
+		 u_int16_t tag, u_char metric)
+{
+  /* RIPng packet header. */
+  if (num == 0)
+    {
+      stream_putc (s, RIPNG_RESPONSE);
+      stream_putc (s, RIPNG_V1);
+      stream_putw (s, 0);
+    }
+
+  /* Write routing table entry. */
+  stream_write (s, (caddr_t) &p->prefix, sizeof (struct in6_addr));
+  stream_putw (s, tag);
+  stream_putc (s, p->prefixlen);
+  stream_putc (s, metric);
+
+  return ++num;
+}
+
+/* Send RESPONSE message to specified destination. */
+void
+ripng_output_process (struct interface *ifp, struct sockaddr_in6 *to,
+		      int route_type, int split_horizon)
+{
+  int ret;
+  struct stream *s;
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+  struct ripng_interface *ri;
+  struct ripng_aggregate *aggregate;
+  struct prefix_ipv6 *p;
+  int num;
+  int mtu;
+  int rtemax;
+  u_char metric;
+  u_char metric_set;
+
+  if (IS_RIPNG_DEBUG_EVENT)
+    zlog_info ("RIPng update routes on interface %s", ifp->name);
+
+  /* Output stream get from ripng structre.  XXX this should be
+     interface structure. */
+  s = ripng->obuf;
+
+  /* Reset stream and RTE counter. */
+  stream_reset (s);
+  num = 0;
+
+  mtu = ifp->mtu;
+  if (mtu < 0)
+    mtu = IFMINMTU;
+
+  rtemax = (min (mtu, RIPNG_MAX_PACKET_SIZE) -
+	    IPV6_HDRLEN - 
+	    sizeof (struct udphdr) -
+	    sizeof (struct ripng_packet) +
+	    sizeof (struct rte)) / sizeof (struct rte);
+
+#ifdef DEBUG
+  zlog_info ("DEBUG RIPng: ifmtu is %d", ifp->mtu);
+  zlog_info ("DEBUG RIPng: rtemax is %d", rtemax);
+#endif /* DEBUG */
+  
+  /* Get RIPng interface. */
+  ri = ifp->info;
+  
+  for (rp = route_top (ripng->table); rp; rp = route_next (rp))
+    {
+      if ((rinfo = rp->info) != NULL && rinfo->suppress == 0)
+	{
+	  p = (struct prefix_ipv6 *) &rp->p;
+	  metric = rinfo->metric;
+
+	  /* Changed route only output. */
+	  if (route_type == ripng_changed_route &&
+	      (! (rinfo->flags & RIPNG_RTF_CHANGED)))
+	    continue;
+
+	  /* Split horizon. */
+	  if (split_horizon == ripng_split_horizon &&
+	      rinfo->ifindex == ifp->ifindex)
+	    continue;
+	
+	  /* Apply output filters.*/
+	  if (ri->list[RIPNG_FILTER_OUT])
+	    {
+	      if (access_list_apply (ri->list[RIPNG_FILTER_OUT], 
+				     (struct prefix *) p) == FILTER_DENY)
+		{
+		  if (IS_RIPNG_DEBUG_PACKET)
+		    zlog_info ("RIPng %s/%d is filtered by distribute out",
+			       inet6_ntop (&p->prefix), p->prefixlen);
+		  continue;
+		}
+	    }
+	  if (ri->prefix[RIPNG_FILTER_OUT])
+	    {
+	      if (prefix_list_apply (ri->prefix[RIPNG_FILTER_OUT], 
+				     (struct prefix *) p) == PREFIX_DENY)
+		{
+		  if (IS_RIPNG_DEBUG_PACKET)
+		    zlog_info ("RIPng %s/%d is filtered by prefix-list out",
+			       inet6_ntop (&p->prefix), p->prefixlen);
+		  continue;
+		}
+	    }
+
+	  /* Preparation for route-map. */
+	  metric_set = 0;
+
+	  /* Route-map */
+	  if (ri->routemap[RIPNG_FILTER_OUT])
+	    {
+	      int ret;
+	      struct ripng_info newinfo;
+
+	      memset (&newinfo, 0, sizeof (struct ripng_info));
+	      newinfo.metric = metric;
+
+	      ret = route_map_apply (ri->routemap[RIPNG_FILTER_OUT], 
+				     (struct prefix *) p, RMAP_RIPNG, 
+				     &newinfo);
+
+	      if (ret == RMAP_DENYMATCH)
+		{
+		  if (IS_RIPNG_DEBUG_PACKET)
+		    zlog_info ("RIPng %s/%d is filtered by route-map out",
+			       inet6_ntop (&p->prefix), p->prefixlen);
+		  return;
+		}
+
+	      metric = newinfo.metric;
+	      metric_set = newinfo.metric_set;
+	    }
+
+	  /* When the interface route-map does not set metric */
+	  if (! metric_set)
+	    {
+	      /* and the redistribute route-map is set. */
+	      if (ripng->route_map[rinfo->type].name)
+		{
+		  int ret;
+		  struct ripng_info newinfo;
+
+		  memset (&newinfo, 0, sizeof (struct ripng_info));
+		  newinfo.metric = metric;
+	      
+		  ret = route_map_apply (ripng->route_map[rinfo->type].map,
+					 (struct prefix *) p, RMAP_RIPNG,
+					 &newinfo);
+
+		  if (ret == RMAP_DENYMATCH)
+		    {
+		      if (IS_RIPNG_DEBUG_PACKET)
+			zlog_info ("RIPng %s/%d is filtered by route-map",
+				   inet6_ntop (&p->prefix), p->prefixlen);
+		      continue;
+		    }
+
+		  metric = newinfo.metric;
+		  metric_set = newinfo.metric_set;
+		}
+
+	      /* When the redistribute route-map does not set metric. */
+	      if (! metric_set)
+		{
+		  /* If the redistribute metric is set. */
+		  if (ripng->route_map[rinfo->type].metric_config
+		      && rinfo->metric != RIPNG_METRIC_INFINITY)
+		    {
+		      metric = ripng->route_map[rinfo->type].metric;
+		    }
+		  else
+		    {
+		      /* If the route is not connected or localy generated
+			 one, use default-metric value */
+		      if (rinfo->type != ZEBRA_ROUTE_RIPNG
+			  && rinfo->type != ZEBRA_ROUTE_CONNECT
+			  && rinfo->metric != RIPNG_METRIC_INFINITY)
+			metric = ripng->default_metric;
+		    }
+		}
+	    }
+
+	  /* Write RTE to the stream. */
+	  num = ripng_write_rte (num, s, p, rinfo->tag, metric);
+	  if (num == rtemax)
+	    {
+	      ret = ripng_send_packet (STREAM_DATA (s), stream_get_endp (s),
+				       to, ifp);
+
+	      if (ret >= 0 && IS_RIPNG_DEBUG_SEND)
+		ripng_packet_dump ((struct ripng_packet *)STREAM_DATA (s),
+				   stream_get_endp(s), "SEND");
+	      num = 0;
+	      stream_reset (s);
+	    }
+	}
+      if ((aggregate = rp->aggregate) != NULL && 
+	  aggregate->count > 0 && 
+	  aggregate->suppress == 0)
+	{
+	  p = (struct prefix_ipv6 *) &rp->p;
+	  metric = aggregate->metric;
+
+	  /* Apply output filters.*/
+	  if (ri->list[RIPNG_FILTER_OUT])
+	    {
+	      if (access_list_apply (ri->list[RIPNG_FILTER_OUT], 
+				     (struct prefix *) p) == FILTER_DENY)
+		{
+		  if (IS_RIPNG_DEBUG_PACKET)
+		    zlog_info ("RIPng %s/%d is filtered by distribute out",
+			       inet6_ntop (&p->prefix), p->prefixlen);
+		  continue;
+		}
+	    }
+	  if (ri->prefix[RIPNG_FILTER_OUT])
+	    {
+	      if (prefix_list_apply (ri->prefix[RIPNG_FILTER_OUT], 
+				     (struct prefix *) p) == PREFIX_DENY)
+		{
+		  if (IS_RIPNG_DEBUG_PACKET)
+		    zlog_info ("RIPng %s/%d is filtered by prefix-list out",
+			       inet6_ntop (&p->prefix), p->prefixlen);
+		  continue;
+		}
+	    }
+
+	  /* Route-map */
+	  if (ri->routemap[RIPNG_FILTER_OUT])
+	    {
+	      int ret;
+	      struct ripng_info newinfo;
+
+	      memset (&newinfo, 0, sizeof (struct ripng_info));
+	      newinfo.metric = metric;
+
+	      ret = route_map_apply (ri->routemap[RIPNG_FILTER_OUT], 
+				     (struct prefix *) p, RMAP_RIPNG, 
+				     &newinfo);
+
+	      if (ret == RMAP_DENYMATCH)
+		{
+		  if (IS_RIPNG_DEBUG_PACKET)
+		    zlog_info ("RIPng %s/%d is filtered by route-map out",
+			       inet6_ntop (&p->prefix), p->prefixlen);
+		  return;
+		}
+
+	      metric = newinfo.metric;
+	    }
+
+	  /* Changed route only output. */
+	  if (route_type == ripng_changed_route)
+	    continue;
+
+	  /* Write RTE to the stream. */
+	  num = ripng_write_rte (num, s, p, aggregate->tag, metric);
+	  if (num == rtemax)
+	    {
+	      ret = ripng_send_packet (STREAM_DATA (s), stream_get_endp (s),
+				       to, ifp);
+
+	      if (ret >= 0 && IS_RIPNG_DEBUG_SEND)
+		ripng_packet_dump ((struct ripng_packet *)STREAM_DATA (s),
+				   stream_get_endp(s), "SEND");
+	      num = 0;
+	      stream_reset (s);
+	    }
+	}
+
+    }
+  
+  /* If unwritten RTE exist, flush it. */
+  if (num != 0)
+    {
+      ret = ripng_send_packet (STREAM_DATA (s), stream_get_endp (s),
+			       to, ifp);
+
+      if (ret >= 0 && IS_RIPNG_DEBUG_SEND)
+	ripng_packet_dump ((struct ripng_packet *)STREAM_DATA (s),
+			   stream_get_endp (s), "SEND");
+      num = 0;
+      stream_reset (s);
+    }
+}
+
+/* Create new RIPng instance and set it to global variable. */
+int
+ripng_create ()
+{
+  /* ripng should be NULL. */
+  assert (ripng == NULL);
+
+  /* Allocaste RIPng instance. */
+  ripng = XMALLOC (0, sizeof (struct ripng));
+  memset (ripng, 0, sizeof (struct ripng));
+
+  /* Default version and timer values. */
+  ripng->version = RIPNG_V1;
+  ripng->update_time = RIPNG_UPDATE_TIMER_DEFAULT;
+  ripng->timeout_time = RIPNG_TIMEOUT_TIMER_DEFAULT;
+  ripng->garbage_time = RIPNG_GARBAGE_TIMER_DEFAULT;
+  ripng->default_metric = RIPNG_DEFAULT_METRIC_DEFAULT;
+  
+  /* Make buffer.  */
+  ripng->ibuf = stream_new (RIPNG_MAX_PACKET_SIZE * 5);
+  ripng->obuf = stream_new (RIPNG_MAX_PACKET_SIZE);
+
+  /* Initialize RIPng routig table. */
+  ripng->table = route_table_init ();
+  ripng->route = route_table_init ();
+  ripng->aggregate = route_table_init ();
+ 
+  /* Make socket. */
+  ripng->sock = ripng_make_socket ();
+  if (ripng->sock < 0)
+    return ripng->sock;
+
+  /* Threads. */
+  ripng_event (RIPNG_READ, ripng->sock);
+  ripng_event (RIPNG_UPDATE_EVENT, 1);
+
+  return 0;
+}
+
+/* Sned RIPng request to the interface. */
+int
+ripng_request (struct interface *ifp)
+{
+  struct rte *rte;
+  struct ripng_packet ripng_packet;
+
+  if (IS_RIPNG_DEBUG_EVENT)
+    zlog_info ("RIPng send request to %s", ifp->name);
+
+  memset (&ripng_packet, 0, sizeof (ripng_packet));
+  ripng_packet.command = RIPNG_REQUEST;
+  ripng_packet.version = RIPNG_V1;
+  rte = ripng_packet.rte;
+  rte->metric = RIPNG_METRIC_INFINITY;
+
+  return ripng_send_packet ((caddr_t) &ripng_packet, sizeof (ripng_packet), 
+			    NULL, ifp);
+}
+
+/* Clean up installed RIPng routes. */
+void
+ripng_terminate ()
+{
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+
+  for (rp = route_top (ripng->table); rp; rp = route_next (rp))
+    if ((rinfo = rp->info) != NULL)
+      {
+	if (rinfo->type == ZEBRA_ROUTE_RIPNG &&
+	    rinfo->sub_type == RIPNG_ROUTE_RTE)
+	  ripng_zebra_ipv6_delete ((struct prefix_ipv6 *)&rp->p,
+				   &rinfo->nexthop, rinfo->ifindex);
+      }
+}
+
+int
+ripng_update_jitter (int time)
+{
+  return ((rand () % (time + 1)) - (time / 2));
+}
+
+void
+ripng_event (enum ripng_event event, int sock)
+{
+  int ripng_request_all (struct thread *);
+  int jitter = 0;
+
+  switch (event)
+    {
+    case RIPNG_READ:
+      if (!ripng->t_read)
+	ripng->t_read = thread_add_read (master, ripng_read, NULL, sock);
+      break;
+    case RIPNG_UPDATE_EVENT:
+      if (ripng->t_update)
+	{
+	  thread_cancel (ripng->t_update);
+	  ripng->t_update = NULL;
+	}
+      /* Update timer jitter. */
+      jitter = ripng_update_jitter (ripng->update_time);
+
+      ripng->t_update = 
+	thread_add_timer (master, ripng_update, NULL, 
+			  sock ? 2 : ripng->update_time + jitter);
+      break;
+    case RIPNG_TRIGGERED_UPDATE:
+      if (ripng->t_triggered_interval)
+	ripng->trigger = 1;
+      else if (! ripng->t_triggered_update)
+	ripng->t_triggered_update = 
+	  thread_add_event (master, ripng_triggered_update, NULL, 0);
+      break;
+    default:
+      break;
+    }
+}
+
+/* Each route type's strings and default preference. */
+struct
+{  
+  int key;
+  char *str;
+  char *str_long;
+  int distance;
+} route_info[] =
+{
+  { ZEBRA_ROUTE_SYSTEM,  "X", "system",    10},
+  { ZEBRA_ROUTE_KERNEL,  "K", "kernel",    20},
+  { ZEBRA_ROUTE_CONNECT, "C", "connected", 30},
+  { ZEBRA_ROUTE_STATIC,  "S", "static",    40},
+  { ZEBRA_ROUTE_RIP,     "R", "rip",       50},
+  { ZEBRA_ROUTE_RIPNG,   "R", "ripng",     50},
+  { ZEBRA_ROUTE_OSPF,    "O", "ospf",      60},
+  { ZEBRA_ROUTE_OSPF6,   "O", "ospf6",     60},
+  { ZEBRA_ROUTE_BGP,     "B", "bgp",       70},
+};
+
+/* For messages. */
+struct message ripng_route_info[] =
+{
+  { RIPNG_ROUTE_RTE,       " "},
+  { RIPNG_ROUTE_STATIC,    "S"},
+  { RIPNG_ROUTE_AGGREGATE, "a"}
+};
+
+/* Print out routes update time. */
+static void
+ripng_vty_out_uptime (struct vty *vty, struct ripng_info *rinfo)
+{
+  struct timeval timer_now;
+  time_t clock;
+  struct tm *tm;
+#define TIME_BUF 25
+  char timebuf [TIME_BUF];
+  struct thread *thread;
+  
+  gettimeofday (&timer_now, NULL);
+
+  if ((thread = rinfo->t_timeout) != NULL)
+    {
+      clock = thread->u.sands.tv_sec - timer_now.tv_sec;
+      tm = gmtime (&clock);
+      strftime (timebuf, TIME_BUF, "%M:%S", tm);
+      vty_out (vty, "%5s", timebuf);
+    }
+  else if ((thread = rinfo->t_garbage_collect) != NULL)
+    {
+      clock = thread->u.sands.tv_sec - timer_now.tv_sec;
+      tm = gmtime (&clock);
+      strftime (timebuf, TIME_BUF, "%M:%S", tm);
+      vty_out (vty, "%5s", timebuf);
+    }
+}
+
+DEFUN (show_ipv6_ripng,
+       show_ipv6_ripng_cmd,
+       "show ipv6 ripng",
+       SHOW_STR
+       IP_STR
+       "Show RIPng routes\n")
+{
+  struct route_node *rp;
+  struct ripng_info *rinfo;
+  struct ripng_aggregate *aggregate;
+  struct prefix_ipv6 *p;
+  int len;
+
+  /* Header of display. */ 
+  vty_out (vty, "%sCodes: R - RIPng%s%s"
+	   "   Network                           "
+	   "Next Hop                  If Met Tag Time%s", VTY_NEWLINE,
+	   VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+  
+  for (rp = route_top (ripng->table); rp; rp = route_next (rp))
+    {
+      if ((aggregate = rp->aggregate) != NULL)
+	{
+	  p = (struct prefix_ipv6 *) &rp->p;
+
+#ifdef DEBUG
+	  len = vty_out (vty, "Ra %d/%d %s/%d ",
+			 aggregate->count, aggregate->suppress,
+			 inet6_ntop (&p->prefix), p->prefixlen);
+#else
+	  len = vty_out (vty, "Ra %s/%d ", 
+			 inet6_ntop (&p->prefix), p->prefixlen);
+#endif /* DEBUG */
+
+	  len = 37 - len;
+	  if (len > 0)
+	    vty_out (vty, "%*s", len, " ");
+
+	  vty_out (vty, "%*s", 26, " ");
+	  vty_out (vty, "%4d %3d%s", aggregate->metric,
+		   aggregate->tag,
+		   VTY_NEWLINE);
+	}
+
+      if ((rinfo = rp->info) != NULL)
+	{
+	  p = (struct prefix_ipv6 *) &rp->p;
+
+#ifdef DEBUG
+	  len = vty_out (vty, "%s%s 0/%d %s/%d ",
+			 route_info[rinfo->type].str,
+			 rinfo->suppress ? "s" : " ",
+			 rinfo->suppress,
+			 inet6_ntop (&p->prefix), p->prefixlen);
+#else
+	  len = vty_out (vty, "%s%s %s/%d ",
+			 route_info[rinfo->type].str,
+			 rinfo->suppress ? "s" : " ",
+			 inet6_ntop (&p->prefix), p->prefixlen);
+#endif /* DEBUG */
+	  len = 37 - len;
+	  if (len > 0)
+	    vty_out (vty, "%*s", len, " ");
+
+	  len = vty_out (vty, "%s", inet6_ntop (&rinfo->nexthop));
+
+	  len = 26 - len;
+	  if (len > 0)
+	    vty_out (vty, "%*s", len, " ");
+
+	  vty_out (vty, "%2d %2d %3d ",
+		   rinfo->ifindex, rinfo->metric, rinfo->tag);
+
+	  if (rinfo->sub_type == RIPNG_ROUTE_RTE)
+	    ripng_vty_out_uptime (vty, rinfo);
+
+	  vty_out (vty, "%s", VTY_NEWLINE);
+	}
+    }
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (router_ripng,
+       router_ripng_cmd,
+       "router ripng",
+       "Enable a routing process\n"
+       "Make RIPng instance command\n")
+{
+  int ret;
+
+  vty->node = RIPNG_NODE;
+
+  if (!ripng)
+    {
+      ret = ripng_create ();
+
+      /* Notice to user we couldn't create RIPng. */
+      if (ret < 0)
+	{
+	  zlog_warn ("can't create RIPng");
+	  return CMD_WARNING;
+	}
+    }
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (ripng_route,
+       ripng_route_cmd,
+       "route IPV6ADDR",
+       "Static route setup\n"
+       "Set static RIPng route announcement\n")
+{
+  int ret;
+  struct prefix_ipv6 p;
+  struct route_node *rp;
+
+  ret = str2prefix_ipv6 (argv[0], (struct prefix_ipv6 *)&p);
+  if (ret <= 0)
+    {
+      vty_out (vty, "Malformed address%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  apply_mask_ipv6 (&p);
+
+  rp = route_node_get (ripng->route, (struct prefix *) &p);
+  if (rp->info)
+    {
+      vty_out (vty, "There is already same static route.%s", VTY_NEWLINE);
+      route_unlock_node (rp);
+      return CMD_WARNING;
+    }
+  rp->info = (void *)1;
+
+  ripng_redistribute_add (ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p, 0);
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_route,
+       no_ripng_route_cmd,
+       "no route IPV6ADDR",
+       NO_STR
+       "Static route setup\n"
+       "Delete static RIPng route announcement\n")
+{
+  int ret;
+  struct prefix_ipv6 p;
+  struct route_node *rp;
+
+  ret = str2prefix_ipv6 (argv[0], (struct prefix_ipv6 *)&p);
+  if (ret <= 0)
+    {
+      vty_out (vty, "Malformed address%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  apply_mask_ipv6 (&p);
+
+  rp = route_node_lookup (ripng->route, (struct prefix *) &p);
+  if (! rp)
+    {
+      vty_out (vty, "Can't find static route.%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  ripng_redistribute_delete (ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p, 0);
+  route_unlock_node (rp);
+
+  rp->info = NULL;
+  route_unlock_node (rp);
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (ripng_aggregate_address,
+       ripng_aggregate_address_cmd,
+       "aggregate-address X:X::X:X/M",
+       "Set aggregate RIPng route announcement\n"
+       "Aggregate network\n")
+{
+  int ret;
+  struct prefix p;
+  struct route_node *node;
+
+  ret = str2prefix_ipv6 (argv[0], (struct prefix_ipv6 *)&p);
+  if (ret <= 0)
+    {
+      vty_out (vty, "Malformed address%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  /* Check aggregate alredy exist or not. */
+  node = route_node_get (ripng->aggregate, &p);
+  if (node->info)
+    {
+      vty_out (vty, "There is already same aggregate route.%s", VTY_NEWLINE);
+      route_unlock_node (node);
+      return CMD_WARNING;
+    }
+  node->info = (void *)1;
+
+  ripng_aggregate_add (&p);
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_aggregate_address,
+       no_ripng_aggregate_address_cmd,
+       "no aggregate-address X:X::X:X/M",
+       NO_STR
+       "Delete aggregate RIPng route announcement\n"
+       "Aggregate network")
+{
+  int ret;
+  struct prefix p;
+  struct route_node *rn;
+
+  ret = str2prefix_ipv6 (argv[0], (struct prefix_ipv6 *) &p);
+  if (ret <= 0)
+    {
+      vty_out (vty, "Malformed address%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  rn = route_node_lookup (ripng->aggregate, &p);
+  if (! rn)
+    {
+      vty_out (vty, "Can't find aggregate route.%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  route_unlock_node (rn);
+  rn->info = NULL;
+  route_unlock_node (rn);
+
+  ripng_aggregate_delete (&p);
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (ripng_default_metric,
+       ripng_default_metric_cmd,
+       "default-metric <1-16>",
+       "Set a metric of redistribute routes\n"
+       "Default metric\n")
+{
+  if (ripng)
+    {
+      ripng->default_metric = atoi (argv[0]);
+    }
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_default_metric,
+       no_ripng_default_metric_cmd,
+       "no default-metric",
+       NO_STR
+       "Set a metric of redistribute routes\n"
+       "Default metric\n")
+{
+  if (ripng)
+    {
+      ripng->default_metric = RIPNG_DEFAULT_METRIC_DEFAULT;
+    }
+  return CMD_SUCCESS;
+}
+
+ALIAS (no_ripng_default_metric,
+       no_ripng_default_metric_val_cmd,
+       "no default-metric <1-16>",
+       NO_STR
+       "Set a metric of redistribute routes\n"
+       "Default metric\n")
+
+#if 0
+/* RIPng update timer setup. */
+DEFUN (ripng_update_timer,
+       ripng_update_timer_cmd,
+       "update-timer SECOND",
+       "Set RIPng update timer in seconds\n"
+       "Seconds\n")
+{
+  unsigned long update;
+  char *endptr = NULL;
+
+  update = strtoul (argv[0], &endptr, 10);
+  if (update == ULONG_MAX || *endptr != '\0')
+    {
+      vty_out (vty, "update timer value error%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  ripng->update_time = update;
+
+  ripng_event (RIPNG_UPDATE_EVENT, 0);
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_update_timer,
+       no_ripng_update_timer_cmd,
+       "no update-timer SECOND",
+       NO_STR
+       "Unset RIPng update timer in seconds\n"
+       "Seconds\n")
+{
+  ripng->update_time = RIPNG_UPDATE_TIMER_DEFAULT;
+  ripng_event (RIPNG_UPDATE_EVENT, 0);
+  return CMD_SUCCESS;
+}
+
+/* RIPng timeout timer setup. */
+DEFUN (ripng_timeout_timer,
+       ripng_timeout_timer_cmd,
+       "timeout-timer SECOND",
+       "Set RIPng timeout timer in seconds\n"
+       "Seconds\n")
+{
+  unsigned long timeout;
+  char *endptr = NULL;
+
+  timeout = strtoul (argv[0], &endptr, 10);
+  if (timeout == ULONG_MAX || *endptr != '\0')
+    {
+      vty_out (vty, "timeout timer value error%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  ripng->timeout_time = timeout;
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_timeout_timer,
+       no_ripng_timeout_timer_cmd,
+       "no timeout-timer SECOND",
+       NO_STR
+       "Unset RIPng timeout timer in seconds\n"
+       "Seconds\n")
+{
+  ripng->timeout_time = RIPNG_TIMEOUT_TIMER_DEFAULT;
+  return CMD_SUCCESS;
+}
+
+/* RIPng garbage timer setup. */
+DEFUN (ripng_garbage_timer,
+       ripng_garbage_timer_cmd,
+       "garbage-timer SECOND",
+       "Set RIPng garbage timer in seconds\n"
+       "Seconds\n")
+{
+  unsigned long garbage;
+  char *endptr = NULL;
+
+  garbage = strtoul (argv[0], &endptr, 10);
+  if (garbage == ULONG_MAX || *endptr != '\0')
+    {
+      vty_out (vty, "garbage timer value error%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  ripng->garbage_time = garbage;
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_garbage_timer,
+       no_ripng_garbage_timer_cmd,
+       "no garbage-timer SECOND",
+       NO_STR
+       "Unset RIPng garbage timer in seconds\n"
+       "Seconds\n")
+{
+  ripng->garbage_time = RIPNG_GARBAGE_TIMER_DEFAULT;
+  return CMD_SUCCESS;
+}
+#endif /* 0 */
+
+DEFUN (ripng_timers,
+       ripng_timers_cmd,
+       "timers basic <0-65535> <0-65535> <0-65535>",
+       "RIPng timers setup\n"
+       "Basic timer\n"
+       "Routing table update timer value in second. Default is 30.\n"
+       "Routing information timeout timer. Default is 180.\n"
+       "Garbage collection timer. Default is 120.\n")
+{
+  unsigned long update;
+  unsigned long timeout;
+  unsigned long garbage;
+  char *endptr = NULL;
+
+  update = strtoul (argv[0], &endptr, 10);
+  if (update == ULONG_MAX || *endptr != '\0')
+    {
+      vty_out (vty, "update timer value error%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  
+  timeout = strtoul (argv[1], &endptr, 10);
+  if (timeout == ULONG_MAX || *endptr != '\0')
+    {
+      vty_out (vty, "timeout timer value error%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+  
+  garbage = strtoul (argv[2], &endptr, 10);
+  if (garbage == ULONG_MAX || *endptr != '\0')
+    {
+      vty_out (vty, "garbage timer value error%s", VTY_NEWLINE);
+      return CMD_WARNING;
+    }
+
+  /* Set each timer value. */
+  ripng->update_time = update;
+  ripng->timeout_time = timeout;
+  ripng->garbage_time = garbage;
+
+  /* Reset update timer thread. */
+  ripng_event (RIPNG_UPDATE_EVENT, 0);
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_ripng_timers,
+       no_ripng_timers_cmd,
+       "no timers basic",
+       NO_STR
+       "RIPng timers setup\n"
+       "Basic timer\n")
+{
+  /* Set each timer value to the default. */
+  ripng->update_time = RIPNG_UPDATE_TIMER_DEFAULT;
+  ripng->timeout_time = RIPNG_TIMEOUT_TIMER_DEFAULT;
+  ripng->garbage_time = RIPNG_GARBAGE_TIMER_DEFAULT;
+
+  /* Reset update timer thread. */
+  ripng_event (RIPNG_UPDATE_EVENT, 0);
+
+  return CMD_SUCCESS;
+}
+
+
+DEFUN (show_ipv6_protocols, show_ipv6_protocols_cmd,
+       "show ipv6 protocols",
+       SHOW_STR
+       IP_STR
+       "Routing protocol information")
+{
+  if (! ripng)
+    return CMD_SUCCESS;
+
+  vty_out (vty, "Routing Protocol is \"ripng\"%s", VTY_NEWLINE);
+  
+  vty_out (vty, "Sending updates every %ld seconds, next due in %d seconds%s",
+	   ripng->update_time, 0,
+	   VTY_NEWLINE);
+
+  vty_out (vty, "Timerout after %ld seconds, garbage correct %ld%s",
+	   ripng->timeout_time,
+	   ripng->garbage_time,
+	   VTY_NEWLINE);
+
+  vty_out (vty, "Outgoing update filter list for all interfaces is not set");
+  vty_out (vty, "Incoming update filter list for all interfaces is not set");
+
+  return CMD_SUCCESS;
+}
+
+/* Please be carefull to use this command. */
+DEFUN (default_information_originate,
+       default_information_originate_cmd,
+       "default-information originate",
+       "Default route information\n"
+       "Distribute default route\n")
+{
+  struct prefix_ipv6 p;
+
+  ripng->default_information = 1;
+
+  str2prefix_ipv6 ("::/0", &p);
+  ripng_redistribute_add (ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p, 0);
+
+  return CMD_SUCCESS;
+}
+
+DEFUN (no_default_information_originate,
+       no_default_information_originate_cmd,
+       "no default-information originate",
+       NO_STR
+       "Default route information\n"
+       "Distribute default route\n")
+{
+  struct prefix_ipv6 p;
+
+  ripng->default_information = 0;
+
+  str2prefix_ipv6 ("::/0", &p);
+  ripng_redistribute_delete (ZEBRA_ROUTE_RIPNG, RIPNG_ROUTE_STATIC, &p, 0);
+
+  return CMD_SUCCESS;
+}
+
+/* RIPng configuration write function. */
+int
+ripng_config_write (struct vty *vty)
+{
+  int ripng_network_write (struct vty *);
+  void ripng_redistribute_write (struct vty *);
+  int write = 0;
+  struct route_node *rp;
+
+  if (ripng)
+    {
+
+      /* RIPng router. */
+      vty_out (vty, "router ripng%s", VTY_NEWLINE);
+
+      if (ripng->default_information)
+	vty_out (vty, " default-information originate%s", VTY_NEWLINE);
+
+      ripng_network_write (vty);
+
+      /* RIPng default metric configuration */
+      if (ripng->default_metric != RIPNG_DEFAULT_METRIC_DEFAULT)
+        vty_out (vty, " default-metric %d%s",
+		 ripng->default_metric, VTY_NEWLINE);
+
+      ripng_redistribute_write (vty);
+      
+      /* RIPng aggregate routes. */
+      for (rp = route_top (ripng->aggregate); rp; rp = route_next (rp))
+	if (rp->info != NULL)
+	  vty_out (vty, " aggregate-address %s/%d%s", 
+		   inet6_ntop (&rp->p.u.prefix6),
+		   rp->p.prefixlen, 
+
+		   VTY_NEWLINE);
+
+      /* RIPng static routes. */
+      for (rp = route_top (ripng->route); rp; rp = route_next (rp))
+	if (rp->info != NULL)
+	  vty_out (vty, " route %s/%d%s", inet6_ntop (&rp->p.u.prefix6),
+		   rp->p.prefixlen,
+		   VTY_NEWLINE);
+
+      /* RIPng timers configuration. */
+      if (ripng->update_time != RIPNG_UPDATE_TIMER_DEFAULT ||
+	  ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT ||
+	  ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT)
+	{
+	  vty_out (vty, " timers basic %ld %ld %ld%s",
+		   ripng->update_time,
+		   ripng->timeout_time,
+		   ripng->garbage_time,
+		   VTY_NEWLINE);
+	}
+#if 0
+      if (ripng->update_time != RIPNG_UPDATE_TIMER_DEFAULT)
+	vty_out (vty, " update-timer %d%s", ripng->update_time,
+		 VTY_NEWLINE);
+      if (ripng->timeout_time != RIPNG_TIMEOUT_TIMER_DEFAULT)
+	vty_out (vty, " timeout-timer %d%s", ripng->timeout_time,
+		 VTY_NEWLINE);
+      if (ripng->garbage_time != RIPNG_GARBAGE_TIMER_DEFAULT)
+	vty_out (vty, " garbage-timer %d%s", ripng->garbage_time,
+		 VTY_NEWLINE);
+#endif /* 0 */
+
+      write += config_write_distribute (vty);
+
+      write += config_write_if_rmap (vty);
+
+      write++;
+    }
+  return write;
+}
+
+/* RIPng node structure. */
+struct cmd_node cmd_ripng_node =
+{
+  RIPNG_NODE,
+  "%s(config-router)# ",
+  1,
+};
+
+void
+ripng_distribute_update (struct distribute *dist)
+{
+  struct interface *ifp;
+  struct ripng_interface *ri;
+  struct access_list *alist;
+  struct prefix_list *plist;
+
+  if (! dist->ifname)
+    return;
+
+  ifp = if_lookup_by_name (dist->ifname);
+  if (ifp == NULL)
+    return;
+
+  ri = ifp->info;
+
+  if (dist->list[DISTRIBUTE_IN])
+    {
+      alist = access_list_lookup (AFI_IP6, dist->list[DISTRIBUTE_IN]);
+      if (alist)
+	ri->list[RIPNG_FILTER_IN] = alist;
+      else
+	ri->list[RIPNG_FILTER_IN] = NULL;
+    }
+  else
+    ri->list[RIPNG_FILTER_IN] = NULL;
+
+  if (dist->list[DISTRIBUTE_OUT])
+    {
+      alist = access_list_lookup (AFI_IP6, dist->list[DISTRIBUTE_OUT]);
+      if (alist)
+	ri->list[RIPNG_FILTER_OUT] = alist;
+      else
+	ri->list[RIPNG_FILTER_OUT] = NULL;
+    }
+  else
+    ri->list[RIPNG_FILTER_OUT] = NULL;
+
+  if (dist->prefix[DISTRIBUTE_IN])
+    {
+      plist = prefix_list_lookup (AFI_IP6, dist->prefix[DISTRIBUTE_IN]);
+      if (plist)
+	ri->prefix[RIPNG_FILTER_IN] = plist;
+      else
+	ri->prefix[RIPNG_FILTER_IN] = NULL;
+    }
+  else
+    ri->prefix[RIPNG_FILTER_IN] = NULL;
+
+  if (dist->prefix[DISTRIBUTE_OUT])
+    {
+      plist = prefix_list_lookup (AFI_IP6, dist->prefix[DISTRIBUTE_OUT]);
+      if (plist)
+	ri->prefix[RIPNG_FILTER_OUT] = plist;
+      else
+	ri->prefix[RIPNG_FILTER_OUT] = NULL;
+    }
+  else
+    ri->prefix[RIPNG_FILTER_OUT] = NULL;
+}
+void
+ripng_distribute_update_interface (struct interface *ifp)
+{
+  struct distribute *dist;
+
+  dist = distribute_lookup (ifp->name);
+  if (dist)
+    ripng_distribute_update (dist);
+}
+
+/* Update all interface's distribute list. */
+void
+ripng_distribute_update_all ()
+{
+  struct interface *ifp;
+  listnode node;
+
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      ripng_distribute_update_interface (ifp);
+    }
+}
+
+void
+ripng_if_rmap_update (struct if_rmap *if_rmap)
+{
+  struct interface *ifp;
+  struct ripng_interface *ri;
+  struct route_map *rmap;
+
+  ifp = if_lookup_by_name (if_rmap->ifname);
+  if (ifp == NULL)
+    return;
+
+  ri = ifp->info;
+
+  if (if_rmap->routemap[IF_RMAP_IN])
+    {
+      rmap = route_map_lookup_by_name (if_rmap->routemap[IF_RMAP_IN]);
+      if (rmap)
+	ri->routemap[IF_RMAP_IN] = rmap;
+      else
+	ri->routemap[IF_RMAP_IN] = NULL;
+    }
+  else
+    ri->routemap[RIPNG_FILTER_IN] = NULL;
+
+  if (if_rmap->routemap[IF_RMAP_OUT])
+    {
+      rmap = route_map_lookup_by_name (if_rmap->routemap[IF_RMAP_OUT]);
+      if (rmap)
+	ri->routemap[IF_RMAP_OUT] = rmap;
+      else
+	ri->routemap[IF_RMAP_OUT] = NULL;
+    }
+  else
+    ri->routemap[RIPNG_FILTER_OUT] = NULL;
+}
+
+void
+ripng_if_rmap_update_interface (struct interface *ifp)
+{
+  struct if_rmap *if_rmap;
+
+  if_rmap = if_rmap_lookup (ifp->name);
+  if (if_rmap)
+    ripng_if_rmap_update (if_rmap);
+}
+
+void
+ripng_routemap_update_redistribute (void)
+{
+  int i;
+
+  if (ripng)
+    {
+      for (i = 0; i < ZEBRA_ROUTE_MAX; i++) 
+	{
+	  if (ripng->route_map[i].name)
+	    ripng->route_map[i].map = 
+	      route_map_lookup_by_name (ripng->route_map[i].name);
+	}
+    }
+}
+
+void
+ripng_routemap_update ()
+{
+  struct interface *ifp;
+  listnode node;
+
+  for (node = listhead (iflist); node; nextnode (node))
+    {
+      ifp = getdata (node);
+      ripng_if_rmap_update_interface (ifp);
+    }
+
+  ripng_routemap_update_redistribute ();
+}
+
+/* Initialize ripng structure and set commands. */
+void
+ripng_init ()
+{
+  /* Randomize. */
+  srand (time (NULL));
+
+  /* Install RIPNG_NODE. */
+  install_node (&cmd_ripng_node, ripng_config_write);
+
+  /* Install ripng commands. */
+  install_element (VIEW_NODE, &show_ipv6_ripng_cmd);
+
+  install_element (ENABLE_NODE, &show_ipv6_ripng_cmd);
+
+  install_element (CONFIG_NODE, &router_ripng_cmd);
+
+  install_default (RIPNG_NODE);
+  install_element (RIPNG_NODE, &ripng_route_cmd);
+  install_element (RIPNG_NODE, &no_ripng_route_cmd);
+  install_element (RIPNG_NODE, &ripng_aggregate_address_cmd);
+  install_element (RIPNG_NODE, &no_ripng_aggregate_address_cmd);
+
+  install_element (RIPNG_NODE, &ripng_default_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_default_metric_cmd);
+  install_element (RIPNG_NODE, &no_ripng_default_metric_val_cmd);
+
+  install_element (RIPNG_NODE, &ripng_timers_cmd);
+  install_element (RIPNG_NODE, &no_ripng_timers_cmd);
+#if 0
+  install_element (RIPNG_NODE, &ripng_update_timer_cmd);
+  install_element (RIPNG_NODE, &no_ripng_update_timer_cmd);
+  install_element (RIPNG_NODE, &ripng_timeout_timer_cmd);
+  install_element (RIPNG_NODE, &no_ripng_timeout_timer_cmd);
+  install_element (RIPNG_NODE, &ripng_garbage_timer_cmd);
+  install_element (RIPNG_NODE, &no_ripng_garbage_timer_cmd);
+#endif /* 0 */
+
+  install_element (RIPNG_NODE, &default_information_originate_cmd);
+  install_element (RIPNG_NODE, &no_default_information_originate_cmd);
+
+  ripng_if_init ();
+  ripng_debug_init ();
+
+  /* Access list install. */
+  access_list_init ();
+  access_list_add_hook (ripng_distribute_update_all);
+  access_list_delete_hook (ripng_distribute_update_all);
+
+  /* Prefix list initialize.*/
+  prefix_list_init ();
+  prefix_list_add_hook (ripng_distribute_update_all);
+  prefix_list_delete_hook (ripng_distribute_update_all);
+
+  /* Distribute list install. */
+  distribute_list_init (RIPNG_NODE);
+  distribute_list_add_hook (ripng_distribute_update);
+  distribute_list_delete_hook (ripng_distribute_update);
+
+  /* Route-map for interface. */
+  ripng_route_map_init ();
+  route_map_add_hook (ripng_routemap_update);
+  route_map_delete_hook (ripng_routemap_update);
+
+  if_rmap_init (RIPNG_NODE);
+  if_rmap_hook_add (ripng_if_rmap_update);
+  if_rmap_hook_delete (ripng_if_rmap_update);
+}
diff --git a/ripngd/ripngd.conf.sample b/ripngd/ripngd.conf.sample
new file mode 100644
index 0000000..ad673e5
--- /dev/null
+++ b/ripngd/ripngd.conf.sample
@@ -0,0 +1,22 @@
+! -*- rip -*-
+!
+! RIPngd sample configuration file
+!
+! $Id: ripngd.conf.sample,v 1.1 2002/12/13 20:15:30 paul Exp $
+!
+hostname ripngd
+password zebra
+!
+! debug ripng events
+! debug ripng packet
+!
+!
+router ripng
+! network sit1
+! route 3ffe:506::0/32
+! distribute-list local-only out sit1
+!
+!ipv6 access-list local-only permit 3ffe:506::0/32
+!ipv6 access-list local-only deny any
+!
+log stdout
diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h
new file mode 100644
index 0000000..2509bdd
--- /dev/null
+++ b/ripngd/ripngd.h
@@ -0,0 +1,318 @@
+/*
+ * RIPng related value and structure.
+ * Copyright (C) 1998 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_RIPNG_RIPNGD_H
+#define _ZEBRA_RIPNG_RIPNGD_H
+
+/* RIPng version and port number. */
+#define RIPNG_V1                         1
+#define RIPNG_PORT_DEFAULT             521
+#define RIPNG_VTY_PORT                2603
+#define RIPNG_VTYSH_PATH              "/tmp/.ripngd"
+#define RIPNG_MAX_PACKET_SIZE         1500
+#define RIPNG_PRIORITY_DEFAULT           0
+
+/* RIPng commands. */
+#define RIPNG_REQUEST                    1
+#define RIPNG_RESPONSE                   2
+
+/* RIPng metric and multicast group address. */
+#define RIPNG_METRIC_INFINITY           16
+#define RIPNG_METRIC_NEXTHOP          0xff
+#define RIPNG_GROUP              "ff02::9"
+
+/* RIPng timers. */
+#define RIPNG_UPDATE_TIMER_DEFAULT      30
+#define RIPNG_TIMEOUT_TIMER_DEFAULT    180
+#define RIPNG_GARBAGE_TIMER_DEFAULT    120
+
+/* Default config file name. */
+#define RIPNG_DEFAULT_CONFIG "ripngd.conf"
+
+/* RIPng route types. */
+#define RIPNG_ROUTE_RTE                  0
+#define RIPNG_ROUTE_STATIC               1
+#define RIPNG_ROUTE_AGGREGATE            2
+
+/* Interface send/receive configuration. */
+#define RIPNG_SEND_UNSPEC                0
+#define RIPNG_SEND_OFF                   1
+#define RIPNG_RECEIVE_UNSPEC             0
+#define RIPNG_RECEIVE_OFF                1
+
+/* Split horizon definitions. */
+#define RIPNG_SPLIT_HORIZON_UNSPEC       0
+#define RIPNG_SPLIT_HORIZON_NONE         1
+#define RIPNG_SPLIT_HORIZON              2
+#define RIPNG_SPLIT_HORIZON_POISONED     3
+
+/* RIP default route's accept/announce methods. */
+#define RIPNG_DEFAULT_ADVERTISE_UNSPEC   0
+#define RIPNG_DEFAULT_ADVERTISE_NONE     1
+#define RIPNG_DEFAULT_ADVERTISE          2
+
+#define RIPNG_DEFAULT_ACCEPT_UNSPEC      0
+#define RIPNG_DEFAULT_ACCEPT_NONE        1
+#define RIPNG_DEFAULT_ACCEPT             2
+
+/* Default value for "default-metric" command. */
+#define RIPNG_DEFAULT_METRIC_DEFAULT     1
+
+/* For max RTE calculation. */
+#ifndef IPV6_HDRLEN
+#define IPV6_HDRLEN 40
+#endif /* IPV6_HDRLEN */
+
+#ifndef IFMINMTU
+#define IFMINMTU    576
+#endif /* IFMINMTU */
+
+/* RIPng structure. */
+struct ripng 
+{
+  /* RIPng socket. */
+  int sock;
+
+  /* RIPng Parameters.*/
+  u_char command;
+  u_char version;
+  unsigned long update_time;
+  unsigned long timeout_time;
+  unsigned long garbage_time;
+  int max_mtu;
+  int default_metric;
+  int default_information;
+
+  /* Input/output buffer of RIPng. */
+  struct stream *ibuf;
+  struct stream *obuf;
+
+  /* RIPng routing information base. */
+  struct route_table *table;
+
+  /* RIPng only static route information. */
+  struct route_table *route;
+
+  /* RIPng aggregate route information. */
+  struct route_table *aggregate;
+
+  /* RIPng threads. */
+  struct thread *t_read;
+  struct thread *t_write;
+  struct thread *t_update;
+  struct thread *t_garbage;
+  struct thread *t_zebra;
+
+  /* Triggered update hack. */
+  int trigger;
+  struct thread *t_triggered_update;
+  struct thread *t_triggered_interval;
+
+  /* For redistribute route map. */
+  struct
+  {
+    char *name;
+    struct route_map *map;
+    int metric_config;
+    u_int32_t metric;
+  } route_map[ZEBRA_ROUTE_MAX];
+};
+
+/* Routing table entry. */
+struct rte
+{
+  struct in6_addr addr;
+  u_short tag;
+  u_char prefixlen;
+  u_char metric;
+};
+
+/* RIPNG send packet. */
+struct ripng_packet
+{
+  u_char command;
+  u_char version;
+  u_int16_t zero; 
+  struct rte rte[1];
+};
+
+/* Each route's information. */
+struct ripng_info
+{
+  /* This route's type.  Static, ripng or aggregate. */
+  u_char type;
+
+  /* Sub type for static route. */
+  u_char sub_type;
+
+  /* RIPng specific information */
+  struct in6_addr nexthop;	
+  struct in6_addr from;
+
+  /* Which interface does this route come from. */
+  unsigned int ifindex;		
+
+  /* Metric of this route.  */
+  u_char metric;		
+
+  /* Tag field of RIPng packet.*/
+  u_int16_t tag;		
+
+  /* For aggregation. */
+  unsigned int suppress;
+
+  /* Flags of RIPng route. */
+#define RIPNG_RTF_FIB      1
+#define RIPNG_RTF_CHANGED  2
+  u_char flags;
+
+  /* Garbage collect timer. */
+  struct thread *t_timeout;
+  struct thread *t_garbage_collect;
+
+  /* Route-map features - this variables can be changed. */
+  u_char metric_set;
+
+  struct route_node *rp;
+};
+
+/* RIPng tag structure. */
+struct ripng_tag
+{
+  /* Tag value. */
+  u_int16_t tag;
+
+  /* Port. */
+  u_int16_t port;
+
+  /* Multicast group. */
+  struct in6_addr maddr;
+
+  /* Table number. */
+  int table;
+
+  /* Distance. */
+  int distance;
+
+  /* Split horizon. */
+  u_char split_horizon;
+
+  /* Poison reverse. */
+  u_char poison_reverse;
+};
+
+/* RIPng specific interface configuration. */
+struct ripng_interface
+{
+  /* RIPng is enabled on this interface. */
+  int enable_network;
+  int enable_interface;
+
+  /* RIPng is running on this interface. */
+  int running;
+
+  /* For filter type slot. */
+#define RIPNG_FILTER_IN  0
+#define RIPNG_FILTER_OUT 1
+#define RIPNG_FILTER_MAX 2
+
+  /* Access-list. */
+  struct access_list *list[RIPNG_FILTER_MAX];
+
+  /* Prefix-list. */
+  struct prefix_list *prefix[RIPNG_FILTER_MAX];
+
+  /* Route-map. */
+  struct route_map *routemap[RIPNG_FILTER_MAX];
+
+  /* RIPng tag configuration. */
+  struct ripng_tag *rtag;
+
+  /* Default information originate. */
+  u_char default_originate;
+
+  /* Default information only. */
+  u_char default_only;
+
+  /* Wake up thread. */
+  struct thread *t_wakeup;
+
+  /* Passive interface. */
+  int passive;
+};
+
+/* All RIPng events. */
+enum ripng_event
+{
+  RIPNG_READ,
+  RIPNG_ZEBRA,
+  RIPNG_REQUEST_EVENT,
+  RIPNG_UPDATE_EVENT,
+  RIPNG_TRIGGERED_UPDATE,
+};
+
+/* RIPng timer on/off macro. */
+#define RIPNG_TIMER_ON(T,F,V) \
+do { \
+   if (!(T)) \
+      (T) = thread_add_timer (master, (F), rinfo, (V)); \
+} while (0)
+
+#define RIPNG_TIMER_OFF(T) \
+do { \
+   if (T) \
+     { \
+       thread_cancel(T); \
+       (T) = NULL; \
+     } \
+} while (0)
+
+/* Count prefix size from mask length */
+#define PSIZE(a) (((a) + 7) / (8))
+
+/* Extern variables. */
+extern struct ripng *ripng;
+
+extern struct thread_master *master;
+
+/* Prototypes. */
+void ripng_init ();
+void ripng_if_init ();
+void ripng_terminate ();
+void ripng_zclient_start ();
+void zebra_init ();
+struct ripng_info * ripng_info_new ();
+void ripng_info_free (struct ripng_info *rinfo);
+void ripng_event (enum ripng_event, int);
+int ripng_request (struct interface *ifp);
+void ripng_redistribute_add (int, int, struct prefix_ipv6 *, unsigned int);
+void ripng_redistribute_delete (int, int, struct prefix_ipv6 *, unsigned int);
+void ripng_redistribute_withdraw (int type);
+
+void ripng_distribute_update_interface (struct interface *);
+void ripng_if_rmap_update_interface (struct interface *);
+
+void ripng_zebra_ipv6_add (struct prefix_ipv6 *p, struct in6_addr *nexthop, unsigned int ifindex);
+void ripng_zebra_ipv6_delete (struct prefix_ipv6 *p, struct in6_addr *nexthop, unsigned int ifindex);
+void ripng_route_map_init ();
+
+#endif /* _ZEBRA_RIPNG_RIPNGD_H */
