--- quagga-0.99.9/bgpd/bgp_open.h 2007-08-06 08:17:45.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/bgpd/bgp_open.h 2008-04-16 11:55:54.000000000 -0700 @@ -44,7 +44,12 @@ struct capability_orf_entry struct { u_char type; u_char mode; +#if ( __GNUC__ == 2) + // did not compile in FreeBSD, gcc 2.95.4 + } orfs[0]; +#else } orfs[]; +#endif } __attribute__ ((packed)); #pragma pack() @@ -58,7 +63,12 @@ struct graceful_restart_af struct capability_gr { u_int16_t restart_flag_time; +#if ( __GNUC__ == 2) + // did not compile in FreeBSD, gcc 2.95.4 + struct graceful_restart_af gr[0]; +#else struct graceful_restart_af gr[]; +#endif }; /* Capability Code */ --- quagga-0.99.9/bgpd/bgp_route.c 2007-08-26 15:44:52.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/bgpd/bgp_route.c 2008-04-16 11:55:54.000000000 -0700 @@ -5802,9 +5803,16 @@ route_vty_out_tag (struct vty *vty, stru #ifdef HAVE_IPV6 else if (p->family == AF_INET6) { +/* gcc-2.95 won't let asserts before array declarations */ +#if ( __GNUC__ > 2) assert (attr->extra); +#endif char buf[BUFSIZ]; char buf1[BUFSIZ]; +/* Move it here */ +#if ( __GNUC__ == 2) + assert (attr->extra); +#endif if (attr->extra->mp_nexthop_len == 16) vty_out (vty, "%s", inet_ntop (AF_INET6, &attr->extra->mp_nexthop_global, --- quagga-0.99.9/configure 2007-09-07 09:54:55.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/configure 2008-04-16 11:55:55.000000000 -0700 @@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='Quagga' PACKAGE_TARNAME='quagga' -PACKAGE_VERSION='0.99.9' -PACKAGE_STRING='Quagga 0.99.9' +PACKAGE_VERSION='0.99.9-ospfv3-manetmdr-2008-04-16' +PACKAGE_STRING='Quagga 0.99.9-ospfv3-manetmdr-2008-04-16' PACKAGE_BUGREPORT='http://bugzilla.quagga.net' ac_unique_file="lib/zebra.h" @@ -21323,6 +21323,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #include <$ac_header> @@ -21415,6 +21418,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif @@ -22871,6 +22877,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -22996,6 +23005,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -27698,6 +27710,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -27803,6 +27818,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -28397,6 +28415,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29338,6 +29359,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29481,6 +29505,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29624,6 +29651,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29767,6 +29797,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -29910,6 +29943,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30053,6 +30089,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30196,6 +30235,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30339,6 +30381,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30482,6 +30527,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30625,6 +30673,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30768,6 +30819,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -30911,6 +30965,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31054,6 +31111,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31199,6 +31259,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31320,6 +31383,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31464,6 +31530,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31585,6 +31654,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31729,6 +31801,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31850,6 +31925,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -31994,6 +32072,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32115,6 +32196,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32259,6 +32343,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32380,6 +32467,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32524,6 +32614,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32645,6 +32738,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32791,6 +32887,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -32932,6 +33031,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -33866,6 +33968,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include @@ -34178,6 +34283,9 @@ cat >>conftest.$ac_ext <<_ACEOF #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif #if HAVE_NET_IF_H # include --- quagga-0.99.9/configure.ac 2007-09-07 09:54:01.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/configure.ac 2008-04-16 11:55:55.000000000 -0700 @@ -8,7 +8,7 @@ ## $Id: configure.ac,v 1.139 2007/09/07 16:54:01 paul Exp $ AC_PREREQ(2.53) -AC_INIT(Quagga, 0.99.9, [http://bugzilla.quagga.net]) +AC_INIT(Quagga, 0.99.9-ospfv3-manetmdr-2008-04-16, [http://bugzilla.quagga.net]) AC_CONFIG_SRCDIR(lib/zebra.h) dnl ----------------------------------- @@ -416,6 +416,9 @@ m4_define([QUAGGA_INCLUDES], #if HAVE_NETINET_IN_H # include #endif +#if HAVE_NET_IF_H +# include +#endif ])dnl AC_CHECK_HEADERS([sys/un.h net/if.h netinet/in_systm.h netinet/in_var.h \ Binary files quagga-0.99.9/doc/imp_sim.pdf and quagga-0.99.9.ospfv3-manetmdr.tmp/doc/imp_sim.pdf differ --- quagga-0.99.9/doc/Makefile.am 2007-03-23 03:53:56.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/doc/Makefile.am 2008-04-16 11:55:52.000000000 -0700 @@ -46,7 +46,8 @@ quagga.pdf: $(info_TEXINFOS) $(figures_p $(TEXI2PDF) -o "$@" $< quagga_TEXINFOS = appendix.texi basic.texi bgpd.texi filter.texi install.texi \ - ipv6.texi kernel.texi main.texi ospf6d.texi ospfd.texi overview.texi \ + ipv6.texi kernel.texi main.texi ospf6d.texi \ + ospf6d-manet.texi ospf6d-af.texi ospfd.texi overview.texi \ protocol.texi ripd.texi ripngd.texi routemap.texi snmp.texi \ vtysh.texi routeserver.texi defines.texi $(figures_png) snmptrap.texi \ $(figures_txt) --- quagga-0.99.9/doc/Makefile.in 2007-09-07 09:54:56.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/doc/Makefile.in 2008-04-16 11:55:52.000000000 -0700 @@ -264,7 +264,8 @@ figures_txt := $(figures_names_parts:%=f BUILT_SOURCES = defines.texi info_TEXINFOS = quagga.texi quagga_TEXINFOS = appendix.texi basic.texi bgpd.texi filter.texi install.texi \ - ipv6.texi kernel.texi main.texi ospf6d.texi ospfd.texi overview.texi \ + ipv6.texi kernel.texi main.texi ospf6d.texi ospf6d-manet.texi \ + ospf6d-af.texi ospfd.texi overview.texi \ protocol.texi ripd.texi ripngd.texi routemap.texi snmp.texi \ vtysh.texi routeserver.texi defines.texi $(figures_png) snmptrap.texi \ $(figures_txt) --- quagga-0.99.9/doc/Makefile.no_doc 1969-12-31 16:00:00.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/doc/Makefile.no_doc 2008-04-16 11:55:52.000000000 -0700 @@ -0,0 +1,8 @@ +all: + echo "done" +clean: + echo "done" +distclean: + echo "done" +install: + echo "done" --- quagga-0.99.9/doc/ospf6d-af.texi 1969-12-31 16:00:00.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/doc/ospf6d-af.texi 2008-04-16 11:55:52.000000000 -0700 @@ -0,0 +1,119 @@ +@node OSPFv3 Address Families +@chapter OSPFv3 Address Families + +The following text describes the implementation of a mechanism for supporting +multiple address families in OSPFv3 using multiple instances. It +maps an address family (AF) to an OSPFv3 instance using the Instance ID +field in the OSPFv3 packet header. This approach is fairly simple +and minimizes extensions to OSPFv3 for supporting multiple AFs. + +This implementation also enables OSPF MANET to support IPv4 routing (next +chapter). + +@menu +* Overview-AF:: +* Enabling OSPF-AF:: +* Configuring OSPF-AF:: +* Running OSPF-AF:: +* Open Issues:: +@end menu + +@node Overview-AF +@section Overview + +For now, please see Section 2 of @uref{http://tools.ietf.org/html/draft-ietf-ospf-af-alt-05,, draft-ietf-ospf-af-alt-05}. + +@subsection Draft compliance +Support of Address Families (AF) in OSPFv3 is supported according to +@uref{http://tools.ietf.org/html/draft-ietf-ospf-af-alt-05,, draft-ietf-ospf-af-alt-05}. + +@subsection License and Contributing Code +This software builds on two projects (GTNetS and quagga) that are under +GNU General Public License (GPL). Our modifications are also under GPL. +Therefore, please consider this simulator as GPL'ed software. + +We would like to encourage people to send in bug fixes, extensions, +or to make their simulation scripts available (that produce their +simulation results). By default, we will not include any contributed +code, bug fixes, or patches unless you specify that you want to include +said code in our future releases of this simulator (also under GPL). + +@node Enabling OSPF-AF +@section Enabling OSPF-AF + +Address families is enabled by compiling the flag @code{OSPF6_AF} into the +source code. +By default this flag is compiled into the code. It must be removed from +configure.ac and config.h.in. + +All modified code is found in the directories lib/, zebra/, and ospf6/. +Each modification is flagged with the tag "OSPF6_AF". + +@node Configuring OSPF-AF +@section Configuring OSPF-AF + +Address Families can be configured in one of two ways. + +1. Add the following lines to the ospf6d.conf file + +@verbatim + interface + ipv6 ospf6 instance-id <0-255> +@end verbatim + +2. From the vtysh or telnet terminal type: +@verbatim + > conf t + > interface + > ipv6 ospf6 instance-id <0-255> + > exit + > exit +@end verbatim + +The value of the instance ID should one of the four ranges below. The most +comman ranges are 0 to 31 for unicast IPv6 routing (standard OSPFv3) and +64 to 95 for IPv4 unicast routing. +@verbatim + Instance ID # 0 - # 31 IPv6 unicast AF + Instance ID # 32 - # 63 IPv6 multicast AF + Instance ID # 64 - # 95 IPv4 unicast AF + Instance ID # 96 - # 127 IPv4 multicast AF + Instance ID # 128 - # 255 Unassigned +@end verbatim + +NOTE: The instance-id must be the same on all interfaces. Different Address +Families cannot be used within the same ospf6d process. The router will +fail if different ranges are used. + + +@node Running OSPF-AF +@section Running OSPF-AF + +From a vtysh or telnet terminal type: + +@verbatim +> show ipv6 ospf6 route +@end verbatim + +This should display the OSPFv3 routes. If IPv4 AFs are used then the +route will appear as an IPv6 route with zeros before the IPv4 route. +Next, type the following command for IPv4 or IPv6 + +@verbatim +> show ip route +> show ipv6 route +@end verbatim + +The entries with the "*" are going to be installed in the kernel routing +table. If these tables are correct then the kernel routing table +should be correct. + +@node Open Issues +@section Open Issues + +Enable different AFs to run in the same ospf6d instance. This would require +a IETF draft changes and a sepeartion of LSAs within the database. + +Known Issue: if instance IDs are not consistent on the interfaces then +routing will fail. + --- quagga-0.99.9/doc/ospf6d-gtnets.texi 1969-12-31 16:00:00.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/doc/ospf6d-gtnets.texi 2008-04-16 11:55:52.000000000 -0700 @@ -0,0 +1,1128 @@ +This section describes the implementation of MANET extensions to OSPFv3 +as an extension to the @code{quagga}@footnote{http://www.quagga.net} +OSPFv3 routing daemon and the Georgia Tech Network Simulator +(GTNetS).@uref{http://www.ece.gatech.edu/research/labs/MANIACS/GTNetS/,,www.ece.gatech.edu/research/labs/MANIACS/GTNetS/} +@ref{fig:sim_imp} illustrates how the same quagga software is +supported in an actual quagga implementation and also wrapped within the +GTNetS simulation framework; this enables moving between implementation +and simulation with the same code base, just by changing some compilation +flags. + +@float Figure,fig:sim_imp +@iftex +@image{imp_sim,8in,,,.pdf} +@end iftex +@caption{Architecture of Simulation and Implementation} +@end float + +This packet-level, discrete-event simulator has the following features: +@itemize +@item OSPFv3 for IPv6 based on recent @code{quagga} software +(version 0.99.9). +@item Support for enabling a proposal known as @strong{ MANET Designated Routers}, +contributed by Richard Ogier and Phil Spagnolo @uref{http://tools.ietf.org/html/draft-ietf-ospf-manet-mdr,,draft-ietf-ospf-manet-mdr} . +@item (slightly modified) 802.11 and wired channel models +@item detailed logging and tracing of simulation events, including all +quagga daemon logging +@end itemize + +We have not removed any features of GTNetS, which are described elsewhere +in the GTNetS documentation, or @code{quagga}, although we note that only +OSPFv3 is supported in the simulation (the full @code{quagga} routing daemon +is available if run as implementation code). Here, we focus on the types +of OSPF MANET simulations that we have done with this simulator. + +The next section describes the details for using this software in +@emph{simulation} mode. + +@subsection Simulation + +@subsubsection Patching the Quagga source code +Before using the simulator you must hook GTNetS and Quagga together. +Follow the following steps: +@itemize +@item Obtain the GTNetS and Quagga source code. +@item Obtain the MANET-MDR GTNetS for Quagga: quagga-0.99.9.ospfv3-manetmdr-gtnets.patch +@item Patch the source code: @code{patch -p1 < quagga-0.99.9.ospfv3-manetmdr-gtnets.patch} +@item Run @code{./configure} in the quagga directory +@item Comment out #define VERSION "0.99.9" in config.h +@item In GTNetS create a smybolic link to quagga in the SRC directory. EX: ln -s ~/quagga-0.99.9/ ~/gtnets/SRC/quagga +@end itemize + +@anchor{Building the Simulator} +@subsubsection Building the Simulator + +These instructions assume that you are using a recent distribution +of Linux. Other *nix variants probably work also, but haven't been tested. +@footnote{GTNetS has been compiled successfully on Linux with +g++-2.96, g++-3.3, Microsoft Windows with MSVC-7.0, and Sun Solaris with +SUNWS-CC version??. However, we have not tested anything except gcc-3.3.3 +since we did the OSPF MANET extensions. We observed a compilation problem +with the newer Fedora Core 3 distribution, which uses gcc-3.4-- contact +us if you need a patch to the file cpqtr.h to make that compiler work.} + + +There are two ways to build the simulator: optimized, and with debugging +symbols. Optimized runs slightly faster. To build, cd into the top level +GTNetS directory, and follow the README. To build everything: +@verbatim +make clean +make depend +make all +@end verbatim +Making "all" builds both an optimized and debugging (with debugging symbols) +binary of each test file. The optimized runs a bit faster. +There are other options in the Makefile to build subsets of the scripts. +For example, to start compilation over and build only the optimized +version of what is in the ietf directory: +@verbatim +make clean +make depend +@end verbatim +@code{make}~~ @emph{target}@code{-}@emph{type} + +@ref{Table: Targets and Types} displays how various +targets (example scripts, +ietf scripts, or validation scripts) can be combined +with the two options for build type (optimized or with debugging symbols). +For example, to compile only the scripts (programs) in the validation +directory, and only for optimized binaries, use @code{make valid-opt}. + +@anchor{Table: Targets and Types} +@float +@multitable @columnfractions .5 .5 +@headitem Possible @emph{targets} @tab Possible @emph{types} +@item examples @tab opt +@item ietf @tab opt or dbg +@item valid @tab opt +@end multitable +@caption{Various ways to combined Targets and Types} +@end float + + +@subheading Qt animation option +A default requirement is the Qt libraries from Trolltech. These are typically +included in Linux distributions if you use KDE. These are used if you +want to look at animations (e.g. @code{testwirelessgrid1.cc} in the +@code{EXAMPLES/} directory). + + +An alternative to configuring and installing a Qt distribution, if you +do not care about animation, is to comment +out the inclusion of the QT configuration script in the toplevel and +sub directory makefiles. + + +@code{include mk/qtcheck.mk} + + +This will allow building without Qt. + + +@strong{ Note:} If you are using Fedora Core 2 or something very recent, you might +have a multithreaded version of Qt installed. Even though Qt works, you +don't have the right header files for GTNetS compilation. In this case, +we suggest the following: + +@itemize +@item install the source package @code{qt-x11-free-3.3.3} in +the directory @code{/usr/local/src} +@item make a symbolic link @code{ln -s /usr/local/src/qt-x11-free-3.3.3 /usr/local/qt3} +@item when you @code{make examples-dbg}, you need to pass in the QTDIR environment variable as such: @code{make examples-dbg QTDIR=/usr/local/qt3/} +@end itemize + +@subsubsection Running the Simulator +Example simulation executables are stored in the EXAMPLES directory. Versions +that are built with debugging symbols contain the suffix "-dbg", and for +optimized, the suffix "-opt". + +Executables that we have been using are stored in the following directories: +@itemize +@item @code{ietf/random_waypoint_manet/} and +@item @code{ietf/link_matrix_manet}. +@end itemize + +Try running an example script such as +@code{ietf/random_waypoint_manet/random_waypoint_manet-opt}. +It should leave a +@code{random_waypoint_manet.stat} file, and print runtime +progress to standard output. + +The files in the @code{SRC/} directory are built as a library +@code{libGTNetS-debug.a,so} or +@code{libGTNetS-opt.a,so}. This +library is linked to whatever test program you are using. +The typical GNU debugger @code{gdb} can be used to debug if debugging +symbols are present. + +@subsubsection Configuring the Simulator + +This chapter describes common command-line interface configuration options, +and then walks through a sample program in Section @ref{Example Test Program}. + +@subheading Compile-Time Options +The default Makefile in the top level directory contains the following +compile-time options (the defaults enabled are shown below): +@verbatim +# To run OSPF6D, enable: +CFLAGS += -pg -fPIC -D$(OSNAME) +# The below defines provide general support for the MANET extensions +CFLAGS += -DETRACE -DETRACE_DEBUG +CFLAGS += -DGTNETS_REPLACE_SCHEDULER -DREPEATABLE_MOBILITY -DETHERNET_BOEING +CFLAGS += -DBOEING_ARGS +CFLAGS += -DMANET +# To add TDMA USAP, add the following: +CFLAGS += -DUSAP_ADDON +# Needed by quagga +CFLAGS += -DHAVE_CONFIG_H -DSYSCONFDIR="/usr/local/etc/quagga" + +# Flags to enable modified basic quagga behavior +CFLAGS += -DBUGFIX +CFLAGS += -DOSPF6_CONFIG +#Address Families +CFLAGS += -DOSPF6_AF +#Redistribution improvements +CFLAGS += -DREDISTRIBUTION +# To run OSPF MDR, add the following: +CFLAGS += -DOSPF6_MANET_MDR +CFLAGS += -DOSPF6_MANET_DIFF_HELLO +CFLAGS += -DOSPF6_DELAYED_FLOOD +CFLAGS += -DOSPF6_DD_OPT +#GTNETS Specific +CFLAGS += -DGTNETS +CFLAGS += -DGTNETS_ETRACE_STAT +CFLAGS += -DGTNETS_REPLACE_SCHEDULER +CFLAGS += -DOSPF6_JITTER +@end verbatim + +For many of these options, the above flags just enable support for the +extension but don't automatically turn them on. For example, to enable +Differential Hellos in a particular script, you need to do two things: +@itemize +@item enable @code{-DOSPF6_MANET_DIFF_HELLO} in the top-level Makefile +@item set the ospf6_inst interface variable "diff_hellos" to "true". +For an example of how to do this, see the +@code{random_waypoint_maney.cc} program; by appending +"diff_hellos" at the command line, it will enable differential hellos +with the follwoing code snippet: +@verbatim + ospf6_inst->SetInterfaceDiffHellos(*it, ca.diff_hellos); +@end verbatim +@end itemize + +Below, we discuss how these options can be selectively enabled and +disabled once they are compiled in. + +@subheading Configuring the Basics +The number of nodes in the MANET can set at the command line. By default, +20 nodes are used. The size of the square topology can be set at the command +line. By default, the topology is 500 meters by 500 meters. +The location of the nodes is defined by a random generator of x and y +coordinates with the max and min values being the size of the topology. +GTNetS provides various random variable types, so the distribution of node +positions can be changed by chaning the random variable in +@code{WirelessGridRectangular()}. + +GTNetS also has the ability to set the shape of the grid. Shapes are +found in documentation. We have only experimented with rectangular and +polar. + +The time at which the simulator is stopped can be configured by changing +the stop time at the command line. +However, if this value is set below start time then Ospfv3 +routers will never fully come up. A start time delay is useful to avoid +synchronization of Ospfv3 routers and to give the routers time to initialize +before staistics are collected and data is sent. + +@subheading Configuring Wireless Behavior +The Wireless mode is defined by the WirelessGrid constructor. See the +GTNetS documentation for further configuring the wireless model. +Mobility is set to random waypoint. The random waypoint pause and velocity +can be set at the command line. + +@subheading onfiguring OSPFv3 +Ospfv3 in GTNetS can be configured in any way that the Quagga +implementation can be configured. We have passed a select few of these +parameters from quagga into GTNetS. +The GTNetS Ospfv3 configuration functions write the configuration to a +standard quagga config file. A sample quagga config file is seen +at gtnets/SRC/quagga/ospf6d/ospf6d.conf. + +The GTNetS per Ospfv3 interface paramters are seen in Subsection +@ref{Ospf6 per Interface Configuration} and +@ref{Ospf6 per Interface Type Configuration}. +The most important parameter to set for wireless interface testing is +the interface type. Currently, two wireless interface types +are available, point-to-multipoint and manet-designated-router. The wireless +interface type can be modified at the command line by selecting 0 for +ptmp and 1 for manet. Differential hellos can be enabled on the manet +interface at the command line. + +The value of the hello interval can be changed from 2 seconds by +changing @code{HelloInteval}. The neighbor dead interval can be changed +from 6 seconds by changing @code{DeadInterval}. The +retransmit interval can be modified from the command line. The per +interface routing cost can be modified by changing @code{cost}. By default, +the interace cost is set to 1. + +Two additional parameters were added to GTNetS. +We added the ability to jitter all the Ospfv3 packets. The amount of +jitter is uniformally distributed between zero and @code{interface_jitter}. +The default jitter is 100 msec. In addition, we added a paramter to delay +the sending of LSAs. This enables us to coalesce LSAs in fewer LSUs. +The delay is by default 100 msec, and it can be changed by modifying +@code{interface_flood_delay}. + +@subheading Configuring Data Traffic +All scenarios that we have configured use CBR data traffic. +The level of traffic is configured on a network wide basis, so the same +load of data traffic is produced for any number of nodes when the +packet rate and packet size are fixed. The traffic +load can be configure on the command line by setting pktrate and +pktsize. The default packet rate is 10 packets per second, and the +packet size is 40 bytes. +All data to wireless nodes must be sent to their loopback addresses. +The loopback addresses on wireless nodes has been configured to be +0.0.RouterId.0/24. + +@subheading Example Test Program +@anchor{Example Test Program} + +This sample program, @code{ietf/random_waypoint_manet/random_waypoint_manet.cc}, +creates a scenario a simple randomly moving MANET. +The scenario consists of N mobile nodes in a L meter square grid. +Nodes move according to the random waypoint model where each node selects a +destination within the grid and a velocity between 0 and V m/s. +The node then moves to the destination, pauses for P seconds, +selects a new destination and velocity, and repeats the process. +Each node is a router and has a wireless interface with an +802.11b or TDMA radio at a carrier rate of 11Mbps. +Each router also has a loopback +interface. Each host generates constant bit rate (CBR) traffic to every other +node by sending periodic B byte packets at a packet rate of R pkt/sec. +Each simulation trial is M minutes long, of which the first D minutes of data +is discarded; each OSPF router is started at a random time in the +first D minutes. The wireless interface can be configured to use OSPFv3 +routing with either a point-to-multipoint or manet interface. + +@subheading Include Files +Necessary include files are listed below. + + +File application-cbr.h is for CBR traffic generation. +File args.h is used for processing command line input. +File ipaddr.h is a class for ipv4 addresses. +File mobility-random-waypoint.h provides random waypoint mobility. +File node.h is the base class for nodes. +File rng.h is for random variable operations. +File simulator.h is the base simulator class for GTNetS. +File validation.h is the method to parse command line input used by GTNetS. +File wireless-grid-rectangular.h is responsible for the number of nodes in the MANET, network topology, and wireless interface configuration. +File wlan.h supports a wireless link layer. +These last three files were developed by Boeing. +File application-ospf6d.h is the main driver of quagga ospf6d. +File etrace.h provides packet level tracing. +File estat.h provides global statistics. + +@verbatim +// Copyright 2004, The Boeing Company +#include +#include + +#include "application-cbr.h" +#include "application-ospf6d.h" +#include "args.h" +#include "estat.h" +#include "etrace.h" +#include "ipaddr.h" +#include "mobility-random-waypoint.h" +#include "node.h" +#include "rng.h" +#include "simulator.h" +#include "validation.h" +#include "wireless-grid-rectangular.h" +#include "wlan.h" +@end verbatim + +@subheading Set Seeds Function +@anchor{Set Seeds Function} +The function @code{set_global_seeds()} is used to set GTNets global seeds from +a single seed. When GTNets global seeds are set, results are repeatable when +rerunning a scenario with the same seed. The seed should be set greater than +or equal to one. +@verbatim +void set_global_seeds(int seed) +{ + // turn one seed into 6 repeatable seeds in the simulator using srand() + unsigned long seeds[6]; + srand(seed); + + seeds[0] = rand(); + seeds[1] = rand(); + seeds[2] = rand(); + seeds[3] = rand(); + seeds[4] = rand(); + seeds[5] = rand(); + + Random::GlobalSeed(seeds[0],seeds[1],seeds[2],seeds[3],seeds[4],seeds[5]); +} +@end verbatim + +@subheading Main Function Initialization +The start of the @code{main()} function begins in this subsection. +Here the objects in the main function are initialized. +@code{Validation::Init()} is used to set seeding, animation, +and tracing in GTNetS. The function, @code{set_ospf6_config_arguments} +sets all the default values used for ospf and stores them in +@code{ca}. Execute @code{random_waypoint_manet-opt,dbg -h} at +the command line to see the default values. Default values are +set in @code{args.cc}. +The function, @code{set_global_seeds()}, sets the +global seed by calling the function in Section @ref{Set Seeds Function}. + +@verbatim +int main(int argc, char** argv) +{ + struct ospf6_config_args ca; + Validation::Init(argc, argv); + Simulator s; + Interface *inter; + IFVec_t vInterface; + std::string tracefile, statfile; + char hostname[20], logfilename[20]; + IPAddr_t first_rtrid; + + // Default configuration arguments are located in SRC/args.cc file + if (!set_ospf6_config_arguments(argc, argv, &ca)) + return 0; + + set_global_seeds(seed); +@end verbatim + + +@subheading Output File Configuration +In this subsection, the tracefile and statfile names are set. If a tag was +defined at the command line, the tag string will be appended to the file +name. Stat files are ended with .stat and trace files are ended with .tr. +@verbatim + // If user specifies "tag=args", this means that the suffix appended + // to the .stat or .tr filename should be the concatenation of all command + // line arguments, e.g.: + // random-waypoint-mobility-opt-num_nodes=20.seed=72.stat + if (ca.tag == "args") { + ca.tag.erase(0,4); + for (int q = 1; q < argc; q++) { + if (!strcmp(argv[q],"tag=args") || + !strcmp(argv[q],"trace") || + !strcmp(argv[q],"etrace") || + !strcmp(argv[q],"ospfv3.log")) + continue; + ca.tag.append(argv[q]); + ca.tag.append("."); + } + ca.tag.erase(ca.tag.length()-1, 1); + } + + // Prepare output file names + tracefile.append(argv[0]); + tracefile.erase(tracefile.length()-4,4); //delete "-opt" or "-dbg" from name + statfile.append(argv[0]); + statfile.erase(statfile.length()-4,4); // delete "-opt" or "-dbg" from name + + // Make sure that output file names are less than 256 char limit + if ((statfile.length() + ca.tag.length() + 7) > 256) { + int overrun = statfile.length() + ca.tag.length() + 7 - 256; + ca.tag.erase(ca.tag.length()- overrun, overrun); + } + + if (ca.tag.size()) { + tracefile.append("."); + tracefile.append(ca.tag.c_str()); + } + tracefile.append(".tr"); + + if (ca.tag.size()) { + statfile.append("."); + statfile.append(ca.tag.c_str()); + } + statfile.append(".stat"); + + cout << statfile.c_str() << endl; + + // Capture command line arguments for logging purposes + for (int q = 0; q < argc; q++) { + argstring.append(argv[q]); + argstring.append(" "); + } +@end verbatim + +@subheading Topology Configuration +The topology of the network is configured in this subsection. +The ipv4 address of the wireless interface on node 0 is set to 10.0.0.1. +Each subsequent node's wireless interface will receive an address +incremented by 1 from the first. To use Ospfv3 with ipv4, the ip address +must be less than +128.0.0.0 because the first bit in the ipv4 address is used to indicate +a linklocal address when converting to an ipv6 addresses with ospfv3. +A square topology with the bottom left corner at location (0,0) and +sides @code{ca.grid_length} meters is created by +@code{WirelessGridRectangular()}. +The number of nodes is a constant defined by @code{ca.nNodes}. +The nodes are uniformly distributed on the square grid. +The wireless MAC layer is also specified in this function. +Random waypoint mobility is defined by fuction, +@code{AddMobility(RandomWaypoint())} if the velocity is greater that zero. +The nodes travel to a random location +with the topology at a speed uniformally distributed between 0 and +@code{ca.velocity} m/s. After reaching the destination, the node pauses for +@code{ca.pause_time} seconds and then moves again. +@verbatim + // ipv4 addresses must be less than 128.0.0.0 for ospf6 because we used + // the first bit in the ipv4 address to indicate a linklocal address + IPAddr_t firstIP = IPAddr("10.0.0.1"); + + Location l(0,0); // lower left corner of rectangular grid + + // Randomize the distribution of nodes uniformly on square grid + WirelessGridRectangular g(ca.mac_protocol, + l, + Constant(ca.nNodes), //number of nodes + Uniform(0.0, ca.grid_length), + firstIP); + + // Mobility: Pause time is second argument, velocity is third argument + if (ca.velocity > 0) + g.AddMobility(RandomWaypoint(g, Constant(ca.pause_time), + Uniform(0,ca.velocity))); +@end verbatim + +@subheading Tracing Configuration +Extended tracing is configured in this subsection. Exteneded tracing was +developed by Boeing and more specifics can be found in +Section @ref{Tracing}. By default, tracing is disabled. +If tracing is enbabled at the command line then the tracefile is opened. +Extended tracing is also disabled by default. If it is enabled at the command +line then fuction, @code{SetExtended()}, enables extended tracing. +Extended tracing adds more detail to the basic packet level tracing. + +The ability to turn off tracing of a specified layer is provided by +function, @code{LayerOff()}. By default, all layers are enabled. +Finally, additional events can be written to the tracefile. +Events are used to display information or statistics not seen in packet level +tracing. The function, @code{SetTraceEventLevel()}, sets the verbosity of +events to display. A value of zero means no event tracing. +@verbatim + // Per-packet tracing configuration + if (ca.trace) { + ETrace* egs = ETrace::Instance(); + egs->Open(tracefile.c_str()); + if (ca.etrace) + egs->SetExtended(true); + egs->LayerOff(1); //don't etrace this layer + egs->LayerOff(2); //don't etrace this layer + egs->SetTraceEventLevel(2); + } +@end verbatim + +@subheading Statistics Configuration +The collection of statistics is initialized in this subsection. By default, +statistics are disabled. If statistics are enbaled at the command line then +statistics begin to be collected at @code{start_time} seconds, and +the results are output to the statistics file. + +@verbatim + // Statistics collection + EStat* estat = EStat::Instance(); + estat->CollectEStats(statfile.c_str(), ca.start_time); + estat->LayerOff(1); + estat->LayerOff(2); +@end verbatim + +@subheading Ospf6 and CBR Intitialization +The intitilization of Ospfv3 routing and CBR traffic is performed in this +subsection. The OSPF6DApplication must be created to run ospf6. The collection +of Ospfv3 stats is configured by @code{CollectStats()}. The rate of +monitoring the physical layer neighbors is set by function, +@code{LogNeighbors}. These physical neighbor statistics are printed +in the statistics file. The first router id indicates the id assigned +to the first node to have an OSPF6DInstance. +The rate of the cbr application is set so the whole MANET network generates +@code{pktrate} packets per second, each of @code{pktsize} bytes. +To avoid synchronization, the cbr traffic is started at a random time +within the packet send interval. +@verbatim + // OSPF6 initialization + OSPF6DApplication ospf6d; + ospf6d.CollectStats(statfile.c_str(), argstring.c_str(), ca.start_time); + ospf6d.LogNeighbors(0.5); // Log physical layer neighbors every 500 ms + + OSPF6DInstance *ospf6_inst; + Uniform u(0,ca.start_time); + first_rtrid = IPAddr("0.0.0.1"); + + // CBR traffic initialization + IPAddr remoteIP; + char buf[32]; + Rate_t rate_bps = ((Rate_t)ca.pktrate * ca.pktsize * 8) / + (ca.nNodes*(ca.nNodes-1)); + // start traffic generators at a random time + Uniform cbrstart(ca.start_time-(double)(ca.pktsize*8)/rate_bps,ca.start_time); +@end verbatim + +@subheading Per Node Configuration +The start of a @code{for} loop that loops over all nodes is begun in this +subsection. Each nodes radio range is set to the identical value, +@code{radio_range}. +@verbatim + for (Count_t i = 0; i < g.Size(); ++i) + { + Node* n = g.GetNode(i); + n->SetRadioRange(ca.radio_range); +@end verbatim + +@subheading Ospf6 per Node Configuration +In this subsection, each node is given an ospf6 instance. Also, the +host name, log file name, and id of each router is set. +The MinLSInterval and MinLSArrival are set here. +The MinLSInterval is the minimum time between originating the same LSA. +The MinLSArrival is the minimum time in which a router will accept +the same LSA. +@verbatim + // OSPF6 Router Configuration + ospf6_inst = ospf6d.AddNode(n); + + sprintf(hostname, "ospf6_%d", n->Id()+1); + sprintf(logfilename, "log_ospf6_%d.log", n->Id()+1); + + ospf6_inst->SetHostName(hostname); + if (ca.ospfv3log) + ospf6_inst->SetLogFileName(logfilename); + ospf6_inst->SetRouterId(n->Id()+first_rtrid); + ospf6_inst->SetMinLSInterval(ca.MinLSInterval); + ospf6_inst->SetMinLSArrival(ca.MinLSArrival); +@end verbatim + +@subheading Ospf6 per Interface Configuration +@anchor{Ospf6 per Interface Configuration} +In this subsection, the interfaces per node are configured with ospf6 interface +specific parameters. The time between periodic hello sends on an interface +is set with +@code{SetInterfaceHelloInterval()}. The time interval when a +neighbor dies due to inactivity of hello reception is set by +@code{SetInterfaceDeadInterval()}. The interval to wait before retransmitting +an LSA is set by @code{SetInterfaceRetransmitInterval()}. +The time that a router waits to colesce LSAcks is set by +@code{SetInterfaceAckInterval}. The ospf6 area +this interface is on is set with @code{SetInterfaceArea()}. The ospf cost +of sending on this interface is set with @code{SetInterfaceCost()}. The max +jitter that is added to the sends of ospf6 packets is set with +@code{SetInterfaceJitter()}. The packet jitter can be thought of as queing +delay of @code{interface_jitter} msec before it is sending. Finally, the +time to wait to accumulate LSAs before flooding is set with +@code{SetInterfaceFloodDelay()}. +@verbatim + vInterface = n->Interfaces(); + for (IFVec_t::iterator it=vInterface.begin(); it!=vInterface.end(); ++it) + { + ospf6_inst->SetInterfaceHelloInterval(*it, ca.HelloInterval); + ospf6_inst->SetInterfaceDeadInterval(*it, ca.DeadInterval); + ospf6_inst->SetInterfaceRetransmitInterval(*it, ca.RxmtInterval); + ospf6_inst->SetInterfaceAckInterval(*it, ca.AckInterval); + ospf6_inst->SetInterfaceArea(*it, 0); + ospf6_inst->SetInterfaceCost(*it, ca.cost); + // too much jitter can cause stale ospf6 state to be sent + ospf6_inst->SetInterfaceJitter(*it, ca.interface_jitter); //msec + ospf6_inst->SetInterfaceFloodDelay(*it, ca.interface_flood_delay); //msec +@end verbatim + +@subheading Ospf6 per Interface Type Configuration +@anchor{Ospf6 per Interface Type Configuration} + +The type of interface is set based on the characteristics of the interface. +The interface type can be either point-to-multipoint, or MDR . +The time which +a Backup MANET Designated Router waits before flooding an LSA +is set by @code{SetInterfaceBackupWaitInterval()}. +MDRs have options for the level of +adjacency connectivity and and the fullness of the router LSAs. +The parameter alpha influences +the probability of a packet being received within the radio range. +When alpha = 1, all packets sent within radio range are received. +The loopback interface is set to Ospfv3 type loopback. +Then cbr traffic is sent from this node to the loopback address of +every other router. The cbr traffic starts just prior to @code{start_time} +seconds and ends at @code{stop_time - 5} seconds. +The start time is jittered so synchronization among routers is avoided. +Finally, all other interface are set to Ospfv3 type broadcast. In this +scenario there are no other interfaces, so this event will not occur. + +@verbatim + if ((*it)->GetL2Proto()->IsWireless()) + { + if(ca.w_int_type == 0) + ospf6_inst->SetInterfaceType(*it, "point-to-multipoint"); + else if (ca.w_int_type == 1) + { + ospf6_inst->SetInterfaceType(*it, "manet-designated-router"); + ospf6_inst->SetInterfaceDiffHellos(*it, ca.diff_hellos); + ospf6_inst->SetInterfaceBackupWaitInterval(*it,ca.BackupWaitInterval); + ospf6_inst->SetInterfaceTwoHopRefresh(*it, ca.TwoHopRefresh); + ospf6_inst->SetInterfaceHelloRepeatCount(*it, ca.HelloRepeatCount); + + if (ca.AdjConnectivity == 0) + ospf6_inst->SetInterfaceAdjConnectivity(*it, "fully"); + else if (ca.AdjConnectivity == 1) + ospf6_inst->SetInterfaceAdjConnectivity(*it, "uniconnected"); + else + ospf6_inst->SetInterfaceAdjConnectivity(*it, "biconnected"); + + if (ca.LSAFullness == 0) + ospf6_inst->SetInterfaceLSAFullness(*it, "minlsa"); + else if (ca.LSAFullness == 1) + ospf6_inst->SetInterfaceLSAFullness(*it, "mincostlsa"); + else if (ca.LSAFullness == 2) + ospf6_inst->SetInterfaceLSAFullness(*it, "mincost2lsa"); + else if (ca.LSAFullness == 3) + ospf6_inst->SetInterfaceLSAFullness(*it, "mdrfulllsa"); + else + ospf6_inst->SetInterfaceLSAFullness(*it, "fulllsa"); + } + if (i==0) + { + WirelessLink *l = (WirelessLink *) (*it)->GetLink(); + l->SetAlpha(ca.alpha); + } + } + else if (strcmp((*it)->GetName(), "lo") == 0) + { + ospf6_inst->SetInterfaceType(*it, "loopback"); + if (rate_bps > 0 && ca.pktsize > 0) + { + // CBR traffic from this router to all other router's loopback addr + for (Count_t j = 0; j < g.Size(); ++j) + { + if (i == j) + continue; + sprintf(buf, "0.0.%d.0", j+1); //loopback addr of routers + remoteIP = IPAddr(buf); + CBRApplication* cbr = (CBRApplication*) n->AddApplication( + CBRApplication(remoteIP,1000,NO_PORT,rate_bps,ca.pktsize)); + cbr->Start(cbrstart.Value()); + cbr->Stop(ca.stop_time - 5); + } + } + } + else + ospf6_inst->SetInterfaceType(*it, "broadcast"); + } +@end verbatim + +@subheading Setting Start and Stop Times +The Ospfv3 routers are started at a random time +between 0 and @code{start_time} seconds. This prevents Ospfv3 packets +from being synchronized. The simulation starts at time 0 and ends at +time @code{stop_time} seconds. +The progress is displayed at the command line every 40 seconds. +Simulations are commenced by function @code{Run()}. +@verbatim + ospf6_inst->Start(u.Value()); // random start time of each ospf6 router + } + s.StopAt(ca.stop_time); + s.Progress(40); + s.Run(); +} +@end verbatim + +@subheading Example Test Programs +@itemize +@item @strong{ ietf/initial/basic.cc}. This program, described above in +the example, runs a basic wireless network with Ospfv3 routing. +@item @strong{ ietf/random_waypoint_manet/random_waypoint_manet.cc}. +This program is similar to the basic.cc program, but it contains +many new updates. It includes support for using a TDMA MAC based on +the Unifying Slot Assignment Protocol (USAP). +@item @strong{ validation/sicds/basic/basic.cc} Performs validation of the +MDR algorithm. +@item @strong{ validation/sicds/pushback1/lsu_loss.cc} Performs validation +of an LSA being delayed after lossing the initial flood. +@item @strong{ validation/sicds/pushback2/lsack_loss.cc} Preforms validation +of losing an LSAck and then having the backupwait timer expire. +@item @strong{ validation/sicds/pushback3/lsu_loss_pushback_lsu_loss.cc} +Performs validation of an LSA being lost, having a node send out a +backupwait LSA and loose it, and then finally having another node +send a backupwait LSA. +@item @strong{ ietf/link_matrix_manet/link_matrix_manet.cc} Uses +an extension +to ethernet (known as link matrix) that allows the bringing up and down +of specifed links at particular times. +@item More scripts are included in the ietf and validation subdirectories. +Please contribute any interesting scripts. +@end itemize + +@subsubsection Simulation Output +There are two main ways to look at simulation output: +@enumerate +@item Explicit "tcpdump"-like tracing of packets to an output +file that can be post-processed later +@item Compilation of summary statistics that can be printed +out at the end of the simulation +@end enumerate + +GTNetS had a basic tracing capability, but we have extended it further +to print out more +detailed logging. This can be used to examine trace output for +correct or errored behavior (much like a tcpdump output file), +or can be fed into post-processing scripts to gather statistics. +The file would typically be called @code{testname.tr}. + +However, for large simulations, both the file size and the time +to parse the traces can become very large, so we also provide +a capability to dump summary statistics into a file at the end +of the simulation run (into a file typically called @code{testname.stat}). + +@subheading Tracing +@anchor{Tracing} + +@subheading How to Enable Tracing + +GTNetS has a built-in tracing facility based on the @emph{Trace} object. +We cloned that object class to create the Extended Trace, or @emph{ETrace} +object. Either, neither, or both Trace and ETrace can be enabled +on a particular script. + +@float Figure,f:tracescript +@verbatim + ETrace* egs = ETrace::Instance(); + egs->Open(""); +@end verbatim +@caption{Sample code to control tracing} +@end float + +@ref{f:tracescript} illustrates the basic C++ commands to +add to your testfile to enable tracing. This snippet creates an ETrace +object and associates it with a file. The filename can be anything +you want. The semantics are to overwrite (not append) any existing +file that may be at that location. + +@float Figure,f:tracescript2 +@verbatim + // Per-packet tracing configuration + if (ca.trace) { + ETrace* egs = ETrace::Instance(); + egs->Open(tracefile.c_str()); + if (ca.etrace) + egs->SetExtended(true); + egs->LayerOff(1); //don't trace this layer + egs->LayerOff(2); //don't trace this layer + egs->TraceTopo(ca.tracetopo); // trace topology every tracetopo seconds + egs->SetTraceEventLevel(2); + } +@end verbatim +@caption{Sample code to control tracing} +@end float + +@ref{f:tracescript2} shows how to control options on what is and isn't +traced. By default, all protocol layers on all nodes are traced. There are +a number of options to control this, however: + +@itemize +@item SetExtended(true|false). This will enable extended tracing, which +basically means to trace beyond the IP header and into the OSPF packet body. +Default is false. +@item SetEventTraceLevel(0|1|2). This controls the level of debugging +output for protocol events (non-packet events) put into the tracefile +(the higher the number, the more events that are logged). Level 1 adds +the following events: +@itemize +@item Count of OSPF packet drops and OTHER packet drops upon end of simulation +@item Information about the number of LSAs out of sync during database exchange +@item when a unicast LSU is sent +@item statistics on the number of neighbors of a node whenever a neighbor +change event occurs +@end itemize +Level 2 adds the following events: +@itemize +@item Prints out when the router started operation +@item Dumps relay selector lists +@item More information traced regarding neighbors changing state +@end itemize +@item LayerOff(n). This indicates that tracing at a particular protocol +layer is disabled. +@item NodeOff(n). This indicates that tracing at a particular node +is disabled. +@item TraceTopo(n). Enable the tracing of topology information every n +seconds. +@end itemize + + +@subheading Sample Tracefile + +@float Figure,f:tracefile +@verbatim +s 3599.97947 N12 -int 1 -pkt_id 1329237 -l3proto IPv4 -src 10.0.0.13 -dst 0.0.1 +4.0 -len 92 -ttl 64 -proto UDP +r 3599.97992 N8 -int 1 -pkt_id 1321800 -l3proto IPv4 -src 138.0.0.14 -dst 138.0 +.0.9 -len 56 -ttl 0 -proto OSPFv3 -type LSAck +r 3599.98195 N13 -int 1 -pkt_id 1329237 -l3proto IPv4 -src 10.0.0.13 -dst 0.0.1 +4.0 -len 92 -ttl 63 -proto UDP +@end verbatim +@caption{Sample tracefile excerpt, with sample 80-column wrap} +@end float + +@ref{f:tracefile} illustrates a sample tracefile excerpt from the +testwirelessospf.cc script. In this example, extended tracing is off, so +OSPF protocol parsing beyond the packet type is disabled. Each traceline +starts with a single character event code. The following event codes +are defined. +@itemize +@item @strong{ s}: Packet send event +@item @strong{ r}: Packet receive event +@item @strong{ f}: Packet forward event +@item @strong{ d}: Packet drop event +@item @strong{ c}: Packet collision event +@item @strong{ e}: Protocol event (non-packet event) +@item @strong{ n}: Node location and DR level(non-packet event) +@item @strong{ a}: Adjacency involving a DR_OTHER router (non-packet event) +@item @strong{ b}: Adjacency between (B)MDRs (non-packet event) +@end itemize +The next field is the node number, followed by a number of key-value pairs: +@itemize +@item @strong{ int}: Interface number that packet was seen on +@item @strong{ pkt_id}: Packet unique id +@item @strong{ l3proto}: Layer 3 protocol in use +@item @strong{ ...}: Other fields are probably self explanatory +@end itemize + +These trace lines will contain more information (expanded) if extended +tracing is enabled. + +@subheading Animating MDR Topology +@anchor{Animating MDR Topology} + +The topology of the OSPF-MDR interface can be displayed graphically +in the form of an animated "gif" file. The animated gif is created +by enabling topology tracing and by +post processing the tracing to form the "gif" file. The appropriate +trace lines are output by calling the function +@code{ETrace::TraceTopo()}. If one is using +@code{random_waypoint_manet.cc} then either @code{tracetopo=<>} or +@code{tracetopoonly=<>} are called from the command line. The input +parameter is the sampling rate in seconds. +The final step is to run +@code{gtnets/bin/tracetogif.pl} on the trace file. The usage of +@code{tracetogif.pl} can be determined by running it with no input +parameters. An example parameterization is shown here: +@code{./tracetogif.pl -stop 2000 -delay 200 trace.tr}. The following +would create an animated gif of the topology data between 1800 and +2000 secs, and it would shows snapshots of the topology every 2 seconds. + +@ignore +\begin{figure}[h] + \centerline{\psfig{figure=wospf-figures/bi.mdr.numnodes.100.eps,width=5.0in}} + \caption{@node{fig:mdranim}100 node OSPF-MDR topology with bi-connected + adjacencies and (B)MDR full LSAs} +\end{figure} +@end ignore + + +@subheading Statistics +@anchor{Statistics} + +To be able to turn off tracing for larger scenarios, we added some +counter-based statistics gathering. At present, this is turned on by +adding the following lines to a particular script: + +@float Figure,f:tracescript3 +@verbatim + //Extended Statistics Configuration + EStat* estat = EStat::Instance(); + estat->CollectEStats(statfilename, delay); + estat->LayerOff(1); + estat->LayerOff(2); + //Ospfv3 Statitistics Configuration + OSPF6DApplication ospf6d; + ospf6d.CollectStats(statfilename, delay); +@end verbatim +@caption{Sample code to control tracing} +@end float + +The output of the statistics will be deposited in the filename +specified, with a @code{.stat} suffix. + +Currently, EStat only generates statitics for UDP traffic, and all +Ospfv3 stats are generated by +@code{class OSPF6DApplication}. We did not use +GTNetS built-in Statistics class because that code is not compatible +with quagga. + +To add additional statistics to Ospfv3, the statistic name must be added +to the enumeration @code{ospf6_stats} in @code{ospf6_top.h}. Each of +these names are elements in the statistics array found in struct ospf6. +Next, the appropriate +place to count the statistic must be found, and the statisitic is counted +by incrementing the element in the array statistic. Statistics in struct +ospf6 are per node, so in the @code{application-ospf6d.cc} function +@code{OSPF6DApplication::ExtractStats()} the node stats are summed to create +global network stats. The final step in creating a new stat is to +add the printout of the value in the @code{application-ospf6d.cc} function +@code{OSPF6DApplication::PrintStats()}. + +@subheading Logging +@anchor{Logging} +Logging build into quagga Ospfv3 has been integrated with GTNetS, so the same +logging produced by quagga can be produced in GTNetS. +Quagga logging creates a seperate log for each router. +To use the logging in GTNetS, the log file for each node must be named +by calling the function @code{OSPF6Instance::SetLogFileName()}. +When this function is called, logging will be generated for LSAs, Hellos, +LSUs, LSAcks, LSRs, and Database Description packets. In addition, +logging will be generated for neighbor and interface changes. +The type of logging generated can be changed in @code{application-ospf6d.cc} +function @code{OSPF6DInstance::CreateConfFile()}. + +%% Note: Use two labels below for cross-referencing in two different reports + +@subsubsection Validation + +This section explains the validation of the OSPF modifications. +Our validation scripts serve two purposes: +@enumerate +@item Detection of code modifications that inadvertently break the correct +behavior of a protocol. +@item Isolation of particular protocol elements to ensure that they +are working correctly. +@end enumerate + +In this section, we first describe the general script that can be used +to detect changes to the behavior of protocols. We then follow +with some examples of how we validated the specific OSPF modifications. + +@subheading The "validate" Script +@anchor{The "validate" Script} + +There is a script called @code{validate} in the top level directory. +This script finds all executables in any subdirectories in the +@code{validation/} directory and executes them. +Each directory in @code{validation} +contains the validation driver, an expected trace file, and expected +stat file. +The @code{validate} script compares +the expected output with the current output. Any differences +are output to a diff file, and they are flagged as a @code{FAILURE} +at the command line. To run @code{validate} the environment variable +@code{GTNETS_HOME} must be set to GTNetS base directory. +This is very similar to how the ns-2 simulator validation works. + +The idea behind this is that if there are changes to the behavior of +the protocols covered by example scripts, then the validation output +will start to diverge from the known good output. The researcher +can then run the @code{validate} script to find out what scripts +are broken, examine the @code{diff} file produced, and determine +whether the source code is broken or whether the expected known +good output needs to be updated (for @code{validate} to pass in +the future). + +@subheading Basic Validation +@anchor{Basic Validation} + +Let's first look at a very simple network-- four OSPFv3 nodes fully +meshed on a broadcast-based subnet (e.g., Ethernet) but running +the multicast-capable point-to-multipoint (i.e., non-MANET) interface +type. We will use the "Matrix" channel, a prototypical script for +which can be found in +@code{ietf/link_matrix_manet/link_matrix_manet.cc}. "Matrix" channel is +intended to allow the packet delivery ratio between any pairwise +set of nodes to be altered, but the default is full mesh connectivity. + +This executable is built if the @code{ietf/} directory was +enabled; this can be done with, for example, @code{make ietf-opt}, +@code{make ietf-dbg}, etc. from the top level directory (see +@ref{Building the Simulator}). + +Let's assume that the "optimized" version of the binary has been +built. Type @code{./link_matrix_manet-opt -help} to see the list +of options and default values. + +We will run with most of the defaults. However, let's enable all +output tracing and logging, and set the number of nodes from its +default of 20 to just 4, and turn off the minimal user data traffic +by setting the packet rate to zero: +@code{./link_matrix_manet-opt num_nodes=4 pktrate=0 trace etrace ospfv3log} + +Next, type @code{more link_matrix_manet-opt.stat} to look at the statistics +file generated. This simulation ran for 3600 seconds, and statistics +were collected over the last 1800 seconds (total of 1800 seconds simulation +time). There is not much of interest to see; there were 720 Hello +messages (one Hello per node every 10 seconds for four nodes and 1800 seconds +yields 720 Hellos). There were 32 LSU packets sent, and (further +down in the statistics output) 48 "relay_flooded_LSAs". We will next +sanity check these results by looking at the output trace file. + +The detailed per-packet and per-event tracing can be found in the +@code{link_matrix_manet-opt.tr} file. Even for this small quiet network, +there are over 4500 lines of trace output generated. Grep for "Started" and +you should see something like: +@verbatim +e 31.41292 N1 Ospf6 Router Started +e 57.94125 N2 Ospf6 Router Started +e 1274.60552 N0 Ospf6 Router Started +e 1634.38450 N3 Ospf6 Router Started +@end verbatim +illustrating the starting times of each router for nodes 0 through 3 (the +event code "e" signifies that this is an implementation event and not a packet). + +For convenience, let's remove all Hello messages from the trace output: +@code{grep -v HELLO link_matrix_manet-opt.tr > output.tr}. Now, let's +look at the resulting @code{output.tr} file. We know that the +first router started up at time 31.4, so at around time 1831.4, there +should be some re-originated LSAs. This can be seen in the +@code{output.tr} file: +@verbatim +e 1831.41492 N1 Re-orig LSA Link -id 0.0.0.1 -advrt 0.0.0.2 -age 0 -seq 21474836 +50 -len 64 +e 1831.41492 N1 Schedule Flood LSA Link -id 0.0.0.1 -advrt 0.0.0.2 -age 0 -seq 2 +147483650 -len 64 from (null) +e 1831.41492 N1 Re-orig LSA Intra-Prefix -id 0.0.0.0 -advrt 0.0.0.2 -age 0 -seq2 +147483650 -len 72 +e 1831.41492 N1 Schedule Flood LSA Intra-Prefix -id 0.0.0.0 -advrt 0.0.0.2 -age0 + -seq 2147483650 -len 72 from (null) +s 1831.53392 N1 -int 1 -pkt_id 519 -l3proto IPv4 -src 138.0.0.2 -dst 224.0.0.5- +len 176 -ttl 1 -proto OSPFv3 -type LSU -len 156 -rid 0.0.0.2 -aid 0.0.0.0 -Num2 +-Lsa Link -id 0.0.0.1 -advrt 0.0.0.2 -age 1 -seq 2147483650 -len 64 -Lsa Intra-P +refix -id 0.0.0.0 -advrt 0.0.0.2 -age 1 -seq 2147483650 -len 72 +@end verbatim +The two LSAs (Intra-Prefix and Link) are generated, and sent in a single +LSU at time 1831.53392. Scrolling down in the tracefile, we can see +that nodes N0, N3, and N4 also receive and reflood this LSU. This accounts +for a total of 4 LSU transmissions, and there are 4 nodes that will +perform this reorigination, so this accounts for 16 of the LSUs, and +32 of the LSAs in the above cited statistics counts. Now, consider that +the Router LSAs are expiring at a different time, since they were +all changed after the fourth router originally came up. Therefore, each +node will generate an additional LSU, causing four LSU transmissions per +node (an additional 16 LSU transmissions and LSA floods) starting around +time 3435. This yields our counts of 32 LSU transmissions and 48 LSA +floods. + +Note that if there were a quagga implementation, output would be stored +in output logs; these should be now available in the @code{log} directory. + +@subheading Radio Range +@anchor{Radio Range} +The directory @code{validation/radio_range} contains some scripts used +to determine the radio range of the selected 802.11-based radios, based +on varying the distance between nodes. These scripts are not well-documented +at this time, but were used to check the radio behavior for different +parameterization. + +@subsection License and Contributing Code + +This software builds on two projects (GTNetS and quagga) that are under +GNU General Public License (GPL). Our modifications are also under GPL. +Therefore, please consider this simulator as GPL'ed software. + +We would like to encourage people to send in bug fixes, extensions, +or to make their simulation scripts available (that produce their +simulation results). By default, we will not include any contributed +code, bug fixes, or patches unless you specify that you want to include +said code in our future releases of this simulator (also under GPL). --- quagga-0.99.9/doc/ospf6d-manet.texi 1969-12-31 16:00:00.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/doc/ospf6d-manet.texi 2008-04-16 11:55:52.000000000 -0700 @@ -0,0 +1,368 @@ +@node OSPF-MANET +@chapter OSPF-MANET + +@command{OSPF-MANET} is a modification of OSPF version 3 (IPv6) for use +in mobile ad hoc networks (MANETs). OSPF for IPv6 is described in RFC2740. + +This chapter is a supplement to the main quagga (@uref{http://www.quagga.net}) +documentation. It describes the implementation, functionality, and usage +of OSPF-MANET and related extensions. + +@menu +* Overview-MANET:: +* Protocol Operation:: +* Enabling OSPF-MANET:: +* Building OSPF-MANET:: +* Configuring OSPF-MANET:: +* Running OSPF-MANET:: +* Use with Address Families:: +* OSPF-MANET Configuration Examples:: +* OSPFv3 Simulation with GTNetS +@end menu + +@node Overview-MANET +@section Overview + +OSPF-MANET can be built for typical quagga usage as a standalone router, +for support in virtual machines such as IMUNES, and within a discrete-event +network simulator. + +OSPF-MANET is defined for IPv6 (OSPFv3). With the addition of what is +known as the @emph{Address Families} patch, an instance of OSPF-MANET can +also be run to build IPv4 routes. Note that to get both IPv4 and IPv6 routing, +two instances of OSPFv3 must be running, as presently defined by the draft +standard. + +OSPF-MANET is distributed as a series of patches against a mainline +quagga distribution. The Boeing server is located at +@uref{http://hipserver.mct.phantomworks.org/ietf/ospf/}. + +@subsection Draft compliance + +@uref{http://tools.ietf.org/html/draft-ietf-ospf-manet-mdr,,draft-ietf-ospf-manet-mdr-01} +The implementation currently excludes some optional capabilities. This +includes the MDR-Metric TLV. + +@subsection License and Contributing Code +This software builds on two projects (GTNetS and quagga) that are under +GNU General Public License (GPL). Our modifications are also under GPL. +Therefore, please consider this simulator as GPL'ed software. + +We would like to encourage people to send in bug fixes, extensions, +or to make their simulation scripts available (that produce their +simulation results). By default, we will not include any contributed +code, bug fixes, or patches unless you specify that you want to include +said code in our future releases of this simulator (also under GPL). + +@subsection Contributors + +This OSPF-MANET software is the product of a number of individuals, +including: +@itemize @bullet +@item Jeff Ahrenholz +@item Claudiu Danilov +@item Tom Henderson +@item Jeff Meegan +@item Richard Ogier +@item Gary Pei +@item Phil Spagnolo +@end itemize + +This research was funded by +the Office of Naval Research under contract N00014-04-C-0003 and Boeing +internal research. The +simulator developed for this project is an extension of two open-source +software projects: the Georgia Tech Network Simulator (GTNetS) and the +Quagga Routing Suite. + +@node Protocol Operation +@section Protocol Operation + + +For now, please see @uref{http://hipserver.mct.phantomworks.org/ietf/ospf/milcom06.pdf} +or Section 2 of @uref{http://tools.ietf.org/html/draft-ietf-ospf-manet-mdr,,draft-ietf-ospf-manet-mdr} + +@node Enabling OSPF-MANET +@section Enabling OSPF-MANET + +OSPF-MANET is enabled by compiling the flags into the source code. +@itemize @bullet +@item BUGFIX: Bugs found in the quagga source. +@item OSPF6_CONFIG: Flag to add new configuration commands. +@item OSPF6_DELAYED_FLOOD: Delay the flooding of an LSA for coalescing. +@item OPF6_MANET_MDR: Enable the use of OSPF-MANET MDR is OSPFv3. +@item OSPF6_DD_OPT: Enable an optimization to the database exchange algorithm. +@item OSPF6_MANET_DIFF_HELLO: Enable differential Hellos in OSPF-MANET MDR. +@item OSPF6_SMF: Hook to allow SMF to use MDR relay set. +@end itemize + +By default these flags are compiled into the code. They must be removed +from configure.ac to disable. + +To support IPv4 routing using OSPF-MANET, one must also define the Address +Families patch (described in another chapter). + +@node Building OSPF-MANET +@section Building OSPF-MANET + +To build quagga as standalone router run: +@verbatim +autoreconf or ./update-autotools +./configure --enable-user=root --enable-group=root --enable-vtysh \ +--with-cflags=-ggdb +make +make install +@end verbatim + +To build quagga in IMUNES (or Boeing's CORE), use the following configure line: +@verbatim + ./configure --enable-user=root --enable-group=wheel \ + --sysconfdir=/usr/local/etc/quagga --enable-vtysh \ + --localstatedir=/var/run/quagga --with-cflags=-ggdb +@end verbatim + +@node Configuring OSPF-MANET +@section Configuring OSPF-MANET + +OSPF-MANET can be configured in one of two ways: +command line interface (CLI) or config file (ospf6d.conf). +In either case, you must install a zebra.conf and ospf6d.conf file in +/usr/local/etc/. +@itemize @bullet +@item CLI: run configuration commands in vtysh or telnet +@item put configuration commands in zebra.conf and ospf6d.conf +@end itemize + +The following commands configure OSPF-MANET MDR. + +@subsection OSPF6 router + +@deffn {OSPF6 Command} {router minls-interval <0-65535>} {} +Set the router's minimum time (in seconds) between LSA origination. +Default 5 +@end deffn + +@deffn {OSPF6 Command} {router minls-arrival <0-65535>} {} +Set the router's minimum time (in seconds) between LSA reception. +Default 1 +@end deffn + +@subsection OSPF6 area + +@deffn {OSPF6 Command} {area @var{a.b.c.d} linklog-file @var{filename}} {} +Set the filename to log links to. Logging links for area +@var{a.b.c.d} is enabled when both @command{linklog-file} and +@command{linklog-interval} are set. The router ID of the advertising +router and it's neighbor are logged in the following format (note the +timestamp is GMT, not local time). +@example +Routing-Links List: 16:28:32.583109 +10.0.0.1 -> 10.0.0.2 +10.0.0.1 -> 10.0.0.5 +10.0.0.2 -> 10.0.0.1 +10.0.0.2 -> 10.0.0.5 +10.0.0.5 -> 10.0.0.1 +10.0.0.5 -> 10.0.0.2 +End of Routing-Links List. +@end example +@end deffn + +@deffn {OSPF6 Command} {area @var{a.b.c.d} linklog-interval <0-255>} {} +Set the minimum time (in seconds) between logging links. An interval +of zero disables link logging for area @var{a.b.c.d}. +Default 0 (link logging is disabled) +@end deffn + +@deffn {OSPF6 Command} {no area @var{a.b.c.d} linklog} {} +Disable logging links for area @var{a.b.c.d}. This is equivalent to +setting @command{linklog-interval} to zero. +@end deffn + +@subsection OSPF6 interface + +@deffn {Interface Command} {ipv6 ospf6 network (broadcast|non-broadcast|point-to-multipoint|point-to-point|loopback|manet-designated-router)} {} +@table @code +@item broadcast +Specify OSPF6 broadcast multi-access network + +@item non-broadcast +Specify OSPF6 NBMA network + +@item point-to-multipoint +Specify OSPF6 point-to-multipoint network + +@item point-to-point +Specify OSPF6 point-to-point network + +@item loopback +Specify OSPF6 loopback + +@item manet-designated-router +Specify OSPF6 manet-designated-router (MDR) network +@end table +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 flood-delay <1-65535>} {} +Time in msec to coalesce LSAs before sending. Default 100 +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 jitter <1-65535>} {} +Time in msec to jitter sending of all ospf6 packets. Default 100 +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 ackinterval <1-65535>} {} +Interval of time in msec to coalesce acks. Default 1800 +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 backupwaitinterval <1-65535>} {} +Interval of time in msec for MBDRs to wait before flooding. Default 2000 +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 diffhellos} {} +Enable differential hellos +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 twohoprefresh <1-65535>} {} +When using differential Hellos, full Hellos are sent every +TwoHopRefresh Hellos. Default 3 +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 hellorepeatcount <1-65535>} {} +Total hellos in succession that cannot be missed using differential +hellos. Default 3 +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 adjacencyconnectivity (uniconnected|biconnected|fully)} {} +Level of adjacencies between neighbors +@table @code +@item uniconnected +The set of adjacencies forms a (uni)connected graph. + +@item biconnnected +The set of adjacencies forms a biconnected graph. + +@item fullyconnected +Adjacency reduction is not used, the router becomes adjacent with all +of its neighbors. +@end table +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 lsafullness (minlsa|mincostlsa|mincost2lsa|mdrfulllsa|fulllsa)} {} +Choose the OSPFv3 interface type +@table @code +@item minlsa +Specify min size LSAs (only adjacent neighbors) + +@item mincostlsa +Specify partial LSAs for min-hop routing + +@item mincost2lsa +Specify partial LSAs for two min-hop routing paths + +@item mdrfulllsa +Specify full LSAs from MDR/MBDRs + +@item fulllsa +Specify full LSAs (all routable neighbors) +@end table +@end deffn + +@deffn {Interface Command} {ipv6 ospf6 smf_mdr_talk} {} +Allow SMF to use the MDR relay set. +@end deffn + +@node Running OSPF-MANET +@section Running OSPF-MANET + +Run the following commands for the command prompt: +@verbatim +/usr/local/sbin/zebra -d +/usr/local/sbin/ospf6d -d +@end verbatim + +To verify OSPF-MANET is running, from a vtysh or telnet terminal type: +@verbatim + > show ipv6 ospf6 route +@end verbatim + +This should display the OSPFv3 routes. If IPv4 AFs are used then the +route will appear as an IPv6 route with zeros before the IPv4 route. +Next, type the following command for IPv4 or IPv6 +@verbatim + > show ip route + > show ipv6 route +@end verbatim + +The entries with the "*" are going to be installed in the kernel routingtable. If these tables are correct then the kernel routing table should be correct. + +@node Use with Address Families +@section Use with Address Families + +To use OSPF MANET to carry IPv4 prefix information, one may enable it +with the following configuration. + +In the interface description section, define an instance-id greater than +64. Such as: + +@verbatim +interface ath0 + ... + ipv6 ospf6 instance-id 65 + ... +@end verbatim + +Then, in the router definition section, describe networks to be associated +with OSPF MANET. + +@verbatim +router ospf6 + router-id 10.1.0.1 + interface ath0 area 0.0.0.0 +@end verbatim + +@subsection Redistribution between OSPFv2 and OSPFv3 MANET + +(to be completed) + +@node OSPF-MANET Configuration Examples +@section OSPF-MANET Configuration Examples + +Here is an example of an interface declaration of an OSPF-MANET interface, +from the @code{ospf6d.conf} file. + +@example +interface ath0 + ipv6 ospf6 priority 1 + ipv6 ospf6 transmit-delay 1 + ipv6 ospf6 instance-id 65 + ipv6 ospf6 ifmtu 1500 + ipv6 ospf6 cost 1 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 6 + ipv6 ospf6 retransmit-interval 5 + ipv6 ospf6 network manet-designated-router + ipv6 ospf6 ackinterval 1800 + ipv6 ospf6 diffhellos + ipv6 ospf6 backupwaitinterval 2000 + ipv6 ospf6 twohoprefresh 3 + ipv6 ospf6 hellorepeatcount 3 + ipv6 ospf6 adjacencyconnectivity biconnected + ipv6 ospf6 lsafullness mdrfulllsa + ipv6 ospf6 flood-delay 100 +! +@end example + +The below router declaration example tells quagga to run OSPF-MANET +on interface ath0 and to redistribute OSPF and connected networks. + +@example +router ospf6 + router-id 10.1.0.1 + interface ath0 area 0.0.0.0 + redistribute ospf + redistribute connected +! +@end example + +@section OSPFv3 Simulation with GTNetS +@include ospf6d-gtnets.texi --- quagga-0.99.9/doc/quagga.texi 2006-07-27 15:55:49.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/doc/quagga.texi 2008-04-16 11:55:52.000000000 -0700 @@ -86,6 +86,8 @@ for @value{PACKAGE_STRING}. @uref{http:/ * RIPng:: * OSPFv2:: * OSPFv3:: +* OSPFv3 Address Families:: +* OSPF-MANET:: * BGP:: * Configuring Quagga as a Route Server:: * VTY shell:: @@ -110,6 +112,8 @@ for @value{PACKAGE_STRING}. @uref{http:/ @include ripngd.texi @include ospfd.texi @include ospf6d.texi +@include ospf6d-af.texi +@include ospf6d-manet.texi @include bgpd.texi @include routeserver.texi @include vtysh.texi --- quagga-0.99.9/lib/buffer.c 2005-12-02 03:02:17.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/buffer.c 2008-04-16 11:55:54.000000000 -0700 @@ -53,7 +53,12 @@ struct buffer_data size_t sp; /* Actual data stream (variable length). */ +#if ( __GNUC__ == 2) + // did not compile in FreeBSD, gcc 2.95.4 + unsigned char data[0]; /* real dimension is buffer->size */ +#else unsigned char data[]; /* real dimension is buffer->size */ +#endif }; /* It should always be true that: 0 <= sp <= cp <= size */ @@ -148,7 +153,8 @@ buffer_add (struct buffer *b) { struct buffer_data *d; - d = XMALLOC(MTYPE_BUFFER_DATA, offsetof(struct buffer_data, data[b->size])); + d = + XMALLOC (MTYPE_BUFFER_DATA, offsetof (struct buffer_data, data[b->size])); d->cp = d->sp = 0; d->next = NULL; @@ -237,7 +243,8 @@ buffer_flush_window (struct buffer *b, i char more[] = " --More-- "; char erase[] = { 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', - 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08}; + 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 + }; struct buffer_data *data; int column; @@ -314,7 +321,8 @@ buffer_flush_window (struct buffer *b, i { zlog_warn("%s: growing iov array to %d; " "width %d, height %d, size %lu", - __func__, iov_alloc, width, height, (u_long)b->size); + __func__, iov_alloc, width, height, + (u_long) b->size); iov = XREALLOC(MTYPE_TMP, iov, iov_alloc*sizeof(*iov)); } else --- quagga-0.99.9/lib/buffer.h 2005-05-03 12:05:50.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/buffer.h 2008-04-16 11:55:54.000000000 -0700 @@ -96,7 +96,8 @@ extern buffer_status_t buffer_flush_all to return -1 (because the logic for handling the erase and more features is too complicated to retry the write later). */ -extern buffer_status_t buffer_flush_window (struct buffer *, int fd, int width, - int height, int erase, int no_more); +extern buffer_status_t buffer_flush_window (struct buffer *, int fd, + int width, int height, int erase, + int no_more); #endif /* _ZEBRA_BUFFER_H */ --- quagga-0.99.9/lib/checksum.c 2005-11-03 03:52:14.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/checksum.c 2008-04-16 11:55:54.000000000 -0700 @@ -24,13 +24,15 @@ in_cksum(void *parg, int nbytes) */ sum = 0; - while (nbytes > 1) { + while (nbytes > 1) + { sum += *ptr++; nbytes -= 2; } /* mop up an odd byte, if necessary */ - if (nbytes == 1) { + if (nbytes == 1) + { oddbyte = 0; /* make sure top half is zero */ *((u_char *) &oddbyte) = *(u_char *)ptr; /* one byte only */ sum += oddbyte; --- quagga-0.99.9/lib/command.c 2007-04-29 05:40:39.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/command.c 2008-04-16 11:55:54.000000000 -0700 @@ -41,74 +41,88 @@ vector cmdvec = NULL; struct host host; /* Standard command node structures. */ -struct cmd_node auth_node = -{ +struct cmd_node auth_node = { AUTH_NODE, "Password: ", }; -struct cmd_node view_node = -{ +struct cmd_node view_node = { VIEW_NODE, "%s> ", }; -struct cmd_node auth_enable_node = -{ +struct cmd_node auth_enable_node = { AUTH_ENABLE_NODE, "Password: ", }; -struct cmd_node enable_node = -{ +struct cmd_node enable_node = { ENABLE_NODE, "%s# ", }; -struct cmd_node config_node = -{ +struct cmd_node config_node = { CONFIG_NODE, "%s(config)# ", 1 }; /* Default motd string. */ -const char *default_motd = -"\r\n\ +const char *default_motd = "\r\n\ Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\ " QUAGGA_COPYRIGHT "\r\n\ \r\n"; -static struct facility_map { +static struct facility_map +{ int facility; const char *name; size_t match; } syslog_facilities[] = { - { LOG_KERN, "kern", 1 }, - { LOG_USER, "user", 2 }, - { LOG_MAIL, "mail", 1 }, - { LOG_DAEMON, "daemon", 1 }, - { LOG_AUTH, "auth", 1 }, - { LOG_SYSLOG, "syslog", 1 }, - { LOG_LPR, "lpr", 2 }, - { LOG_NEWS, "news", 1 }, - { LOG_UUCP, "uucp", 2 }, - { LOG_CRON, "cron", 1 }, + { + LOG_KERN, "kern", 1}, + { + LOG_USER, "user", 2}, + { + LOG_MAIL, "mail", 1}, + { + LOG_DAEMON, "daemon", 1}, + { + LOG_AUTH, "auth", 1}, + { + LOG_SYSLOG, "syslog", 1}, + { + LOG_LPR, "lpr", 2}, + { + LOG_NEWS, "news", 1}, + { + LOG_UUCP, "uucp", 2}, + { + LOG_CRON, "cron", 1}, #ifdef LOG_FTP - { LOG_FTP, "ftp", 1 }, + { + LOG_FTP, "ftp", 1}, #endif - { LOG_LOCAL0, "local0", 6 }, - { LOG_LOCAL1, "local1", 6 }, - { LOG_LOCAL2, "local2", 6 }, - { LOG_LOCAL3, "local3", 6 }, - { LOG_LOCAL4, "local4", 6 }, - { LOG_LOCAL5, "local5", 6 }, - { LOG_LOCAL6, "local6", 6 }, - { LOG_LOCAL7, "local7", 6 }, - { 0, NULL, 0 }, - }; + { + LOG_LOCAL0, "local0", 6}, + { + LOG_LOCAL1, "local1", 6}, + { + LOG_LOCAL2, "local2", 6}, + { + LOG_LOCAL3, "local3", 6}, + { + LOG_LOCAL4, "local4", 6}, + { + LOG_LOCAL5, "local5", 6}, + { + LOG_LOCAL6, "local6", 6}, + { + LOG_LOCAL7, "local7", 6}, + { +0, NULL, 0},}; static const char * facility_name(int facility) @@ -181,8 +195,7 @@ argv_concat (const char **argv, int argc /* Install top node of command vector. */ void -install_node (struct cmd_node *node, - int (*func) (struct vty *)) +install_node (struct cmd_node *node, int (*func) (struct vty *)) { vector_set_index (cmdvec, node->node, node); node->func = func; @@ -402,7 +415,9 @@ cmd_make_descvec (const char *string, co sp = cp; - while (! (isspace ((int) *cp) || *cp == '\r' || *cp == '\n' || *cp == ')' || *cp == '|') && *cp != '\0') + while (! + (isspace ((int) *cp) || *cp == '\r' || *cp == '\n' || *cp == ')' + || *cp == '|') && *cp != '\0') cp++; len = cp - sp; @@ -536,7 +551,8 @@ config_write_host (struct vty *vty) if (host.password_encrypt) vty_out (vty, "password 8 %s%s", host.password_encrypt, VTY_NEWLINE); if (host.enable_encrypt) - vty_out (vty, "enable password 8 %s%s", host.enable_encrypt, VTY_NEWLINE); + vty_out (vty, "enable password 8 %s%s", host.enable_encrypt, + VTY_NEWLINE); } else { @@ -574,9 +590,11 @@ config_write_host (struct vty *vty) if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) vty_out(vty,"no log monitor%s",VTY_NEWLINE); - else if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] != zlog_default->default_lvl) + else if (zlog_default->maxlvl[ZLOG_DEST_MONITOR] != + zlog_default->default_lvl) vty_out(vty,"log monitor %s%s", - zlog_priority[zlog_default->maxlvl[ZLOG_DEST_MONITOR]],VTY_NEWLINE); + zlog_priority[zlog_default->maxlvl[ZLOG_DEST_MONITOR]], + VTY_NEWLINE); if (zlog_default->maxlvl[ZLOG_DEST_SYSLOG] != ZLOG_DISABLED) { @@ -605,8 +623,7 @@ config_write_host (struct vty *vty) vty_out (vty, "service password-encryption%s", VTY_NEWLINE); if (host.lines >= 0) - vty_out (vty, "service terminal-length %d%s", host.lines, - VTY_NEWLINE); + vty_out (vty, "service terminal-length %d%s", host.lines, VTY_NEWLINE); if (host.motdfile) vty_out (vty, "banner motd file %s%s", host.motdfile, VTY_NEWLINE); @@ -638,7 +655,9 @@ cmd_filter_by_symbol (char *command, cha lim = strlen (command); while (i < lim) { - if (! (isdigit ((int) command[i]) || command[i] == '.' || command[i] == '/')) + if (! + (isdigit ((int) command[i]) || command[i] == '.' + || command[i] == '/')) return 1; i++; } @@ -650,7 +669,9 @@ cmd_filter_by_symbol (char *command, cha lim = strlen (command); while (i < lim) { - if (! (isalpha ((int) command[i]) || command[i] == '_' || command[i] == '-')) + if (! + (isalpha ((int) command[i]) || command[i] == '_' + || command[i] == '-')) return 1; i++; } @@ -1557,13 +1578,13 @@ desc_unique_string (vector v, const char } static int -cmd_try_do_shortcut (enum node_type node, char* first_word) { +cmd_try_do_shortcut (enum node_type node, char *first_word) +{ if ( first_word != NULL && node != AUTH_NODE && node != VIEW_NODE && node != AUTH_ENABLE_NODE && - node != ENABLE_NODE && - 0 == strcmp( "do", first_word ) ) + node != ENABLE_NODE && 0 == strcmp ("do", first_word)) return 1; return 0; } @@ -1616,7 +1637,8 @@ cmd_describe_command_real (vector vline, && (vector_active (cmd_element->strvec))) { descvec = vector_slot (cmd_element->strvec, - vector_active (cmd_element->strvec) - 1); + vector_active (cmd_element->strvec) - + 1); for (k = 0; k < vector_active (descvec); k++) { struct desc *desc = vector_slot (descvec, k); @@ -1725,7 +1747,8 @@ cmd_describe_command (vector vline, stru /* use memcpy? */ for (index = 1; index < vector_active (vline); index++) { - vector_set_index (shifted_vline, index-1, vector_lookup(vline, index)); + vector_set_index (shifted_vline, index - 1, + vector_lookup (vline, index)); } ret = cmd_describe_command_real (shifted_vline, vty, status); @@ -1948,7 +1971,8 @@ cmd_complete_command (vector vline, stru /* use memcpy? */ for (index = 1; index < vector_active (vline); index++) { - vector_set_index (shifted_vline, index-1, vector_lookup(vline, index)); + vector_set_index (shifted_vline, index - 1, + vector_lookup (vline, index)); } ret = cmd_complete_command_real (shifted_vline, vty, status); @@ -2090,7 +2114,8 @@ cmd_execute_command_real (vector vline, if (CMD_VARARG (desc->cmd)) varflag = 1; - if (varflag || CMD_VARIABLE (desc->cmd) || CMD_OPTION (desc->cmd)) + if (varflag || CMD_VARIABLE (desc->cmd) + || CMD_OPTION (desc->cmd)) argv[argc++] = vector_slot (vline, i); } else @@ -2114,7 +2139,8 @@ cmd_execute_command_real (vector vline, int cmd_execute_command (vector vline, struct vty *vty, struct cmd_element **cmd, - int vtysh) { + int vtysh) +{ int ret, saved_ret, tried = 0; enum node_type onode, try_node; @@ -2132,7 +2158,8 @@ cmd_execute_command (vector vline, struc /* use memcpy? */ for (index = 1; index < vector_active (vline); index++) { - vector_set_index (shifted_vline, index-1, vector_lookup(vline, index)); + vector_set_index (shifted_vline, index - 1, + vector_lookup (vline, index)); } ret = cmd_execute_command_real (shifted_vline, vty, cmd); @@ -2149,8 +2176,7 @@ cmd_execute_command (vector vline, struc return saved_ret; /* This assumes all nodes above CONFIG_NODE are childs of CONFIG_NODE */ - while ( ret != CMD_SUCCESS && ret != CMD_WARNING - && vty->node > CONFIG_NODE ) + while (ret != CMD_SUCCESS && ret != CMD_WARNING && vty->node > CONFIG_NODE) { try_node = node_parent(try_node); vty->node = try_node; @@ -2266,7 +2292,8 @@ cmd_execute_command_strict (vector vline if (CMD_VARARG (desc->cmd)) varflag = 1; - if (varflag || CMD_VARIABLE (desc->cmd) || CMD_OPTION (desc->cmd)) + if (varflag || CMD_VARIABLE (desc->cmd) + || CMD_OPTION (desc->cmd)) argv[argc++] = vector_slot (vline, i); } else @@ -2326,14 +2353,14 @@ config_from_file (struct vty *vty, FILE DEFUN (config_terminal, config_terminal_cmd, "configure terminal", - "Configuration from vty interface\n" - "Configuration terminal\n") + "Configuration from vty interface\n" "Configuration terminal\n") { if (vty_config_lock (vty)) vty->node = CONFIG_NODE; else { - vty_out (vty, "VTY configuration is locked by other VTY%s", VTY_NEWLINE); + vty_out (vty, "VTY configuration is locked by other VTY%s", + VTY_NEWLINE); return CMD_WARNING; } return CMD_SUCCESS; @@ -2341,9 +2368,7 @@ DEFUN (config_terminal, /* Enable command */ DEFUN (enable, - config_enable_cmd, - "enable", - "Turn on privileged mode command\n") + config_enable_cmd, "enable", "Turn on privileged mode command\n") { /* If enable password is NULL, change to ENABLE_NODE */ if ((host.enable == NULL && host.enable_encrypt == NULL) || @@ -2357,9 +2382,7 @@ DEFUN (enable, /* Disable command */ DEFUN (disable, - config_disable_cmd, - "disable", - "Turn off privileged mode command\n") + config_disable_cmd, "disable", "Turn off privileged mode command\n") { if (vty->node == ENABLE_NODE) vty->node = VIEW_NODE; @@ -2369,8 +2392,7 @@ DEFUN (disable, /* Down vty node level. */ DEFUN (config_exit, config_exit_cmd, - "exit", - "Exit current mode and down to previous mode\n") + "exit", "Exit current mode and down to previous mode\n") { switch (vty->node) { @@ -2418,14 +2440,10 @@ DEFUN (config_exit, /* quit is alias of exit. */ ALIAS (config_exit, config_quit_cmd, - "quit", - "Exit current mode and down to previous mode\n") - + "quit", "Exit current mode and down to previous mode\n") /* End of configuration. */ DEFUN (config_end, - config_end_cmd, - "end", - "End current mode and change to enable mode.") + config_end_cmd, "end", "End current mode and change to enable mode.") { switch (vty->node) { @@ -2463,13 +2481,10 @@ DEFUN (config_end, /* Show version. */ DEFUN (show_version, - show_version_cmd, - "show version", - SHOW_STR - "Displays zebra version\n") + show_version_cmd, "show version", SHOW_STR "Displays zebra version\n") { - vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, host.name?host.name:"", - VTY_NEWLINE); + vty_out (vty, "Quagga %s (%s).%s", QUAGGA_VERSION, + host.name ? host.name : "", VTY_NEWLINE); vty_out (vty, "%s%s", QUAGGA_COPYRIGHT, VTY_NEWLINE); return CMD_SUCCESS; @@ -2478,8 +2493,7 @@ DEFUN (show_version, /* Help display function for all node. */ DEFUN (config_help, config_help_cmd, - "help", - "Description of the interactive help system\n") + "help", "Description of the interactive help system\n") { vty_out (vty, "Quagga VTY provides advanced help feature. When you need help,%s\ @@ -2493,17 +2507,12 @@ command argument (e.g. 'show ?') and des argument.%s\ 2. Partial help is provided when an abbreviated argument is entered%s\ and you want to know what arguments match the input%s\ - (e.g. 'show me?'.)%s%s", VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, - VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, - VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + (e.g. 'show me?'.)%s%s", VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); return CMD_SUCCESS; } /* Help display function for all node. */ -DEFUN (config_list, - config_list_cmd, - "list", - "Print command list\n") +DEFUN (config_list, config_list_cmd, "list", "Print command list\n") { unsigned int i; struct cmd_node *cnode = vector_slot (cmdvec, vty->node); @@ -2513,8 +2522,7 @@ DEFUN (config_list, if ((cmd = vector_slot (cnode->cmd_vector, i)) != NULL && !(cmd->attr == CMD_ATTR_DEPRECATED || cmd->attr == CMD_ATTR_HIDDEN)) - vty_out (vty, " %s%s", cmd->string, - VTY_NEWLINE); + vty_out (vty, " %s%s", cmd->string, VTY_NEWLINE); return CMD_SUCCESS; } @@ -2584,14 +2592,14 @@ DEFUN (config_write_file, if (unlink (config_file_sav) != 0) if (errno != ENOENT) { - vty_out (vty, "Can't unlink backup configuration file %s.%s", config_file_sav, - VTY_NEWLINE); + vty_out (vty, "Can't unlink backup configuration file %s.%s", + config_file_sav, VTY_NEWLINE); goto finished; } if (link (config_file, config_file_sav) != 0) { - vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav, - VTY_NEWLINE); + vty_out (vty, "Can't backup old configuration file %s.%s", + config_file_sav, VTY_NEWLINE); goto finished; } sync (); @@ -2616,8 +2624,7 @@ DEFUN (config_write_file, goto finished; } - vty_out (vty, "Configuration saved to %s%s", config_file, - VTY_NEWLINE); + vty_out (vty, "Configuration saved to %s%s", config_file, VTY_NEWLINE); ret = CMD_SUCCESS; finished: @@ -2666,8 +2670,7 @@ DEFUN (config_write_terminal, } else { - vty_out (vty, "%sCurrent configuration:%s", VTY_NEWLINE, - VTY_NEWLINE); + vty_out (vty, "%sCurrent configuration:%s", VTY_NEWLINE, VTY_NEWLINE); vty_out (vty, "!%s", VTY_NEWLINE); for (i = 0; i < vector_active (cmdvec); i++) @@ -2684,16 +2687,11 @@ DEFUN (config_write_terminal, /* Write current configuration into the terminal. */ ALIAS (config_write_terminal, show_running_config_cmd, - "show running-config", - SHOW_STR - "running configuration\n") - + "show running-config", SHOW_STR "running configuration\n") /* Write startup configuration into the terminal. */ DEFUN (show_startup_config, show_startup_config_cmd, - "show startup-config", - SHOW_STR - "Contentes of startup configuration\n") + "show startup-config", SHOW_STR "Contentes of startup configuration\n") { char buf[BUFSIZ]; FILE *confp; @@ -2726,12 +2724,12 @@ DEFUN (show_startup_config, DEFUN (config_hostname, hostname_cmd, "hostname WORD", - "Set system's network name\n" - "This system's network name\n") + "Set system's network name\n" "This system's network name\n") { if (!isalpha((int) *argv[0])) { - vty_out (vty, "Please specify string starting with alphabet%s", VTY_NEWLINE); + vty_out (vty, "Please specify string starting with alphabet%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -2745,9 +2743,7 @@ DEFUN (config_hostname, DEFUN (config_no_hostname, no_hostname_cmd, "no hostname [HOSTNAME]", - NO_STR - "Reset system's network name\n" - "Host name of this router\n") + NO_STR "Reset system's network name\n" "Host name of this router\n") { if (host.name) XFREE (MTYPE_HOST, host.name); @@ -2760,8 +2756,7 @@ DEFUN (config_password, password_cmd, "password (8|) WORD", "Assign the terminal connection password\n" "Specifies a HIDDEN password will follow\n" - "dummy string \n" - "The HIDDEN line password string\n") + "dummy string \n" "The HIDDEN line password string\n") { /* Argument check. */ if (argc == 0) @@ -2792,7 +2787,8 @@ DEFUN (config_password, password_cmd, if (!isalnum ((int) *argv[0])) { vty_out (vty, - "Please specify string starting with alphanumeric%s", VTY_NEWLINE); + "Please specify string starting with alphanumeric%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -2823,8 +2818,7 @@ DEFUN (config_enable_password, enable_pa "Modify enable password parameters\n" "Assign the privileged level password\n" "Specifies a HIDDEN password will follow\n" - "dummy string \n" - "The HIDDEN 'enable' password string\n") + "dummy string \n" "The HIDDEN 'enable' password string\n") { /* Argument check. */ if (argc == 0) @@ -2858,7 +2852,8 @@ DEFUN (config_enable_password, enable_pa if (!isalnum ((int) *argv[0])) { vty_out (vty, - "Please specify string starting with alphanumeric%s", VTY_NEWLINE); + "Please specify string starting with alphanumeric%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -2907,8 +2901,7 @@ DEFUN (no_config_enable_password, no_ena DEFUN (service_password_encrypt, service_password_encrypt_cmd, "service password-encryption", - "Set up miscellaneous service\n" - "Enable encrypted passwords\n") + "Set up miscellaneous service\n" "Enable encrypted passwords\n") { if (host.encrypt) return CMD_SUCCESS; @@ -2934,9 +2927,7 @@ DEFUN (service_password_encrypt, DEFUN (no_service_password_encrypt, no_service_password_encrypt_cmd, "no service password-encryption", - NO_STR - "Set up miscellaneous service\n" - "Enable encrypted passwords\n") + NO_STR "Set up miscellaneous service\n" "Enable encrypted passwords\n") { if (! host.encrypt) return CMD_SUCCESS; @@ -2977,8 +2968,7 @@ DEFUN (config_terminal_length, config_te DEFUN (config_terminal_no_length, config_terminal_no_length_cmd, "terminal no length", "Set terminal line parameters\n" - NO_STR - "Set number of lines on a screen\n") + NO_STR "Set number of lines on a screen\n") { vty->lines = -1; return CMD_SUCCESS; @@ -3018,13 +3008,13 @@ DEFUN (no_service_terminal_length, no_se DEFUN_HIDDEN (do_echo, echo_cmd, "echo .MESSAGE", - "Echo a message back to the vty\n" - "The message to echo\n") + "Echo a message back to the vty\n" "The message to echo\n") { char *message; - vty_out (vty, "%s%s", ((message = argv_concat(argv, argc, 0)) ? message : ""), - VTY_NEWLINE); + vty_out (vty, "%s%s", + ((message = + argv_concat (argv, argc, 0)) ? message : ""), VTY_NEWLINE); if (message) XFREE(MTYPE_TMP, message); return CMD_SUCCESS; @@ -3034,8 +3024,7 @@ DEFUN (config_logmsg, config_logmsg_cmd, "logmsg "LOG_LEVELS" .MESSAGE", "Send a message to enabled logging destinations\n" - LOG_LEVEL_DESC - "The message to send\n") + LOG_LEVEL_DESC "The message to send\n") { int level; char *message; @@ -3043,7 +3032,8 @@ DEFUN (config_logmsg, if ((level = level_match(argv[0])) == ZLOG_DISABLED) return CMD_ERR_NO_MATCH; - zlog(NULL, level, ((message = argv_concat(argv, argc, 1)) ? message : "")); + zlog (NULL, level, + ((message = argv_concat (argv, argc, 1)) ? message : "")); if (message) XFREE(MTYPE_TMP, message); return CMD_SUCCESS; @@ -3051,9 +3041,7 @@ DEFUN (config_logmsg, DEFUN (show_logging, show_logging_cmd, - "show logging", - SHOW_STR - "Show current logging configuration\n") + "show logging", SHOW_STR "Show current logging configuration\n") { struct zlog *zl = zlog_default; @@ -3070,26 +3058,22 @@ DEFUN (show_logging, if (zl->maxlvl[ZLOG_DEST_STDOUT] == ZLOG_DISABLED) vty_out (vty, "disabled"); else - vty_out (vty, "level %s", - zlog_priority[zl->maxlvl[ZLOG_DEST_STDOUT]]); + vty_out (vty, "level %s", zlog_priority[zl->maxlvl[ZLOG_DEST_STDOUT]]); vty_out (vty, "%s", VTY_NEWLINE); vty_out (vty, "Monitor logging: "); if (zl->maxlvl[ZLOG_DEST_MONITOR] == ZLOG_DISABLED) vty_out (vty, "disabled"); else - vty_out (vty, "level %s", - zlog_priority[zl->maxlvl[ZLOG_DEST_MONITOR]]); + vty_out (vty, "level %s", zlog_priority[zl->maxlvl[ZLOG_DEST_MONITOR]]); vty_out (vty, "%s", VTY_NEWLINE); vty_out (vty, "File logging: "); - if ((zl->maxlvl[ZLOG_DEST_FILE] == ZLOG_DISABLED) || - !zl->fp) + if ((zl->maxlvl[ZLOG_DEST_FILE] == ZLOG_DISABLED) || !zl->fp) vty_out (vty, "disabled"); else vty_out (vty, "level %s, filename %s", - zlog_priority[zl->maxlvl[ZLOG_DEST_FILE]], - zl->filename); + zlog_priority[zl->maxlvl[ZLOG_DEST_FILE]], zl->filename); vty_out (vty, "%s", VTY_NEWLINE); vty_out (vty, "Protocol name: %s%s", @@ -3104,9 +3088,7 @@ DEFUN (show_logging, DEFUN (config_log_stdout, config_log_stdout_cmd, - "log stdout", - "Logging control\n" - "Set stdout logging level\n") + "log stdout", "Logging control\n" "Set stdout logging level\n") { zlog_set_level (NULL, ZLOG_DEST_STDOUT, zlog_default->default_lvl); return CMD_SUCCESS; @@ -3115,9 +3097,7 @@ DEFUN (config_log_stdout, DEFUN (config_log_stdout_level, config_log_stdout_level_cmd, "log stdout "LOG_LEVELS, - "Logging control\n" - "Set stdout logging level\n" - LOG_LEVEL_DESC) + "Logging control\n" "Set stdout logging level\n" LOG_LEVEL_DESC) { int level; @@ -3131,9 +3111,7 @@ DEFUN (no_config_log_stdout, no_config_log_stdout_cmd, "no log stdout [LEVEL]", NO_STR - "Logging control\n" - "Cancel logging to stdout\n" - "Logging level\n") + "Logging control\n" "Cancel logging to stdout\n" "Logging level\n") { zlog_set_level (NULL, ZLOG_DEST_STDOUT, ZLOG_DISABLED); return CMD_SUCCESS; @@ -3142,8 +3120,7 @@ DEFUN (no_config_log_stdout, DEFUN (config_log_monitor, config_log_monitor_cmd, "log monitor", - "Logging control\n" - "Set terminal line (monitor) logging level\n") + "Logging control\n" "Set terminal line (monitor) logging level\n") { zlog_set_level (NULL, ZLOG_DEST_MONITOR, zlog_default->default_lvl); return CMD_SUCCESS; @@ -3153,8 +3130,7 @@ DEFUN (config_log_monitor_level, config_log_monitor_level_cmd, "log monitor "LOG_LEVELS, "Logging control\n" - "Set terminal line (monitor) logging level\n" - LOG_LEVEL_DESC) + "Set terminal line (monitor) logging level\n" LOG_LEVEL_DESC) { int level; @@ -3169,8 +3145,7 @@ DEFUN (no_config_log_monitor, "no log monitor [LEVEL]", NO_STR "Logging control\n" - "Disable terminal line (monitor) logging\n" - "Logging level\n") + "Disable terminal line (monitor) logging\n" "Logging level\n") { zlog_set_level (NULL, ZLOG_DEST_MONITOR, ZLOG_DISABLED); return CMD_SUCCESS; @@ -3229,9 +3204,7 @@ set_log_file(struct vty *vty, const char DEFUN (config_log_file, config_log_file_cmd, "log file FILENAME", - "Logging control\n" - "Logging to file\n" - "Logging filename\n") + "Logging control\n" "Logging to file\n" "Logging filename\n") { return set_log_file(vty, argv[0], zlog_default->default_lvl); } @@ -3240,9 +3213,7 @@ DEFUN (config_log_file_level, config_log_file_level_cmd, "log file FILENAME "LOG_LEVELS, "Logging control\n" - "Logging to file\n" - "Logging filename\n" - LOG_LEVEL_DESC) + "Logging to file\n" "Logging filename\n" LOG_LEVEL_DESC) { int level; @@ -3255,9 +3226,7 @@ DEFUN (no_config_log_file, no_config_log_file_cmd, "no log file [FILENAME]", NO_STR - "Logging control\n" - "Cancel logging to file\n" - "Logging file name\n") + "Logging control\n" "Cancel logging to file\n" "Logging file name\n") { zlog_reset_file (NULL); @@ -3277,12 +3246,9 @@ ALIAS (no_config_log_file, "Cancel logging to file\n" "Logging file name\n" "Logging level\n") - DEFUN (config_log_syslog, config_log_syslog_cmd, - "log syslog", - "Logging control\n" - "Set syslog logging level\n") + "log syslog", "Logging control\n" "Set syslog logging level\n") { zlog_set_level (NULL, ZLOG_DEST_SYSLOG, zlog_default->default_lvl); return CMD_SUCCESS; @@ -3291,9 +3257,7 @@ DEFUN (config_log_syslog, DEFUN (config_log_syslog_level, config_log_syslog_level_cmd, "log syslog "LOG_LEVELS, - "Logging control\n" - "Set syslog logging level\n" - LOG_LEVEL_DESC) + "Logging control\n" "Set syslog logging level\n" LOG_LEVEL_DESC) { int level; @@ -3325,9 +3289,7 @@ DEFUN (no_config_log_syslog, no_config_log_syslog_cmd, "no log syslog [LEVEL]", NO_STR - "Logging control\n" - "Cancel logging to syslog\n" - "Logging level\n") + "Logging control\n" "Cancel logging to syslog\n" "Logging level\n") { zlog_set_level (NULL, ZLOG_DEST_SYSLOG, ZLOG_DISABLED); return CMD_SUCCESS; @@ -3346,8 +3307,7 @@ DEFUN (config_log_facility, config_log_facility_cmd, "log facility "LOG_FACILITIES, "Logging control\n" - "Facility parameter for syslog messages\n" - LOG_FACILITY_DESC) + "Facility parameter for syslog messages\n" LOG_FACILITY_DESC) { int facility; @@ -3362,8 +3322,7 @@ DEFUN (no_config_log_facility, "no log facility [FACILITY]", NO_STR "Logging control\n" - "Reset syslog facility to default (daemon)\n" - "Syslog facility\n") + "Reset syslog facility to default (daemon)\n" "Syslog facility\n") { zlog_default->facility = LOG_DAEMON; return CMD_SUCCESS; @@ -3394,8 +3353,7 @@ DEFUN_DEPRECATED (no_config_log_trap, "no log trap [LEVEL]", NO_STR "Logging control\n" - "Permit all logging information\n" - "Logging level\n") + "Permit all logging information\n" "Logging level\n") { zlog_default->default_lvl = LOG_DEBUG; return CMD_SUCCESS; @@ -3427,8 +3385,7 @@ DEFUN (config_log_timestamp_precision, "log timestamp precision <0-6>", "Logging control\n" "Timestamp configuration\n" - "Set the timestamp precision\n" - "Number of subsecond digits\n") + "Set the timestamp precision\n" "Number of subsecond digits\n") { if (argc != 1) { @@ -3456,10 +3413,7 @@ DEFUN (no_config_log_timestamp_precision DEFUN (banner_motd_file, banner_motd_file_cmd, "banner motd file [FILE]", - "Set banner\n" - "Banner for motd\n" - "Banner from a file\n" - "Filename\n") + "Set banner\n" "Banner for motd\n" "Banner from a file\n" "Filename\n") { if (host.motdfile) XFREE (MTYPE_HOST, host.motdfile); @@ -3471,9 +3425,7 @@ DEFUN (banner_motd_file, DEFUN (banner_motd_default, banner_motd_default_cmd, "banner motd default", - "Set banner string\n" - "Strings for motd\n" - "Default string\n") + "Set banner string\n" "Strings for motd\n" "Default string\n") { host.motd = default_motd; return CMD_SUCCESS; @@ -3481,10 +3433,7 @@ DEFUN (banner_motd_default, DEFUN (no_banner_motd, no_banner_motd_cmd, - "no banner motd", - NO_STR - "Set banner string\n" - "Strings for motd\n") + "no banner motd", NO_STR "Set banner string\n" "Strings for motd\n") { host.motd = NULL; if (host.motdfile) --- quagga-0.99.9/lib/command.h 2007-05-02 08:28:32.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/command.h 2008-04-16 11:55:54.000000000 -0700 @@ -342,8 +343,10 @@ extern char **cmd_complete_command (vect extern const char *cmd_prompt (enum node_type); extern int config_from_file (struct vty *, FILE *); extern enum node_type node_parent (enum node_type); -extern int cmd_execute_command (vector, struct vty *, struct cmd_element **, int); -extern int cmd_execute_command_strict (vector, struct vty *, struct cmd_element **); +extern int cmd_execute_command (vector, struct vty *, struct cmd_element **, + int); +extern int cmd_execute_command_strict (vector, struct vty *, + struct cmd_element **); extern void config_replace_string (struct cmd_element *, char *, ...); extern void cmd_init (int); --- quagga-0.99.9/lib/distribute.c 2005-05-06 07:43:13.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/distribute.c 2008-04-16 11:55:54.000000000 -0700 @@ -385,8 +383,7 @@ DEFUN (distribute_list, "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { enum distribute_type type; struct distribute *dist; @@ -398,7 +395,8 @@ DEFUN (distribute_list, type = DISTRIBUTE_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -423,8 +420,7 @@ DEFUN (no_districute_list, no_distribute "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { int ret; enum distribute_type type; @@ -436,7 +432,8 @@ DEFUN (no_districute_list, no_distribute type = DISTRIBUTE_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -547,8 +541,7 @@ DEFUN (districute_list_prefix, distribut "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { enum distribute_type type; struct distribute *dist; @@ -587,8 +579,7 @@ DEFUN (no_districute_list_prefix, no_dis "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") + "Filter outgoing routing updates\n" "Interface name\n") { int ret; enum distribute_type type; @@ -621,11 +612,8 @@ ALIAS (no_districute_list_prefix, no_ipv "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" - "Filter outgoing routing updates\n" - "Interface name\n") - -int -config_show_distribute (struct vty *vty) + "Filter outgoing routing updates\n" "Interface name\n") + int config_show_distribute (struct vty *vty) { unsigned int i; struct hash_backet *mp; @@ -645,7 +633,9 @@ config_show_distribute (struct vty *vty) vty_out (vty, "%s", VTY_NEWLINE); } else - vty_out (vty, " Outgoing update filter list for all interface is not set%s", VTY_NEWLINE); + vty_out (vty, + " Outgoing update filter list for all interface is not set%s", + VTY_NEWLINE); for (i = 0; i < disthash->size; i++) for (mp = disthash->index[i]; mp; mp = mp->next) @@ -680,7 +670,9 @@ config_show_distribute (struct vty *vty) vty_out (vty, "%s", VTY_NEWLINE); } else - vty_out (vty, " Incoming update filter list for all interface is not set%s", VTY_NEWLINE); + vty_out (vty, + " Incoming update filter list for all interface is not set%s", + VTY_NEWLINE); for (i = 0; i < disthash->size; i++) for (mp = disthash->index[i]; mp; mp = mp->next) @@ -721,8 +713,7 @@ config_write_distribute (struct vty *vty { vty_out (vty, " distribute-list %s in %s%s", dist->list[DISTRIBUTE_IN], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } @@ -729,10 +720,8 @@ config_write_distribute (struct vty *vty if (dist->list[DISTRIBUTE_OUT]) { vty_out (vty, " distribute-list %s out %s%s", - dist->list[DISTRIBUTE_OUT], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } @@ -740,8 +729,7 @@ config_write_distribute (struct vty *vty { vty_out (vty, " distribute-list prefix %s in %s%s", dist->prefix[DISTRIBUTE_IN], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } @@ -749,8 +737,7 @@ config_write_distribute (struct vty *vty { vty_out (vty, " distribute-list prefix %s out %s%s", dist->prefix[DISTRIBUTE_OUT], - dist->ifname ? dist->ifname : "", - VTY_NEWLINE); + dist->ifname ? dist->ifname : "", VTY_NEWLINE); write++; } } @@ -771,7 +758,8 @@ distribute_list_init (int node) disthash = hash_create ((unsigned int (*) (void *)) distribute_hash_make, (int (*) (void *, void *)) distribute_cmp); - if(node==RIP_NODE) { + if (node == RIP_NODE) + { install_element (RIP_NODE, &distribute_list_all_cmd); install_element (RIP_NODE, &no_distribute_list_all_cmd); install_element (RIP_NODE, &distribute_list_cmd); @@ -780,7 +768,9 @@ distribute_list_init (int node) install_element (RIP_NODE, &no_distribute_list_prefix_all_cmd); install_element (RIP_NODE, &distribute_list_prefix_cmd); install_element (RIP_NODE, &no_distribute_list_prefix_cmd); - } else { + } + else + { install_element (RIPNG_NODE, &ipv6_distribute_list_all_cmd); install_element (RIPNG_NODE, &no_ipv6_distribute_list_all_cmd); install_element (RIPNG_NODE, &ipv6_distribute_list_cmd); --- quagga-0.99.9/lib/distribute.h 2005-05-03 10:26:11.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/distribute.h 2008-04-16 11:55:54.000000000 -0700 @@ -51,7 +51,9 @@ extern struct distribute *distribute_loo extern int config_write_distribute (struct vty *); extern int config_show_distribute (struct vty *); -extern enum filter_type distribute_apply_in (struct interface *, struct prefix *); -extern enum filter_type distribute_apply_out (struct interface *, struct prefix *); +extern enum filter_type distribute_apply_in (struct interface *, + struct prefix *); +extern enum filter_type distribute_apply_out (struct interface *, + struct prefix *); #endif /* _ZEBRA_DISTRIBUTE_H */ --- quagga-0.99.9/lib/filter.c 2005-09-29 07:41:06.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/filter.c 2008-04-16 11:55:54.000000000 -0700 @@ -92,8 +92,7 @@ struct access_master }; /* Static structure for IPv4 access_list's master. */ -static struct access_master access_master_ipv4 = -{ +static struct access_master access_master_ipv4 = { {NULL, NULL}, {NULL, NULL}, NULL, @@ -102,8 +101,7 @@ static struct access_master access_maste #ifdef HAVE_IPV6 /* Static structure for IPv6 access_list's master. */ -static struct access_master access_master_ipv6 = -{ +static struct access_master access_master_ipv6 = { {NULL, NULL}, {NULL, NULL}, NULL, @@ -577,8 +575,7 @@ vty_access_list_remark_unset (struct vty access = access_list_lookup (afi, name); if (! access) { - vty_out (vty, "%% access-list %s doesn't exist%s", name, - VTY_NEWLINE); + vty_out (vty, "%% access-list %s doesn't exist%s", name, VTY_NEWLINE); return CMD_WARNING; } @@ -624,16 +621,14 @@ filter_set_cisco (struct vty *vty, const ret = inet_aton (addr_str, &addr); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } ret = inet_aton (addr_mask_str, &addr_mask); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } @@ -642,16 +637,14 @@ filter_set_cisco (struct vty *vty, const ret = inet_aton (mask_str, &mask); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } ret = inet_aton (mask_mask_str, &mask_mask); if (ret <= 0) { - vty_out (vty, "%%Inconsistent address and mask%s", - VTY_NEWLINE); + vty_out (vty, "%%Inconsistent address and mask%s", VTY_NEWLINE); return CMD_WARNING; } } @@ -702,9 +695,7 @@ DEFUN (access_list_standard, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n" - "Wildcard bits\n") + "Specify packets to forward\n" "Address to match\n" "Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], NULL, NULL, 0, 1); @@ -717,8 +708,7 @@ DEFUN (access_list_standard_nomask, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n") + "Specify packets to forward\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 1); @@ -732,8 +722,7 @@ DEFUN (access_list_standard_host, "IP standard access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "A single host address\n" - "Address to match\n") + "A single host address\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 1); @@ -746,8 +735,7 @@ DEFUN (access_list_standard_any, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any source host\n") + "Specify packets to forward\n" "Any source host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", NULL, NULL, 0, 1); @@ -761,9 +749,7 @@ DEFUN (no_access_list_standard, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n" - "Wildcard bits\n") + "Specify packets to forward\n" "Address to match\n" "Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], NULL, NULL, 0, 0); @@ -777,8 +763,7 @@ DEFUN (no_access_list_standard_nomask, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Address to match\n") + "Specify packets to forward\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 0); @@ -793,8 +778,7 @@ DEFUN (no_access_list_standard_host, "IP standard access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "A single host address\n" - "Address to match\n") + "A single host address\n" "Address to match\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], "0.0.0.0", NULL, NULL, 0, 0); @@ -808,8 +792,7 @@ DEFUN (no_access_list_standard_any, "IP standard access list\n" "IP standard access list (expanded range)\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any source host\n") + "Specify packets to forward\n" "Any source host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", NULL, NULL, 0, 0); @@ -827,8 +810,7 @@ DEFUN (access_list_extended, "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], 1 ,1); @@ -843,13 +825,10 @@ DEFUN (access_list_extended_mask_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "Source address\n" - "Source wildcard bits\n" - "Any destination host\n") + "Source address\n" "Source wildcard bits\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], "0.0.0.0", - "255.255.255.255", 1, 1); + argv[3], "0.0.0.0", "255.255.255.255", 1, 1); } DEFUN (access_list_extended_any_mask, @@ -862,12 +841,10 @@ DEFUN (access_list_extended_any_mask, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - argv[3], 1, 1); + "255.255.255.255", argv[2], argv[3], 1, 1); } DEFUN (access_list_extended_any_any, @@ -878,9 +855,7 @@ DEFUN (access_list_extended_any_any, "IP extended access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Any Internet Protocol\n" - "Any source host\n" - "Any destination host\n") + "Any Internet Protocol\n" "Any source host\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", "0.0.0.0", @@ -898,12 +873,10 @@ DEFUN (access_list_extended_mask_host, "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], argv[4], - "0.0.0.0", 1, 1); + argv[3], argv[4], "0.0.0.0", 1, 1); } DEFUN (access_list_extended_host_mask, @@ -917,12 +890,10 @@ DEFUN (access_list_extended_host_mask, "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - argv[4], 1, 1); + "0.0.0.0", argv[3], argv[4], 1, 1); } DEFUN (access_list_extended_host_host, @@ -936,12 +907,10 @@ DEFUN (access_list_extended_host_host, "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - "0.0.0.0", 1, 1); + "0.0.0.0", argv[3], "0.0.0.0", 1, 1); } DEFUN (access_list_extended_any_host, @@ -954,12 +923,10 @@ DEFUN (access_list_extended_any_host, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - "0.0.0.0", 1, 1); + "255.255.255.255", argv[2], "0.0.0.0", 1, 1); } DEFUN (access_list_extended_host_any, @@ -971,13 +938,10 @@ DEFUN (access_list_extended_host_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "A single source host\n" - "Source address\n" - "Any destination host\n") + "A single source host\n" "Source address\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", "0.0.0.0", - "255.255.255.255", 1, 1); + "0.0.0.0", "0.0.0.0", "255.255.255.255", 1, 1); } DEFUN (no_access_list_extended, @@ -992,8 +956,7 @@ DEFUN (no_access_list_extended, "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5], 1, 0); @@ -1009,13 +972,10 @@ DEFUN (no_access_list_extended_mask_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "Source address\n" - "Source wildcard bits\n" - "Any destination host\n") + "Source address\n" "Source wildcard bits\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], "0.0.0.0", - "255.255.255.255", 1, 0); + argv[3], "0.0.0.0", "255.255.255.255", 1, 0); } DEFUN (no_access_list_extended_any_mask, @@ -1029,12 +989,10 @@ DEFUN (no_access_list_extended_any_mask, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - argv[3], 1, 0); + "255.255.255.255", argv[2], argv[3], 1, 0); } DEFUN (no_access_list_extended_any_any, @@ -1046,9 +1004,7 @@ DEFUN (no_access_list_extended_any_any, "IP extended access list (expanded range)\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Any Internet Protocol\n" - "Any source host\n" - "Any destination host\n") + "Any Internet Protocol\n" "Any source host\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", "255.255.255.255", "0.0.0.0", @@ -1067,12 +1023,10 @@ DEFUN (no_access_list_extended_mask_host "Any Internet Protocol\n" "Source address\n" "Source wildcard bits\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - argv[3], argv[4], - "0.0.0.0", 1, 0); + argv[3], argv[4], "0.0.0.0", 1, 0); } DEFUN (no_access_list_extended_host_mask, @@ -1087,12 +1041,10 @@ DEFUN (no_access_list_extended_host_mask "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "Destination address\n" - "Destination Wildcard bits\n") + "Destination address\n" "Destination Wildcard bits\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - argv[4], 1, 0); + "0.0.0.0", argv[3], argv[4], 1, 0); } DEFUN (no_access_list_extended_host_host, @@ -1107,12 +1059,10 @@ DEFUN (no_access_list_extended_host_host "Any Internet Protocol\n" "A single source host\n" "Source address\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", argv[3], - "0.0.0.0", 1, 0); + "0.0.0.0", argv[3], "0.0.0.0", 1, 0); } DEFUN (no_access_list_extended_any_host, @@ -1126,12 +1076,10 @@ DEFUN (no_access_list_extended_any_host, "Specify packets to forward\n" "Any Internet Protocol\n" "Any source host\n" - "A single destination host\n" - "Destination address\n") + "A single destination host\n" "Destination address\n") { return filter_set_cisco (vty, argv[0], argv[1], "0.0.0.0", - "255.255.255.255", argv[2], - "0.0.0.0", 1, 0); + "255.255.255.255", argv[2], "0.0.0.0", 1, 0); } DEFUN (no_access_list_extended_host_any, @@ -1144,13 +1092,10 @@ DEFUN (no_access_list_extended_host_any, "Specify packets to reject\n" "Specify packets to forward\n" "Any Internet Protocol\n" - "A single source host\n" - "Source address\n" - "Any destination host\n") + "A single source host\n" "Source address\n" "Any destination host\n") { return filter_set_cisco (vty, argv[0], argv[1], argv[2], - "0.0.0.0", "0.0.0.0", - "255.255.255.255", 1, 0); + "0.0.0.0", "0.0.0.0", "255.255.255.255", 1, 0); } static int @@ -1241,8 +1186,7 @@ DEFUN (access_list, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 0, 1); } @@ -1254,8 +1198,7 @@ DEFUN (access_list_exact, "IP zebra access-list name\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n" - "Exact match of the prefixes\n") + "Prefix to match. e.g. 10.0.0.0/8\n" "Exact match of the prefixes\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 1, 1); } @@ -1266,8 +1209,7 @@ DEFUN (access_list_any, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, "0.0.0.0/0", 0, 1); } @@ -1279,8 +1221,7 @@ DEFUN (no_access_list, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 0, 0); } @@ -1293,8 +1234,7 @@ DEFUN (no_access_list_exact, "IP zebra access-list name\n" "Specify packets to reject\n" "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n" - "Exact match of the prefixes\n") + "Prefix to match. e.g. 10.0.0.0/8\n" "Exact match of the prefixes\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, argv[2], 1, 0); } @@ -1306,8 +1246,7 @@ DEFUN (no_access_list_any, "Add an access list entry\n" "IP zebra access-list name\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 10.0.0.0/8\n") + "Specify packets to forward\n" "Prefix to match. e.g. 10.0.0.0/8\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP, "0.0.0.0/0", 0, 0); } @@ -1356,8 +1295,7 @@ DEFUN (access_list_remark, "IP standard access list (expanded range)\n" "IP extended access list (expanded range)\n" "IP zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") + "Access list entry comment\n" "Comment up to 100 characters\n") { struct access_list *access; @@ -1382,8 +1320,7 @@ DEFUN (no_access_list_remark, "IP extended access list\n" "IP standard access list (expanded range)\n" "IP extended access list (expanded range)\n" - "IP zebra access-list\n" - "Access list entry comment\n") + "IP zebra access-list\n" "Access list entry comment\n") { return vty_access_list_remark_unset (vty, AFI_IP, argv[0]); } @@ -1398,9 +1335,7 @@ ALIAS (no_access_list_remark, "IP standard access list (expanded range)\n" "IP extended access list (expanded range)\n" "IP zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") - + "Access list entry comment\n" "Comment up to 100 characters\n") #ifdef HAVE_IPV6 DEFUN (ipv6_access_list, ipv6_access_list_cmd, @@ -1409,8 +1344,7 @@ DEFUN (ipv6_access_list, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 3ffe:506::/32\n") + "Specify packets to forward\n" "Prefix to match. e.g. 3ffe:506::/32\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, argv[2], 0, 1); } @@ -1436,8 +1370,7 @@ DEFUN (ipv6_access_list_any, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any prefixi to match\n") + "Specify packets to forward\n" "Any prefixi to match\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, "::/0", 0, 1); } @@ -1450,8 +1383,7 @@ DEFUN (no_ipv6_access_list, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Prefix to match. e.g. 3ffe:506::/32\n") + "Specify packets to forward\n" "Prefix to match. e.g. 3ffe:506::/32\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, argv[2], 0, 0); } @@ -1479,8 +1411,7 @@ DEFUN (no_ipv6_access_list_any, "Add an access list entry\n" "IPv6 zebra access-list\n" "Specify packets to reject\n" - "Specify packets to forward\n" - "Any prefixi to match\n") + "Specify packets to forward\n" "Any prefixi to match\n") { return filter_set_zebra (vty, argv[0], argv[1], AFI_IP6, "::/0", 0, 0); } @@ -1490,9 +1421,7 @@ DEFUN (no_ipv6_access_list_all, no_ipv6_access_list_all_cmd, "no ipv6 access-list WORD", NO_STR - IPV6_STR - "Add an access list entry\n" - "IPv6 zebra access-list\n") + IPV6_STR "Add an access list entry\n" "IPv6 zebra access-list\n") { struct access_list *access; struct access_master *master; @@ -1524,8 +1453,7 @@ DEFUN (ipv6_access_list_remark, IPV6_STR "Add an access list entry\n" "IPv6 zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") + "Access list entry comment\n" "Comment up to 100 characters\n") { struct access_list *access; @@ -1547,8 +1475,7 @@ DEFUN (no_ipv6_access_list_remark, NO_STR IPV6_STR "Add an access list entry\n" - "IPv6 zebra access-list\n" - "Access list entry comment\n") + "IPv6 zebra access-list\n" "Access list entry comment\n") { return vty_access_list_remark_unset (vty, AFI_IP6, argv[0]); } @@ -1560,10 +1487,8 @@ ALIAS (no_ipv6_access_list_remark, IPV6_STR "Add an access list entry\n" "IPv6 zebra access-list\n" - "Access list entry comment\n" - "Comment up to 100 characters\n") + "Access list entry comment\n" "Comment up to 100 characters\n") #endif /* HAVE_IPV6 */ - void config_write_access_zebra (struct vty *, struct filter *); void config_write_access_cisco (struct vty *, struct filter *); @@ -1568,8 +1493,7 @@ void config_write_access_zebra (struct v void config_write_access_cisco (struct vty *, struct filter *); /* show access-list command. */ -static int -filter_show (struct vty *vty, const char *name, afi_t afi) + static int filter_show (struct vty *vty, const char *name, afi_t afi) { struct access_list *access; struct access_master *master; @@ -1602,8 +1526,7 @@ filter_show (struct vty *vty, const char vty_out (vty, "%s IP%s access list %s%s", mfilter->cisco ? (filter->extended ? "Extended" : "Standard") : "Zebra", - afi == AFI_IP6 ? "v6" : "", - access->name, VTY_NEWLINE); + afi == AFI_IP6 ? "v6" : "", access->name, VTY_NEWLINE); write = 0; } @@ -1622,7 +1545,8 @@ filter_show (struct vty *vty, const char { vty_out (vty, " %s", inet_ntoa (filter->addr)); if (filter->addr_mask.s_addr != 0) - vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); + vty_out (vty, ", wildcard bits %s", + inet_ntoa (filter->addr_mask)); vty_out (vty, "%s", VTY_NEWLINE); } } @@ -1645,8 +1569,7 @@ filter_show (struct vty *vty, const char vty_out (vty, "%s IP%s access list %s%s", mfilter->cisco ? (filter->extended ? "Extended" : "Standard") : "Zebra", - afi == AFI_IP6 ? "v6" : "", - access->name, VTY_NEWLINE); + afi == AFI_IP6 ? "v6" : "", access->name, VTY_NEWLINE); write = 0; } @@ -1665,7 +1588,8 @@ filter_show (struct vty *vty, const char { vty_out (vty, " %s", inet_ntoa (filter->addr)); if (filter->addr_mask.s_addr != 0) - vty_out (vty, ", wildcard bits %s", inet_ntoa (filter->addr_mask)); + vty_out (vty, ", wildcard bits %s", + inet_ntoa (filter->addr_mask)); vty_out (vty, "%s", VTY_NEWLINE); } } @@ -1676,10 +1600,7 @@ filter_show (struct vty *vty, const char DEFUN (show_ip_access_list, show_ip_access_list_cmd, - "show ip access-list", - SHOW_STR - IP_STR - "List IP access lists\n") + "show ip access-list", SHOW_STR IP_STR "List IP access lists\n") { return filter_show (vty, NULL, AFI_IP); } @@ -1693,8 +1614,7 @@ DEFUN (show_ip_access_list_name, "IP standard access list\n" "IP extended access list\n" "IP standard access list (expanded range)\n" - "IP extended access list (expanded range)\n" - "IP zebra access-list\n") + "IP extended access list (expanded range)\n" "IP zebra access-list\n") { return filter_show (vty, argv[0], AFI_IP); } @@ -1702,10 +1622,7 @@ DEFUN (show_ip_access_list_name, #ifdef HAVE_IPV6 DEFUN (show_ipv6_access_list, show_ipv6_access_list_cmd, - "show ipv6 access-list", - SHOW_STR - IPV6_STR - "List IPv6 access lists\n") + "show ipv6 access-list", SHOW_STR IPV6_STR "List IPv6 access lists\n") { return filter_show (vty, NULL, AFI_IP6); } @@ -1714,9 +1631,7 @@ DEFUN (show_ipv6_access_list_name, show_ipv6_access_list_name_cmd, "show ipv6 access-list WORD", SHOW_STR - IPV6_STR - "List IPv6 access lists\n" - "IPv6 zebra access-list\n") + IPV6_STR "List IPv6 access lists\n" "IPv6 zebra access-list\n") { return filter_show (vty, argv[0], AFI_IP6); } @@ -1782,8 +1697,7 @@ config_write_access_zebra (struct vty *v else vty_out (vty, " %s/%d%s", inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), - p->prefixlen, - filter->exact ? " exact-match" : ""); + p->prefixlen, filter->exact ? " exact-match" : ""); vty_out (vty, "%s", VTY_NEWLINE); } @@ -1806,8 +1720,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s remark %s%s", afi == AFI_IP ? "" : "ipv6 ", - access->name, access->remark, - VTY_NEWLINE); + access->name, access->remark, VTY_NEWLINE); write++; } @@ -1815,8 +1728,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s %s", afi == AFI_IP ? "" : "ipv6 ", - access->name, - filter_type_str (mfilter)); + access->name, filter_type_str (mfilter)); if (mfilter->cisco) config_write_access_cisco (vty, mfilter); @@ -1833,8 +1745,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s remark %s%s", afi == AFI_IP ? "" : "ipv6 ", - access->name, access->remark, - VTY_NEWLINE); + access->name, access->remark, VTY_NEWLINE); write++; } @@ -1842,8 +1753,7 @@ config_write_access (struct vty *vty, af { vty_out (vty, "%saccess-list %s %s", afi == AFI_IP ? "" : "ipv6 ", - access->name, - filter_type_str (mfilter)); + access->name, filter_type_str (mfilter)); if (mfilter->cisco) config_write_access_cisco (vty, mfilter); @@ -1857,8 +1767,7 @@ config_write_access (struct vty *vty, af } /* Access-list node. */ -struct cmd_node access_node = -{ +struct cmd_node access_node = { ACCESS_NODE, "", /* Access list has no interface. */ 1 @@ -1953,8 +1862,7 @@ access_list_init_ipv4 (void) } #ifdef HAVE_IPV6 -struct cmd_node access_ipv6_node = -{ +struct cmd_node access_ipv6_node = { ACCESS_IPV6_NODE, "", 1 --- quagga-0.99.9/lib/getopt1.c 2005-05-15 07:32:03.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/getopt1.c 2008-04-16 11:55:54.000000000 -0700 @@ -112,8 +112,7 @@ main (argc, argv) { int this_option_optind = optind ? optind : 1; int option_index = 0; - static struct option long_options[] = - { + static struct option long_options[] = { {"add", 1, 0, 0}, {"append", 0, 0, 0}, {"delete", 1, 0, 0}, --- quagga-0.99.9/lib/getopt.c 2005-08-13 03:55:48.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/getopt.c 2008-04-16 11:55:54.000000000 -0700 @@ -270,8 +270,7 @@ static char *const *original_argv; is valid for the getopt call we must make sure that the ARGV passed to getopt is that one passed to the process. */ static void -__attribute__ ((unused)) -store_args_and_env (int argc, char *const *argv) + __attribute__ ((unused)) store_args_and_env (int argc, char *const *argv) { /* XXX This is no good solution. We should rather copy the args so that we can compare them later. But we must not use malloc(3). */ @@ -638,7 +638,9 @@ _getopt_internal (argc, argv, optstring, if (longopts != NULL && (argv[optind][1] == '-' - || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + || (long_only + && (argv[optind][2] + || !my_index (optstring, argv[optind][1]))))) { char *nameend; const struct option *p; @@ -704,12 +706,14 @@ _getopt_internal (argc, argv, optstring, if (argv[optind - 1][1] == '-') /* --option */ fprintf (stderr, - _("%s: option `--%s' doesn't allow an argument\n"), + _ + ("%s: option `--%s' doesn't allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ fprintf (stderr, - _("%s: option `%c%s' doesn't allow an argument\n"), + _ + ("%s: option `%c%s' doesn't allow an argument\n"), argv[0], argv[optind - 1][0], pfound->name); } @@ -786,11 +790,9 @@ _getopt_internal (argc, argv, optstring, { if (posixly_correct) /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), - argv[0], c); + fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else - fprintf (stderr, _("%s: invalid option -- %c\n"), - argv[0], c); + fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } optopt = c; return '?'; @@ -837,7 +839,8 @@ _getopt_internal (argc, argv, optstring, /* optarg is now the argument, see if it's in the table of longopts. */ - for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++) + for (nextchar = nameend = optarg; *nameend && *nameend != '='; + nameend++) /* Do nothing. */ ; /* Test all long options for either exact match @@ -885,8 +888,7 @@ _getopt_internal (argc, argv, optstring, { if (opterr) fprintf (stderr, _("\ -%s: option `-W %s' doesn't allow an argument\n"), - argv[0], pfound->name); +%s: option `-W %s' doesn't allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); return '?'; @@ -978,9 +980,7 @@ getopt (argc, argv, optstring) const char *optstring; { return _getopt_internal (argc, argv, optstring, - (const struct option *) 0, - (int *) 0, - 0); + (const struct option *) 0, (int *) 0, 0); } #endif /* REALLY_NEED_PLAIN_GETOPT */ --- quagga-0.99.9/lib/getopt.h 2005-08-13 03:55:48.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/getopt.h 2008-04-16 11:55:54.000000000 -0700 @@ -35,7 +35,8 @@ */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* For communication from `getopt' to the caller. --- quagga-0.99.9/lib/if.c 2006-12-12 14:12:06.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/if.c 2008-04-16 11:55:54.000000000 -0700 @@ -36,6 +35,8 @@ #include "str.h" #include "log.h" + + /* Master list of interfaces. */ struct list *iflist; @@ -65,7 +66,8 @@ if_cmp_func (struct interface *ifp1, str p1 = ifp1->name; p2 = ifp2->name; - while (*p1 && *p2) { + while (*p1 && *p2) + { /* look up to any number */ l1 = strcspn(p1, "0123456789"); l2 = strcspn(p2, "0123456789"); @@ -164,7 +167,8 @@ if_delete (struct interface *ifp) void if_add_hook (int type, int (*func)(struct interface *ifp)) { - switch (type) { + switch (type) + { case IF_NEW_HOOK: if_master.if_new_hook = func; break; @@ -196,8 +200,7 @@ ifindex2ifname (unsigned int index) { struct interface *ifp; - return ((ifp = if_lookup_by_index(index)) != NULL) ? - ifp->name : "unknown"; + return ((ifp = if_lookup_by_index (index)) != NULL) ? ifp->name : "unknown"; } unsigned int @@ -266,6 +269,33 @@ if_lookup_exact_address (struct in_addr return NULL; } +/* Lookup interface by IPv6 address. */ +struct interface * +if_lookup_exact_address_ipv6 (struct in6_addr src) +{ + struct listnode *node; + struct listnode *cnode; + struct interface *ifp; + struct prefix *p; + struct connected *c; + + for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) + { + for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c)) + { + p = c->address; + + if (p && p->family == AF_INET6) + { + if (IPV6_ADDR_SAME (&p->u.prefix6, &src)) + return ifp; + } + } + } + return NULL; +} + + /* Lookup interface by IPv4 address. */ struct interface * if_lookup_address (struct in_addr src) @@ -340,7 +370,8 @@ int if_is_operative (struct interface *ifp) { return ((ifp->flags & IFF_UP) && - (ifp->flags & IFF_RUNNING || !CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_LINKDETECTION))); + (ifp->flags & IFF_RUNNING + || !CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_LINKDETECTION))); } /* Is this loopback interface ? */ @@ -431,8 +462,7 @@ if_dump (struct interface *ifp) #ifdef HAVE_IPV6 "mtu6 %d " #endif /* HAVE_IPV6 */ - "%s", - ifp->name, ifp->ifindex, ifp->metric, ifp->mtu, + "%s", ifp->name, ifp->ifindex, ifp->metric, ifp->mtu, #ifdef HAVE_IPV6 ifp->mtu6, #endif /* HAVE_IPV6 */ @@ -474,9 +504,7 @@ DEFUN (interface_desc, DEFUN (no_interface_desc, no_interface_desc_cmd, - "no description", - NO_STR - "Interface specific description\n") + "no description", NO_STR "Interface specific description\n") { struct interface *ifp; @@ -533,8 +561,7 @@ if_sunwzebra_get (const char *name, size DEFUN (interface, interface_cmd, "interface IFNAME", - "Select an interface to configure\n" - "Interface's name\n") + "Select an interface to configure\n" "Interface's name\n") { struct interface *ifp; size_t sl; @@ -542,8 +569,7 @@ DEFUN (interface, if ((sl = strlen(argv[0])) > INTERFACE_NAMSIZ) { vty_out (vty, "%% Interface name %s is invalid: length exceeds " - "%d characters%s", - argv[0], INTERFACE_NAMSIZ, VTY_NEWLINE); + "%d characters%s", argv[0], INTERFACE_NAMSIZ, VTY_NEWLINE); return CMD_WARNING; } @@ -590,11 +616,7 @@ DEFUN_NOSH (no_interface, } /* For debug purpose. */ -DEFUN (show_address, - show_address_cmd, - "show address", - SHOW_STR - "address\n") +DEFUN (show_address, show_address_cmd, "show address", SHOW_STR "address\n") { struct listnode *node; struct listnode *node2; @@ -620,7 +642,8 @@ DEFUN (show_address, struct connected * connected_new (void) { - struct connected *new = XMALLOC (MTYPE_CONNECTED, sizeof (struct connected)); + struct connected *new = + XMALLOC (MTYPE_CONNECTED, sizeof (struct connected)); memset (new, 0, sizeof (struct connected)); return new; } @@ -655,8 +678,7 @@ connected_log (struct connected *connect snprintf (logbuf, BUFSIZ, "%s interface %s %s %s/%d ", str, ifp->name, prefix_family_str (p), - inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), - p->prefixlen); + inet_ntop (p->family, &p->u.prefix, buf, BUFSIZ), p->prefixlen); p = connected->destination; if (p) @@ -765,8 +787,11 @@ if_nametoindex (const char *name) { struct interface *ifp; - return ((ifp = if_lookup_by_name_len(name, strnlen(name, IFNAMSIZ))) != NULL) - ? ifp->ifindex : 0; + return ((ifp = + if_lookup_by_name_len (name, + strnlen (name, + IFNAMSIZ))) != + NULL) ? ifp->ifindex : 0; } #endif @@ -871,7 +896,8 @@ if_init (void) ifaddr_ipv4_table = route_table_init (); #endif /* ifaddr_ipv4_table */ - if (iflist) { + if (iflist) + { iflist->cmp = (int (*)(void *, void *))if_cmp_func; return; } --- quagga-0.99.9/lib/if.h 2007-05-09 13:59:34.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/if.h 2008-04-16 11:55:54.000000000 -0700 @@ -233,6 +235,7 @@ extern int if_cmp_func (struct interface extern struct interface *if_create (const char *name, int namelen); extern struct interface *if_lookup_by_index (unsigned int); extern struct interface *if_lookup_exact_address (struct in_addr); +extern struct interface *if_lookup_exact_address_ipv6 (struct in6_addr); extern struct interface *if_lookup_address (struct in_addr); /* These 2 functions are to be used when the ifname argument is terminated @@ -245,7 +248,8 @@ extern struct interface *if_get_by_name In most cases, strnlen should be used to calculate the namelen value. */ extern struct interface *if_lookup_by_name_len(const char *ifname, size_t namelen); -extern struct interface *if_get_by_name_len(const char *ifname, size_t namelen); +extern struct interface *if_get_by_name_len (const char *ifname, + size_t namelen); /* Delete the interface, but do not free the structure, and leave it in the --- quagga-0.99.9/lib/if_rmap.c 2005-10-25 22:05:45.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/if_rmap.c 2008-04-16 11:55:54.000000000 -0700 @@ -209,8 +209,7 @@ DEFUN (if_rmap, "Route map set\n" "Route map name\n" "Route map set for input filtering\n" - "Route map set for output filtering\n" - "Route map interface name\n") + "Route map set for output filtering\n" "Route map interface name\n") { enum if_rmap_type type; struct if_rmap *if_rmap; @@ -246,8 +244,7 @@ DEFUN (no_if_rmap, "Route map unset\n" "Route map name\n" "Route map for input filtering\n" - "Route map for output filtering\n" - "Route map interface name\n") + "Route map for output filtering\n" "Route map interface name\n") { int ret; enum if_rmap_type type; @@ -271,19 +268,15 @@ DEFUN (no_if_rmap, return CMD_SUCCESS; } -ALIAS (no_if_rmap, - no_if_ipv6_rmap_cmd, +ALIAS (no_if_rmap, no_if_ipv6_rmap_cmd, "no route-map ROUTEMAP_NAME (in|out) IFNAME", NO_STR "Route map unset\n" "Route map name\n" "Route map for input filtering\n" - "Route map for output filtering\n" - "Route map interface name\n") - + "Route map for output filtering\n" "Route map interface name\n") /* Configuration write function. */ -int -config_write_if_rmap (struct vty *vty) + int config_write_if_rmap (struct vty *vty) { unsigned int i; struct hash_backet *mp; @@ -300,8 +293,7 @@ config_write_if_rmap (struct vty *vty) { vty_out (vty, " route-map %s in %s%s", if_rmap->routemap[IF_RMAP_IN], - if_rmap->ifname, - VTY_NEWLINE); + if_rmap->ifname, VTY_NEWLINE); write++; } @@ -309,8 +301,7 @@ config_write_if_rmap (struct vty *vty) { vty_out (vty, " route-map %s out %s%s", if_rmap->routemap[IF_RMAP_OUT], - if_rmap->ifname, - VTY_NEWLINE); + if_rmap->ifname, VTY_NEWLINE); write++; } } @@ -327,10 +318,13 @@ void if_rmap_init (int node) { ifrmaphash = hash_create (if_rmap_hash_make, if_rmap_hash_cmp); - if (node == RIPNG_NODE) { + if (node == RIPNG_NODE) + { install_element (RIPNG_NODE, &if_ipv6_rmap_cmd); install_element (RIPNG_NODE, &no_if_ipv6_rmap_cmd); - } else if (node == RIP_NODE) { + } + else if (node == RIP_NODE) + { install_element (RIP_NODE, &if_rmap_cmd); install_element (RIP_NODE, &no_if_rmap_cmd); } --- quagga-0.99.9/lib/jhash.h 2005-05-03 12:06:44.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/jhash.h 2008-04-16 11:55:54.000000000 -0700 @@ -37,7 +37,8 @@ extern u_int32_t jhash2(u_int32_t *k, u_ * NOTE: In partilar the "c += length; __jhash_mix(a,b,c);" normally * done at the end is not done here. */ -extern u_int32_t jhash_3words(u_int32_t a, u_int32_t b, u_int32_t c, u_int32_t initval); +extern u_int32_t jhash_3words (u_int32_t a, u_int32_t b, u_int32_t c, + u_int32_t initval); extern u_int32_t jhash_2words(u_int32_t a, u_int32_t b, u_int32_t initval); extern u_int32_t jhash_1word(u_int32_t a, u_int32_t initval); --- quagga-0.99.9/lib/keychain.c 2005-05-03 11:13:23.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/keychain.c 2008-04-16 11:55:54.000000000 -0700 @@ -237,8 +237,7 @@ DEFUN (key_chain, key_chain_cmd, "key chain WORD", "Authentication key management\n" - "Key-chain management\n" - "Key-chain name\n") + "Key-chain management\n" "Key-chain name\n") { struct keychain *keychain; @@ -254,8 +253,7 @@ DEFUN (no_key_chain, "no key chain WORD", NO_STR "Authentication key management\n" - "Key-chain management\n" - "Key-chain name\n") + "Key-chain management\n" "Key-chain name\n") { struct keychain *keychain; @@ -274,9 +272,7 @@ DEFUN (no_key_chain, DEFUN (key, key_cmd, - "key <0-2147483647>", - "Configure a key\n" - "Key identifier number\n") + "key <0-2147483647>", "Configure a key\n" "Key identifier number\n") { struct keychain *keychain; struct key *key; @@ -295,9 +291,7 @@ DEFUN (key, DEFUN (no_key, no_key_cmd, "no key <0-2147483647>", - NO_STR - "Delete a key\n" - "Key identifier number\n") + NO_STR "Delete a key\n" "Key identifier number\n") { struct keychain *keychain; struct key *key; @@ -321,10 +315,7 @@ DEFUN (no_key, } DEFUN (key_string, - key_string_cmd, - "key-string LINE", - "Set key string\n" - "The key\n") + key_string_cmd, "key-string LINE", "Set key string\n" "The key\n") { struct key *key; @@ -339,10 +330,7 @@ DEFUN (key_string, DEFUN (no_key_string, no_key_string_cmd, - "no key-string [LINE]", - NO_STR - "Unset key string\n" - "The key\n") + "no key-string [LINE]", NO_STR "Unset key string\n" "The key\n") { struct key *key; @@ -360,8 +348,8 @@ DEFUN (no_key_string, /* Convert HH:MM:SS MON DAY YEAR to time_t value. -1 is returned when given string is malformed. */ static time_t -key_str2time (const char *time_str, const char *day_str, const char *month_str, - const char *year_str) +key_str2time (const char *time_str, const char *day_str, + const char *month_str, const char *year_str) { int i = 0; char *colon; @@ -370,8 +358,7 @@ key_str2time (const char *time_str, cons unsigned int sec, min, hour; unsigned int day, month, year; - const char *month_name[] = - { + const char *month_name[] = { "January", "February", "March", @@ -484,7 +471,8 @@ key_lifetime_set (struct vty *vty, struc if (time_end <= time_start) { - vty_out (vty, "Expire time is not later than start time%s", VTY_NEWLINE); + vty_out (vty, "Expire time is not later than start time%s", + VTY_NEWLINE); return CMD_WARNING; } @@ -548,8 +536,7 @@ DEFUN (accept_lifetime_day_month_day_mon "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; @@ -569,8 +556,7 @@ DEFUN (accept_lifetime_day_month_month_d "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; @@ -590,8 +576,7 @@ DEFUN (accept_lifetime_month_day_day_mon "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; @@ -611,8 +596,7 @@ DEFUN (accept_lifetime_month_day_month_d "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; @@ -628,9 +612,7 @@ DEFUN (accept_lifetime_infinite_day_mont "Set accept lifetime of the key\n" "Time to start\n" "Day of th month to start\n" - "Month of the year to start\n" - "Year to start\n" - "Never expires") + "Month of the year to start\n" "Year to start\n" "Never expires") { struct key *key; @@ -646,9 +628,7 @@ DEFUN (accept_lifetime_infinite_month_da "Set accept lifetime of the key\n" "Time to start\n" "Month of the year to start\n" - "Day of th month to start\n" - "Year to start\n" - "Never expires") + "Day of th month to start\n" "Year to start\n" "Never expires") { struct key *key; @@ -665,9 +645,7 @@ DEFUN (accept_lifetime_duration_day_mont "Time to start\n" "Day of th month to start\n" "Month of the year to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; @@ -684,9 +662,7 @@ DEFUN (accept_lifetime_duration_month_da "Time to start\n" "Month of the year to start\n" "Day of th month to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; @@ -706,15 +682,14 @@ DEFUN (send_lifetime_day_month_day_month "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], argv[3], - argv[4], argv[5], argv[6], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], + argv[3], argv[4], argv[5], argv[6], argv[7]); } DEFUN (send_lifetime_day_month_month_day, @@ -727,15 +702,14 @@ DEFUN (send_lifetime_day_month_month_day "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], argv[3], - argv[4], argv[6], argv[5], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[1], argv[2], + argv[3], argv[4], argv[6], argv[5], argv[7]); } DEFUN (send_lifetime_month_day_day_month, @@ -748,15 +722,14 @@ DEFUN (send_lifetime_month_day_day_month "Year to start\n" "Time to expire\n" "Day of th month to expire\n" - "Month of the year to expire\n" - "Year to expire\n") + "Month of the year to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], argv[3], - argv[4], argv[5], argv[6], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], + argv[3], argv[4], argv[5], argv[6], argv[7]); } DEFUN (send_lifetime_month_day_month_day, @@ -769,15 +742,14 @@ DEFUN (send_lifetime_month_day_month_day "Year to start\n" "Time to expire\n" "Month of the year to expire\n" - "Day of th month to expire\n" - "Year to expire\n") + "Day of th month to expire\n" "Year to expire\n") { struct key *key; key = vty->index_sub; - return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], argv[3], - argv[4], argv[6], argv[5], argv[7]); + return key_lifetime_set (vty, &key->send, argv[0], argv[2], argv[1], + argv[3], argv[4], argv[6], argv[5], argv[7]); } DEFUN (send_lifetime_infinite_day_month, @@ -786,16 +758,14 @@ DEFUN (send_lifetime_infinite_day_month, "Set send lifetime of the key\n" "Time to start\n" "Day of th month to start\n" - "Month of the year to start\n" - "Year to start\n" - "Never expires") + "Month of the year to start\n" "Year to start\n" "Never expires") { struct key *key; key = vty->index_sub; - return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[1], argv[2], - argv[3]); + return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[1], + argv[2], argv[3]); } DEFUN (send_lifetime_infinite_month_day, @@ -804,16 +774,14 @@ DEFUN (send_lifetime_infinite_month_day, "Set send lifetime of the key\n" "Time to start\n" "Month of the year to start\n" - "Day of th month to start\n" - "Year to start\n" - "Never expires") + "Day of th month to start\n" "Year to start\n" "Never expires") { struct key *key; key = vty->index_sub; - return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[2], argv[1], - argv[3]); + return key_lifetime_infinite_set (vty, &key->send, argv[0], argv[2], + argv[1], argv[3]); } DEFUN (send_lifetime_duration_day_month, @@ -823,16 +791,14 @@ DEFUN (send_lifetime_duration_day_month, "Time to start\n" "Day of th month to start\n" "Month of the year to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; key = vty->index_sub; - return key_lifetime_duration_set (vty, &key->send, argv[0], argv[1], argv[2], - argv[3], argv[4]); + return key_lifetime_duration_set (vty, &key->send, argv[0], argv[1], + argv[2], argv[3], argv[4]); } DEFUN (send_lifetime_duration_month_day, @@ -842,27 +808,23 @@ DEFUN (send_lifetime_duration_month_day, "Time to start\n" "Month of the year to start\n" "Day of th month to start\n" - "Year to start\n" - "Duration of the key\n" - "Duration seconds\n") + "Year to start\n" "Duration of the key\n" "Duration seconds\n") { struct key *key; key = vty->index_sub; - return key_lifetime_duration_set (vty, &key->send, argv[0], argv[2], argv[1], - argv[3], argv[4]); + return key_lifetime_duration_set (vty, &key->send, argv[0], argv[2], + argv[1], argv[3], argv[4]); } -struct cmd_node keychain_node = -{ +struct cmd_node keychain_node = { KEYCHAIN_NODE, "%s(config-keychain)# ", 1 }; -struct cmd_node keychain_key_node = -{ +struct cmd_node keychain_key_node = { KEYCHAIN_KEY_NODE, "%s(config-keychain-key)# ", 1 @@ -927,7 +889,8 @@ keychain_config_write (struct vty *vty) if (key->send.end == -1) vty_out (vty, " infinite"); else if (key->send.duration) - vty_out (vty, " duration %ld", (long)(key->send.end - key->send.start)); + vty_out (vty, " duration %ld", + (long) (key->send.end - key->send.start)); else { keychain_strftime (buf, BUFSIZ, &key->send.end); @@ -970,14 +933,22 @@ keychain_init () install_element (KEYCHAIN_KEY_NODE, &key_cmd); install_element (KEYCHAIN_KEY_NODE, &no_key_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_day_month_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_day_month_month_day_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_month_day_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_month_day_month_day_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_infinite_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_infinite_month_day_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_duration_day_month_cmd); - install_element (KEYCHAIN_KEY_NODE, &accept_lifetime_duration_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_day_month_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_day_month_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_month_day_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_month_day_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_infinite_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_infinite_month_day_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_duration_day_month_cmd); + install_element (KEYCHAIN_KEY_NODE, + &accept_lifetime_duration_month_day_cmd); install_element (KEYCHAIN_KEY_NODE, &send_lifetime_day_month_day_month_cmd); install_element (KEYCHAIN_KEY_NODE, &send_lifetime_day_month_month_day_cmd); --- quagga-0.99.9/lib/keychain.h 2005-05-03 10:51:36.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/keychain.h 2008-04-16 11:55:54.000000000 -0700 @@ -50,7 +50,8 @@ struct key extern void keychain_init (void); extern struct keychain *keychain_lookup (const char *); extern struct key *key_lookup_for_accept (const struct keychain *, u_int32_t); -extern struct key *key_match_for_accept (const struct keychain *, const char *); +extern struct key *key_match_for_accept (const struct keychain *, + const char *); extern struct key *key_lookup_for_send (const struct keychain *); #endif /* _ZEBRA_KEYCHAIN_H */ --- quagga-0.99.9/lib/linklist.h 2005-05-03 12:07:24.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/linklist.h 2008-04-16 11:55:54.000000000 -0700 @@ -100,9 +101,9 @@ extern void list_add_list (struct list * * of previous macro. */ #define ALL_LIST_ELEMENTS_RO(list,node,data) \ - (node) = listhead(list); \ - (node) != NULL && ((data) = listgetdata(node), 1); \ - (node) = listnextnode(node) + (node) = (typeof(node))listhead(list); \ + (node) != NULL && ((data) = (typeof(data))listgetdata(node), 1); \ + (node) = (typeof(node))listnextnode(node) /* these *do not* cleanup list nodes and referenced data, as the functions * do - these macros simply {de,at}tach a listnode from/to a list. --- quagga-0.99.9/lib/log.c 2007-08-06 08:21:45.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/log.c 2008-04-16 11:55:54.000000000 -0700 @@ -803,7 +803,7 @@ static const struct zebra_desc_table rou DESC_ENTRY (ZEBRA_ROUTE_RIP, "rip", 'R' ), DESC_ENTRY (ZEBRA_ROUTE_RIPNG, "ripng", 'R' ), DESC_ENTRY (ZEBRA_ROUTE_OSPF, "ospf", 'O' ), - DESC_ENTRY (ZEBRA_ROUTE_OSPF6, "ospf6", 'O' ), + DESC_ENTRY (ZEBRA_ROUTE_OSPF6, "ospf6", 'o' ), DESC_ENTRY (ZEBRA_ROUTE_ISIS, "isis", 'I' ), DESC_ENTRY (ZEBRA_ROUTE_BGP, "bgp", 'B' ), DESC_ENTRY (ZEBRA_ROUTE_HSLS, "hsls", 'H' ), --- quagga-0.99.9/lib/log.h 2007-04-29 05:40:40.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/log.h 2008-04-16 11:55:54.000000000 -0700 @@ -111,13 +111,16 @@ extern void closezlog (struct zlog *zl); #endif /* __GNUC__ */ /* Generic function for zlog. */ -extern void zlog (struct zlog *zl, int priority, const char *format, ...) PRINTF_ATTRIBUTE(3, 4); +extern void +zlog (struct zlog *zl, int priority, const char *format, ...) +PRINTF_ATTRIBUTE (3, 4); /* Handy zlog functions. */ extern void zlog_err (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); extern void zlog_warn (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); extern void zlog_info (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); -extern void zlog_notice (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); + extern void zlog_notice (const char *format, ...) PRINTF_ATTRIBUTE (1, + 2); extern void zlog_debug (const char *format, ...) PRINTF_ATTRIBUTE(1, 2); /* For bgpd's peer oriented log. */ @@ -134,7 +137,8 @@ extern void plog_debug (struct zlog *, c extern void zlog_set_level (struct zlog *zl, zlog_dest_t, int log_level); /* Set logging to the given filename at the specified level. */ -extern int zlog_set_file (struct zlog *zl, const char *filename, int log_level); + extern int zlog_set_file (struct zlog *zl, const char *filename, + int log_level); /* Disable file logging. */ extern int zlog_reset_file (struct zlog *zl); @@ -145,7 +149,8 @@ extern int zlog_rotate (struct zlog *); #define LOOKUP(x, y) mes_lookup(x, x ## _max, y) extern const char *lookup (struct message *, int); -extern const char *mes_lookup (struct message *meslist, int max, int index); + extern const char *mes_lookup (struct message *meslist, int max, + int index); extern const char *zlog_priority[]; extern const char *zlog_proto_names[]; @@ -175,11 +180,13 @@ extern void zlog_backtrace_sigsafe(int p It caches the most recent localtime result and can therefore avoid multiple calls within the same second. If buflen is too small, *buf will be set to '\0', and 0 will be returned. */ -extern size_t quagga_timestamp(int timestamp_precision /* # subsecond digits */, + extern size_t quagga_timestamp (int timestamp_precision + /* # subsecond digits */ , char *buf, size_t buflen); /* structure useful for avoiding repeated rendering of the same timestamp */ -struct timestamp_control { + struct timestamp_control + { size_t len; /* length of rendered timestamp */ int precision; /* configuration parameter */ int already_rendered; /* should be initialized to 0 */ --- quagga-0.99.9/lib/md5.c 2006-01-31 12:55:52.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/md5.c 2008-04-16 11:55:54.000000000 -0700 @@ -135,7 +135,8 @@ static const uint8_t md5_paddat[MD5_BUFL static void md5_calc (const uint8_t *, md5_ctxt *); -void md5_init(md5_ctxt *ctxt) +void +md5_init (md5_ctxt * ctxt) { ctxt->md5_n = 0; ctxt->md5_i = 0; @@ -146,7 +147,8 @@ void md5_init(md5_ctxt *ctxt) memset (ctxt->md5_buf, 0, sizeof(ctxt->md5_buf)); } -void md5_loop(md5_ctxt *ctxt, const void *vinput, uint len) +void +md5_loop (md5_ctxt * ctxt, const void *vinput, uint len) { uint gap, i; const uint8_t *input = vinput; @@ -154,32 +156,40 @@ void md5_loop(md5_ctxt *ctxt, const void ctxt->md5_n += len * 8; /* byte to bit */ gap = MD5_BUFLEN - ctxt->md5_i; - if (len >= gap) { + if (len >= gap) + { memcpy (ctxt->md5_buf + ctxt->md5_i, input, gap); md5_calc(ctxt->md5_buf, ctxt); - for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN) { + for (i = gap; i + MD5_BUFLEN <= len; i += MD5_BUFLEN) + { md5_calc((input + i), ctxt); } ctxt->md5_i = len - i; memcpy (ctxt->md5_buf, (input + i), ctxt->md5_i); - } else { + } + else + { memcpy (ctxt->md5_buf + ctxt->md5_i, input, len); ctxt->md5_i += len; } } -void md5_pad(md5_ctxt *ctxt) +void +md5_pad (md5_ctxt * ctxt) { uint gap; /* Don't count up padding. Keep md5_n. */ gap = MD5_BUFLEN - ctxt->md5_i; - if (gap > 8) { + if (gap > 8) + { memcpy (ctxt->md5_buf + ctxt->md5_i, md5_paddat, gap - sizeof(ctxt->md5_n)); - } else { + } + else + { /* including gap == 8 */ memcpy (ctxt->md5_buf + ctxt->md5_i, md5_paddat, gap); md5_calc (ctxt->md5_buf, ctxt); @@ -204,25 +214,35 @@ void md5_pad(md5_ctxt *ctxt) md5_calc(ctxt->md5_buf, ctxt); } -void md5_result(uint8_t *digest, md5_ctxt *ctxt) +void +md5_result (uint8_t * digest, md5_ctxt * ctxt) { /* 4 byte words */ if (BYTE_ORDER == LITTLE_ENDIAN) memcpy (digest, &ctxt->md5_st8[0], 16); else if (BYTE_ORDER == BIG_ENDIAN) { - digest[ 0] = ctxt->md5_st8[ 3]; digest[ 1] = ctxt->md5_st8[ 2]; - digest[ 2] = ctxt->md5_st8[ 1]; digest[ 3] = ctxt->md5_st8[ 0]; - digest[ 4] = ctxt->md5_st8[ 7]; digest[ 5] = ctxt->md5_st8[ 6]; - digest[ 6] = ctxt->md5_st8[ 5]; digest[ 7] = ctxt->md5_st8[ 4]; - digest[ 8] = ctxt->md5_st8[11]; digest[ 9] = ctxt->md5_st8[10]; - digest[10] = ctxt->md5_st8[ 9]; digest[11] = ctxt->md5_st8[ 8]; - digest[12] = ctxt->md5_st8[15]; digest[13] = ctxt->md5_st8[14]; - digest[14] = ctxt->md5_st8[13]; digest[15] = ctxt->md5_st8[12]; + digest[0] = ctxt->md5_st8[3]; + digest[1] = ctxt->md5_st8[2]; + digest[2] = ctxt->md5_st8[1]; + digest[3] = ctxt->md5_st8[0]; + digest[4] = ctxt->md5_st8[7]; + digest[5] = ctxt->md5_st8[6]; + digest[6] = ctxt->md5_st8[5]; + digest[7] = ctxt->md5_st8[4]; + digest[8] = ctxt->md5_st8[11]; + digest[9] = ctxt->md5_st8[10]; + digest[10] = ctxt->md5_st8[9]; + digest[11] = ctxt->md5_st8[8]; + digest[12] = ctxt->md5_st8[15]; + digest[13] = ctxt->md5_st8[14]; + digest[14] = ctxt->md5_st8[13]; + digest[15] = ctxt->md5_st8[12]; } } -static void md5_calc(const uint8_t *b64, md5_ctxt * ctxt) +static void +md5_calc (const uint8_t * b64, md5_ctxt * ctxt) { uint32_t A = ctxt->md5_sta; uint32_t B = ctxt->md5_stb; @@ -238,59 +258,139 @@ static void md5_calc(const uint8_t *b64, /* 4 byte words */ /* what a brute force but fast! */ uint8_t *y = (uint8_t *)X; - y[ 0] = b64[ 3]; y[ 1] = b64[ 2]; y[ 2] = b64[ 1]; y[ 3] = b64[ 0]; - y[ 4] = b64[ 7]; y[ 5] = b64[ 6]; y[ 6] = b64[ 5]; y[ 7] = b64[ 4]; - y[ 8] = b64[11]; y[ 9] = b64[10]; y[10] = b64[ 9]; y[11] = b64[ 8]; - y[12] = b64[15]; y[13] = b64[14]; y[14] = b64[13]; y[15] = b64[12]; - y[16] = b64[19]; y[17] = b64[18]; y[18] = b64[17]; y[19] = b64[16]; - y[20] = b64[23]; y[21] = b64[22]; y[22] = b64[21]; y[23] = b64[20]; - y[24] = b64[27]; y[25] = b64[26]; y[26] = b64[25]; y[27] = b64[24]; - y[28] = b64[31]; y[29] = b64[30]; y[30] = b64[29]; y[31] = b64[28]; - y[32] = b64[35]; y[33] = b64[34]; y[34] = b64[33]; y[35] = b64[32]; - y[36] = b64[39]; y[37] = b64[38]; y[38] = b64[37]; y[39] = b64[36]; - y[40] = b64[43]; y[41] = b64[42]; y[42] = b64[41]; y[43] = b64[40]; - y[44] = b64[47]; y[45] = b64[46]; y[46] = b64[45]; y[47] = b64[44]; - y[48] = b64[51]; y[49] = b64[50]; y[50] = b64[49]; y[51] = b64[48]; - y[52] = b64[55]; y[53] = b64[54]; y[54] = b64[53]; y[55] = b64[52]; - y[56] = b64[59]; y[57] = b64[58]; y[58] = b64[57]; y[59] = b64[56]; - y[60] = b64[63]; y[61] = b64[62]; y[62] = b64[61]; y[63] = b64[60]; - } - - ROUND1(A, B, C, D, 0, Sa, 1); ROUND1(D, A, B, C, 1, Sb, 2); - ROUND1(C, D, A, B, 2, Sc, 3); ROUND1(B, C, D, A, 3, Sd, 4); - ROUND1(A, B, C, D, 4, Sa, 5); ROUND1(D, A, B, C, 5, Sb, 6); - ROUND1(C, D, A, B, 6, Sc, 7); ROUND1(B, C, D, A, 7, Sd, 8); - ROUND1(A, B, C, D, 8, Sa, 9); ROUND1(D, A, B, C, 9, Sb, 10); - ROUND1(C, D, A, B, 10, Sc, 11); ROUND1(B, C, D, A, 11, Sd, 12); - ROUND1(A, B, C, D, 12, Sa, 13); ROUND1(D, A, B, C, 13, Sb, 14); - ROUND1(C, D, A, B, 14, Sc, 15); ROUND1(B, C, D, A, 15, Sd, 16); - - ROUND2(A, B, C, D, 1, Se, 17); ROUND2(D, A, B, C, 6, Sf, 18); - ROUND2(C, D, A, B, 11, Sg, 19); ROUND2(B, C, D, A, 0, Sh, 20); - ROUND2(A, B, C, D, 5, Se, 21); ROUND2(D, A, B, C, 10, Sf, 22); - ROUND2(C, D, A, B, 15, Sg, 23); ROUND2(B, C, D, A, 4, Sh, 24); - ROUND2(A, B, C, D, 9, Se, 25); ROUND2(D, A, B, C, 14, Sf, 26); - ROUND2(C, D, A, B, 3, Sg, 27); ROUND2(B, C, D, A, 8, Sh, 28); - ROUND2(A, B, C, D, 13, Se, 29); ROUND2(D, A, B, C, 2, Sf, 30); - ROUND2(C, D, A, B, 7, Sg, 31); ROUND2(B, C, D, A, 12, Sh, 32); - - ROUND3(A, B, C, D, 5, Si, 33); ROUND3(D, A, B, C, 8, Sj, 34); - ROUND3(C, D, A, B, 11, Sk, 35); ROUND3(B, C, D, A, 14, Sl, 36); - ROUND3(A, B, C, D, 1, Si, 37); ROUND3(D, A, B, C, 4, Sj, 38); - ROUND3(C, D, A, B, 7, Sk, 39); ROUND3(B, C, D, A, 10, Sl, 40); - ROUND3(A, B, C, D, 13, Si, 41); ROUND3(D, A, B, C, 0, Sj, 42); - ROUND3(C, D, A, B, 3, Sk, 43); ROUND3(B, C, D, A, 6, Sl, 44); - ROUND3(A, B, C, D, 9, Si, 45); ROUND3(D, A, B, C, 12, Sj, 46); - ROUND3(C, D, A, B, 15, Sk, 47); ROUND3(B, C, D, A, 2, Sl, 48); - - ROUND4(A, B, C, D, 0, Sm, 49); ROUND4(D, A, B, C, 7, Sn, 50); - ROUND4(C, D, A, B, 14, So, 51); ROUND4(B, C, D, A, 5, Sp, 52); - ROUND4(A, B, C, D, 12, Sm, 53); ROUND4(D, A, B, C, 3, Sn, 54); - ROUND4(C, D, A, B, 10, So, 55); ROUND4(B, C, D, A, 1, Sp, 56); - ROUND4(A, B, C, D, 8, Sm, 57); ROUND4(D, A, B, C, 15, Sn, 58); - ROUND4(C, D, A, B, 6, So, 59); ROUND4(B, C, D, A, 13, Sp, 60); - ROUND4(A, B, C, D, 4, Sm, 61); ROUND4(D, A, B, C, 11, Sn, 62); - ROUND4(C, D, A, B, 2, So, 63); ROUND4(B, C, D, A, 9, Sp, 64); + y[0] = b64[3]; + y[1] = b64[2]; + y[2] = b64[1]; + y[3] = b64[0]; + y[4] = b64[7]; + y[5] = b64[6]; + y[6] = b64[5]; + y[7] = b64[4]; + y[8] = b64[11]; + y[9] = b64[10]; + y[10] = b64[9]; + y[11] = b64[8]; + y[12] = b64[15]; + y[13] = b64[14]; + y[14] = b64[13]; + y[15] = b64[12]; + y[16] = b64[19]; + y[17] = b64[18]; + y[18] = b64[17]; + y[19] = b64[16]; + y[20] = b64[23]; + y[21] = b64[22]; + y[22] = b64[21]; + y[23] = b64[20]; + y[24] = b64[27]; + y[25] = b64[26]; + y[26] = b64[25]; + y[27] = b64[24]; + y[28] = b64[31]; + y[29] = b64[30]; + y[30] = b64[29]; + y[31] = b64[28]; + y[32] = b64[35]; + y[33] = b64[34]; + y[34] = b64[33]; + y[35] = b64[32]; + y[36] = b64[39]; + y[37] = b64[38]; + y[38] = b64[37]; + y[39] = b64[36]; + y[40] = b64[43]; + y[41] = b64[42]; + y[42] = b64[41]; + y[43] = b64[40]; + y[44] = b64[47]; + y[45] = b64[46]; + y[46] = b64[45]; + y[47] = b64[44]; + y[48] = b64[51]; + y[49] = b64[50]; + y[50] = b64[49]; + y[51] = b64[48]; + y[52] = b64[55]; + y[53] = b64[54]; + y[54] = b64[53]; + y[55] = b64[52]; + y[56] = b64[59]; + y[57] = b64[58]; + y[58] = b64[57]; + y[59] = b64[56]; + y[60] = b64[63]; + y[61] = b64[62]; + y[62] = b64[61]; + y[63] = b64[60]; + } + + ROUND1 (A, B, C, D, 0, Sa, 1); + ROUND1 (D, A, B, C, 1, Sb, 2); + ROUND1 (C, D, A, B, 2, Sc, 3); + ROUND1 (B, C, D, A, 3, Sd, 4); + ROUND1 (A, B, C, D, 4, Sa, 5); + ROUND1 (D, A, B, C, 5, Sb, 6); + ROUND1 (C, D, A, B, 6, Sc, 7); + ROUND1 (B, C, D, A, 7, Sd, 8); + ROUND1 (A, B, C, D, 8, Sa, 9); + ROUND1 (D, A, B, C, 9, Sb, 10); + ROUND1 (C, D, A, B, 10, Sc, 11); + ROUND1 (B, C, D, A, 11, Sd, 12); + ROUND1 (A, B, C, D, 12, Sa, 13); + ROUND1 (D, A, B, C, 13, Sb, 14); + ROUND1 (C, D, A, B, 14, Sc, 15); + ROUND1 (B, C, D, A, 15, Sd, 16); + + ROUND2 (A, B, C, D, 1, Se, 17); + ROUND2 (D, A, B, C, 6, Sf, 18); + ROUND2 (C, D, A, B, 11, Sg, 19); + ROUND2 (B, C, D, A, 0, Sh, 20); + ROUND2 (A, B, C, D, 5, Se, 21); + ROUND2 (D, A, B, C, 10, Sf, 22); + ROUND2 (C, D, A, B, 15, Sg, 23); + ROUND2 (B, C, D, A, 4, Sh, 24); + ROUND2 (A, B, C, D, 9, Se, 25); + ROUND2 (D, A, B, C, 14, Sf, 26); + ROUND2 (C, D, A, B, 3, Sg, 27); + ROUND2 (B, C, D, A, 8, Sh, 28); + ROUND2 (A, B, C, D, 13, Se, 29); + ROUND2 (D, A, B, C, 2, Sf, 30); + ROUND2 (C, D, A, B, 7, Sg, 31); + ROUND2 (B, C, D, A, 12, Sh, 32); + + ROUND3 (A, B, C, D, 5, Si, 33); + ROUND3 (D, A, B, C, 8, Sj, 34); + ROUND3 (C, D, A, B, 11, Sk, 35); + ROUND3 (B, C, D, A, 14, Sl, 36); + ROUND3 (A, B, C, D, 1, Si, 37); + ROUND3 (D, A, B, C, 4, Sj, 38); + ROUND3 (C, D, A, B, 7, Sk, 39); + ROUND3 (B, C, D, A, 10, Sl, 40); + ROUND3 (A, B, C, D, 13, Si, 41); + ROUND3 (D, A, B, C, 0, Sj, 42); + ROUND3 (C, D, A, B, 3, Sk, 43); + ROUND3 (B, C, D, A, 6, Sl, 44); + ROUND3 (A, B, C, D, 9, Si, 45); + ROUND3 (D, A, B, C, 12, Sj, 46); + ROUND3 (C, D, A, B, 15, Sk, 47); + ROUND3 (B, C, D, A, 2, Sl, 48); + + ROUND4 (A, B, C, D, 0, Sm, 49); + ROUND4 (D, A, B, C, 7, Sn, 50); + ROUND4 (C, D, A, B, 14, So, 51); + ROUND4 (B, C, D, A, 5, Sp, 52); + ROUND4 (A, B, C, D, 12, Sm, 53); + ROUND4 (D, A, B, C, 3, Sn, 54); + ROUND4 (C, D, A, B, 10, So, 55); + ROUND4 (B, C, D, A, 1, Sp, 56); + ROUND4 (A, B, C, D, 8, Sm, 57); + ROUND4 (D, A, B, C, 15, Sn, 58); + ROUND4 (C, D, A, B, 6, So, 59); + ROUND4 (B, C, D, A, 13, Sp, 60); + ROUND4 (A, B, C, D, 4, Sm, 61); + ROUND4 (D, A, B, C, 11, Sn, 62); + ROUND4 (C, D, A, B, 2, So, 63); + ROUND4 (B, C, D, A, 9, Sp, 64); ctxt->md5_sta += A; ctxt->md5_stb += B; --- quagga-0.99.9/lib/md5.h 2006-01-31 12:55:52.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/md5.h 2008-04-16 11:55:54.000000000 -0700 @@ -44,8 +44,10 @@ #define MD5_BUFLEN 64 -typedef struct { - union { +typedef struct +{ + union + { uint32_t md5_state32[4]; uint8_t md5_state8[16]; } md5_st; @@ -56,7 +58,8 @@ typedef struct { #define md5_std md5_st.md5_state32[3] #define md5_st8 md5_st.md5_state8 - union { + union + { uint64_t md5_count64; uint8_t md5_count8[8]; } md5_count; --- quagga-0.99.9/lib/memory.c 2007-03-20 11:23:00.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/memory.c 2008-04-16 11:55:54.000000000 -0700 @@ -33,8 +33,7 @@ static void alloc_inc (int); static void alloc_dec (int); static void log_memstats(int log_priority); -static struct message mstr [] = -{ +static struct message mstr[] = { { MTYPE_THREAD, "thread" }, { MTYPE_THREAD_MASTER, "thread_master" }, { MTYPE_VECTOR, "vector" }, @@ -140,7 +139,8 @@ static struct static void mtype_log (char *func, void *memory, const char *file, int line, int type) { - zlog_debug ("%s: %s %p %s %d", func, lookup (mstr, type), memory, file, line); + zlog_debug ("%s: %s %p %s %d", func, lookup (mstr, type), memory, file, + line); } void * @@ -249,7 +249,8 @@ log_memstats(int pri) zlog (NULL, pri, "Memory utilization in module %s:", ml->name); for (m = ml->list; m->index >= 0; m++) if (m->index && mstat[m->index].alloc) - zlog (NULL, pri, " %-30s: %10ld", m->format, mstat[m->index].alloc); + zlog (NULL, pri, " %-30s: %10ld", m->format, + mstat[m->index].alloc); } } @@ -291,32 +292,23 @@ show_memory_mallinfo (struct vty *vty) vty_out (vty, "System allocator statistics:%s", VTY_NEWLINE); vty_out (vty, " Total heap allocated: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.arena), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.arena), VTY_NEWLINE); vty_out (vty, " Holding block headers: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.hblkhd), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.hblkhd), VTY_NEWLINE); vty_out (vty, " Used small blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.usmblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.usmblks), VTY_NEWLINE); vty_out (vty, " Used ordinary blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.uordblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.uordblks), VTY_NEWLINE); vty_out (vty, " Free small blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fsmblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fsmblks), VTY_NEWLINE); vty_out (vty, " Free ordinary blocks: %s%s", - mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fordblks), - VTY_NEWLINE); + mtype_memstr (buf, MTYPE_MEMSTR_LEN, minfo.fordblks), VTY_NEWLINE); vty_out (vty, " Ordinary blocks: %ld%s", - (unsigned long)minfo.ordblks, - VTY_NEWLINE); + (unsigned long) minfo.ordblks, VTY_NEWLINE); vty_out (vty, " Small blocks: %ld%s", - (unsigned long)minfo.smblks, - VTY_NEWLINE); + (unsigned long) minfo.smblks, VTY_NEWLINE); vty_out (vty, " Holding blocks: %ld%s", - (unsigned long)minfo.hblks, - VTY_NEWLINE); + (unsigned long) minfo.hblks, VTY_NEWLINE); vty_out (vty, "(see system documentation for 'mallinfo' for meaning)%s", VTY_NEWLINE); return 1; @@ -327,8 +319,7 @@ DEFUN (show_memory_all, show_memory_all_cmd, "show memory all", "Show running system information\n" - "Memory statistics\n" - "All memory statistics\n") + "Memory statistics\n" "All memory statistics\n") { struct mlist *ml; int needsep = 0; @@ -352,13 +343,9 @@ ALIAS (show_memory_all, "show memory", "Show running system information\n" "Memory statistics\n") - DEFUN (show_memory_lib, show_memory_lib_cmd, - "show memory lib", - SHOW_STR - "Memory statistics\n" - "Library memory\n") + "show memory lib", SHOW_STR "Memory statistics\n" "Library memory\n") { show_memory_vty (vty, memory_list_lib); return CMD_SUCCESS; @@ -366,10 +353,7 @@ DEFUN (show_memory_lib, DEFUN (show_memory_zebra, show_memory_zebra_cmd, - "show memory zebra", - SHOW_STR - "Memory statistics\n" - "Zebra memory\n") + "show memory zebra", SHOW_STR "Memory statistics\n" "Zebra memory\n") { show_memory_vty (vty, memory_list_zebra); return CMD_SUCCESS; @@ -377,10 +361,7 @@ DEFUN (show_memory_zebra, DEFUN (show_memory_rip, show_memory_rip_cmd, - "show memory rip", - SHOW_STR - "Memory statistics\n" - "RIP memory\n") + "show memory rip", SHOW_STR "Memory statistics\n" "RIP memory\n") { show_memory_vty (vty, memory_list_rip); return CMD_SUCCESS; @@ -388,10 +369,7 @@ DEFUN (show_memory_rip, DEFUN (show_memory_ripng, show_memory_ripng_cmd, - "show memory ripng", - SHOW_STR - "Memory statistics\n" - "RIPng memory\n") + "show memory ripng", SHOW_STR "Memory statistics\n" "RIPng memory\n") { show_memory_vty (vty, memory_list_ripng); return CMD_SUCCESS; @@ -399,10 +377,7 @@ DEFUN (show_memory_ripng, DEFUN (show_memory_bgp, show_memory_bgp_cmd, - "show memory bgp", - SHOW_STR - "Memory statistics\n" - "BGP memory\n") + "show memory bgp", SHOW_STR "Memory statistics\n" "BGP memory\n") { show_memory_vty (vty, memory_list_bgp); return CMD_SUCCESS; @@ -410,10 +385,7 @@ DEFUN (show_memory_bgp, DEFUN (show_memory_ospf, show_memory_ospf_cmd, - "show memory ospf", - SHOW_STR - "Memory statistics\n" - "OSPF memory\n") + "show memory ospf", SHOW_STR "Memory statistics\n" "OSPF memory\n") { show_memory_vty (vty, memory_list_ospf); return CMD_SUCCESS; @@ -421,10 +393,7 @@ DEFUN (show_memory_ospf, DEFUN (show_memory_ospf6, show_memory_ospf6_cmd, - "show memory ospf6", - SHOW_STR - "Memory statistics\n" - "OSPF6 memory\n") + "show memory ospf6", SHOW_STR "Memory statistics\n" "OSPF6 memory\n") { show_memory_vty (vty, memory_list_ospf6); return CMD_SUCCESS; @@ -432,10 +401,7 @@ DEFUN (show_memory_ospf6, DEFUN (show_memory_isis, show_memory_isis_cmd, - "show memory isis", - SHOW_STR - "Memory statistics\n" - "ISIS memory\n") + "show memory isis", SHOW_STR "Memory statistics\n" "ISIS memory\n") { show_memory_vty (vty, memory_list_isis); return CMD_SUCCESS; --- quagga-0.99.9/lib/memory.h 2006-06-15 05:28:59.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/memory.h 2008-04-16 11:55:54.000000000 -0700 @@ -28,7 +28,8 @@ struct memory_list const char *format; }; -struct mlist { +struct mlist +{ struct memory_list *list; const char *name; }; @@ -67,7 +68,8 @@ extern void *zrealloc (int type, void *p extern void zfree (int type, void *ptr); extern char *zstrdup (int type, const char *str); -extern void *mtype_zmalloc (const char *file, int line, int type, size_t size); +extern void *mtype_zmalloc (const char *file, int line, int type, + size_t size); extern void *mtype_zcalloc (const char *file, int line, int type, size_t num, size_t size); @@ -75,8 +77,7 @@ extern void *mtype_zcalloc (const char * extern void *mtype_zrealloc (const char *file, int line, int type, void *ptr, size_t size); -extern void mtype_zfree (const char *file, int line, int type, - void *ptr); +extern void mtype_zfree (const char *file, int line, int type, void *ptr); extern char *mtype_zstrdup (const char *file, int line, int type, const char *str); --- quagga-0.99.9/lib/memtypes.c 2007-05-04 13:15:47.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/memtypes.c 2008-04-16 11:55:54.000000000 -0700 @@ -12,8 +12,7 @@ #include "zebra.h" #include "memory.h" -struct memory_list memory_list_lib[] = -{ +struct memory_list memory_list_lib[] = { { MTYPE_TMP, "Temporary memory" }, { MTYPE_STRVEC, "String vector" }, { MTYPE_VECTOR, "Vector" }, @@ -75,8 +74,7 @@ struct memory_list memory_list_lib[] = { -1, NULL }, }; -struct memory_list memory_list_zebra[] = -{ +struct memory_list memory_list_zebra[] = { { MTYPE_RTADV_PREFIX, "Router Advertisement Prefix" }, { MTYPE_VRF, "VRF" }, { MTYPE_VRF_NAME, "VRF name" }, @@ -88,8 +86,7 @@ struct memory_list memory_list_zebra[] = { -1, NULL }, }; -struct memory_list memory_list_bgp[] = -{ +struct memory_list memory_list_bgp[] = { { MTYPE_BGP, "BGP instance" }, { MTYPE_BGP_PEER, "BGP peer" }, { MTYPE_BGP_PEER_HOST, "BGP peer hostname" }, @@ -151,8 +148,7 @@ struct memory_list memory_list_bgp[] = { -1, NULL } }; -struct memory_list memory_list_rip[] = -{ +struct memory_list memory_list_rip[] = { { MTYPE_RIP, "RIP structure" }, { MTYPE_RIP_INFO, "RIP route info" }, { MTYPE_RIP_INTERFACE, "RIP interface" }, @@ -162,8 +158,7 @@ struct memory_list memory_list_rip[] = { -1, NULL } }; -struct memory_list memory_list_ripng[] = -{ +struct memory_list memory_list_ripng[] = { { MTYPE_RIPNG, "RIPng structure" }, { MTYPE_RIPNG_ROUTE, "RIPng route info" }, { MTYPE_RIPNG_AGGREGATE, "RIPng aggregate" }, @@ -173,8 +168,7 @@ struct memory_list memory_list_ripng[] = { -1, NULL } }; -struct memory_list memory_list_ospf[] = -{ +struct memory_list memory_list_ospf[] = { { MTYPE_OSPF_TOP, "OSPF top" }, { MTYPE_OSPF_AREA, "OSPF area" }, { MTYPE_OSPF_AREA_RANGE, "OSPF area range" }, @@ -203,8 +197,7 @@ struct memory_list memory_list_ospf[] = { -1, NULL }, }; -struct memory_list memory_list_ospf6[] = -{ +struct memory_list memory_list_ospf6[] = { { MTYPE_OSPF6_TOP, "OSPF6 top" }, { MTYPE_OSPF6_AREA, "OSPF6 area" }, { MTYPE_OSPF6_IF, "OSPF6 interface" }, @@ -223,8 +216,7 @@ struct memory_list memory_list_ospf6[] = { -1, NULL }, }; -struct memory_list memory_list_isis[] = -{ +struct memory_list memory_list_isis[] = { { MTYPE_ISIS, "ISIS" }, { MTYPE_ISIS_TMP, "ISIS TMP" }, { MTYPE_ISIS_CIRCUIT, "ISIS circuit" }, @@ -242,21 +234,29 @@ struct memory_list memory_list_isis[] = { -1, NULL }, }; -struct memory_list memory_list_vtysh[] = -{ +struct memory_list memory_list_vtysh[] = { { MTYPE_VTYSH_CONFIG, "Vtysh configuration", }, { MTYPE_VTYSH_CONFIG_LINE, "Vtysh configuration line" }, { -1, NULL }, }; -struct mlist mlists[] __attribute__ ((unused)) = { - { memory_list_lib, "LIB" }, - { memory_list_zebra, "ZEBRA" }, - { memory_list_rip, "RIP" }, - { memory_list_ripng, "RIPNG" }, - { memory_list_ospf, "OSPF" }, - { memory_list_ospf6, "OSPF6" }, - { memory_list_isis, "ISIS" }, - { memory_list_bgp, "BGP" }, - { NULL, NULL}, -}; +struct mlist mlists[] __attribute__ ((unused)) = +{ + { + memory_list_lib, "LIB"}, + { + memory_list_zebra, "ZEBRA"}, + { + memory_list_rip, "RIP"}, + { + memory_list_ripng, "RIPNG"}, + { + memory_list_ospf, "OSPF"}, + { + memory_list_ospf6, "OSPF6"}, + { + memory_list_isis, "ISIS"}, + { + memory_list_bgp, "BGP"}, + { +NULL, NULL},}; --- quagga-0.99.9/lib/network.c 2005-02-16 10:27:08.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/network.c 2008-04-16 11:55:54.000000000 -0700 @@ -39,8 +39,7 @@ readn (int fd, u_char *ptr, int nbytes) if (nread < 0) return (nread); - else - if (nread == 0) + else if (nread == 0) break; nleft -= nread; --- quagga-0.99.9/lib/plist.c 2006-05-12 16:16:00.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/plist.c 2008-04-16 11:55:54.000000000 -0700 @@ -80,8 +80,7 @@ struct prefix_master }; /* Static structure of IPv4 prefix_list's master. */ -static struct prefix_master prefix_master_ipv4 = -{ +static struct prefix_master prefix_master_ipv4 = { {NULL, NULL}, {NULL, NULL}, 1, @@ -91,8 +90,7 @@ static struct prefix_master prefix_maste #ifdef HAVE_IPV6 /* Static structure of IPv6 prefix-list's master. */ -static struct prefix_master prefix_master_ipv6 = -{ +static struct prefix_master prefix_master_ipv6 = { {NULL, NULL}, {NULL, NULL}, 1, @@ -102,8 +100,7 @@ static struct prefix_master prefix_maste #endif /* HAVE_IPV6*/ /* Static structure of BGP ORF prefix_list's master. */ -static struct prefix_master prefix_master_orf = -{ +static struct prefix_master prefix_master_orf = { {NULL, NULL}, {NULL, NULL}, 1, @@ -432,8 +429,7 @@ prefix_list_entry_lookup (struct prefix_ static void prefix_list_entry_delete (struct prefix_list *plist, - struct prefix_list_entry *pentry, - int update_list) + struct prefix_list_entry *pentry, int update_list) { if (plist == NULL || pentry == NULL) return; @@ -640,8 +636,7 @@ prefix_entry_dup_check (struct prefix_li if (prefix_same (&pentry->prefix, &new->prefix) && pentry->type == new->type && pentry->le == new->le - && pentry->ge == new->ge - && pentry->seq != seq) + && pentry->ge == new->ge && pentry->seq != seq) return pentry; } return NULL; @@ -650,7 +645,8 @@ prefix_entry_dup_check (struct prefix_li static int vty_invalid_prefix_range (struct vty *vty, const char *prefix) { - vty_out (vty, "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value%s", + vty_out (vty, + "%% Invalid prefix range for %s, make sure: len < ge-value <= le-value%s", prefix, VTY_NEWLINE); return CMD_WARNING; } @@ -949,8 +945,7 @@ vty_show_prefix_entry (struct vty *vty, vty_out (vty, " count: %d, range entries: %d, sequences: %d - %d%s", plist->count, plist->rangecount, plist->head ? plist->head->seq : 0, - plist->tail ? plist->tail->seq : 0, - VTY_NEWLINE); + plist->tail ? plist->tail->seq : 0, VTY_NEWLINE); } if (dtype != summary_display) @@ -1023,7 +1018,8 @@ vty_show_prefix_list (struct vty *vty, a if (dtype == detail_display || dtype == summary_display) { if (master->recent) - vty_out (vty, "Prefix-list with the last deletion/insertion: %s%s", + vty_out (vty, + "Prefix-list with the last deletion/insertion: %s%s", master->recent->name, VTY_NEWLINE); } @@ -1076,8 +1072,7 @@ vty_show_prefix_list_prefix (struct vty if (match) { vty_out (vty, " seq %d %s ", - pentry->seq, - prefix_list_type_str (pentry)); + pentry->seq, prefix_list_type_str (pentry)); if (pentry->any) vty_out (vty, "any"); @@ -1190,8 +1185,7 @@ DEFUN (ip_prefix_list_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], argv[3], NULL); @@ -1208,8 +1202,7 @@ DEFUN (ip_prefix_list_ge_le, "IP prefix /, e.g., 35.0.0.0/8\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], argv[3], argv[4]); @@ -1224,8 +1217,7 @@ DEFUN (ip_prefix_list_le, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], NULL, argv[3]); @@ -1242,8 +1234,7 @@ DEFUN (ip_prefix_list_le_ge, "IP prefix /, e.g., 35.0.0.0/8\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], argv[4], argv[3]); @@ -1277,8 +1268,7 @@ DEFUN (ip_prefix_list_seq_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], argv[4], NULL); @@ -1297,8 +1287,7 @@ DEFUN (ip_prefix_list_seq_ge_le, "IP prefix /, e.g., 35.0.0.0/8\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); @@ -1315,8 +1304,7 @@ DEFUN (ip_prefix_list_seq_le, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]); @@ -1335,8 +1323,7 @@ DEFUN (ip_prefix_list_seq_le_ge, "IP prefix /, e.g., 35.0.0.0/8\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], argv[5], argv[4]); @@ -1345,10 +1332,7 @@ DEFUN (ip_prefix_list_seq_le_ge, DEFUN (no_ip_prefix_list, no_ip_prefix_list_cmd, "no ip prefix-list WORD", - NO_STR - IP_STR - PREFIX_LIST_STR - "Name of a prefix list\n") + NO_STR IP_STR PREFIX_LIST_STR "Name of a prefix list\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], NULL, NULL, NULL, NULL, NULL); @@ -1380,8 +1364,7 @@ DEFUN (no_ip_prefix_list_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], argv[3], NULL); @@ -1399,8 +1382,7 @@ DEFUN (no_ip_prefix_list_ge_le, "IP prefix /, e.g., 35.0.0.0/8\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], argv[3], argv[4]); @@ -1416,8 +1398,7 @@ DEFUN (no_ip_prefix_list_le, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], NULL, argv[3]); @@ -1435,8 +1416,7 @@ DEFUN (no_ip_prefix_list_le_ge, "IP prefix /, e.g., 35.0.0.0/8\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], NULL, argv[1], argv[2], argv[4], argv[3]); @@ -1472,8 +1452,7 @@ DEFUN (no_ip_prefix_list_seq_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], argv[4], NULL); @@ -1493,8 +1472,7 @@ DEFUN (no_ip_prefix_list_seq_ge_le, "IP prefix /, e.g., 35.0.0.0/8\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); @@ -1512,8 +1490,7 @@ DEFUN (no_ip_prefix_list_seq_le, "Specify packets to reject\n" "Specify packets to forward\n" "IP prefix /, e.g., 35.0.0.0/8\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]); @@ -1533,8 +1510,7 @@ DEFUN (no_ip_prefix_list_seq_le_ge, "IP prefix /, e.g., 35.0.0.0/8\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP, argv[0], argv[1], argv[2], argv[3], argv[5], argv[4]); @@ -1543,9 +1519,7 @@ DEFUN (no_ip_prefix_list_seq_le_ge, DEFUN (ip_prefix_list_sequence_number, ip_prefix_list_sequence_number_cmd, "ip prefix-list sequence-number", - IP_STR - PREFIX_LIST_STR - "Include/exclude sequence numbers in NVGEN\n") + IP_STR PREFIX_LIST_STR "Include/exclude sequence numbers in NVGEN\n") { prefix_master_ipv4.seqnum = 1; return CMD_SUCCESS; @@ -1555,9 +1529,7 @@ DEFUN (no_ip_prefix_list_sequence_number no_ip_prefix_list_sequence_number_cmd, "no ip prefix-list sequence-number", NO_STR - IP_STR - PREFIX_LIST_STR - "Include/exclude sequence numbers in NVGEN\n") + IP_STR PREFIX_LIST_STR "Include/exclude sequence numbers in NVGEN\n") { prefix_master_ipv4.seqnum = 0; return CMD_SUCCESS; @@ -1592,8 +1564,7 @@ DEFUN (no_ip_prefix_list_description, NO_STR IP_STR PREFIX_LIST_STR - "Name of a prefix list\n" - "Prefix-list specific description\n") + "Name of a prefix list\n" "Prefix-list specific description\n") { return vty_prefix_list_desc_unset (vty, AFI_IP, argv[0]); } @@ -1607,13 +1578,9 @@ ALIAS (no_ip_prefix_list_description, "Name of a prefix list\n" "Prefix-list specific description\n" "Up to 80 characters describing this prefix-list\n") - DEFUN (show_ip_prefix_list, show_ip_prefix_list_cmd, - "show ip prefix-list", - SHOW_STR - IP_STR - PREFIX_LIST_STR) + "show ip prefix-list", SHOW_STR IP_STR PREFIX_LIST_STR) { return vty_show_prefix_list (vty, AFI_IP, NULL, NULL, normal_display); } @@ -1621,10 +1588,7 @@ DEFUN (show_ip_prefix_list, DEFUN (show_ip_prefix_list_name, show_ip_prefix_list_name_cmd, "show ip prefix-list WORD", - SHOW_STR - IP_STR - PREFIX_LIST_STR - "Name of a prefix list\n") + SHOW_STR IP_STR PREFIX_LIST_STR "Name of a prefix list\n") { return vty_show_prefix_list (vty, AFI_IP, argv[0], NULL, normal_display); } @@ -1636,10 +1600,10 @@ DEFUN (show_ip_prefix_list_name_seq, IP_STR PREFIX_LIST_STR "Name of a prefix list\n" - "sequence number of an entry\n" - "Sequence number\n") + "sequence number of an entry\n" "Sequence number\n") { - return vty_show_prefix_list (vty, AFI_IP, argv[0], argv[1], sequential_display); + return vty_show_prefix_list (vty, AFI_IP, argv[0], argv[1], + sequential_display); } DEFUN (show_ip_prefix_list_prefix, @@ -1651,7 +1615,8 @@ DEFUN (show_ip_prefix_list_prefix, "Name of a prefix list\n" "IP prefix /, e.g., 35.0.0.0/8\n") { - return vty_show_prefix_list_prefix (vty, AFI_IP, argv[0], argv[1], normal_display); + return vty_show_prefix_list_prefix (vty, AFI_IP, argv[0], argv[1], + normal_display); } DEFUN (show_ip_prefix_list_prefix_longer, @@ -1664,7 +1629,8 @@ DEFUN (show_ip_prefix_list_prefix_longer "IP prefix /, e.g., 35.0.0.0/8\n" "Lookup longer prefix\n") { - return vty_show_prefix_list_prefix (vty, AFI_IP, argv[0], argv[1], longer_display); + return vty_show_prefix_list_prefix (vty, AFI_IP, argv[0], argv[1], + longer_display); } DEFUN (show_ip_prefix_list_prefix_first_match, @@ -1677,16 +1643,14 @@ DEFUN (show_ip_prefix_list_prefix_first_ "IP prefix /, e.g., 35.0.0.0/8\n" "First matched prefix\n") { - return vty_show_prefix_list_prefix (vty, AFI_IP, argv[0], argv[1], first_match_display); + return vty_show_prefix_list_prefix (vty, AFI_IP, argv[0], argv[1], + first_match_display); } DEFUN (show_ip_prefix_list_summary, show_ip_prefix_list_summary_cmd, "show ip prefix-list summary", - SHOW_STR - IP_STR - PREFIX_LIST_STR - "Summary of prefix lists\n") + SHOW_STR IP_STR PREFIX_LIST_STR "Summary of prefix lists\n") { return vty_show_prefix_list (vty, AFI_IP, NULL, NULL, summary_display); } @@ -1696,9 +1660,7 @@ DEFUN (show_ip_prefix_list_summary_name, "show ip prefix-list summary WORD", SHOW_STR IP_STR - PREFIX_LIST_STR - "Summary of prefix lists\n" - "Name of a prefix list\n") + PREFIX_LIST_STR "Summary of prefix lists\n" "Name of a prefix list\n") { return vty_show_prefix_list (vty, AFI_IP, argv[0], NULL, summary_display); } @@ -1707,10 +1669,7 @@ DEFUN (show_ip_prefix_list_summary_name, DEFUN (show_ip_prefix_list_detail, show_ip_prefix_list_detail_cmd, "show ip prefix-list detail", - SHOW_STR - IP_STR - PREFIX_LIST_STR - "Detail of prefix lists\n") + SHOW_STR IP_STR PREFIX_LIST_STR "Detail of prefix lists\n") { return vty_show_prefix_list (vty, AFI_IP, NULL, NULL, detail_display); } @@ -1720,19 +1679,14 @@ DEFUN (show_ip_prefix_list_detail_name, "show ip prefix-list detail WORD", SHOW_STR IP_STR - PREFIX_LIST_STR - "Detail of prefix lists\n" - "Name of a prefix list\n") + PREFIX_LIST_STR "Detail of prefix lists\n" "Name of a prefix list\n") { return vty_show_prefix_list (vty, AFI_IP, argv[0], NULL, detail_display); } DEFUN (clear_ip_prefix_list, clear_ip_prefix_list_cmd, - "clear ip prefix-list", - CLEAR_STR - IP_STR - PREFIX_LIST_STR) + "clear ip prefix-list", CLEAR_STR IP_STR PREFIX_LIST_STR) { return vty_clear_prefix_list (vty, AFI_IP, NULL, NULL); } @@ -1740,10 +1694,7 @@ DEFUN (clear_ip_prefix_list, DEFUN (clear_ip_prefix_list_name, clear_ip_prefix_list_name_cmd, "clear ip prefix-list WORD", - CLEAR_STR - IP_STR - PREFIX_LIST_STR - "Name of a prefix list\n") + CLEAR_STR IP_STR PREFIX_LIST_STR "Name of a prefix list\n") { return vty_clear_prefix_list (vty, AFI_IP, argv[0], NULL); } @@ -1785,8 +1736,7 @@ DEFUN (ipv6_prefix_list_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], argv[3], NULL); @@ -1803,9 +1753,7 @@ DEFUN (ipv6_prefix_list_ge_le, "IPv6 prefix /, e.g., 3ffe::/16\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") - + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], argv[3], argv[4]); @@ -1820,8 +1768,7 @@ DEFUN (ipv6_prefix_list_le, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], NULL, argv[3]); @@ -1838,8 +1785,7 @@ DEFUN (ipv6_prefix_list_le_ge, "IPv6 prefix /, e.g., 3ffe::/16\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], argv[4], argv[3]); @@ -1873,8 +1819,7 @@ DEFUN (ipv6_prefix_list_seq_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], argv[4], NULL); @@ -1893,8 +1838,7 @@ DEFUN (ipv6_prefix_list_seq_ge_le, "IPv6 prefix /, e.g., 3ffe::/16\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); @@ -1911,8 +1855,7 @@ DEFUN (ipv6_prefix_list_seq_le, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]); @@ -1931,8 +1874,7 @@ DEFUN (ipv6_prefix_list_seq_le_ge, "IPv6 prefix /, e.g., 3ffe::/16\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_install (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], argv[5], argv[4]); @@ -1941,10 +1883,7 @@ DEFUN (ipv6_prefix_list_seq_le_ge, DEFUN (no_ipv6_prefix_list, no_ipv6_prefix_list_cmd, "no ipv6 prefix-list WORD", - NO_STR - IPV6_STR - PREFIX_LIST_STR - "Name of a prefix list\n") + NO_STR IPV6_STR PREFIX_LIST_STR "Name of a prefix list\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], NULL, NULL, NULL, NULL, NULL); @@ -1976,8 +1915,7 @@ DEFUN (no_ipv6_prefix_list_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], argv[3], NULL); @@ -1995,8 +1933,7 @@ DEFUN (no_ipv6_prefix_list_ge_le, "IPv6 prefix /, e.g., 3ffe::/16\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], argv[3], argv[4]); @@ -2012,8 +1949,7 @@ DEFUN (no_ipv6_prefix_list_le, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], NULL, argv[3]); @@ -2031,8 +1967,7 @@ DEFUN (no_ipv6_prefix_list_le_ge, "IPv6 prefix /, e.g., 3ffe::/16\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], NULL, argv[1], argv[2], argv[4], argv[3]); @@ -2068,8 +2003,7 @@ DEFUN (no_ipv6_prefix_list_seq_ge, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], argv[4], NULL); @@ -2089,8 +2023,7 @@ DEFUN (no_ipv6_prefix_list_seq_ge_le, "IPv6 prefix /, e.g., 3ffe::/16\n" "Minimum prefix length to be matched\n" "Minimum prefix length\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], argv[4], argv[5]); @@ -2108,8 +2041,7 @@ DEFUN (no_ipv6_prefix_list_seq_le, "Specify packets to reject\n" "Specify packets to forward\n" "IPv6 prefix /, e.g., 3ffe::/16\n" - "Maximum prefix length to be matched\n" - "Maximum prefix length\n") + "Maximum prefix length to be matched\n" "Maximum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], NULL, argv[4]); @@ -2129,8 +2061,7 @@ DEFUN (no_ipv6_prefix_list_seq_le_ge, "IPv6 prefix /, e.g., 3ffe::/16\n" "Maximum prefix length to be matched\n" "Maximum prefix length\n" - "Minimum prefix length to be matched\n" - "Minimum prefix length\n") + "Minimum prefix length to be matched\n" "Minimum prefix length\n") { return vty_prefix_list_uninstall (vty, AFI_IP6, argv[0], argv[1], argv[2], argv[3], argv[5], argv[4]); @@ -2139,9 +2070,7 @@ DEFUN (no_ipv6_prefix_list_seq_le_ge, DEFUN (ipv6_prefix_list_sequence_number, ipv6_prefix_list_sequence_number_cmd, "ipv6 prefix-list sequence-number", - IPV6_STR - PREFIX_LIST_STR - "Include/exclude sequence numbers in NVGEN\n") + IPV6_STR PREFIX_LIST_STR "Include/exclude sequence numbers in NVGEN\n") { prefix_master_ipv6.seqnum = 1; return CMD_SUCCESS; @@ -2151,9 +2080,7 @@ DEFUN (no_ipv6_prefix_list_sequence_numb no_ipv6_prefix_list_sequence_number_cmd, "no ipv6 prefix-list sequence-number", NO_STR - IPV6_STR - PREFIX_LIST_STR - "Include/exclude sequence numbers in NVGEN\n") + IPV6_STR PREFIX_LIST_STR "Include/exclude sequence numbers in NVGEN\n") { prefix_master_ipv6.seqnum = 0; return CMD_SUCCESS; @@ -2188,8 +2115,7 @@ DEFUN (no_ipv6_prefix_list_description, NO_STR IPV6_STR PREFIX_LIST_STR - "Name of a prefix list\n" - "Prefix-list specific description\n") + "Name of a prefix list\n" "Prefix-list specific description\n") { return vty_prefix_list_desc_unset (vty, AFI_IP6, argv[0]); } @@ -2203,13 +2129,9 @@ ALIAS (no_ipv6_prefix_list_description, "Name of a prefix list\n" "Prefix-list specific description\n" "Up to 80 characters describing this prefix-list\n") - DEFUN (show_ipv6_prefix_list, show_ipv6_prefix_list_cmd, - "show ipv6 prefix-list", - SHOW_STR - IPV6_STR - PREFIX_LIST_STR) + "show ipv6 prefix-list", SHOW_STR IPV6_STR PREFIX_LIST_STR) { return vty_show_prefix_list (vty, AFI_IP6, NULL, NULL, normal_display); } @@ -2217,10 +2139,7 @@ DEFUN (show_ipv6_prefix_list, DEFUN (show_ipv6_prefix_list_name, show_ipv6_prefix_list_name_cmd, "show ipv6 prefix-list WORD", - SHOW_STR - IPV6_STR - PREFIX_LIST_STR - "Name of a prefix list\n") + SHOW_STR IPV6_STR PREFIX_LIST_STR "Name of a prefix list\n") { return vty_show_prefix_list (vty, AFI_IP6, argv[0], NULL, normal_display); } @@ -2232,10 +2151,10 @@ DEFUN (show_ipv6_prefix_list_name_seq, IPV6_STR PREFIX_LIST_STR "Name of a prefix list\n" - "sequence number of an entry\n" - "Sequence number\n") + "sequence number of an entry\n" "Sequence number\n") { - return vty_show_prefix_list (vty, AFI_IP6, argv[0], argv[1], sequential_display); + return vty_show_prefix_list (vty, AFI_IP6, argv[0], argv[1], + sequential_display); } DEFUN (show_ipv6_prefix_list_prefix, @@ -2247,7 +2166,8 @@ DEFUN (show_ipv6_prefix_list_prefix, "Name of a prefix list\n" "IPv6 prefix /, e.g., 3ffe::/16\n") { - return vty_show_prefix_list_prefix (vty, AFI_IP6, argv[0], argv[1], normal_display); + return vty_show_prefix_list_prefix (vty, AFI_IP6, argv[0], argv[1], + normal_display); } DEFUN (show_ipv6_prefix_list_prefix_longer, @@ -2260,7 +2180,8 @@ DEFUN (show_ipv6_prefix_list_prefix_long "IPv6 prefix /, e.g., 3ffe::/16\n" "Lookup longer prefix\n") { - return vty_show_prefix_list_prefix (vty, AFI_IP6, argv[0], argv[1], longer_display); + return vty_show_prefix_list_prefix (vty, AFI_IP6, argv[0], argv[1], + longer_display); } DEFUN (show_ipv6_prefix_list_prefix_first_match, @@ -2273,16 +2194,14 @@ DEFUN (show_ipv6_prefix_list_prefix_firs "IPv6 prefix /, e.g., 3ffe::/16\n" "First matched prefix\n") { - return vty_show_prefix_list_prefix (vty, AFI_IP6, argv[0], argv[1], first_match_display); + return vty_show_prefix_list_prefix (vty, AFI_IP6, argv[0], argv[1], + first_match_display); } DEFUN (show_ipv6_prefix_list_summary, show_ipv6_prefix_list_summary_cmd, "show ipv6 prefix-list summary", - SHOW_STR - IPV6_STR - PREFIX_LIST_STR - "Summary of prefix lists\n") + SHOW_STR IPV6_STR PREFIX_LIST_STR "Summary of prefix lists\n") { return vty_show_prefix_list (vty, AFI_IP6, NULL, NULL, summary_display); } @@ -2292,9 +2211,7 @@ DEFUN (show_ipv6_prefix_list_summary_nam "show ipv6 prefix-list summary WORD", SHOW_STR IPV6_STR - PREFIX_LIST_STR - "Summary of prefix lists\n" - "Name of a prefix list\n") + PREFIX_LIST_STR "Summary of prefix lists\n" "Name of a prefix list\n") { return vty_show_prefix_list (vty, AFI_IP6, argv[0], NULL, summary_display); } @@ -2302,10 +2219,7 @@ DEFUN (show_ipv6_prefix_list_summary_nam DEFUN (show_ipv6_prefix_list_detail, show_ipv6_prefix_list_detail_cmd, "show ipv6 prefix-list detail", - SHOW_STR - IPV6_STR - PREFIX_LIST_STR - "Detail of prefix lists\n") + SHOW_STR IPV6_STR PREFIX_LIST_STR "Detail of prefix lists\n") { return vty_show_prefix_list (vty, AFI_IP6, NULL, NULL, detail_display); } @@ -2315,19 +2229,14 @@ DEFUN (show_ipv6_prefix_list_detail_name "show ipv6 prefix-list detail WORD", SHOW_STR IPV6_STR - PREFIX_LIST_STR - "Detail of prefix lists\n" - "Name of a prefix list\n") + PREFIX_LIST_STR "Detail of prefix lists\n" "Name of a prefix list\n") { return vty_show_prefix_list (vty, AFI_IP6, argv[0], NULL, detail_display); } DEFUN (clear_ipv6_prefix_list, clear_ipv6_prefix_list_cmd, - "clear ipv6 prefix-list", - CLEAR_STR - IPV6_STR - PREFIX_LIST_STR) + "clear ipv6 prefix-list", CLEAR_STR IPV6_STR PREFIX_LIST_STR) { return vty_clear_prefix_list (vty, AFI_IP6, NULL, NULL); } @@ -2335,10 +2244,7 @@ DEFUN (clear_ipv6_prefix_list, DEFUN (clear_ipv6_prefix_list_name, clear_ipv6_prefix_list_name_cmd, "clear ipv6 prefix-list WORD", - CLEAR_STR - IPV6_STR - PREFIX_LIST_STR - "Name of a prefix list\n") + CLEAR_STR IPV6_STR PREFIX_LIST_STR "Name of a prefix list\n") { return vty_clear_prefix_list (vty, AFI_IP6, argv[0], NULL); } @@ -2389,8 +2295,7 @@ config_write_prefix_afi (afi_t afi, stru for (pentry = plist->head; pentry; pentry = pentry->next) { vty_out (vty, "ip%s prefix-list %s ", - afi == AFI_IP ? "" : "v6", - plist->name); + afi == AFI_IP ? "" : "v6", plist->name); if (master->seqnum) vty_out (vty, "seq %d ", pentry->seq); @@ -2432,8 +2337,7 @@ config_write_prefix_afi (afi_t afi, stru for (pentry = plist->head; pentry; pentry = pentry->next) { vty_out (vty, "ip%s prefix-list %s ", - afi == AFI_IP ? "" : "v6", - plist->name); + afi == AFI_IP ? "" : "v6", plist->name); if (master->seqnum) vty_out (vty, "seq %d ", pentry->seq); @@ -2478,8 +2382,7 @@ prefix_bgp_orf_entry (struct stream *s, u_char flag = init_flag; struct prefix *p = &pentry->prefix; - flag |= (pentry->type == PREFIX_PERMIT ? - permit_flag : deny_flag); + flag |= (pentry->type == PREFIX_PERMIT ? permit_flag : deny_flag); stream_putc (s, flag); stream_putl (s, (u_int32_t)pentry->seq); stream_putc (s, (u_char)pentry->ge); @@ -2529,8 +2432,9 @@ prefix_bgp_orf_set (char *name, afi_t af else { pentry = prefix_list_entry_lookup (plist, &orfp->p, - (permit ? PREFIX_PERMIT : PREFIX_DENY), - orfp->seq, orfp->le, orfp->ge); + (permit ? PREFIX_PERMIT : + PREFIX_DENY), orfp->seq, orfp->le, + orfp->ge); if (! pentry) return CMD_WARNING; @@ -2566,8 +2470,7 @@ prefix_bgp_show_prefix_list (struct vty return plist->count; vty_out (vty, "ip%s prefix-list %s: %d entries%s", - afi == AFI_IP ? "" : "v6", - plist->name, plist->count, VTY_NEWLINE); + afi == AFI_IP ? "" : "v6", plist->name, plist->count, VTY_NEWLINE); for (pentry = plist->head; pentry; pentry = pentry->next) { @@ -2623,8 +2526,7 @@ prefix_list_reset_orf (void) /* Prefix-list node. */ -struct cmd_node prefix_node = -{ +struct cmd_node prefix_node = { PREFIX_NODE, "", /* Prefix list has no interface. */ 1 @@ -2732,8 +2634,7 @@ prefix_list_init_ipv4 (void) #ifdef HAVE_IPV6 /* Prefix-list node. */ -struct cmd_node prefix_ipv6_node = -{ +struct cmd_node prefix_ipv6_node = { PREFIX_IPV6_NODE, "", /* Prefix list has no interface. */ 1 @@ -2828,7 +2729,8 @@ prefix_list_init_ipv6 (void) install_element (ENABLE_NODE, &show_ipv6_prefix_list_name_seq_cmd); install_element (ENABLE_NODE, &show_ipv6_prefix_list_prefix_cmd); install_element (ENABLE_NODE, &show_ipv6_prefix_list_prefix_longer_cmd); - install_element (ENABLE_NODE, &show_ipv6_prefix_list_prefix_first_match_cmd); + install_element (ENABLE_NODE, + &show_ipv6_prefix_list_prefix_first_match_cmd); install_element (ENABLE_NODE, &show_ipv6_prefix_list_summary_cmd); install_element (ENABLE_NODE, &show_ipv6_prefix_list_summary_name_cmd); install_element (ENABLE_NODE, &show_ipv6_prefix_list_detail_cmd); --- quagga-0.99.9/lib/prefix.c 2005-07-28 17:14:23.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/prefix.c 2008-04-16 11:55:54.000000000 -0700 @@ -30,7 +30,8 @@ /* Maskbit. */ static u_char maskbit[] = {0x00, 0x80, 0xc0, 0xe0, 0xf0, - 0xf8, 0xfc, 0xfe, 0xff}; + 0xf8, 0xfc, 0xfe, 0xff +}; /* Number of bits in prefix type. */ #ifndef PNBBY @@ -512,8 +513,7 @@ apply_mask (struct prefix *p) /* Utility function of convert between struct prefix <=> union sockunion. * FIXME This function isn't used anywhere. */ struct prefix * -sockunion2prefix (const union sockunion *dest, - const union sockunion *mask) +sockunion2prefix (const union sockunion *dest, const union sockunion *mask) { if (dest->sa.sa_family == AF_INET) { @@ -646,7 +646,8 @@ all_digit (const char *str) } /* Utility function to convert ipv4 prefixes to Classful prefixes */ -void apply_classful_mask_ipv4 (struct prefix_ipv4 *p) +void +apply_classful_mask_ipv4 (struct prefix_ipv4 *p) { u_int32_t destination; --- quagga-0.99.9/lib/privs.c 2006-03-30 05:21:35.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/privs.c 2008-04-16 11:55:54.000000000 -0700 @@ -40,7 +40,8 @@ */ #ifdef HAVE_LCAPS /* Linux doesn't have a 'set' type: a set of related privileges */ -struct _pset { +struct _pset +{ int num; cap_value_t *caps; }; @@ -100,38 +101,101 @@ static struct } cap_map [ZCAP_MAX] = { #ifdef HAVE_LCAPS /* Quagga -> Linux capabilities mappings */ - [ZCAP_SETID] = { 2, (pvalue_t []) { CAP_SETGID, - CAP_SETUID }, }, - [ZCAP_BIND] = { 2, (pvalue_t []) { CAP_NET_BIND_SERVICE, - CAP_NET_BROADCAST }, }, - [ZCAP_NET_ADMIN] = { 1, (pvalue_t []) { CAP_NET_ADMIN }, }, - [ZCAP_NET_RAW] = { 1, (pvalue_t []) { CAP_NET_RAW }, }, - [ZCAP_CHROOT] = { 1, (pvalue_t []) { CAP_SYS_CHROOT, }, }, - [ZCAP_NICE] = { 1, (pvalue_t []) { CAP_SYS_NICE }, }, - [ZCAP_PTRACE] = { 1, (pvalue_t []) { CAP_SYS_PTRACE }, }, - [ZCAP_DAC_OVERRIDE] = { 1, (pvalue_t []) { CAP_DAC_OVERRIDE }, }, - [ZCAP_READ_SEARCH] = { 1, (pvalue_t []) { CAP_DAC_READ_SEARCH }, }, - [ZCAP_SYS_ADMIN] = { 1, (pvalue_t []) { CAP_SYS_ADMIN }, }, - [ZCAP_FOWNER] = { 1, (pvalue_t []) { CAP_FOWNER }, }, + [ZCAP_SETID] = + { + 2, (pvalue_t[]) + { + CAP_SETGID, CAP_SETUID},},[ZCAP_BIND] = + { + 2, (pvalue_t[]) + { + CAP_NET_BIND_SERVICE, CAP_NET_BROADCAST},},[ZCAP_NET_ADMIN] = + { + 1, (pvalue_t[]) + { + CAP_NET_ADMIN},},[ZCAP_NET_RAW] = + { + 1, (pvalue_t[]) + { + CAP_NET_RAW},},[ZCAP_CHROOT] = + { + 1, (pvalue_t[]) + { + CAP_SYS_CHROOT,},},[ZCAP_NICE] = + { + 1, (pvalue_t[]) + { + CAP_SYS_NICE},},[ZCAP_PTRACE] = + { + 1, (pvalue_t[]) + { + CAP_SYS_PTRACE},},[ZCAP_DAC_OVERRIDE] = + { + 1, (pvalue_t[]) + { + CAP_DAC_OVERRIDE},},[ZCAP_READ_SEARCH] = + { + 1, (pvalue_t[]) + { + CAP_DAC_READ_SEARCH},},[ZCAP_SYS_ADMIN] = + { + 1, (pvalue_t[]) + { + CAP_SYS_ADMIN},},[ZCAP_FOWNER] = + { + 1, (pvalue_t[]) + { + CAP_FOWNER},}, #elif defined(HAVE_SOLARIS_CAPABILITIES) /* HAVE_LCAPS */ /* Quagga -> Solaris privilege mappings */ - [ZCAP_SETID] = { 1, (pvalue_t []) { PRIV_PROC_SETID }, }, - [ZCAP_BIND] = { 1, (pvalue_t []) { PRIV_NET_PRIVADDR }, }, - [ZCAP_NET_ADMIN] = { 1, (pvalue_t []) { PRIV_SYS_NET_CONFIG }, }, - [ZCAP_NET_RAW] = { 2, (pvalue_t []) { PRIV_NET_RAWACCESS, - PRIV_NET_ICMPACCESS }, }, - [ZCAP_CHROOT] = { 1, (pvalue_t []) { PRIV_PROC_CHROOT }, }, - [ZCAP_NICE] = { 1, (pvalue_t []) { PRIV_PROC_PRIOCNTL }, }, - [ZCAP_PTRACE] = { 1, (pvalue_t []) { PRIV_PROC_SESSION }, }, - [ZCAP_DAC_OVERRIDE] = { 2, (pvalue_t []) { PRIV_FILE_DAC_EXECUTE, + [ZCAP_SETID] = + { + 1, (pvalue_t[]) + { + PRIV_PROC_SETID},},[ZCAP_BIND] = + { + 1, (pvalue_t[]) + { + PRIV_NET_PRIVADDR},},[ZCAP_NET_ADMIN] = + { + 1, (pvalue_t[]) + { + PRIV_SYS_NET_CONFIG},},[ZCAP_NET_RAW] = + { + 2, (pvalue_t[]) + { + PRIV_NET_RAWACCESS, PRIV_NET_ICMPACCESS},},[ZCAP_CHROOT] = + { + 1, (pvalue_t[]) + { + PRIV_PROC_CHROOT},},[ZCAP_NICE] = + { + 1, (pvalue_t[]) + { + PRIV_PROC_PRIOCNTL},},[ZCAP_PTRACE] = + { + 1, (pvalue_t[]) + { + PRIV_PROC_SESSION},},[ZCAP_DAC_OVERRIDE] = + { + 2, (pvalue_t[]) + { + PRIV_FILE_DAC_EXECUTE, PRIV_FILE_DAC_READ, PRIV_FILE_DAC_SEARCH, - PRIV_FILE_DAC_WRITE, - PRIV_FILE_DAC_SEARCH }, }, - [ZCAP_READ_SEARCH] = { 2, (pvalue_t []) { PRIV_FILE_DAC_SEARCH, - PRIV_FILE_DAC_READ }, }, - [ZCAP_SYS_ADMIN] = { 1, (pvalue_t []) { PRIV_SYS_ADMIN }, }, - [ZCAP_FOWNER] = { 1, (pvalue_t []) { PRIV_FILE_OWNER }, }, + PRIV_FILE_DAC_WRITE, PRIV_FILE_DAC_SEARCH},},[ZCAP_READ_SEARCH] = + { + 2, (pvalue_t[]) + { + PRIV_FILE_DAC_SEARCH, PRIV_FILE_DAC_READ},},[ZCAP_SYS_ADMIN] = + { + 1, (pvalue_t[]) + { + PRIV_SYS_ADMIN},},[ZCAP_FOWNER] = + { + 1, (pvalue_t[]) + { + PRIV_FILE_OWNER},}, #endif /* HAVE_SOLARIS_CAPABILITIES */ }; @@ -197,8 +261,7 @@ zprivs_change_caps (zebra_privs_ops_t op if ( !cap_set_flag (zprivs_state.caps, CAP_EFFECTIVE, zprivs_state.syscaps_p->num, - zprivs_state.syscaps_p->caps, - cflag)) + zprivs_state.syscaps_p->caps, cflag)) return cap_set_proc (zprivs_state.caps); return -1; } @@ -277,16 +340,14 @@ zprivs_caps_init (struct zebra_privs_t * /* set permitted caps */ cap_set_flag(zprivs_state.caps, CAP_PERMITTED, zprivs_state.syscaps_p->num, - zprivs_state.syscaps_p->caps, - CAP_SET); + zprivs_state.syscaps_p->caps, CAP_SET); /* set inheritable caps, if any */ if (zprivs_state.syscaps_i && zprivs_state.syscaps_i->num) { cap_set_flag(zprivs_state.caps, CAP_INHERITABLE, zprivs_state.syscaps_i->num, - zprivs_state.syscaps_i->caps, - CAP_SET); + zprivs_state.syscaps_i->caps, CAP_SET); } /* apply caps. CAP_EFFECTIVE is cleared. we'll raise the caps as @@ -444,8 +505,7 @@ zprivs_caps_init (struct zebra_privs_t * if (!zprivs_state.syscaps_p) { fprintf (stderr, "%s: capabilities enabled, " - "but no valid capabilities supplied\n", - __func__); + "but no valid capabilities supplied\n", __func__); } /* We retain the basic set in our permitted set, as Linux has no --- quagga-0.99.9/lib/privs.h 2005-09-29 07:41:07.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/privs.h 2008-04-16 11:55:54.000000000 -0700 @@ -64,10 +64,8 @@ struct zebra_privs_t const char *group; const char *vty_group; /* group to chown vty socket to */ /* methods */ - int - (*change) (zebra_privs_ops_t); /* change privileges, 0 on success */ - zebra_privs_current_t - (*current_state) (void); /* current privilege state */ + int (*change) (zebra_privs_ops_t); /* change privileges, 0 on success */ + zebra_privs_current_t (*current_state) (void); /* current privilege state */ }; struct zprivs_ids_t --- quagga-0.99.9/lib/regex.c 2006-01-31 12:55:53.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/regex.c 2008-04-16 11:55:54.000000000 -0700 @@ -734,8 +733,7 @@ print_partial_compiled_pattern (start, e assert (p + *p < pend); for (c = 0; c < 256; c++) - if (c / 8 < *p - && (p[1 + (c/8)] & (1 << (c % 8)))) + if (c / 8 < *p && (p[1 + (c / 8)] & (1 << (c % 8)))) { /* Are we starting a range? */ if (last + 1 == c && ! in_range) @@ -1011,14 +1010,11 @@ re_set_syntax (syntax) #ifdef _LIBC weak_alias (__re_set_syntax, re_set_syntax) #endif - /* This table gives an error message for each of the error codes listed in regex.h. Obviously the order here has to be same as there. POSIX doesn't require that we do anything for REG_NOERROR, but why not be nice? */ - -static const char re_error_msgid[] = - { + static const char re_error_msgid[] = { #define REG_NOERROR_IDX 0 gettext_noop ("Success") /* REG_NOERROR */ "\0" @@ -1071,8 +1067,7 @@ static const char re_error_msgid[] = gettext_noop ("Unmatched ) or \\)"), /* REG_ERPAREN */ }; -static const size_t re_error_msgid_idx[] = - { +static const size_t re_error_msgid_idx[] = { REG_NOERROR_IDX, REG_NOMATCH_IDX, REG_BADPAT_IDX, @@ -1558,25 +1553,25 @@ static char reg_unset_dummy; /* Subroutine declarations and macros for regex_compile. */ -static reg_errcode_t regex_compile _RE_ARGS ((const char *pattern, size_t size, - reg_syntax_t syntax, +static reg_errcode_t regex_compile +_RE_ARGS ((const char *pattern, size_t size, reg_syntax_t syntax, struct re_pattern_buffer *bufp)); -static void store_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg)); -static void store_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, - int arg1, int arg2)); -static void insert_op1 _RE_ARGS ((re_opcode_t op, unsigned char *loc, - int arg, unsigned char *end)); -static void insert_op2 _RE_ARGS ((re_opcode_t op, unsigned char *loc, - int arg1, int arg2, unsigned char *end)); -static boolean at_begline_loc_p _RE_ARGS ((const char *pattern, const char *p, - reg_syntax_t syntax)); -static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend, - reg_syntax_t syntax)); -static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr, - const char *pend, - char *translate, - reg_syntax_t syntax, - unsigned char *b)); +static void store_op1 +_RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg)); +static void store_op2 +_RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2)); +static void insert_op1 +_RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg, unsigned char *end)); +static void insert_op2 +_RE_ARGS ((re_opcode_t op, unsigned char *loc, int arg1, int arg2, + unsigned char *end)); +static boolean at_begline_loc_p +_RE_ARGS ((const char *pattern, const char *p, reg_syntax_t syntax)); +static boolean at_endline_loc_p +_RE_ARGS ((const char *p, const char *pend, reg_syntax_t syntax)); +static reg_errcode_t compile_range +_RE_ARGS ((const char **p_ptr, const char *pend, char *translate, + reg_syntax_t syntax, unsigned char *b)); /* Fetch the next character in the uncompiled pattern---translating it if necessary. Also cast from a signed character in the constant @@ -1990,7 +1985,8 @@ regex_compile (pattern, size, syntax, bu { /* Caller did not allocate a buffer. Do it for them. */ bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char); } - if (!bufp->buffer) FREE_STACK_RETURN (REG_ESPACE); + if (!bufp->buffer) + FREE_STACK_RETURN (REG_ESPACE); bufp->allocated = INIT_BUF_SIZE; } @@ -2036,8 +2032,7 @@ regex_compile (pattern, size, syntax, bu case '+': case '?': - if ((syntax & RE_BK_PLUS_QM) - || (syntax & RE_LIMITED_OPS)) + if ((syntax & RE_BK_PLUS_QM) || (syntax & RE_LIMITED_OPS)) goto normal_char; handle_plus: case '*': @@ -2078,7 +2073,8 @@ regex_compile (pattern, size, syntax, bu else if (syntax & RE_BK_PLUS_QM && c == '\\') { - if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + if (p == pend) + FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); if (!(c1 == '+' || c1 == '?')) @@ -2147,8 +2143,7 @@ regex_compile (pattern, size, syntax, bu end of the buffer after this jump is inserted. */ GET_BUFFER_SPACE (3); INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump - : on_failure_jump, - laststart, b + 3); + : on_failure_jump, laststart, b + 3); pending_exact = 0; b += 3; @@ -2177,7 +2172,8 @@ regex_compile (pattern, size, syntax, bu { boolean had_char_class = false; - if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + if (p == pend) + FREE_STACK_RETURN (REG_EBRACK); /* Ensure that we have enough space to push a charset: the opcode, the length count, and the bitset; 34 bytes in all. */ @@ -2208,14 +2204,16 @@ regex_compile (pattern, size, syntax, bu /* Read in characters and ranges, setting map bits. */ for (;;) { - if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + if (p == pend) + FREE_STACK_RETURN (REG_EBRACK); PATFETCH (c); /* \ might escape characters inside [...] and [^...]. */ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\') { - if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + if (p == pend) + FREE_STACK_RETURN (REG_EESCAPE); PATFETCH (c1); SET_LIST_BIT (c1); @@ -2244,7 +2242,8 @@ regex_compile (pattern, size, syntax, bu { reg_errcode_t ret = compile_range (&p, pend, translate, syntax, b); - if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); + if (ret != REG_NOERROR) + FREE_STACK_RETURN (ret); } else if (p[0] == '-' && p[1] != ']') @@ -2255,7 +2254,8 @@ regex_compile (pattern, size, syntax, bu PATFETCH (c1); ret = compile_range (&p, pend, translate, syntax, b); - if (ret != REG_NOERROR) FREE_STACK_RETURN (ret); + if (ret != REG_NOERROR) + FREE_STACK_RETURN (ret); } /* See if we're at the beginning of a possible character @@ -2269,7 +2269,8 @@ regex_compile (pattern, size, syntax, bu c1 = 0; /* If pattern is `[[:'. */ - if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + if (p == pend) + FREE_STACK_RETURN (REG_EBRACK); for (;;) { @@ -2303,7 +2304,8 @@ regex_compile (pattern, size, syntax, bu class. */ PATFETCH (c); - if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + if (p == pend) + FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ++ch) { @@ -2343,7 +2345,8 @@ regex_compile (pattern, size, syntax, bu class. */ PATFETCH (c); - if (p == pend) FREE_STACK_RETURN (REG_EBRACK); + if (p == pend) + FREE_STACK_RETURN (REG_EBRACK); for (ch = 0; ch < 1 << BYTEWIDTH; ch++) { @@ -2433,7 +2436,8 @@ regex_compile (pattern, size, syntax, bu case '\\': - if (p == pend) FREE_STACK_RETURN (REG_EESCAPE); + if (p == pend) + FREE_STACK_RETURN (REG_EESCAPE); /* Do not translate the character after the \, so that we can distinguish, e.g., \B from \b, even if we normally would @@ -2454,7 +2458,8 @@ regex_compile (pattern, size, syntax, bu { RETALLOC (compile_stack.stack, compile_stack.size << 1, compile_stack_elt_t); - if (compile_stack.stack == NULL) return REG_ESPACE; + if (compile_stack.stack == NULL) + return REG_ESPACE; compile_stack.size <<= 1; } @@ -2492,7 +2497,8 @@ regex_compile (pattern, size, syntax, bu case ')': - if (syntax & RE_NO_BK_PARENS) goto normal_backslash; + if (syntax & RE_NO_BK_PARENS) + goto normal_backslash; if (COMPILE_STACK_EMPTY) { @@ -2537,8 +2543,7 @@ regex_compile (pattern, size, syntax, bu begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; fixup_alt_jump = COMPILE_STACK_TOP.fixup_alt_jump - ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 - : 0; + ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 : 0; laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; this_group_regnum = COMPILE_STACK_TOP.regnum; /* If we've reached MAX_REGNUM groups, then this open @@ -2637,7 +2642,8 @@ regex_compile (pattern, size, syntax, bu if (c == ',') { GET_UNSIGNED_NUMBER (upper_bound); - if (upper_bound < 0) upper_bound = RE_DUP_MAX; + if (upper_bound < 0) + upper_bound = RE_DUP_MAX; } else /* Interval such as `{1}' => match exactly once. */ @@ -2654,7 +2660,8 @@ regex_compile (pattern, size, syntax, bu if (!(syntax & RE_NO_BK_BRACES)) { - if (c != '\\') FREE_STACK_RETURN (REG_EBRACE); + if (c != '\\') + FREE_STACK_RETURN (REG_EBRACE); PATFETCH (c); } @@ -2712,8 +2719,7 @@ regex_compile (pattern, size, syntax, bu because `re_compile_fastmap' needs to know. Jump to the `jump_n' we might insert below. */ INSERT_JUMP2 (succeed_n, laststart, - b + 5 + (upper_bound > 1) * 5, - lower_bound); + b + 5 + (upper_bound > 1) * 5, lower_bound); b += 5; /* Code to initialize the lower bound. Insert @@ -2848,8 +2854,15 @@ regex_compile (pattern, size, syntax, bu BUF_PUSH (endbuf); break; - case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': if (syntax & RE_NO_BK_REFS) goto normal_char; @@ -2904,8 +2914,7 @@ regex_compile (pattern, size, syntax, bu : (*p == '+' || *p == '?')) || ((syntax & RE_INTERVALS) && ((syntax & RE_NO_BK_BRACES) - ? *p == '{' - : (p[0] == '\\' && p[1] == '{')))) + ? *p == '{' : (p[0] == '\\' && p[1] == '{')))) { /* Start building a new exactn. */ @@ -3113,8 +3122,7 @@ group_in_compile_stack (compile_stack, r int this_element; for (this_element = compile_stack.avail - 1; - this_element >= 0; - this_element--) + this_element >= 0; this_element--) if (compile_stack.stack[this_element].regnum == regnum) return true; @@ -3484,7 +3493,6 @@ re_compile_fastmap (bufp) #ifdef _LIBC weak_alias (__re_compile_fastmap, re_compile_fastmap) #endif - /* Set REGS to hold NUM_REGS registers, storing them in STARTS and ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use this memory for recording register information. STARTS and ENDS @@ -3497,9 +3505,7 @@ weak_alias (__re_compile_fastmap, re_com Unless this function is called, the first search or match using PATTERN_BUFFER will allocate its own register data, without freeing the old data. */ - -void -re_set_registers (bufp, regs, num_regs, starts, ends) + void re_set_registers (bufp, regs, num_regs, starts, ends) struct re_pattern_buffer *bufp; struct re_registers *regs; unsigned num_regs; @@ -3522,14 +3529,10 @@ re_set_registers (bufp, regs, num_regs, #ifdef _LIBC weak_alias (__re_set_registers, re_set_registers) #endif - /* Searching routines. */ - /* Like re_search_2, below, but only one string is specified, and doesn't let you say where to stop matching. */ - -int -re_search (bufp, string, size, startpos, range, regs) + int re_search (bufp, string, size, startpos, range, regs) struct re_pattern_buffer *bufp; const char *string; int size, startpos, range; @@ -3563,9 +3565,9 @@ weak_alias (__re_search, re_search) We return either the position in the strings at which the match was found, -1 if no match, or -2 if error (such as failure stack overflow). */ - int -re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop) + re_search_2 (bufp, string1, size1, string2, size2, startpos, range, + regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; @@ -3594,11 +3596,10 @@ re_search_2 (bufp, string1, size1, strin /* If the search isn't to be a backwards one, don't waste time in a search for a pattern that must be anchored. */ - if (bufp->used > 0 && range > 0 - && ((re_opcode_t) bufp->buffer[0] == begbuf + if (bufp->used > 0 && range > 0 && ((re_opcode_t) bufp->buffer[0] == begbuf /* `begline' is like `begbuf' if it cannot match at newlines. */ - || ((re_opcode_t) bufp->buffer[0] == begline - && !bufp->newline_anchor))) + || ((re_opcode_t) bufp->buffer[0] == + begline && !bufp->newline_anchor))) { if (startpos > 0) return -1; @@ -3704,7 +3706,6 @@ re_search_2 (bufp, string1, size1, strin #ifdef _LIBC weak_alias (__re_search_2, re_search_2) #endif - /* This converts PTR, a pointer into one of the search strings `string1' and `string2' into an offset from the beginning of that string. */ #define POINTER_TO_OFFSET(ptr) \ @@ -3783,14 +3774,10 @@ weak_alias (__re_search_2, re_search_2) to actually save any registers when none are active. */ #define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH) #define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1) - /* Matching routines. */ - #ifndef emacs /* Emacs never uses this. */ /* re_match is like re_match_2 except it takes only a single string. */ - -int -re_match (bufp, string, size, pos, regs) + int re_match (bufp, string, size, pos, regs) struct re_pattern_buffer *bufp; const char *string; int size, pos; @@ -3809,18 +3797,18 @@ re_match (bufp, string, size, pos, regs) weak_alias (__re_match, re_match) # endif #endif /* not emacs */ - static boolean group_match_null_string_p _RE_ARGS ((unsigned char **p, unsigned char *end, + register_info_type * + reg_info)); + static boolean alt_match_null_string_p + _RE_ARGS ((unsigned char *p, unsigned char *end, register_info_type *reg_info)); -static boolean alt_match_null_string_p _RE_ARGS ((unsigned char *p, - unsigned char *end, - register_info_type *reg_info)); -static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p, - unsigned char *end, + static boolean common_op_match_null_string_p + _RE_ARGS ((unsigned char **p, unsigned char *end, register_info_type *reg_info)); -static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2, - int len, char *translate)); + static int bcmp_translate + _RE_ARGS ((const char *s1, const char *s2, int len, char *translate)); /* re_match_2 matches the compiled pattern in BUFP against the the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1 @@ -3835,8 +3823,7 @@ static int bcmp_translate _RE_ARGS ((con failure stack overflowing). Otherwise, we return the length of the matched substring. */ -int -re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) + int re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; @@ -3860,7 +3847,8 @@ weak_alias (__re_match_2, re_match_2) /* This is a separate function so that we can force an alloca cleanup afterwards. */ static int -re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) + re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, + stop) struct re_pattern_buffer *bufp; const char *string1, *string2; int size1, size2; @@ -4261,8 +4249,7 @@ re_match_2_internal (bufp, string1, size DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed); mcnt = d - pos - (MATCHING_IN_FIRST_STRING - ? string1 - : string2 - size1); + ? string1 : string2 - size1); DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt); @@ -4308,7 +4295,8 @@ re_match_2_internal (bufp, string1, size do { PREFETCH (); - if (*d++ != (char) *p++) goto fail; + if (*d++ != (char) *p++) + goto fail; } while (--mcnt); } @@ -4351,7 +4339,8 @@ re_match_2_internal (bufp, string1, size p += 1 + *p; - if (!not) goto fail; + if (!not) + goto fail; SET_REGS_MATCHED (); d++; @@ -4370,9 +4359,10 @@ re_match_2_internal (bufp, string1, size /* Find out if this group can match the empty string. */ p1 = p; /* To send to group_match_null_string_p. */ - if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE) - REG_MATCH_NULL_STRING_P (reg_info[*p]) - = group_match_null_string_p (&p1, pend, reg_info); + if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == + MATCH_NULL_UNSET_VALUE) + REG_MATCH_NULL_STRING_P (reg_info[*p]) = + group_match_null_string_p (&p1, pend, reg_info); /* Save the position in the string where we were the last time we were at this open-group operator in case the group is @@ -4380,8 +4370,7 @@ re_match_2_internal (bufp, string1, size against `ab'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) - ? REG_UNSET (regstart[*p]) ? d : regstart[*p] - : regstart[*p]; + ? REG_UNSET (regstart[*p]) ? d : regstart[*p] : regstart[*p]; DEBUG_PRINT2 (" old_regstart: %d\n", POINTER_TO_OFFSET (old_regstart[*p])); @@ -4421,8 +4410,7 @@ re_match_2_internal (bufp, string1, size against `aba'; then we want to ignore where we are now in the string in case this attempt to match fails. */ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p]) - ? REG_UNSET (regend[*p]) ? d : regend[*p] - : regend[*p]; + ? REG_UNSET (regend[*p]) ? d : regend[*p] : regend[*p]; DEBUG_PRINT2 (" old_regend: %d\n", POINTER_TO_OFFSET (old_regend[*p])); @@ -4473,8 +4461,7 @@ re_match_2_internal (bufp, string1, size information for this group that we had before trying this last match. */ if ((!MATCHED_SOMETHING (reg_info[*p]) - || just_past_start_mem == p - 1) - && (p + 2) < pend) + || just_past_start_mem == p - 1) && (p + 2) < pend) { boolean is_a_jump_n = false; @@ -4575,15 +4562,18 @@ re_match_2_internal (bufp, string1, size contents. */ while (d2 == dend2) { - if (dend2 == end_match_2) break; - if (dend2 == regend[regno]) break; + if (dend2 == end_match_2) + break; + if (dend2 == regend[regno]) + break; /* End of string1 => advance to string2. */ d2 = string2; dend2 = regend[regno]; } /* At end of register contents => success */ - if (d2 == dend2) break; + if (d2 == dend2) + break; /* If necessary, advance to next segment in data. */ PREFETCH (); @@ -4619,7 +4609,8 @@ re_match_2_internal (bufp, string1, size if (AT_STRINGS_BEG (d)) { - if (!bufp->not_bol) break; + if (!bufp->not_bol) + break; } else if (d[-1] == '\n' && bufp->newline_anchor) { @@ -4635,7 +4626,8 @@ re_match_2_internal (bufp, string1, size if (AT_STRINGS_END (d)) { - if (!bufp->not_eol) break; + if (!bufp->not_eol) + break; } /* We have to ``prefetch'' the next character. */ @@ -4805,7 +4797,8 @@ re_match_2_internal (bufp, string1, size } else if ((re_opcode_t) *p2 == exactn - || (bufp->newline_anchor && (re_opcode_t) *p2 == endline)) + || (bufp->newline_anchor + && (re_opcode_t) * p2 == endline)) { register unsigned char c = *p2 == (unsigned char) endline ? '\n' : p2[2]; @@ -4882,8 +4875,7 @@ re_match_2_internal (bufp, string1, size /* We win if the charset inside the loop has no overlap with the one after the loop. */ for (idx = 0; - idx < (int) p2[1] && idx < (int) p1[4]; - idx++) + idx < (int) p2[1] && idx < (int) p1[4]; idx++) if ((p2[2 + idx] & p1[5 + idx]) != 0) break; @@ -5006,7 +4998,8 @@ re_match_2_internal (bufp, string1, size #ifdef _LIBC DEBUG_PRINT2 (" Setting two bytes from %p to no_op.\n", p+2); #else - DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2); + DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", + p + 2); #endif p[2] = (unsigned char) no_op; p[3] = (unsigned char) no_op; @@ -5313,8 +5306,7 @@ group_match_null_string_p (p, end, reg_i is, including the ending `jump_past_alt' and its number. */ - if (!alt_match_null_string_p (p1, p1 + mcnt - 3, - reg_info)) + if (!alt_match_null_string_p (p1, p1 + mcnt - 3, reg_info)) return false; /* Move to right after this alternative, including the @@ -5444,7 +5436,8 @@ common_op_match_null_string_p (p, end, r /* Have to set this here in case we're checking a group which contains a group and a back reference to it. */ - if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE) + if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == + MATCH_NULL_UNSET_VALUE) REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret; if (!ret) @@ -5506,7 +5499,8 @@ bcmp_translate (s1, s2, len, translate) register const unsigned char *p2 = (const unsigned char *) s2; while (len) { - if (translate[*p1++] != translate[*p2++]) return 1; + if (translate[*p1++] != translate[*p2++]) + return 1; len--; } return 0; @@ -5552,12 +5547,9 @@ re_compile_pattern (pattern, length, buf #ifdef _LIBC weak_alias (__re_compile_pattern, re_compile_pattern) #endif - /* Entry points compatible with 4.2 BSD regex library. We don't define them unless specifically requested. */ - #if defined _REGEX_RE_COMP || defined _LIBC - /* BSD has one and only one pattern buffer. */ static struct re_pattern_buffer re_comp_buf; @@ -5718,7 +5710,8 @@ regcomp (preg, pattern, cflags) /* POSIX doesn't distinguish between an unmatched open-group and an unmatched close-group: both are REG_EPAREN. */ - if (ret == REG_ERPAREN) ret = REG_EPAREN; + if (ret == REG_ERPAREN) + ret = REG_EPAREN; if (ret == REG_NOERROR && preg->fastmap) { @@ -5753,9 +5745,7 @@ weak_alias (__regcomp, regcomp) string; if REG_NOTEOL is set, then $ does not match at the end. We return 0 if we find a match and REG_NOMATCH if not. */ - -int -regexec (preg, string, nmatch, pmatch, eflags) + int regexec (preg, string, nmatch, pmatch, eflags) const regex_t *preg; const char *string; size_t nmatch; @@ -5864,12 +5853,8 @@ regerror (err, preg, errbuf, errbuf_size #ifdef _LIBC weak_alias (__regerror, regerror) #endif - - /* Free dynamically allocated space used by PREG. */ - -void -regfree (preg) + void regfree (preg) regex_t *preg; { if (preg->buffer != NULL) --- quagga-0.99.9/lib/regex-gnu.h 2002-12-13 12:15:29.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/regex-gnu.h 2008-04-16 11:55:54.000000000 -0700 @@ -25,7 +25,8 @@ /* Allow the use in C++ code. */ #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif /* POSIX says that must be included (by the caller) before @@ -454,7 +455,8 @@ extern const char *re_compile_pattern /* Compile a fastmap for the compiled pattern in BUFFER; used to accelerate searches. Return 0 if successful and -2 if was an internal error. */ -extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer)); + extern int re_compile_fastmap + _RE_ARGS ((struct re_pattern_buffer * buffer)); /* Search in the string STRING (with length LENGTH) for the pattern --- quagga-0.99.9/lib/routemap.c 2007-05-02 08:28:32.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/routemap.c 2008-04-16 11:55:54.000000000 -0700 @@ -67,11 +67,9 @@ struct route_map_list static struct route_map_list route_map_master = { NULL, NULL, NULL, NULL }; static void -route_map_rule_delete (struct route_map_rule_list *, - struct route_map_rule *); +route_map_rule_delete (struct route_map_rule_list *, struct route_map_rule *); -static void -route_map_index_delete (struct route_map_index *, int); +static void route_map_index_delete (struct route_map_index *, int); /* New route map allocation. Please note route map's name must be specified. */ @@ -334,8 +332,7 @@ route_map_index_lookup (struct route_map struct route_map_index *index; for (index = map->head; index; index = index->next) - if ((index->type == type || type == RMAP_ANY) - && index->pref == pref) + if ((index->type == type || type == RMAP_ANY) && index->pref == pref) return index; return NULL; } @@ -386,8 +383,7 @@ route_map_index_add (struct route_map *m /* Execute event hook. */ if (route_map_master.event_hook) - (*route_map_master.event_hook) (RMAP_EVENT_INDEX_ADDED, - map->name); + (*route_map_master.event_hook) (RMAP_EVENT_INDEX_ADDED, map->name); return index; } @@ -574,8 +570,7 @@ route_map_add_match (struct route_map_in if (route_map_master.event_hook) (*route_map_master.event_hook) (replaced ? RMAP_EVENT_MATCH_REPLACED: - RMAP_EVENT_MATCH_ADDED, - index->map->name); + RMAP_EVENT_MATCH_ADDED, index->map->name); return 0; } @@ -661,8 +656,7 @@ route_map_add_set (struct route_map_inde if (route_map_master.event_hook) (*route_map_master.event_hook) (replaced ? RMAP_EVENT_SET_REPLACED: - RMAP_EVENT_SET_ADDED, - index->map->name); + RMAP_EVENT_SET_ADDED, index->map->name); return 0; } @@ -944,16 +938,14 @@ DEFUN (no_route_map_all, no_route_map_all_cmd, "no route-map WORD", NO_STR - "Create route-map or enter route-map command mode\n" - "Route map tag\n") + "Create route-map or enter route-map command mode\n" "Route map tag\n") { struct route_map *map; map = route_map_lookup_by_name (argv[0]); if (map == NULL) { - vty_out (vty, "%% Could not find route-map %s%s", - argv[0], VTY_NEWLINE); + vty_out (vty, "%% Could not find route-map %s%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } @@ -1007,8 +999,7 @@ DEFUN (no_route_map, map = route_map_lookup_by_name (argv[0]); if (map == NULL) { - vty_out (vty, "%% Could not find route-map %s%s", - argv[0], VTY_NEWLINE); + vty_out (vty, "%% Could not find route-map %s%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } @@ -1033,9 +1024,7 @@ DEFUN (no_route_map, DEFUN (rmap_onmatch_next, rmap_onmatch_next_cmd, - "on-match next", - "Exit policy on matches\n" - "Next clause\n") + "on-match next", "Exit policy on matches\n" "Next clause\n") { struct route_map_index *index; @@ -1049,10 +1038,7 @@ DEFUN (rmap_onmatch_next, DEFUN (no_rmap_onmatch_next, no_rmap_onmatch_next_cmd, - "no on-match next", - NO_STR - "Exit policy on matches\n" - "Next clause\n") + "no on-match next", NO_STR "Exit policy on matches\n" "Next clause\n") { struct route_map_index *index; @@ -1067,9 +1053,7 @@ DEFUN (no_rmap_onmatch_next, DEFUN (rmap_onmatch_goto, rmap_onmatch_goto_cmd, "on-match goto <1-65535>", - "Exit policy on matches\n" - "Goto Clause number\n" - "Number\n") + "Exit policy on matches\n" "Goto Clause number\n" "Number\n") { struct route_map_index *index = vty->index; int d = 0; @@ -1084,8 +1068,7 @@ DEFUN (rmap_onmatch_goto, if (d <= index->pref) { /* Can't allow you to do that, Dave */ - vty_out (vty, "can't jump backwards in route-maps%s", - VTY_NEWLINE); + vty_out (vty, "can't jump backwards in route-maps%s", VTY_NEWLINE); return CMD_WARNING; } else @@ -1100,9 +1083,7 @@ DEFUN (rmap_onmatch_goto, DEFUN (no_rmap_onmatch_goto, no_rmap_onmatch_goto_cmd, "no on-match goto", - NO_STR - "Exit policy on matches\n" - "Goto Clause number\n") + NO_STR "Exit policy on matches\n" "Goto Clause number\n") { struct route_map_index *index; @@ -1123,9 +1103,7 @@ ALIAS (rmap_onmatch_goto, ALIAS (no_rmap_onmatch_goto, no_rmap_continue_cmd, "no continue", - NO_STR - "Continue on a different entry within the route-map\n") - + NO_STR "Continue on a different entry within the route-map\n") /* GNU Zebra compatible */ ALIAS (rmap_onmatch_goto, rmap_continue_seq_cmd, @@ -1143,9 +1119,7 @@ ALIAS (no_rmap_onmatch_goto, DEFUN (rmap_show_name, rmap_show_name_cmd, "show route-map [WORD]", - SHOW_STR - "route-map information\n" - "route-map name\n") + SHOW_STR "route-map information\n" "route-map name\n") { const char *name = NULL; if (argc) @@ -1179,9 +1152,7 @@ DEFUN (rmap_call, DEFUN (no_rmap_call, no_rmap_call_cmd, - "no call", - NO_STR - "Jump to another Route-Map after match+set\n") + "no call", NO_STR "Jump to another Route-Map after match+set\n") { struct route_map_index *index; @@ -1199,8 +1170,7 @@ DEFUN (no_rmap_call, DEFUN (rmap_description, rmap_description_cmd, "description .LINE", - "Route-map comment\n" - "Comment describing this route-map rule\n") + "Route-map comment\n" "Comment describing this route-map rule\n") { struct route_map_index *index; @@ -1216,9 +1186,7 @@ DEFUN (rmap_description, DEFUN (no_rmap_description, no_rmap_description_cmd, - "no description", - NO_STR - "Route-map comment\n") + "no description", NO_STR "Route-map comment\n") { struct route_map_index *index; @@ -1252,21 +1220,18 @@ route_map_config_write (struct vty *vty) vty_out (vty, "route-map %s %s %d%s", map->name, - route_map_type_str (index->type), - index->pref, VTY_NEWLINE); + route_map_type_str (index->type), index->pref, VTY_NEWLINE); if (index->description) vty_out (vty, " description %s%s", index->description, VTY_NEWLINE); for (rule = index->match_list.head; rule; rule = rule->next) vty_out (vty, " match %s %s%s", rule->cmd->str, - rule->rule_str ? rule->rule_str : "", - VTY_NEWLINE); + rule->rule_str ? rule->rule_str : "", VTY_NEWLINE); for (rule = index->set_list.head; rule; rule = rule->next) vty_out (vty, " set %s %s%s", rule->cmd->str, - rule->rule_str ? rule->rule_str : "", - VTY_NEWLINE); + rule->rule_str ? rule->rule_str : "", VTY_NEWLINE); if (index->nextrm) vty_out (vty, " call %s%s", index->nextrm, VTY_NEWLINE); if (index->exitpolicy == RMAP_GOTO) @@ -1280,8 +1245,7 @@ route_map_config_write (struct vty *vty) } /* Route map node structure. */ -struct cmd_node rmap_node = -{ +struct cmd_node rmap_node = { RMAP_NODE, "%s(config-route-map)# ", 1 --- quagga-0.99.9/lib/routemap.h 2007-05-02 08:28:32.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/routemap.h 2008-04-16 11:55:54.000000000 -0700 @@ -166,13 +166,11 @@ extern int route_map_delete_match (struc /* Add route-map set statement to the route map. */ extern int route_map_add_set (struct route_map_index *index, - const char *set_name, - const char *set_arg); + const char *set_name, const char *set_arg); /* Delete route map set rule. */ extern int route_map_delete_set (struct route_map_index *index, - const char *set_name, - const char *set_arg); + const char *set_name, const char *set_arg); /* Install rule command to the match list. */ extern void route_map_install_match (struct route_map_rule_cmd *cmd); @@ -191,6 +189,7 @@ extern route_map_result_t route_map_appl extern void route_map_add_hook (void (*func) (const char *)); extern void route_map_delete_hook (void (*func) (const char *)); -extern void route_map_event_hook (void (*func) (route_map_event_t, const char *)); +extern void +route_map_event_hook (void (*func) (route_map_event_t, const char *)); #endif /* _ZEBRA_ROUTEMAP_H */ --- quagga-0.99.9/lib/route_types.h 2006-06-27 03:43:51.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/route_types.h 2008-04-16 11:55:54.000000000 -0700 @@ -38,24 +38,29 @@ "Border Gateway Protocol (BGP)\n" /* ospfd */ + #define QUAGGA_REDIST_STR_OSPFD \ -"(kernel|connected|static|rip|isis|bgp)" +"(kernel|connected|static|rip|ospf|ospf6|isis|bgp)" #define QUAGGA_REDIST_HELP_STR_OSPFD \ "Kernel routes (not installed via the zebra RIB)\n" \ "Connected routes (directly attached subnet or host)\n" \ "Statically configured routes\n" \ "Routing Information Protocol (RIP)\n" \ + "Open Shortest Path First v2 (OSPFv2)\n" \ + "Open Shortest Path First v3 (OSPFv3)\n" \ "Intermediate System to Intermediate System (IS-IS)\n" \ "Border Gateway Protocol (BGP)\n" /* ospf6d */ #define QUAGGA_REDIST_STR_OSPF6D \ -"(kernel|connected|static|ripng|isis|bgp)" +"(kernel|connected|static|ripng|ospf|ospf6|isis|bgp)" #define QUAGGA_REDIST_HELP_STR_OSPF6D \ "Kernel routes (not installed via the zebra RIB)\n" \ "Connected routes (directly attached subnet or host)\n" \ "Statically configured routes\n" \ "Routing Information Protocol next-generation (IPv6) (RIPng)\n" \ + "Open Shortest Path First v2 (OSPFv2)\n" \ + "Open Shortest Path First v3 (OSPFv3)\n" \ "Intermediate System to Intermediate System (IS-IS)\n" \ "Border Gateway Protocol (BGP)\n" --- quagga-0.99.9/lib/sigevent.c 2005-05-03 11:02:06.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/sigevent.c 2008-04-16 11:55:54.000000000 -0700 @@ -130,7 +130,8 @@ quagga_signal_timer (struct thread *t) int i; sigm = THREAD_ARG (t); - sigm->t = thread_add_timer (sigm->t->master, quagga_signal_timer, &sigmaster, + sigm->t = + thread_add_timer (sigm->t->master, quagga_signal_timer, &sigmaster, QUAGGA_SIGNAL_TIMER_INTERVAL); return quagga_sigevent_process (); } @@ -148,11 +149,14 @@ signal_set (int signo) sig.sa_handler = &quagga_signal_handler; sigfillset (&sig.sa_mask); sig.sa_flags = 0; - if (signo == SIGALRM) { + if (signo == SIGALRM) + { #ifdef SA_INTERRUPT sig.sa_flags |= SA_INTERRUPT; /* SunOS */ #endif - } else { + } + else + { #ifdef SA_RESTART sig.sa_flags |= SA_RESTART; #endif /* SA_RESTART */ @@ -185,10 +189,10 @@ program_counter(void *context) #endif /* SA_SIGINFO */ -static void __attribute__ ((noreturn)) -exit_handler(int signo +static void __attribute__ ((noreturn)) exit_handler (int signo #ifdef SA_SIGINFO - , siginfo_t *siginfo, void *context + , siginfo_t * siginfo, + void *context #endif ) { @@ -200,10 +204,10 @@ exit_handler(int signo _exit(128+signo); } -static void __attribute__ ((noreturn)) -core_handler(int signo +static void __attribute__ ((noreturn)) core_handler (int signo #ifdef SA_SIGINFO - , siginfo_t *siginfo, void *context + , siginfo_t * siginfo, + void *context #endif ) { @@ -257,7 +261,8 @@ trap_default_signals(void) static const int ignore_signals[] = { SIGPIPE, }; - static const struct { + static const struct + { const int *sigs; u_int nsigs; void (*handler)(int signo @@ -265,11 +270,20 @@ trap_default_signals(void) , siginfo_t *info, void *context #endif ); - } sigmap[] = { - { core_signals, sizeof(core_signals)/sizeof(core_signals[0]), core_handler}, - { exit_signals, sizeof(exit_signals)/sizeof(exit_signals[0]), exit_handler}, - { ignore_signals, sizeof(ignore_signals)/sizeof(ignore_signals[0]), NULL}, - }; + } sigmap[] = + { + { + core_signals, sizeof (core_signals) / sizeof (core_signals[0]), + core_handler} + , + { + exit_signals, sizeof (exit_signals) / sizeof (exit_signals[0]), + exit_handler} + , + { + ignore_signals, sizeof (ignore_signals) / sizeof (ignore_signals[0]), + NULL} + ,}; u_int i; for (i = 0; i < sizeof(sigmap)/sizeof(sigmap[0]); i++) --- quagga-0.99.9/lib/smux.c 2007-05-09 13:59:34.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/smux.c 2008-04-16 11:55:54.000000000 -0700 @@ -40,7 +40,8 @@ #define min(A,B) ((A) < (B) ? (A) : (B)) -enum smux_event {SMUX_SCHEDULE, SMUX_CONNECT, SMUX_READ}; +enum smux_event +{ SMUX_SCHEDULE, SMUX_CONNECT, SMUX_READ }; void smux_event (enum smux_event, int); @@ -71,8 +72,7 @@ int debug_smux = 0; int fail = 0; /* SMUX node. */ -struct cmd_node smux_node = -{ +struct cmd_node smux_node = { SMUX_NODE, "" /* SMUX has no interface. */ }; @@ -252,7 +252,8 @@ smux_socket () sockopt_reuseaddr (sock); sockopt_reuseport (sock); - ret = connect (sock, (struct sockaddr *) &serv, sizeof (struct sockaddr_in)); + ret = + connect (sock, (struct sockaddr *) &serv, sizeof (struct sockaddr_in)); if (ret < 0) { close (sock); @@ -308,15 +309,15 @@ smux_getresp_send (oid objid[], size_t o h2 = ptr; /* Place holder h2 for one variable */ ptr = asn_build_sequence (ptr, &len, - (u_char)(ASN_SEQUENCE | ASN_CONSTRUCTOR), - 0); + (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), 0); h2e = ptr; ptr = snmp_build_var_op (ptr, objid, &objid_len, val_type, arg_len, arg, &len); /* Now variable size is known, fill in size */ - asn_build_sequence(h2,&length,(u_char)(ASN_SEQUENCE|ASN_CONSTRUCTOR),ptr-h2e); + asn_build_sequence (h2, &length, (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), + ptr - h2e); /* Fill in size of whole sequence */ asn_build_sequence(h1,&length,(u_char)SMUX_GETRSP,ptr-h1e); @@ -329,9 +330,7 @@ smux_getresp_send (oid objid[], size_t o char * smux_var (char *ptr, size_t len, oid objid[], size_t *objid_len, - size_t *var_val_len, - u_char *var_val_type, - void **var_value) + size_t * var_val_len, u_char * var_val_type, void **var_value) { u_char type; u_char val_type; @@ -689,8 +688,9 @@ smux_parse_set (char *ptr, size_t len, i if (debug_smux) zlog_debug ("SMUX SET(%s) message parse: len %ld", - (RESERVE1 == action) ? "RESERVE1" : ((FREE == action) ? "FREE" : "COMMIT"), - len); + (RESERVE1 == + action) ? "RESERVE1" : ((FREE == + action) ? "FREE" : "COMMIT"), len); /* Parse SET message header. */ ptr = smux_parse_get_header (ptr, &len, &reqid); @@ -810,11 +810,13 @@ process_rest: /* see note below: YYY */ if (sout_save_len > 0) { - smux_parse_set (sout_save_buff, sout_save_len, rollback ? FREE : COMMIT); + smux_parse_set (sout_save_buff, sout_save_len, + rollback ? FREE : COMMIT); sout_save_len = 0; } else - zlog_warn ("SMUX_SOUT sout_save_len=%d - invalid", (int) sout_save_len); + zlog_warn ("SMUX_SOUT sout_save_len=%d - invalid", + (int) sout_save_len); if (len_income > 3) { @@ -1043,14 +1045,13 @@ smux_trap (oid *name, size_t namelen, /* Timeticks timestamp. */ val = 0; ptr = asn_build_unsigned_int (ptr, &len, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_TIMETICKS), - &val, sizeof (val)); + (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | + ASN_TIMETICKS), &val, sizeof (val)); /* Variables. */ h1 = ptr; ptr = asn_build_sequence (ptr, &len, - (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), - 0); + (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), 0); /* Iteration for each objects. */ @@ -1075,7 +1076,8 @@ smux_trap (oid *name, size_t namelen, else { oid_copy (oid, name, namelen); - oid_copy (oid + namelen, trapobj[i].name, trapobj[i].namelen * (-1)); + oid_copy (oid + namelen, trapobj[i].name, + trapobj[i].namelen * (-1)); oid_len = namelen + trapobj[i].namelen * (-1) ; } @@ -1106,8 +1108,7 @@ smux_trap (oid *name, size_t namelen, /* Now variable size is known, fill in size */ asn_build_sequence(h1, &length, - (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), - ptr - h1e); + (u_char) (ASN_SEQUENCE | ASN_CONSTRUCTOR), ptr - h1e); /* Fill in size of whole sequence */ len = BUFSIZ; @@ -1147,18 +1148,21 @@ smux_register (int sock) /* Priority. */ priority = -1; ptr = asn_build_int (ptr, &len, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - &priority, sizeof (priority)); + (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | + ASN_INTEGER), &priority, + sizeof (priority)); /* Operation. */ operation = 2; /* Register R/W */ ptr = asn_build_int (ptr, &len, - (u_char)(ASN_UNIVERSAL | ASN_PRIMITIVE | ASN_INTEGER), - &operation, sizeof (operation)); + (u_char) (ASN_UNIVERSAL | ASN_PRIMITIVE | + ASN_INTEGER), &operation, + sizeof (operation)); if (debug_smux) { - smux_oid_dump ("SMUX register oid", subtree->name, subtree->name_len); + smux_oid_dump ("SMUX register oid", subtree->name, + subtree->name_len); zlog_debug ("SMUX register priority: %ld", priority); zlog_debug ("SMUX register operation: %ld", operation); } @@ -1209,7 +1213,8 @@ smux_connect (struct thread *t) ret = smux_register (smux_sock); if (ret < 0) { - zlog_warn ("SMUX register message send failed: %s", safe_strerror (errno)); + zlog_warn ("SMUX register message send failed: %s", + safe_strerror (errno)); close (smux_sock); smux_sock = -1; if (++fail < SMUX_MAX_FAILURE) @@ -1353,8 +1358,8 @@ smux_peer_oid (struct vty *vty, const ch } int -smux_header_generic (struct variable *v, oid *name, size_t *length, int exact, - size_t *var_len, WriteMethod **write_method) +smux_header_generic (struct variable *v, oid * name, size_t * length, + int exact, size_t * var_len, WriteMethod ** write_method) { oid fulloid[MAX_OID_LEN]; int ret; @@ -1401,8 +1406,7 @@ DEFUN (smux_peer, smux_peer_cmd, "smux peer OID", "SNMP MUX protocol settings\n" - "SNMP MUX peer settings\n" - "Object ID used in SMUX peering\n") + "SNMP MUX peer settings\n" "Object ID used in SMUX peering\n") { if (smux_peer_oid (vty, argv[0], NULL) == 0) { @@ -1418,8 +1422,7 @@ DEFUN (smux_peer_password, "smux peer OID PASSWORD", "SNMP MUX protocol settings\n" "SNMP MUX peer settings\n" - "SMUX peering object ID\n" - "SMUX peering password\n") + "SMUX peering object ID\n" "SMUX peering password\n") { if (smux_peer_oid (vty, argv[0], argv[1]) == 0) { @@ -1433,9 +1436,7 @@ DEFUN (smux_peer_password, DEFUN (no_smux_peer, no_smux_peer_cmd, "no smux peer", - NO_STR - "SNMP MUX protocol settings\n" - "SNMP MUX peer settings\n") + NO_STR "SNMP MUX protocol settings\n" "SNMP MUX peer settings\n") { smux_stop(); return smux_peer_default (); @@ -1455,11 +1455,8 @@ ALIAS (no_smux_peer, NO_STR "SNMP MUX protocol settings\n" "SNMP MUX peer settings\n" - "SMUX peering object ID\n" - "SMUX peering password\n") - -int -config_write_smux (struct vty *vty) + "SMUX peering object ID\n" "SMUX peering password\n") + int config_write_smux (struct vty *vty) { int first = 1; unsigned int i; @@ -1480,8 +1477,7 @@ config_write_smux (struct vty *vty) /* Register subtree to smux master tree. */ void smux_register_mib (const char *descr, struct variable *var, - size_t width, int num, - oid name[], size_t namelen) + size_t width, int num, oid name[], size_t namelen) { struct subtree *tree; --- quagga-0.99.9/lib/smux.h 2005-10-03 07:20:30.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/smux.h 2008-04-16 11:55:54.000000000 -0700 @@ -67,9 +67,7 @@ typedef int (WriteMethod)(int action, u_char var_val_type, size_t var_val_len, u_char *statP, - oid *name, - size_t length, - struct variable *v); + oid * name, size_t length, struct variable * v); typedef u_char *(FindVarMethod)(struct variable *v, oid *name, --- quagga-0.99.9/lib/sockopt.c 2007-08-22 09:22:54.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/sockopt.c 2008-04-16 11:55:54.000000000 -0700 @@ -72,8 +72,7 @@ getsockopt_cmsg_data (struct msghdr *msg void *ptr = NULL; for (cmsg = ZCMSG_FIRSTHDR(msgh); - cmsg != NULL; - cmsg = CMSG_NXTHDR(msgh, cmsg)) + cmsg != NULL; cmsg = CMSG_NXTHDR (msgh, cmsg)) if (cmsg->cmsg_level == level && cmsg->cmsg_type) return (ptr = CMSG_DATA(cmsg)); @@ -90,7 +89,8 @@ setsockopt_ipv6_pktinfo (int sock, int v #ifdef IPV6_RECVPKTINFO /*2292bis-01*/ ret = setsockopt(sock, IPPROTO_IPV6, IPV6_RECVPKTINFO, &val, sizeof(val)); if (ret < 0) - zlog_warn ("can't setsockopt IPV6_RECVPKTINFO : %s", safe_strerror (errno)); + zlog_warn ("can't setsockopt IPV6_RECVPKTINFO : %s", + safe_strerror (errno)); #else /*RFC2292*/ ret = setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, &val, sizeof(val)); if (ret < 0) @@ -121,7 +121,8 @@ setsockopt_ipv6_multicast_hops (int sock { int ret; - ret = setsockopt(sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &val, sizeof(val)); + ret = + setsockopt (sock, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &val, sizeof (val)); if (ret < 0) zlog_warn ("can't setsockopt IPV6_MULTICAST_HOPS"); return ret; @@ -133,7 +134,8 @@ setsockopt_ipv6_unicast_hops (int sock, { int ret; - ret = setsockopt(sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &val, sizeof(val)); + ret = + setsockopt (sock, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &val, sizeof (val)); if (ret < 0) zlog_warn ("can't setsockopt IPV6_UNICAST_HOPS"); return ret; @@ -145,7 +147,8 @@ setsockopt_ipv6_hoplimit (int sock, int int ret; #ifdef IPV6_RECVHOPLIMIT /*2292bis-01*/ - ret = setsockopt (sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &val, sizeof(val)); + ret = + setsockopt (sock, IPPROTO_IPV6, IPV6_RECVHOPLIMIT, &val, sizeof (val)); if (ret < 0) zlog_warn ("can't setsockopt IPV6_RECVHOPLIMIT"); #else /*RFC2292*/ @@ -206,12 +209,11 @@ int setsockopt_multicast_ipv4(int sock, int optname, struct in_addr if_addr /* required */, - unsigned int mcast_addr, - unsigned int ifindex /* optional: if non-zero, may be + unsigned int mcast_addr, unsigned int ifindex /* optional: if non-zero, may be used instead of if_addr */) { -#ifdef HAVE_STRUCT_IP_MREQN_IMR_IFINDEX +#ifdef GNU_LINUX /* This is better because it uses ifindex directly */ struct ip_mreqn mreqn; int ret; @@ -233,7 +235,8 @@ setsockopt_multicast_ipv4(int sock, ret = setsockopt(sock, IPPROTO_IP, optname, (void *)&mreqn, sizeof(mreqn)); - if ((ret < 0) && (optname == IP_ADD_MEMBERSHIP) && (errno == EADDRINUSE)) + if ((ret < 0) && (optname == IP_ADD_MEMBERSHIP) + && (errno == EADDRINUSE)) { /* see above: handle possible problem when interface comes back up */ char buf[2][INET_ADDRSTRLEN]; @@ -263,6 +266,95 @@ setsockopt_multicast_ipv4(int sock, /* #elif defined(BOGON_NIX) && EXAMPLE_VERSION_CODE > -100000 */ /* Add your favourite OS here! */ +#elif __FreeBSD__ == 7 + + struct ip_mreqn mreqn; + struct group_req gr; + struct sockaddr_in *si; + int ret; + + switch (optname) + { + case IP_MULTICAST_IF: + memset (&mreqn, 0, sizeof (mreqn)); + + if (mcast_addr) + mreqn.imr_multiaddr.s_addr = mcast_addr; + + if (ifindex) + mreqn.imr_ifindex = ifindex; + else + mreqn.imr_address = if_addr; + + ret = setsockopt (sock, IPPROTO_IP, optname, + (void *) &mreqn, sizeof (mreqn)); + return ret; + break; + + case IP_ADD_MEMBERSHIP: + case IP_DROP_MEMBERSHIP: + if (ifindex) + { + memset (&gr, 0, sizeof (gr)); + si = (struct sockaddr_in *) &gr.gr_group; + gr.gr_interface = ifindex; + if (mcast_addr) + si->sin_family = AF_INET; + si->sin_len = sizeof (struct sockaddr_in); + si->sin_addr.s_addr = mcast_addr; + if (optname == IP_ADD_MEMBERSHIP) + ret = setsockopt (sock, IPPROTO_IP, MCAST_JOIN_GROUP, + (void *) &gr, sizeof (gr)); + else + ret = setsockopt (sock, IPPROTO_IP, MCAST_LEAVE_GROUP, + (void *) &gr, sizeof (gr)); + } + else + { + memset (&mreqn, 0, sizeof (mreqn)); + if (mcast_addr) + mreqn.imr_multiaddr.s_addr = mcast_addr; + mreqn.imr_address = if_addr; + + ret = setsockopt (sock, IPPROTO_IP, optname, + (void *) &mreqn, sizeof (mreqn)); + } + if ((ret < 0) && (optname == IP_ADD_MEMBERSHIP) + && (errno == EADDRINUSE)) + { + /* see above: handle possible problem when interface comes back up */ + char buf[2][INET_ADDRSTRLEN]; + zlog_info ("setsockopt_multicast_ipv4 attempting to drop and " + "re-add (fd %d, ifaddr %s, mcast %s, ifindex %u)", + sock, + inet_ntop (AF_INET, &if_addr, buf[0], sizeof (buf[0])), + inet_ntop (AF_INET, &mcast_addr, buf[1], + sizeof (buf[1])), ifindex); + if (ifindex) + { + setsockopt (sock, IPPROTO_IP, MCAST_LEAVE_GROUP, + (void *) &gr, sizeof (gr)); + ret = setsockopt (sock, IPPROTO_IP, MCAST_JOIN_GROUP, + (void *) &gr, sizeof (gr)); + } + else + { + setsockopt (sock, IPPROTO_IP, IP_DROP_MEMBERSHIP, + (void *) &mreqn, sizeof (mreqn)); + ret = setsockopt (sock, IPPROTO_IP, IP_ADD_MEMBERSHIP, + (void *) &mreqn, sizeof (mreqn)); + } + } + return ret; + break; + + default: + /* Can out and give an understandable error */ + errno = EINVAL; + return -1; + break; + } + #else /* #if OS_TYPE */ /* standard BSD API */ @@ -289,8 +381,10 @@ setsockopt_multicast_ipv4(int sock, mreq.imr_multiaddr.s_addr = mcast_addr; mreq.imr_interface = m; - ret = setsockopt (sock, IPPROTO_IP, optname, (void *)&mreq, sizeof(mreq)); - if ((ret < 0) && (optname == IP_ADD_MEMBERSHIP) && (errno == EADDRINUSE)) + ret = + setsockopt (sock, IPPROTO_IP, optname, (void *) &mreq, sizeof (mreq)); + if ((ret < 0) && (optname == IP_ADD_MEMBERSHIP) + && (errno == EADDRINUSE)) { /* see above: handle possible problem when interface comes back up */ char buf[2][INET_ADDRSTRLEN]; @@ -324,13 +418,15 @@ setsockopt_ipv4_ifindex (int sock, int v int ret; #if defined (IP_PKTINFO) - if ((ret = setsockopt (sock, IPPROTO_IP, IP_PKTINFO, &val, sizeof (val))) < 0) - zlog_warn ("Can't set IP_PKTINFO option for fd %d to %d: %s", - sock,val,safe_strerror(errno)); + if ((ret = + setsockopt (sock, IPPROTO_IP, IP_PKTINFO, &val, sizeof (val))) < 0) + zlog_warn ("Can't set IP_PKTINFO option for fd %d to %d: %s", sock, val, + safe_strerror (errno)); #elif defined (IP_RECVIF) - if ((ret = setsockopt (sock, IPPROTO_IP, IP_RECVIF, &val, sizeof (val))) < 0) - zlog_warn ("Can't set IP_RECVIF option for fd %d to %d: %s", - sock,val,safe_strerror(errno)); + if ((ret = + setsockopt (sock, IPPROTO_IP, IP_RECVIF, &val, sizeof (val))) < 0) + zlog_warn ("Can't set IP_RECVIF option for fd %d to %d: %s", sock, val, + safe_strerror (errno)); #else #warning "Neither IP_PKTINFO nor IP_RECVIF is available." #warning "Will not be able to receive link info." --- quagga-0.99.9/lib/sockunion.c 2007-05-09 13:59:34.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/sockunion.c 2008-04-16 11:55:54.000000000 -0700 @@ -42,8 +42,16 @@ inet_aton (const char *cp, struct in_add switch (c) { - case '0': case '1': case '2': case '3': case '4': case '5': - case '6': case '7': case '8': case '9': + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': val = (val * base) + (c - '0'); break; case '.': @@ -58,7 +66,8 @@ inet_aton (const char *cp, struct in_add default: return 0; } - } while (*cp++) ; + } + while (*cp++); if (dots < 3) addr <<= 8 * (3 - dots); @@ -236,7 +245,8 @@ sockunion_socket (union sockunion *su) sock = socket (su->sa.sa_family, SOCK_STREAM, 0); if (sock < 0) { - zlog (NULL, LOG_WARNING, "Can't make socket : %s", safe_strerror (errno)); + zlog (NULL, LOG_WARNING, "Can't make socket : %s", + safe_strerror (errno)); return -1; } @@ -307,7 +317,8 @@ sockunion_log (union sockunion *su) #ifdef HAVE_IPV6 case AF_INET6: snprintf (buf, SU_ADDRSTRLEN, "%s", - inet_ntop (AF_INET6, &(su->sin6.sin6_addr), buf, SU_ADDRSTRLEN)); + inet_ntop (AF_INET6, &(su->sin6.sin6_addr), buf, + SU_ADDRSTRLEN)); break; #endif /* HAVE_IPV6 */ default: @@ -459,7 +470,8 @@ sockopt_reuseaddr (int sock) (void *) &on, sizeof (on)); if (ret < 0) { - zlog (NULL, LOG_WARNING, "can't set sockopt SO_REUSEADDR to socket %d", sock); + zlog (NULL, LOG_WARNING, "can't set sockopt SO_REUSEADDR to socket %d", + sock); return -1; } return 0; @@ -476,7 +488,8 @@ sockopt_reuseport (int sock) (void *) &on, sizeof (on)); if (ret < 0) { - zlog (NULL, LOG_WARNING, "can't set sockopt SO_REUSEPORT to socket %d", sock); + zlog (NULL, LOG_WARNING, "can't set sockopt SO_REUSEPORT to socket %d", + sock); return -1; } return 0; @@ -501,7 +514,8 @@ sockopt_ttl (int family, int sock, int t (void *) &ttl, sizeof (int)); if (ret < 0) { - zlog (NULL, LOG_WARNING, "can't set sockopt IP_TTL %d to socket %d", ttl, sock); + zlog (NULL, LOG_WARNING, "can't set sockopt IP_TTL %d to socket %d", + ttl, sock); return -1; } return 0; @@ -514,8 +528,9 @@ sockopt_ttl (int family, int sock, int t (void *) &ttl, sizeof (int)); if (ret < 0) { - zlog (NULL, LOG_WARNING, "can't set sockopt IPV6_UNICAST_HOPS %d to socket %d", - ttl, sock); + zlog (NULL, LOG_WARNING, + "can't set sockopt IPV6_UNICAST_HOPS %d to socket %d", ttl, + sock); return -1; } return 0; @@ -662,8 +677,7 @@ sockunion_getpeername (int fd) } /* Print sockunion structure */ -static void __attribute__ ((unused)) -sockunion_print (union sockunion *su) +static void __attribute__ ((unused)) sockunion_print (union sockunion *su) { if (su == NULL) return; @@ -731,7 +745,8 @@ sockunion_cmp (union sockunion *su1, uni if (su1->sa.sa_family == AF_INET) { - if (ntohl (su1->sin.sin_addr.s_addr) == ntohl (su2->sin.sin_addr.s_addr)) + if (ntohl (su1->sin.sin_addr.s_addr) == + ntohl (su2->sin.sin_addr.s_addr)) return 0; if (ntohl (su1->sin.sin_addr.s_addr) > ntohl (su2->sin.sin_addr.s_addr)) return 1; --- quagga-0.99.9/lib/sockunion.h 2005-05-03 12:14:13.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/sockunion.h 2008-04-16 11:55:54.000000000 -0700 @@ -24,8 +24,10 @@ #define _ZEBRA_SOCKUNION_H #if 0 -union sockunion { - struct sockinet { +union sockunion +{ + struct sockinet + { u_char si_len; u_char si_family; u_short si_port; --- quagga-0.99.9/lib/str.c 2005-09-19 06:12:02.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/str.c 2008-04-16 11:55:54.000000000 -0700 @@ -49,7 +49,8 @@ strlcpy(char *d, const char *s, size_t b { size_t len = strlen(s); size_t ret = len; - if (bufsize > 0) { + if (bufsize > 0) + { if (len >= bufsize) len = bufsize-1; memcpy(d, s, len); @@ -74,7 +75,8 @@ strlcat(char *d, const char *s, size_t b size_t len2 = strlen(s); size_t ret = len1 + len2; - if (len1 < bufsize - 1) { + if (len1 < bufsize - 1) + { if (len2 >= bufsize - len1) len2 = bufsize - len1 - 1; memcpy(d+len1, s, len2); @@ -89,7 +91,9 @@ size_t strnlen(const char *s, size_t maxlen) { const char *p; - return (p = (const char *)memchr(s, '\0', maxlen)) ? (size_t)(p-s) : maxlen; + return (p = + (const char *) memchr (s, '\0', + maxlen)) ? (size_t) (p - s) : maxlen; } #endif --- quagga-0.99.9/lib/stream.c 2006-02-03 06:47:24.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/stream.c 2008-04-16 11:55:54.000000000 -0700 @@ -760,7 +760,8 @@ stream_read_try(struct stream *s, int fd /* Error: was it transient (return -2) or fatal (return -1)? */ if (ERRNO_IO_RETRY(errno)) return -2; - zlog_warn("%s: read failed on fd %d: %s", __func__, fd, safe_strerror(errno)); + zlog_warn ("%s: read failed on fd %d: %s", __func__, fd, + safe_strerror (errno)); return -1; } @@ -792,7 +793,8 @@ stream_recvfrom (struct stream *s, int f /* Error: was it transient (return -2) or fatal (return -1)? */ if (ERRNO_IO_RETRY(errno)) return -2; - zlog_warn("%s: read failed on fd %d: %s", __func__, fd, safe_strerror(errno)); + zlog_warn ("%s: read failed on fd %d: %s", __func__, fd, + safe_strerror (errno)); return -1; } --- quagga-0.99.9/lib/table.c 2005-05-03 10:11:25.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/table.c 2008-04-16 11:55:54.000000000 -0700 @@ -125,8 +125,7 @@ route_table_free (struct route_table *rt } /* Utility mask array. */ -static u_char maskbit[] = -{ +static u_char maskbit[] = { 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; @@ -220,8 +219,7 @@ route_unlock_node (struct route_node *no } /* Dump routing table. */ -static void __attribute__ ((unused)) -route_dump_node (struct route_table *t) +static void __attribute__ ((unused)) route_dump_node (struct route_table *t) { struct route_node *node; char buf[46]; --- quagga-0.99.9/lib/thread.c 2006-08-26 23:40:36.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/thread.c 2008-04-16 11:55:54.000000000 -0700 @@ -30,6 +30,8 @@ #include "command.h" #include "sigevent.h" + + /* Recent absolute time of day */ struct timeval recent_time; static struct timeval last_recent_time; @@ -82,8 +84,7 @@ timeval_subtract (struct timeval a, stru static long timeval_cmp (struct timeval a, struct timeval b) { - return (a.tv_sec == b.tv_sec - ? a.tv_usec - b.tv_usec : a.tv_sec - b.tv_sec); + return (a.tv_sec == b.tv_sec ? a.tv_usec - b.tv_usec : a.tv_sec - b.tv_sec); } static unsigned long @@ -240,8 +241,7 @@ cpu_record_hash_alloc (struct cpu_thread } static inline void -vty_out_cpu_thread_history(struct vty* vty, - struct cpu_thread_history *a) +vty_out_cpu_thread_history (struct vty *vty, struct cpu_thread_history *a) { #ifdef HAVE_RUSAGE vty_out(vty, "%7ld.%03ld %9d %8ld %9ld %8ld %9ld", @@ -264,8 +264,7 @@ vty_out_cpu_thread_history(struct vty* v } static void -cpu_record_hash_print(struct hash_backet *bucket, - void *args[]) +cpu_record_hash_print (struct hash_backet *bucket, void *args[]) { struct cpu_thread_history *totals = args[0]; struct vty *vty = args[1]; @@ -307,8 +306,8 @@ cpu_record_print(struct vty *vty, unsign #endif vty_out(vty, " Type Thread%s", VTY_NEWLINE); hash_iterate(cpu_record, - (void(*)(struct hash_backet*,void*))cpu_record_hash_print, - args); + (void (*)(struct hash_backet *, void *)) + cpu_record_hash_print, args); if (tmp.total_calls > 0) vty_out_cpu_thread_history(vty, &tmp); @@ -319,8 +318,7 @@ DEFUN(show_thread_cpu, "show thread cpu [FILTER]", SHOW_STR "Thread information\n" - "Thread CPU usage\n" - "Display filter (rwtexb)\n") + "Thread CPU usage\n" "Display filter (rwtexb)\n") { int i = 0; unsigned char filter = 0xff; @@ -409,7 +407,8 @@ thread_master_create () { if (cpu_record == NULL) cpu_record - = hash_create_size (1011, (unsigned int (*) (void *))cpu_record_hash_key, + = + hash_create_size (1011, (unsigned int (*)(void *)) cpu_record_hash_key, (int (*) (void *, void *))cpu_record_hash_cmp); return (struct thread_master *) XCALLOC (MTYPE_THREAD_MASTER, @@ -433,8 +432,7 @@ thread_list_add (struct thread_list *lis /* Add a new thread just before the point. */ static void thread_list_add_before (struct thread_list *list, - struct thread *point, - struct thread *thread) + struct thread *point, struct thread *thread) { thread->next = point; thread->prev = point->prev; @@ -594,7 +592,8 @@ thread_get (struct thread_master *m, u_c /* Add new read thread. */ struct thread * funcname_thread_add_read (struct thread_master *m, - int (*func) (struct thread *), void *arg, int fd, const char* funcname) + int (*func) (struct thread *), void *arg, int fd, + const char *funcname) { struct thread *thread; @@ -617,7 +616,8 @@ funcname_thread_add_read (struct thread_ /* Add new write thread. */ struct thread * funcname_thread_add_write (struct thread_master *m, - int (*func) (struct thread *), void *arg, int fd, const char* funcname) + int (*func) (struct thread *), void *arg, int fd, + const char *funcname) { struct thread *thread; @@ -716,8 +717,7 @@ funcname_thread_add_timer_msec (struct t struct thread * funcname_thread_add_background (struct thread_master *m, int (*func) (struct thread *), - void *arg, long delay, - const char *funcname) + void *arg, long delay, const char *funcname) { struct timeval trel; @@ -741,7 +741,8 @@ funcname_thread_add_background (struct t /* Add simple event thread. */ struct thread * funcname_thread_add_event (struct thread_master *m, - int (*func) (struct thread *), void *arg, int val, const char* funcname) + int (*func) (struct thread *), void *arg, int val, + const char *funcname) { struct thread *thread; @@ -973,7 +975,8 @@ thread_fetch (struct thread_master *m, s } unsigned long -thread_consumed_time (RUSAGE_T *now, RUSAGE_T *start, unsigned long *cputime) +thread_consumed_time (RUSAGE_T * now, RUSAGE_T * start, + unsigned long *cputime) { #ifdef HAVE_RUSAGE /* This is 'user + sys' time. */ @@ -1085,9 +1088,7 @@ thread_call (struct thread *thread) struct thread * funcname_thread_execute (struct thread_master *m, int (*func)(struct thread *), - void *arg, - int val, - const char* funcname) + void *arg, int val, const char *funcname) { struct thread dummy; --- quagga-0.99.9/lib/thread.h 2006-08-26 23:40:36.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/thread.h 2008-04-16 11:55:54.000000000 -0700 @@ -67,7 +67,8 @@ struct thread struct thread_master *master; /* pointer to the struct thread_master. */ int (*func) (struct thread *); /* event function */ void *arg; /* event argument */ - union { + union + { int val; /* second argument of the event. */ int fd; /* file descriptor in case of read/write. */ struct timeval sands; /* rest of time sands value. */ @@ -93,7 +94,8 @@ struct cpu_thread_history }; /* Clocks supported by Quagga */ -enum quagga_clkid { +enum quagga_clkid +{ QUAGGA_CLK_REALTIME = 0, /* ala gettimeofday() */ QUAGGA_CLK_MONOTONIC, /* monotonic, against an indeterminate base */ QUAGGA_CLK_REALTIME_STABILISED, /* like realtime, but non-decrementing */ @@ -172,15 +174,18 @@ extern struct thread *funcname_thread_ad int (*)(struct thread *), void *, long, const char*); extern struct thread *funcname_thread_add_timer_msec (struct thread_master *, - int (*)(struct thread *), - void *, long, const char*); + int (*)(struct thread + *), void *, + long, const char *); extern struct thread *funcname_thread_add_event (struct thread_master *, int (*)(struct thread *), void *, int, const char*); extern struct thread *funcname_thread_add_background (struct thread_master *, - int (*func)(struct thread *), + int (*func) (struct + thread *), void *arg, - long milliseconds_to_delay, + long + milliseconds_to_delay, const char *funcname); extern struct thread *funcname_thread_execute (struct thread_master *, int (*)(struct thread *), @@ -204,7 +209,8 @@ extern int quagga_gettime (enum quagga_c extern time_t quagga_time (time_t *); /* Returns elapsed real (wall clock) time. */ -extern unsigned long thread_consumed_time(RUSAGE_T *after, RUSAGE_T *before, +extern unsigned long thread_consumed_time (RUSAGE_T * after, + RUSAGE_T * before, unsigned long *cpu_time_elapsed); /* Global variable containing a recent result from gettimeofday. This can --- quagga-0.99.9/lib/vty.c 2007-05-09 13:59:34.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/vty.c 2008-04-16 11:55:54.000000000 -0700 @@ -157,7 +157,8 @@ vty_log_out (struct vty *vty, const char if (!ctl->already_rendered) { - ctl->len = quagga_timestamp(ctl->precision, ctl->buf, sizeof(ctl->buf)); + ctl->len = + quagga_timestamp (ctl->precision, ctl->buf, sizeof (ctl->buf)); ctl->already_rendered = 1; } if (ctl->len+1 >= sizeof(buf)) @@ -167,7 +168,8 @@ vty_log_out (struct vty *vty, const char buf[len] = '\0'; if (level) - ret = snprintf(buf+len, sizeof(buf)-len, "%s: %s: ", level, proto_str); + ret = + snprintf (buf + len, sizeof (buf) - len, "%s: %s: ", level, proto_str); else ret = snprintf(buf+len, sizeof(buf)-len, "%s: ", proto_str); if ((ret < 0) || ((size_t)(len += ret) >= sizeof(buf))) @@ -235,8 +237,8 @@ vty_hello (struct vty *vty) { char *s; /* work backwards to ignore trailling isspace() */ - for (s = buf + strlen (buf); (s > buf) && isspace ((int)*(s - 1)); - s--); + for (s = buf + strlen (buf); + (s > buf) && isspace ((int) *(s - 1)); s--); *s = '\0'; vty_out (vty, "%s%s", buf, VTY_NEWLINE); } @@ -375,14 +377,16 @@ vty_auth (struct vty *vty, char *buf) { if (vty->node == AUTH_NODE) { - vty_out (vty, "%% Bad passwords, too many failures!%s", VTY_NEWLINE); + vty_out (vty, "%% Bad passwords, too many failures!%s", + VTY_NEWLINE); vty->status = VTY_CLOSE; } else { /* AUTH_ENABLE_NODE */ vty->fail = 0; - vty_out (vty, "%% Bad enable passwords, too many failures!%s", VTY_NEWLINE); + vty_out (vty, "%% Bad enable passwords, too many failures!%s", + VTY_NEWLINE); vty->node = VIEW_NODE; } } @@ -441,7 +445,8 @@ vty_command (struct vty *vty, char *buf) vty_out (vty, "%% Ambiguous command.%s", VTY_NEWLINE); break; case CMD_ERR_NO_MATCH: - vty_out (vty, "%% [%s] Unknown command: %s%s", protocolname, buf, VTY_NEWLINE); + vty_out (vty, "%% [%s] Unknown command: %s%s", protocolname, buf, + VTY_NEWLINE); break; case CMD_ERR_INCOMPLETE: vty_out (vty, "%% Command incomplete.%s", VTY_NEWLINE); @@ -980,8 +985,7 @@ vty_describe_command (struct vty *vty) vline = vector_init (1); vector_set (vline, '\0'); } - else - if (isspace ((int) vty->buf[vty->length - 1])) + else if (isspace ((int) vty->buf[vty->length - 1])) vector_set (vline, '\0'); describe = cmd_describe_command (vline, vty, &ret); @@ -1240,9 +1244,10 @@ vty_telnet_option (struct vty *vty, unsi vty->width = ((vty->sb_buf[1] << 8)|vty->sb_buf[2]); vty->height = ((vty->sb_buf[3] << 8)|vty->sb_buf[4]); #ifdef TELNET_OPTION_DEBUG - vty_out(vty, "TELNET NAWS window size negotiation completed: " - "width %d, height %d%s", - vty->width, vty->height, VTY_NEWLINE); + vty_out (vty, + "TELNET NAWS window size negotiation completed: " + "width %d, height %d%s", vty->width, vty->height, + VTY_NEWLINE); #endif } break; @@ -1568,14 +1573,12 @@ vty_flush (struct thread *thread) else flushrc = buffer_flush_window(vty->obuf, vty->fd, vty->width, vty->lines >= 0 ? vty->lines : - vty->height, - erase, 0); + vty->height, erase, 0); switch (flushrc) { case BUFFER_ERROR: vty->monitor = 0; /* disable monitoring to avoid infinite recursion */ - zlog_warn("buffer_flush failed on vty client fd %d, closing", - vty->fd); + zlog_warn ("buffer_flush failed on vty client fd %d, closing", vty->fd); buffer_reset(vty->obuf); vty_close(vty); return 0; @@ -1653,7 +1656,8 @@ vty_create (int vty_sock, union sockunio /* Say hello to the world. */ vty_hello (vty); if (! no_password_check) - vty_out (vty, "%sUser Access Verification%s%s", VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE); + vty_out (vty, "%sUser Access Verification%s%s", VTY_NEWLINE, VTY_NEWLINE, + VTY_NEWLINE); /* Setting up terminal. */ vty_will_echo (vty); @@ -1798,7 +1802,8 @@ vty_serv_sock_addrinfo (const char *host ) continue; - sock = socket (ainfo->ai_family, ainfo->ai_socktype, ainfo->ai_protocol); + sock = + socket (ainfo->ai_family, ainfo->ai_socktype, ainfo->ai_protocol); if (sock < 0) continue; @@ -1857,7 +1862,8 @@ vty_serv_sock_family (const char* addr, naddr=NULL; break; case 0: - zlog_err("error translating address %s: %s",addr,safe_strerror(errno)); + zlog_err ("error translating address %s: %s", addr, + safe_strerror (errno)); naddr=NULL; } @@ -1916,7 +1922,8 @@ vty_serv_un (const char *path) sock = socket (AF_UNIX, SOCK_STREAM, 0); if (sock < 0) { - zlog_err("Cannot create unix stream socket: %s", safe_strerror(errno)); + zlog_err ("Cannot create unix stream socket: %s", + safe_strerror (errno)); return; } @@ -2310,8 +2317,7 @@ vty_use_backup_config (char *fullpath) /* Read up configuration file from file_name. */ void -vty_read_config (char *config_file, - char *config_default_dir) +vty_read_config (char *config_file, char *config_default_dir) { char cwd[MAXPATHLEN]; FILE *confp = NULL; @@ -2324,8 +2330,7 @@ vty_read_config (char *config_file, if (! IS_DIRECTORY_SEP (config_file[0])) { getcwd (cwd, MAXPATHLEN); - tmp = XMALLOC (MTYPE_TMP, - strlen (cwd) + strlen (config_file) + 2); + tmp = XMALLOC (MTYPE_TMP, strlen (cwd) + strlen (config_file) + 2); sprintf (tmp, "%s/%s", cwd, config_file); fullpath = tmp; } @@ -2537,10 +2542,7 @@ vty_event (enum event event, int sock, s } } -DEFUN (config_who, - config_who_cmd, - "who", - "Display who is on vty\n") +DEFUN (config_who, config_who_cmd, "who", "Display who is on vty\n") { unsigned int i; struct vty *v; @@ -2548,17 +2550,14 @@ DEFUN (config_who, for (i = 0; i < vector_active (vtyvec); i++) if ((v = vector_slot (vtyvec, i)) != NULL) vty_out (vty, "%svty[%d] connected from %s.%s", - v->config ? "*" : " ", - i, v->address, VTY_NEWLINE); + v->config ? "*" : " ", i, v->address, VTY_NEWLINE); return CMD_SUCCESS; } /* Move to vty configuration mode. */ DEFUN (line_vty, line_vty_cmd, - "line vty", - "Configure a terminal line\n" - "Virtual terminal\n") + "line vty", "Configure a terminal line\n" "Virtual terminal\n") { vty->node = VTY_NODE; return CMD_SUCCESS; @@ -2591,8 +2590,7 @@ exec_timeout (struct vty *vty, const cha DEFUN (exec_timeout_min, exec_timeout_min_cmd, "exec-timeout <0-35791>", - "Set timeout value\n" - "Timeout value in minutes\n") + "Set timeout value\n" "Timeout value in minutes\n") { return exec_timeout (vty, argv[0], NULL); } @@ -2600,18 +2598,14 @@ DEFUN (exec_timeout_min, DEFUN (exec_timeout_sec, exec_timeout_sec_cmd, "exec-timeout <0-35791> <0-2147483>", - "Set the EXEC timeout\n" - "Timeout in minutes\n" - "Timeout in seconds\n") + "Set the EXEC timeout\n" "Timeout in minutes\n" "Timeout in seconds\n") { return exec_timeout (vty, argv[0], argv[1]); } DEFUN (no_exec_timeout, no_exec_timeout_cmd, - "no exec-timeout", - NO_STR - "Set the EXEC timeout\n") + "no exec-timeout", NO_STR "Set the EXEC timeout\n") { return exec_timeout (vty, NULL, NULL); } @@ -2620,8 +2614,7 @@ DEFUN (no_exec_timeout, DEFUN (vty_access_class, vty_access_class_cmd, "access-class WORD", - "Filter connections based on an IP access list\n" - "IP access list\n") + "Filter connections based on an IP access list\n" "IP access list\n") { if (vty_accesslist_name) XFREE(MTYPE_VTY, vty_accesslist_name); @@ -2636,8 +2629,7 @@ DEFUN (no_vty_access_class, no_vty_access_class_cmd, "no access-class [WORD]", NO_STR - "Filter connections based on an IP access list\n" - "IP access list\n") + "Filter connections based on an IP access list\n" "IP access list\n") { if (! vty_accesslist_name || (argc && strcmp(vty_accesslist_name, argv[0]))) { @@ -2659,8 +2651,7 @@ DEFUN (vty_ipv6_access_class, vty_ipv6_access_class_cmd, "ipv6 access-class WORD", IPV6_STR - "Filter connections based on an IP access list\n" - "IPv6 access list\n") + "Filter connections based on an IP access list\n" "IPv6 access list\n") { if (vty_ipv6_accesslist_name) XFREE(MTYPE_VTY, vty_ipv6_accesslist_name); @@ -2676,8 +2667,7 @@ DEFUN (no_vty_ipv6_access_class, "no ipv6 access-class [WORD]", NO_STR IPV6_STR - "Filter connections based on an IP access list\n" - "IPv6 access list\n") + "Filter connections based on an IP access list\n" "IPv6 access list\n") { if (! vty_ipv6_accesslist_name || (argc && strcmp(vty_ipv6_accesslist_name, argv[0]))) @@ -2696,20 +2686,14 @@ DEFUN (no_vty_ipv6_access_class, #endif /* HAVE_IPV6 */ /* vty login. */ -DEFUN (vty_login, - vty_login_cmd, - "login", - "Enable password checking\n") +DEFUN (vty_login, vty_login_cmd, "login", "Enable password checking\n") { no_password_check = 0; return CMD_SUCCESS; } DEFUN (no_vty_login, - no_vty_login_cmd, - "no login", - NO_STR - "Enable password checking\n") + no_vty_login_cmd, "no login", NO_STR "Enable password checking\n") { no_password_check = 1; return CMD_SUCCESS; @@ -2750,8 +2734,7 @@ DEFUN (terminal_no_monitor, terminal_no_monitor_cmd, "terminal no monitor", "Set terminal line parameters\n" - NO_STR - "Copy debug output to the current terminal line\n") + NO_STR "Copy debug output to the current terminal line\n") { vty->monitor = 0; return CMD_SUCCESS; @@ -2763,12 +2746,9 @@ ALIAS (terminal_no_monitor, NO_STR "Set terminal line parameters\n" "Copy debug output to the current terminal line\n") - DEFUN (show_history, show_history_cmd, - "show history", - SHOW_STR - "Display the session command history\n") + "show history", SHOW_STR "Display the session command history\n") { int index; @@ -2796,8 +2776,7 @@ vty_config_write (struct vty *vty) vty_out (vty, "line vty%s", VTY_NEWLINE); if (vty_accesslist_name) - vty_out (vty, " access-class %s%s", - vty_accesslist_name, VTY_NEWLINE); + vty_out (vty, " access-class %s%s", vty_accesslist_name, VTY_NEWLINE); if (vty_ipv6_accesslist_name) vty_out (vty, " ipv6 access-class %s%s", @@ -2806,8 +2785,7 @@ vty_config_write (struct vty *vty) /* exec-timeout */ if (vty_timeout_val != VTY_TIMEOUT_DEFAULT) vty_out (vty, " exec-timeout %ld %ld%s", - vty_timeout_val / 60, - vty_timeout_val % 60, VTY_NEWLINE); + vty_timeout_val / 60, vty_timeout_val % 60, VTY_NEWLINE); /* login */ if (no_password_check) @@ -2818,8 +2796,7 @@ vty_config_write (struct vty *vty) return CMD_SUCCESS; } -struct cmd_node vty_node = -{ +struct cmd_node vty_node = { VTY_NODE, "%s(config-line)# ", 1, --- quagga-0.99.9/lib/vty.h 2007-04-29 05:40:40.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/vty.h 2008-04-16 11:55:54.000000000 -0700 @@ -34,7 +35,8 @@ struct vty int fd; /* Is this vty connect to file or not */ - enum {VTY_TERM, VTY_FILE, VTY_SHELL, VTY_SHELL_SERV} type; + enum + { VTY_TERM, VTY_FILE, VTY_SHELL, VTY_SHELL_SERV } type; /* Node status of this vty */ int node; @@ -80,7 +82,8 @@ struct vty unsigned char escape; /* Current vty status. */ - enum {VTY_NORMAL, VTY_CLOSE, VTY_MORE, VTY_MORELINE} status; + enum + { VTY_NORMAL, VTY_CLOSE, VTY_MORE, VTY_MORELINE } status; /* IAC handling: was the last character received the IAC (interpret-as-command) escape character (and therefore the next @@ -205,14 +208,17 @@ extern void vty_init (struct thread_mast extern void vty_init_vtysh (void); extern void vty_reset (void); extern struct vty *vty_new (void); -extern int vty_out (struct vty *, const char *, ...) PRINTF_ATTRIBUTE(2, 3); +extern int +vty_out (struct vty *, const char *, ...) +PRINTF_ATTRIBUTE (2, 3); extern void vty_read_config (char *, char *); extern void vty_time_print (struct vty *, int); extern void vty_serv_sock (const char *, unsigned short, const char *); extern void vty_close (struct vty *); extern char *vty_get_cwd (void); extern void vty_log (const char *level, const char *proto, - const char *fmt, struct timestamp_control *, va_list); + const char *fmt, struct timestamp_control *, + va_list); extern int vty_config_lock (struct vty *); extern int vty_config_unlock (struct vty *); extern int vty_shell (struct vty *); --- quagga-0.99.9/lib/workqueue.c 2006-03-30 06:43:49.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/workqueue.c 2008-04-16 11:55:54.000000000 -0700 @@ -40,8 +40,7 @@ work_queue_item_new (struct work_queue * struct work_queue_item *item; assert (wq); - item = XCALLOC (MTYPE_WORK_QUEUE_ITEM, - sizeof (struct work_queue_item)); + item = XCALLOC (MTYPE_WORK_QUEUE_ITEM, sizeof (struct work_queue_item)); return item; } @@ -104,8 +103,7 @@ work_queue_schedule (struct work_queue * { /* if appropriate, schedule work queue thread */ if ( (wq->flags == WQ_UNPLUGGED) - && (wq->thread == NULL) - && (listcount (wq->items) > 0) ) + && (wq->thread == NULL) && (listcount (wq->items) > 0)) { wq->thread = thread_add_background (wq->master, work_queue_run, wq, delay); @@ -162,26 +160,19 @@ work_queue_item_requeue (struct work_que DEFUN(show_work_queues, show_work_queues_cmd, - "show work-queues", - SHOW_STR - "Work Queue information\n") + "show work-queues", SHOW_STR "Work Queue information\n") { struct listnode *node; struct work_queue *wq; vty_out (vty, "%c %8s %5s %8s %21s%s", - ' ', "List","(ms) ","Q. Runs","Cycle Counts ", - VTY_NEWLINE); + ' ', "List", "(ms) ", "Q. Runs", "Cycle Counts ", VTY_NEWLINE); vty_out (vty, "%c %8s %5s %8s %7s %6s %6s %s%s", 'P', "Items", - "Hold", - "Total", - "Best","Gran.","Avg.", - "Name", - VTY_NEWLINE); + "Hold", "Total", "Best", "Gran.", "Avg.", "Name", VTY_NEWLINE); for (ALL_LIST_ELEMENTS_RO ((&work_queues), node, wq)) { @@ -193,8 +184,7 @@ DEFUN(show_work_queues, wq->cycles.best, wq->cycles.granularity, (wq->runs) ? (unsigned int) (wq->cycles.total / wq->runs) : 0, - wq->name, - VTY_NEWLINE); + wq->name, VTY_NEWLINE); } return CMD_SUCCESS; @@ -285,8 +275,7 @@ work_queue_run (struct thread *thread) ret = wq->spec.workfunc (wq, item->data); item->ran++; } - while ((ret == WQ_RETRY_NOW) - && (item->ran < wq->spec.max_retries)); + while ((ret == WQ_RETRY_NOW) && (item->ran < wq->spec.max_retries)); switch (ret) { @@ -326,8 +315,7 @@ work_queue_run (struct thread *thread) cycles++; /* test if we should yield */ - if ( !(cycles % wq->cycles.granularity) - && thread_should_yield (thread)) + if (!(cycles % wq->cycles.granularity) && thread_should_yield (thread)) { yielded = 1; goto stats; --- quagga-0.99.9/lib/workqueue.h 2006-03-30 06:20:39.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/workqueue.h 2008-04-16 11:55:54.000000000 -0700 @@ -65,7 +65,8 @@ struct work_queue /* Specification for this work queue. * Public, must be set before use by caller. May be modified at will. */ - struct { + struct + { /* optional opaque user data, global to the queue. */ void *data; @@ -94,7 +95,8 @@ struct work_queue struct list *items; /* queue item list */ unsigned long runs; /* runs count */ - struct { + struct + { unsigned int best; unsigned int granularity; unsigned long total; --- quagga-0.99.9/lib/zclient.c 2007-05-09 13:59:34.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/zclient.c 2008-04-16 11:55:54.000000000 -0700 @@ -34,7 +34,8 @@ #include "table.h" /* Zebra client events. */ -enum event {ZCLIENT_SCHEDULE, ZCLIENT_READ, ZCLIENT_CONNECT}; +enum event +{ ZCLIENT_SCHEDULE, ZCLIENT_READ, ZCLIENT_CONNECT }; /* Prototype for event manager. */ static void zclient_event (enum event, struct zclient *); @@ -232,7 +233,8 @@ zclient_flush_data(struct thread *thread switch (buffer_flush_available(zclient->wb, zclient->sock)) { case BUFFER_ERROR: - zlog_warn("%s: buffer_flush_available failed on zclient fd %d, closing", + zlog_warn + ("%s: buffer_flush_available failed on zclient fd %d, closing", __func__, zclient->sock); return zclient_failed(zclient); break; @@ -251,7 +253,8 @@ zclient_send_message(struct zclient *zcl { if (zclient->sock < 0) return -1; - switch (buffer_write(zclient->wb, zclient->sock, STREAM_DATA(zclient->obuf), + switch (buffer_write + (zclient->wb, zclient->sock, STREAM_DATA (zclient->obuf), stream_get_endp(zclient->obuf))) { case BUFFER_ERROR: @@ -613,7 +616,8 @@ zebra_interface_add_read (struct stream stream_get (ifname_tmp, s, INTERFACE_NAMSIZ); /* Lookup/create interface by name. */ - ifp = if_get_by_name_len (ifname_tmp, strnlen(ifname_tmp, INTERFACE_NAMSIZ)); + ifp = + if_get_by_name_len (ifname_tmp, strnlen (ifname_tmp, INTERFACE_NAMSIZ)); /* Read interface's index. */ ifp->ifindex = stream_getl (s); @@ -777,8 +781,10 @@ zebra_interface_address_read (int type, if (type == ZEBRA_INTERFACE_ADDRESS_ADD) { /* N.B. NULL destination pointers are encoded as all zeroes */ - ifc = connected_add_by_prefix(ifp, &p,(memconstant(&d.u.prefix,0,plen) ? - NULL : &d)); + ifc = + connected_add_by_prefix (ifp, &p, + (memconstant (&d.u.prefix, 0, plen) ? NULL : + &d)); if (ifc != NULL) { ifc->flags = ifc_flags; @@ -819,7 +825,8 @@ zclient_read (struct thread *thread) (nbyte == -1)) { if (zclient_debug) - zlog_debug ("zclient connection closed socket [%d].", zclient->sock); + zlog_debug ("zclient connection closed socket [%d].", + zclient->sock); return zclient_failed(zclient); } if (nbyte != (ssize_t)(ZEBRA_HEADER_SIZE-already)) @@ -875,7 +882,8 @@ zclient_read (struct thread *thread) (nbyte == -1)) { if (zclient_debug) - zlog_debug("zclient connection closed socket [%d].", zclient->sock); + zlog_debug ("zclient connection closed socket [%d].", + zclient->sock); return zclient_failed(zclient); } if (nbyte != (ssize_t)(length-already)) --- quagga-0.99.9/lib/zclient.h 2006-01-31 12:55:54.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/lib/zclient.h 2008-04-16 11:55:54.000000000 -0700 @@ -151,8 +151,10 @@ extern void zclient_create_header (struc extern struct interface *zebra_interface_add_read (struct stream *); extern struct interface *zebra_interface_state_read (struct stream *s); extern struct connected *zebra_interface_address_read (int, struct stream *); -extern void zebra_interface_if_set_value (struct stream *, struct interface *); -extern void zebra_router_id_update_read (struct stream *s, struct prefix *rid); +extern void zebra_interface_if_set_value (struct stream *, + struct interface *); +extern void zebra_router_id_update_read (struct stream *s, + struct prefix *rid); extern int zapi_ipv4_route (u_char, struct zclient *, struct prefix_ipv4 *, struct zapi_ipv4 *); --- quagga-0.99.9/ospf6d/Makefile.am 2005-04-04 21:48:41.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/Makefile.am 2008-04-16 11:55:52.000000000 -0700 @@ -12,14 +12,14 @@ libospf6_a_SOURCES = \ ospf6_top.c ospf6_area.c ospf6_interface.c ospf6_neighbor.c \ ospf6_flood.c ospf6_route.c ospf6_intra.c ospf6_zebra.c \ ospf6_spf.c ospf6_proto.c ospf6_asbr.c ospf6_abr.c ospf6_snmp.c \ - ospf6d.c + ospf6d.c ospf6_mdr.c ospf6_ghc.c noinst_HEADERS = \ ospf6_network.h ospf6_message.h ospf6_lsa.h ospf6_lsdb.h \ ospf6_top.h ospf6_area.h ospf6_interface.h ospf6_neighbor.h \ ospf6_flood.h ospf6_route.h ospf6_intra.h ospf6_zebra.h \ ospf6_spf.h ospf6_proto.h ospf6_asbr.h ospf6_abr.h ospf6_snmp.h \ - ospf6d.h + ospf6d.h ospf6_mdr.h ospf6_ghc.h ospf6d_SOURCES = \ ospf6_main.c $(libospf6_a_SOURCES) --- quagga-0.99.9/ospf6d/Makefile.in 2007-09-07 09:54:57.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/Makefile.in 2008-04-16 11:55:52.000000000 -0700 @@ -1,8 +1,8 @@ -# Makefile.in generated by automake 1.10 from Makefile.am. +# Makefile.in generated by automake 1.6.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 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. @@ -13,132 +13,75 @@ # PARTICULAR PURPOSE. @SET_MAKE@ +SHELL = @SHELL@ - - - +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) +transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_triplet = @build@ +host_alias = @host_alias@ host_triplet = @host@ -target_triplet = @target@ -sbin_PROGRAMS = ospf6d$(EXEEXT) -subdir = ospf6d -DIST_COMMON = README $(dist_examples_DATA) $(noinst_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in ChangeLog -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -libospf6_a_AR = $(AR) $(ARFLAGS) -libospf6_a_LIBADD = -am_libospf6_a_OBJECTS = ospf6_network.$(OBJEXT) \ - ospf6_message.$(OBJEXT) ospf6_lsa.$(OBJEXT) \ - ospf6_lsdb.$(OBJEXT) ospf6_top.$(OBJEXT) ospf6_area.$(OBJEXT) \ - ospf6_interface.$(OBJEXT) ospf6_neighbor.$(OBJEXT) \ - ospf6_flood.$(OBJEXT) ospf6_route.$(OBJEXT) \ - ospf6_intra.$(OBJEXT) ospf6_zebra.$(OBJEXT) \ - ospf6_spf.$(OBJEXT) ospf6_proto.$(OBJEXT) ospf6_asbr.$(OBJEXT) \ - ospf6_abr.$(OBJEXT) ospf6_snmp.$(OBJEXT) ospf6d.$(OBJEXT) -libospf6_a_OBJECTS = $(am_libospf6_a_OBJECTS) -am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(examplesdir)" -sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) -PROGRAMS = $(sbin_PROGRAMS) -am__objects_1 = ospf6_network.$(OBJEXT) ospf6_message.$(OBJEXT) \ - ospf6_lsa.$(OBJEXT) ospf6_lsdb.$(OBJEXT) ospf6_top.$(OBJEXT) \ - ospf6_area.$(OBJEXT) ospf6_interface.$(OBJEXT) \ - ospf6_neighbor.$(OBJEXT) ospf6_flood.$(OBJEXT) \ - ospf6_route.$(OBJEXT) ospf6_intra.$(OBJEXT) \ - ospf6_zebra.$(OBJEXT) ospf6_spf.$(OBJEXT) \ - ospf6_proto.$(OBJEXT) ospf6_asbr.$(OBJEXT) ospf6_abr.$(OBJEXT) \ - ospf6_snmp.$(OBJEXT) ospf6d.$(OBJEXT) -am_ospf6d_OBJECTS = ospf6_main.$(OBJEXT) $(am__objects_1) -ospf6d_OBJECTS = $(am_ospf6d_OBJECTS) -ospf6d_DEPENDENCIES = ../lib/libzebra.la -DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libospf6_a_SOURCES) $(ospf6d_SOURCES) -DIST_SOURCES = $(libospf6_a_SOURCES) $(ospf6d_SOURCES) -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; -dist_examplesDATA_INSTALL = $(INSTALL_DATA) -DATA = $(dist_examples_DATA) -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ AMTAR = @AMTAR@ AR = @AR@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ +AS = @AS@ AWK = @AWK@ BGPD = @BGPD@ CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ CONFDATE = @CONFDATE@ CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ CURSES = @CURSES@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ GAWK = @GAWK@ -GREP = @GREP@ IF_METHOD = @IF_METHOD@ IF_PROC = @IF_PROC@ + INCLUDES = @INCLUDES@ -I.. -I$(top_srcdir) -I$(top_srcdir)/lib @SNMP_INCLUDES@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ IOCTL_METHOD = @IOCTL_METHOD@ IPFORWARD = @IPFORWARD@ @@ -148,34 +91,22 @@ ISIS_TOPOLOGY_DIR = @ISIS_TOPOLOGY_DIR@ ISIS_TOPOLOGY_INCLUDES = @ISIS_TOPOLOGY_INCLUDES@ ISIS_TOPOLOGY_LIB = @ISIS_TOPOLOGY_LIB@ KERNEL_METHOD = @KERNEL_METHOD@ -LDFLAGS = @LDFLAGS@ LIBCAP = @LIBCAP@ LIBM = @LIBM@ -LIBOBJS = @LIBOBJS@ LIBPAM = @LIBPAM@ LIBREADLINE = @LIBREADLINE@ -LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_IPV6 = @LIB_IPV6@ LIB_REGEX = @LIB_REGEX@ LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ MULTIPATH_NUM = @MULTIPATH_NUM@ -OBJEXT = @OBJEXT@ +OBJDUMP = @OBJDUMP@ OSPF6D = @OSPF6D@ OSPFAPI = @OSPFAPI@ OSPFCLIENT = @OSPFCLIENT@ 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@ PERL = @PERL@ RANLIB = @RANLIB@ RIPD = @RIPD@ @@ -183,8 +114,6 @@ RIPNGD = @RIPNGD@ RTREAD_METHOD = @RTREAD_METHOD@ RT_METHOD = @RT_METHOD@ SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ SNMP_INCLUDES = @SNMP_INCLUDES@ SOLARIS = @SOLARIS@ STRIP = @STRIP@ @@ -192,83 +121,37 @@ VERSION = @VERSION@ VTYSH = @VTYSH@ WATCHQUAGGA = @WATCHQUAGGA@ ZEBRA = @ZEBRA@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ am__include = @am__include@ -am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ enable_group = @enable_group@ enable_user = @enable_user@ enable_vty_group = @enable_vty_group@ exampledir = @exampledir@ -exec_prefix = @exec_prefix@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ pkgsrcdir = @pkgsrcdir@ pkgsrcrcdir = @pkgsrcrcdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ quagga_statedir = @quagga_statedir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -sysconfdir = @sysconfdir@ -target = @target@ -target_alias = @target_alias@ -target_cpu = @target_cpu@ -target_os = @target_os@ -target_vendor = @target_vendor@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ +DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" INSTALL_SDATA = @INSTALL@ -m 600 + noinst_LIBRARIES = libospf6.a +sbin_PROGRAMS = ospf6d + libospf6_a_SOURCES = \ ospf6_network.c ospf6_message.c ospf6_lsa.c ospf6_lsdb.c \ ospf6_top.c ospf6_area.c ospf6_interface.c ospf6_neighbor.c \ ospf6_flood.c ospf6_route.c ospf6_intra.c ospf6_zebra.c \ ospf6_spf.c ospf6_proto.c ospf6_asbr.c ospf6_abr.c ospf6_snmp.c \ - ospf6d.c + ospf6d.c ospf6_mdr.c + noinst_HEADERS = \ ospf6_network.h ospf6_message.h ospf6_lsa.h ospf6_lsdb.h \ ospf6_top.h ospf6_area.h ospf6_interface.h ospf6_neighbor.h \ ospf6_flood.h ospf6_route.h ospf6_intra.h ospf6_zebra.h \ ospf6_spf.h ospf6_proto.h ospf6_asbr.h ospf6_abr.h ospf6_snmp.h \ - ospf6d.h + ospf6d.h ospf6_mdr.h + ospf6d_SOURCES = \ ospf6_main.c $(libospf6_a_SOURCES) @@ -273,42 +156,90 @@ noinst_HEADERS = \ ospf6d_SOURCES = \ ospf6_main.c $(libospf6_a_SOURCES) + ospf6d_LDADD = ../lib/libzebra.la @LIBCAP@ + examplesdir = $(exampledir) dist_examples_DATA = ospf6d.conf.sample +subdir = ospf6d +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + +libospf6_a_AR = $(AR) cru +libospf6_a_LIBADD = +am_libospf6_a_OBJECTS = ospf6_network.$(OBJEXT) ospf6_message.$(OBJEXT) \ + ospf6_lsa.$(OBJEXT) ospf6_lsdb.$(OBJEXT) ospf6_top.$(OBJEXT) \ + ospf6_area.$(OBJEXT) ospf6_interface.$(OBJEXT) \ + ospf6_neighbor.$(OBJEXT) ospf6_flood.$(OBJEXT) \ + ospf6_route.$(OBJEXT) ospf6_intra.$(OBJEXT) \ + ospf6_zebra.$(OBJEXT) ospf6_spf.$(OBJEXT) ospf6_proto.$(OBJEXT) \ + ospf6_asbr.$(OBJEXT) ospf6_abr.$(OBJEXT) ospf6_snmp.$(OBJEXT) \ + ospf6d.$(OBJEXT) ospf6_mdr.$(OBJEXT) +libospf6_a_OBJECTS = $(am_libospf6_a_OBJECTS) +sbin_PROGRAMS = ospf6d$(EXEEXT) +PROGRAMS = $(sbin_PROGRAMS) + +am__objects_1 = ospf6_network.$(OBJEXT) ospf6_message.$(OBJEXT) \ + ospf6_lsa.$(OBJEXT) ospf6_lsdb.$(OBJEXT) ospf6_top.$(OBJEXT) \ + ospf6_area.$(OBJEXT) ospf6_interface.$(OBJEXT) \ + ospf6_neighbor.$(OBJEXT) ospf6_flood.$(OBJEXT) \ + ospf6_route.$(OBJEXT) ospf6_intra.$(OBJEXT) \ + ospf6_zebra.$(OBJEXT) ospf6_spf.$(OBJEXT) ospf6_proto.$(OBJEXT) \ + ospf6_asbr.$(OBJEXT) ospf6_abr.$(OBJEXT) ospf6_snmp.$(OBJEXT) \ + ospf6d.$(OBJEXT) ospf6_mdr.$(OBJEXT) +am_ospf6d_OBJECTS = ospf6_main.$(OBJEXT) $(am__objects_1) +ospf6d_OBJECTS = $(am_ospf6d_OBJECTS) +ospf6d_DEPENDENCIES = ../lib/libzebra.la +ospf6d_LDFLAGS = +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ospf6_abr.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_area.Po ./$(DEPDIR)/ospf6_asbr.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_flood.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_interface.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_intra.Po ./$(DEPDIR)/ospf6_lsa.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_lsdb.Po ./$(DEPDIR)/ospf6_main.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_mdr.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_message.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_neighbor.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_network.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_proto.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_route.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_snmp.Po ./$(DEPDIR)/ospf6_spf.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6_top.Po ./$(DEPDIR)/ospf6_zebra.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/ospf6d.Po +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(libospf6_a_SOURCES) $(ospf6d_SOURCES) +DATA = $(dist_examples_DATA) + +HEADERS = $(noinst_HEADERS) + +DIST_COMMON = README $(dist_examples_DATA) $(noinst_HEADERS) ChangeLog \ + Makefile.am Makefile.in +SOURCES = $(libospf6_a_SOURCES) $(ospf6d_SOURCES) + all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu ospf6d/Makefile'; \ +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) cd $(top_srcdir) && \ $(AUTOMAKE) --gnu ospf6d/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) @@ -316,17 +247,18 @@ libospf6.a: $(libospf6_a_OBJECTS) $(libo -rm -f libospf6.a $(libospf6_a_AR) libospf6.a $(libospf6_a_OBJECTS) $(libospf6_a_LIBADD) $(RANLIB) libospf6.a +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)" + $(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ - echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(sbindir)/$$f'"; \ - $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(sbindir)/$$f" || exit 1; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \ else :; fi; \ done @@ -334,8 +266,8 @@ 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"; \ + echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ + rm -f $(DESTDIR)$(sbindir)/$$f; \ done clean-sbinPROGRAMS: @@ -346,10 +278,10 @@ clean-sbinPROGRAMS: done ospf6d$(EXEEXT): $(ospf6d_OBJECTS) $(ospf6d_DEPENDENCIES) @rm -f ospf6d$(EXEEXT) - $(LINK) $(ospf6d_OBJECTS) $(ospf6d_LDADD) $(LIBS) + $(LINK) $(ospf6d_LDFLAGS) $(ospf6d_OBJECTS) $(ospf6d_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.$(OBJEXT) + -rm -f *.$(OBJEXT) core *.core distclean-compile: -rm -f *.tab.c @@ -363,6 +295,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_lsa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_lsdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_mdr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_message.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_neighbor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_network.Po@am__quote@ @@ -374,50 +307,61 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6_zebra.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ospf6d.Po@am__quote@ +distclean-depend: + -rm -rf ./$(DEPDIR) + .c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$< .c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(COMPILE) -c `cygpath -w $<` .c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +CCDEPMODE = @CCDEPMODE@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: +dist_examplesDATA_INSTALL = $(INSTALL_DATA) install-dist_examplesDATA: $(dist_examples_DATA) @$(NORMAL_INSTALL) - test -z "$(examplesdir)" || $(MKDIR_P) "$(DESTDIR)$(examplesdir)" + $(mkinstalldirs) $(DESTDIR)$(examplesdir) @list='$(dist_examples_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - f=$(am__strip_dir) \ - echo " $(dist_examplesDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(examplesdir)/$$f'"; \ - $(dist_examplesDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(examplesdir)/$$f"; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " $(dist_examplesDATA_INSTALL) $$d$$p $(DESTDIR)$(examplesdir)/$$f"; \ + $(dist_examplesDATA_INSTALL) $$d$$p $(DESTDIR)$(examplesdir)/$$f; \ done uninstall-dist_examplesDATA: @$(NORMAL_UNINSTALL) @list='$(dist_examples_DATA)'; for p in $$list; do \ - f=$(am__strip_dir) \ - echo " rm -f '$(DESTDIR)$(examplesdir)/$$f'"; \ - rm -f "$(DESTDIR)$(examplesdir)/$$f"; \ + f="`echo $$p | sed -e 's|^.*/||'`"; \ + echo " rm -f $(DESTDIR)$(examplesdir)/$$f"; \ + rm -f $(DESTDIR)$(examplesdir)/$$f; \ done +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -426,7 +370,6 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique -tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) @@ -438,24 +381,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEP done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -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) \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique GTAGS: @@ -464,24 +391,23 @@ GTAGS: && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ + @list='$(DISTFILES)'; for file in $$list; do \ 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 \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ @@ -495,10 +421,10 @@ distdir: $(DISTFILES) check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(DATA) $(HEADERS) + installdirs: - for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(examplesdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done + $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(examplesdir) + install: install-am install-exec: install-exec-am install-data: install-data-am @@ -510,7 +436,7 @@ install-am: all-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: @@ -518,7 +444,7 @@ mostlyclean-generic: clean-generic: distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -rm -f Makefile $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -529,42 +455,30 @@ clean-am: clean-generic clean-libtool cl clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags dvi: dvi-am dvi-am: -html: html-am - info: info-am info-am: install-data-am: install-dist_examplesDATA -install-dvi: install-dvi-am - install-exec-am: install-sbinPROGRAMS -install-html: install-html-am - install-info: install-info-am install-man: -install-pdf: install-pdf-am - -install-ps: install-ps-am - installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile + maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am @@ -572,33 +486,21 @@ mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: +uninstall-am: uninstall-dist_examplesDATA uninstall-info-am \ + uninstall-sbinPROGRAMS -uninstall-am: uninstall-dist_examplesDATA uninstall-sbinPROGRAMS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dist_examplesDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sbinPROGRAMS install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ +.PHONY: GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES clean-sbinPROGRAMS \ + distclean distclean-compile distclean-depend distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am info \ + info-am install install-am install-data install-data-am \ + install-dist_examplesDATA install-exec install-exec-am \ + install-info install-info-am install-man install-sbinPROGRAMS \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ tags uninstall uninstall-am uninstall-dist_examplesDATA \ - uninstall-sbinPROGRAMS + uninstall-info-am uninstall-sbinPROGRAMS # 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. --- quagga-0.99.9/ospf6d/ospf6_abr.c 2006-05-15 03:43:52.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_abr.c 2008-04-16 11:55:54.000000000 -0700 @@ -206,7 +207,8 @@ ospf6_abr_originate_summary_to_area (str ! CHECK_FLAG (route->path.router_bits, OSPF6_ROUTER_BIT_E))) { if (is_debug) - zlog_debug ("Route type is none of network, range nor ASBR, withdraw"); + zlog_debug + ("Route type is none of network, range nor ASBR, withdraw"); if (summary) ospf6_route_remove (summary, summary_table); if (old) @@ -346,8 +348,7 @@ ospf6_abr_originate_summary_to_area (str if (EXPORT_NAME (area)) { if (EXPORT_LIST (area) == NULL) - EXPORT_LIST (area) = - access_list_lookup (AFI_IP6, EXPORT_NAME (area)); + EXPORT_LIST (area) = access_list_lookup (AFI_IP6, EXPORT_NAME (area)); if (EXPORT_LIST (area)) if (access_list_apply (EXPORT_LIST (area), @@ -678,7 +679,8 @@ ospf6_abr_examin_summary (struct ospf6_l if (PREFIX_NAME_IN (oa)) { if (PREFIX_LIST_IN (oa) == NULL) - PREFIX_LIST_IN (oa) = prefix_list_lookup (AFI_IP6, PREFIX_NAME_IN (oa)); + PREFIX_LIST_IN (oa) = + prefix_list_lookup (AFI_IP6, PREFIX_NAME_IN (oa)); if (PREFIX_LIST_IN (oa)) if (prefix_list_apply (PREFIX_LIST_IN (oa), &prefix) != PREFIX_PERMIT) @@ -809,11 +811,7 @@ ospf6_inter_area_router_lsa_show (struct /* Debug commands */ DEFUN (debug_ospf6_abr, debug_ospf6_abr_cmd, - "debug ospf6 abr", - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 ABR function\n" - ) + "debug ospf6 abr", DEBUG_STR OSPF6_STR "Debug OSPFv3 ABR function\n") { OSPF6_DEBUG_ABR_ON (); return CMD_SUCCESS; @@ -822,11 +820,7 @@ DEFUN (debug_ospf6_abr, DEFUN (no_debug_ospf6_abr, no_debug_ospf6_abr_cmd, "no debug ospf6 abr", - NO_STR - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 ABR function\n" - ) + NO_STR DEBUG_STR OSPF6_STR "Debug OSPFv3 ABR function\n") { OSPF6_DEBUG_ABR_OFF (); return CMD_SUCCESS; @@ -849,15 +843,13 @@ install_element_ospf6_debug_abr () install_element (CONFIG_NODE, &no_debug_ospf6_abr_cmd); } -struct ospf6_lsa_handler inter_prefix_handler = -{ +struct ospf6_lsa_handler inter_prefix_handler = { OSPF6_LSTYPE_INTER_PREFIX, "Inter-Prefix", ospf6_inter_area_prefix_lsa_show }; -struct ospf6_lsa_handler inter_router_handler = -{ +struct ospf6_lsa_handler inter_router_handler = { OSPF6_LSTYPE_INTER_ROUTER, "Inter-Router", ospf6_inter_area_router_lsa_show --- quagga-0.99.9/ospf6d/ospf6_area.c 2006-05-15 03:43:52.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_area.c 2008-04-16 11:55:54.000000000 -0700 @@ -3,20 +3,19 @@ * * 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 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. + * 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. + * 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 @@ -164,9 +163,14 @@ ospf6_area_create (u_int32_t area_id, st oa->summary_router->scope = oa; /* set default options */ - OSPF6_OPT_SET (oa->options, OSPF6_OPT_V6); - OSPF6_OPT_SET (oa->options, OSPF6_OPT_E); - OSPF6_OPT_SET (oa->options, OSPF6_OPT_R); + OSPF6_OPT_SET (oa->options, OSPF6_OPT_V6, 2); + OSPF6_OPT_SET (oa->options, OSPF6_OPT_E, 2); + OSPF6_OPT_SET (oa->options, OSPF6_OPT_R, 2); + + //AF draft 05 Sec 2.2 .1 + // When a router supports AF, it MUST set this new bit in the Options + // field of Hello Packets, DD packets and LSAs + OSPF6_OPT_SET (oa->options, OSPF6_OPT_AF, 1); oa->ospf6 = o; listnode_add_sort (o->area_list, oa); @@ -314,10 +319,7 @@ DEFUN (area_range, area_range_cmd, "area A.B.C.D range X:X::X:X/M", "OSPF area parameters\n" - OSPF6_AREA_ID_STR - "Configured address range\n" - "Specify IPv6 prefix\n" - ) + OSPF6_AREA_ID_STR "Configured address range\n" "Specify IPv6 prefix\n") { int ret; struct ospf6_area *oa; @@ -362,18 +362,13 @@ ALIAS (area_range, "area A.B.C.D range X:X::X:X/M (advertise|not-advertise)", "OSPF area parameters\n" OSPF6_AREA_ID_STR - "Configured address range\n" - "Specify IPv6 prefix\n" - ); + "Configured address range\n" "Specify IPv6 prefix\n"); DEFUN (no_area_range, no_area_range_cmd, "no area A.B.C.D range X:X::X:X/M", "OSPF area parameters\n" - OSPF6_AREA_ID_STR - "Configured address range\n" - "Specify IPv6 prefix\n" - ) + OSPF6_AREA_ID_STR "Configured address range\n" "Specify IPv6 prefix\n") { int ret; struct ospf6_area *oa; @@ -614,10 +607,7 @@ DEFUN (show_ipv6_ospf6_spf_tree, show_ipv6_ospf6_spf_tree_cmd, "show ipv6 ospf6 spf tree", SHOW_STR - IP6_STR - OSPF6_STR - "Shortest Path First caculation\n" - "Show SPF tree\n") + IP6_STR OSPF6_STR "Shortest Path First caculation\n" "Show SPF tree\n") { struct listnode *node; struct ospf6_area *oa; @@ -650,9 +640,7 @@ DEFUN (show_ipv6_ospf6_area_spf_tree, IP6_STR OSPF6_STR OSPF6_AREA_STR - OSPF6_AREA_ID_STR - "Shortest Path First caculation\n" - "Show SPF tree\n") + OSPF6_AREA_ID_STR "Shortest Path First caculation\n" "Show SPF tree\n") { u_int32_t area_id; struct ospf6_area *oa; @@ -745,6 +731,194 @@ DEFUN (show_ipv6_ospf6_simulate_spf_tree return CMD_SUCCESS; } +static int +ospf6_area_linklog_timestampstr (char *buf, size_t bufsize) +{ + struct timeval tv; + struct tm tm; + size_t len; + + if (gettimeofday (&tv, NULL)) + { + zlog_warn ("%s: gettimeofday() failed", __func__); + return -1; + } + if (gmtime_r (&tv.tv_sec, &tm) == NULL) + { + zlog_warn ("%s: gmtime_r() failed", __func__); + return -1; + } + if ((len = strftime (buf, bufsize, "%T", &tm)) == 0) + { + zlog_warn ("%s: timestampstr() failed", __func__); + return -1; + } + if (bufsize - len == 1) + { + zlog_warn ("%s: time stamp string exceeds bufsize", __func__); + return -1; + } + buf += len; + bufsize -= len; + if (snprintf (buf, bufsize, ".%06d", tv.tv_usec) >= bufsize) + { + zlog_warn ("%s: snprintf() failed", __func__); + return -1; + } + return 0; +} + +static int +ospf6_area_linklog (struct ospf6_area *area) +{ + char timestr[16]; + u_int16_t type; + struct ospf6_lsa *lsa; + + if (!area->linklog_stream) + { + zlog_warn ("%s: no linklog output file", __func__); + return -1; + } + if (ospf6_area_linklog_timestampstr (timestr, sizeof (timestr))) + return -1; + + fprintf (area->linklog_stream, "Routing-Links List: %s\n", timestr); + + type = ntohs (OSPF6_LSTYPE_ROUTER); + for (lsa = ospf6_lsdb_type_head (type, area->lsdb); + lsa; lsa = ospf6_lsdb_type_next (type, lsa)) + { + char *start, *end, *current; + struct ospf6_router_lsa *router_lsa; + char adv_router[64]; + + inet_ntop (AF_INET, &lsa->header->adv_router, + adv_router, sizeof (adv_router)); + + router_lsa = (struct ospf6_router_lsa *) + ((char *) lsa->header + sizeof (struct ospf6_lsa_header)); + start = (char *) router_lsa + sizeof (struct ospf6_router_lsa); + end = (char *) lsa->header + ntohs (lsa->header->length); + + for (current = start; + current + sizeof (struct ospf6_router_lsdesc) <= end; + current += sizeof (struct ospf6_router_lsdesc)) + { + struct ospf6_router_lsdesc *lsdesc; + char neighbor_router[64]; + + lsdesc = (struct ospf6_router_lsdesc *) current; + + inet_ntop (AF_INET, &lsdesc->neighbor_router_id, + neighbor_router, sizeof (neighbor_router)); + + fprintf (area->linklog_stream, "%s -> %s\n", adv_router, + neighbor_router); + } + } + + fprintf (area->linklog_stream, "End of Routing-Links List.\n"); + fflush (area->linklog_stream); + + return 0; +} + +static int +ospf6_area_linklog_timer (struct thread *thread) +{ + struct ospf6_area *area; + struct listnode *i; + char timestr[16]; + + area = (struct ospf6_area *) THREAD_ARG (thread); + assert (area); + + ospf6_area_linklog (area); + + area->linklog_thread = thread_add_timer (master, ospf6_area_linklog_timer, + area, area->linklog_interval); + + return 0; +} + +static void +ospf6_area_start_linklog (struct ospf6_area *area) +{ + THREAD_TIMER_ON (master, area->linklog_thread, + ospf6_area_linklog_timer, area, 0); + return; +} + +static void +ospf6_area_stop_linklog (struct ospf6_area *area) +{ + if (area->linklog_thread) + THREAD_TIMER_OFF (area->linklog_thread); + area->linklog_interval = 0; + return; +} + +DEFUN (area_linklog_file, + area_linklog_file_cmd, + "area A.B.C.D linklog-file FILENAME", + "OSPFv6 area parameters\n" + OSPF6_AREA_ID_STR "filename to log links to\n" "filename\n") +{ + struct ospf6_area *area; + + OSPF6_CMD_AREA_GET (argv[0], area); + + if (area->linklog_stream) + fclose (area->linklog_stream); + + if ((area->linklog_stream = fopen (argv[1], "a")) == NULL) + { + vty_out (vty, "%s: fopen('%s') failed: %s%s", + __func__, argv[1], strerror (errno), VNL); + return CMD_SUCCESS; + } + if (area->linklog_interval && !area->linklog_thread) + ospf6_area_start_linklog (area); + + return CMD_SUCCESS; +} + +DEFUN (area_linklog_interval, + area_linklog_interval_cmd, + "area A.B.C.D linklog-interval <0-255>", + "OSPFv6 area parameters\n" + OSPF6_AREA_ID_STR "minimum time between logging links\n" "seconds\n") +{ + struct ospf6_area *area; + + OSPF6_CMD_AREA_GET (argv[0], area); + + area->linklog_interval = strtol (argv[1], NULL, 10); + + if (area->linklog_interval && area->linklog_stream && !area->linklog_thread) + ospf6_area_start_linklog (area); + else if (!area->linklog_interval && area->linklog_thread) + ospf6_area_stop_linklog (area); + + return CMD_SUCCESS; +} + +DEFUN (no_area_linklog, + no_area_linklog_cmd, + "no area A.B.C.D linklog", + NO_STR + "OSPF area parameters\n" OSPF6_AREA_ID_STR "disable logging links\n") +{ + struct ospf6_area *area; + + OSPF6_CMD_AREA_GET (argv[0], area); + + ospf6_area_stop_linklog (area); + + return CMD_SUCCESS; +} + void ospf6_area_init () { @@ -768,6 +942,8 @@ ospf6_area_init () install_element (OSPF6_NODE, &area_filter_list_cmd); install_element (OSPF6_NODE, &no_area_filter_list_cmd); -} - + install_element (OSPF6_NODE, &area_linklog_file_cmd); + install_element (OSPF6_NODE, &area_linklog_interval_cmd); + install_element (OSPF6_NODE, &no_area_linklog_cmd); +} --- quagga-0.99.9/ospf6d/ospf6_area.h 2005-06-27 16:55:57.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_area.h 2008-04-16 11:55:54.000000000 -0700 @@ -97,6 +98,10 @@ struct ospf6_area #define PREFIX_NAME_OUT(A) (A)->plist_out.name #define PREFIX_LIST_OUT(A) (A)->plist_out.list + u_char linklog_interval; + FILE *linklog_stream; + struct thread *linklog_thread; + }; #define OSPF6_AREA_ENABLE 0x01 @@ -126,5 +131,5 @@ void ospf6_area_show (struct vty *, stru void ospf6_area_config_write (struct vty *vty); void ospf6_area_init (); -#endif /* OSPF_AREA_H */ +#endif /* OSPF_AREA_H */ --- quagga-0.99.9/ospf6d/ospf6_asbr.c 2006-05-15 03:46:39.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_asbr.c 2008-04-16 11:55:54.000000000 -0700 @@ -325,14 +326,6 @@ ospf6_asbr_lsentry_remove (struct ospf6_ u_int16_t type; u_int32_t router; - if (! CHECK_FLAG (asbr_entry->flag, OSPF6_ROUTE_BEST)) - { - char buf[16]; - inet_ntop (AF_INET, &ADV_ROUTER_IN_PREFIX (&asbr_entry->prefix), - buf, sizeof (buf)); - zlog_info ("ignore non-best path: lsentry %s remove", buf); - return; - } type = htons (OSPF6_LSTYPE_AS_EXTERNAL); router = ospf6_linkstate_prefix_adv_router (&asbr_entry->prefix); @@ -415,7 +408,8 @@ ospf6_asbr_redistribute_unset (int type) void ospf6_asbr_redistribute_add (int type, int ifindex, struct prefix *prefix, - u_int nexthop_num, struct in6_addr *nexthop) + u_int nexthop_num, struct in6_addr *nexthop, + u_int32_t metric) { int ret; struct ospf6_route troute; @@ -456,6 +450,7 @@ ospf6_asbr_redistribute_add (int type, i memset (&troute, 0, sizeof (troute)); memset (&tinfo, 0, sizeof (tinfo)); troute.route_option = &tinfo; + troute.path.cost = metric; ret = route_map_apply (ospf6->rmap[type].map, prefix, RMAP_OSPF6, &troute); @@ -487,7 +482,8 @@ ospf6_asbr_redistribute_add (int type, i info->type = type; match->nexthop[0].ifindex = ifindex; if (nexthop_num && nexthop) - memcpy (&match->nexthop[0].address, nexthop, sizeof (struct in6_addr)); + memcpy (&match->nexthop[0].address, nexthop, + sizeof (struct in6_addr)); /* create/update binding in external_id_table */ prefix_id.family = AF_INET; @@ -511,6 +507,8 @@ ospf6_asbr_redistribute_add (int type, i route = ospf6_route_create (); route->type = OSPF6_DEST_TYPE_NETWORK; memcpy (&route->prefix, prefix, sizeof (struct prefix)); + route->path.metric_type = 1; + route->path.cost = metric; info = (struct ospf6_external_info *) XMALLOC (MTYPE_OSPF6_EXTERNAL_INFO, sizeof (struct ospf6_external_info)); @@ -626,14 +624,12 @@ ospf6_asbr_redistribute_remove (int type DEFUN (ospf6_redistribute, ospf6_redistribute_cmd, - "redistribute (static|kernel|connected|ripng|bgp)", + "redistribute (ospf|ospf6|static|kernel|connected|ripng|bgp)", "Redistribute\n" + "OSPF route\n" + "OSPF6 route\n" "Static route\n" - "Kernel route\n" - "Connected route\n" - "RIPng route\n" - "BGP route\n" - ) + "Kernel route\n" "Connected route\n" "RIPng route\n" "BGP route\n") { int type = 0; @@ -647,6 +643,10 @@ DEFUN (ospf6_redistribute, type = ZEBRA_ROUTE_RIPNG; else if (strncmp (argv[0], "bgp", 3) == 0) type = ZEBRA_ROUTE_BGP; + else if (strncmp (argv[0], "ospf6", 5) == 0) + type = ZEBRA_ROUTE_OSPF6; + else if (strncmp (argv[0], "ospf", 4) == 0) + type = ZEBRA_ROUTE_OSPF; ospf6_asbr_redistribute_unset (type); ospf6_asbr_routemap_unset (type); @@ -656,16 +656,15 @@ DEFUN (ospf6_redistribute, DEFUN (ospf6_redistribute_routemap, ospf6_redistribute_routemap_cmd, - "redistribute (static|kernel|connected|ripng|bgp) route-map WORD", + "redistribute (ospf|ospf6|static|kernel|connected|ripng|bgp) route-map WORD", "Redistribute\n" + "OSPF route\n" + "OSPF6 route\n" "Static routes\n" "Kernel route\n" "Connected route\n" "RIPng route\n" - "BGP route\n" - "Route map reference\n" - "Route map name\n" - ) + "BGP route\n" "Route map reference\n" "Route map name\n") { int type = 0; @@ -679,6 +678,10 @@ DEFUN (ospf6_redistribute_routemap, type = ZEBRA_ROUTE_RIPNG; else if (strncmp (argv[0], "bgp", 3) == 0) type = ZEBRA_ROUTE_BGP; + else if (strncmp (argv[0], "ospf6", 5) == 0) + type = ZEBRA_ROUTE_OSPF6; + else if (strncmp (argv[0], "ospf", 4) == 0) + type = ZEBRA_ROUTE_OSPF; ospf6_asbr_redistribute_unset (type); ospf6_asbr_routemap_set (type, argv[1]); @@ -688,15 +691,13 @@ DEFUN (ospf6_redistribute_routemap, DEFUN (no_ospf6_redistribute, no_ospf6_redistribute_cmd, - "no redistribute (static|kernel|connected|ripng|bgp)", + "no redistribute (ospf|ospf6|static|kernel|connected|ripng|bgp)", NO_STR "Redistribute\n" + "OSPF route\n" + "OSPF6 route\n" "Static route\n" - "Kernel route\n" - "Connected route\n" - "RIPng route\n" - "BGP route\n" - ) + "Kernel route\n" "Connected route\n" "RIPng route\n" "BGP route\n") { int type = 0; @@ -710,6 +711,10 @@ DEFUN (no_ospf6_redistribute, type = ZEBRA_ROUTE_RIPNG; else if (strncmp (argv[0], "bgp", 3) == 0) type = ZEBRA_ROUTE_BGP; + else if (strncmp (argv[0], "ospf6", 5) == 0) + type = ZEBRA_ROUTE_OSPF6; + else if (strncmp (argv[0], "ospf", 4) == 0) + type = ZEBRA_ROUTE_OSPF; ospf6_asbr_redistribute_unset (type); ospf6_asbr_routemap_unset (type); @@ -733,8 +738,7 @@ ospf6_redistribute_config_write (struct vty_out (vty, " redistribute %s route-map %s%s", ZROUTE_NAME (type), ospf6->rmap[type].name, VNL); else - vty_out (vty, " redistribute %s%s", - ZROUTE_NAME (type), VNL); + vty_out (vty, " redistribute %s%s", ZROUTE_NAME (type), VNL); } return 0; @@ -771,11 +775,9 @@ ospf6_redistribute_show_config (struct v if (ospf6->rmap[type].name) vty_out (vty, " %d: %s with route-map \"%s\"%s%s", nroute[type], ZROUTE_NAME (type), ospf6->rmap[type].name, - (ospf6->rmap[type].map ? "" : " (not found !)"), - VNL); + (ospf6->rmap[type].map ? "" : " (not found !)"), VNL); else - vty_out (vty, " %d: %s%s", nroute[type], - ZROUTE_NAME (type), VNL); + vty_out (vty, " %d: %s%s", nroute[type], ZROUTE_NAME (type), VNL); } vty_out (vty, "Total %d routes%s", total, VNL); } @@ -814,9 +816,7 @@ ospf6_routemap_rule_match_address_prefix XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd -ospf6_routemap_rule_match_address_prefixlist_cmd = -{ +struct route_map_rule_cmd ospf6_routemap_rule_match_address_prefixlist_cmd = { "ipv6 address prefix-list", ospf6_routemap_rule_match_address_prefixlist, ospf6_routemap_rule_match_address_prefixlist_compile, @@ -855,9 +855,7 @@ ospf6_routemap_rule_set_metric_type_free XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd -ospf6_routemap_rule_set_metric_type_cmd = -{ +struct route_map_rule_cmd ospf6_routemap_rule_set_metric_type_cmd = { "metric-type", ospf6_routemap_rule_set_metric_type, ospf6_routemap_rule_set_metric_type_compile, @@ -895,9 +893,7 @@ ospf6_routemap_rule_set_metric_free (voi XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd -ospf6_routemap_rule_set_metric_cmd = -{ +struct route_map_rule_cmd ospf6_routemap_rule_set_metric_cmd = { "metric", ospf6_routemap_rule_set_metric, ospf6_routemap_rule_set_metric_compile, @@ -939,9 +935,7 @@ ospf6_routemap_rule_set_forwarding_free XFREE (MTYPE_ROUTE_MAP_COMPILED, rule); } -struct route_map_rule_cmd -ospf6_routemap_rule_set_forwarding_cmd = -{ +struct route_map_rule_cmd ospf6_routemap_rule_set_forwarding_cmd = { "forwarding-address", ospf6_routemap_rule_set_forwarding, ospf6_routemap_rule_set_forwarding_compile, @@ -976,8 +970,7 @@ DEFUN (ospf6_routemap_match_address_pref "Match values\n" IPV6_STR "Match address of route\n" - "Match entries of prefix-lists\n" - "IPv6 prefix-list name\n") + "Match entries of prefix-lists\n" "IPv6 prefix-list name\n") { int ret = route_map_add_match ((struct route_map_index *) vty->index, "ipv6 address prefix-list", argv[0]); @@ -992,8 +985,7 @@ DEFUN (ospf6_routemap_no_match_address_p "Match values\n" IPV6_STR "Match address of route\n" - "Match entries of prefix-lists\n" - "IPv6 prefix-list name\n") + "Match entries of prefix-lists\n" "IPv6 prefix-list name\n") { int ret = route_map_delete_match ((struct route_map_index *) vty->index, "ipv6 address prefix-list", argv[0]); @@ -1006,8 +998,7 @@ DEFUN (ospf6_routemap_set_metric_type, "set metric-type (type-1|type-2)", "Set value\n" "Type of metric\n" - "OSPF6 external type 1 metric\n" - "OSPF6 external type 2 metric\n") + "OSPF6 external type 1 metric\n" "OSPF6 external type 2 metric\n") { int ret = route_map_add_set ((struct route_map_index *) vty->index, "metric-type", argv[0]); @@ -1021,8 +1012,7 @@ DEFUN (ospf6_routemap_no_set_metric_type NO_STR "Set value\n" "Type of metric\n" - "OSPF6 external type 1 metric\n" - "OSPF6 external type 2 metric\n") + "OSPF6 external type 1 metric\n" "OSPF6 external type 2 metric\n") { int ret = route_map_delete_set ((struct route_map_index *) vty->index, "metric-type", argv[0]); @@ -1033,9 +1023,7 @@ DEFUN (ospf6_routemap_no_set_metric_type DEFUN (set_metric, set_metric_cmd, "set metric <0-4294967295>", - "Set value\n" - "Metric value\n" - "Metric value\n") + "Set value\n" "Metric value\n" "Metric value\n") { int ret = route_map_add_set ((struct route_map_index *) vty->index, "metric", argv[0]); @@ -1046,10 +1034,7 @@ DEFUN (set_metric, DEFUN (no_set_metric, no_set_metric_cmd, "no set metric <0-4294967295>", - NO_STR - "Set value\n" - "Metric\n" - "METRIC value\n") + NO_STR "Set value\n" "Metric\n" "METRIC value\n") { int ret = route_map_delete_set ((struct route_map_index *) vty->index, "metric", argv[0]); @@ -1060,9 +1045,7 @@ DEFUN (no_set_metric, DEFUN (ospf6_routemap_set_forwarding, ospf6_routemap_set_forwarding_cmd, "set forwarding-address X:X::X:X", - "Set value\n" - "Forwarding Address\n" - "IPv6 Address\n") + "Set value\n" "Forwarding Address\n" "IPv6 Address\n") { int ret = route_map_add_set ((struct route_map_index *) vty->index, "forwarding-address", argv[0]); @@ -1073,10 +1056,7 @@ DEFUN (ospf6_routemap_set_forwarding, DEFUN (ospf6_routemap_no_set_forwarding, ospf6_routemap_no_set_forwarding_cmd, "no set forwarding-address X:X::X:X", - NO_STR - "Set value\n" - "Forwarding Address\n" - "IPv6 Address\n") + NO_STR "Set value\n" "Forwarding Address\n" "IPv6 Address\n") { int ret = route_map_delete_set ((struct route_map_index *) vty->index, "forwarding-address", argv[0]); @@ -1098,7 +1078,8 @@ ospf6_routemap_init () /* Match address prefix-list */ install_element (RMAP_NODE, &ospf6_routemap_match_address_prefixlist_cmd); - install_element (RMAP_NODE, &ospf6_routemap_no_match_address_prefixlist_cmd); + install_element (RMAP_NODE, + &ospf6_routemap_no_match_address_prefixlist_cmd); /* ASE Metric Type (e.g. Type-1/Type-2) */ install_element (RMAP_NODE, &ospf6_routemap_set_metric_type_cmd); @@ -1128,9 +1109,11 @@ ospf6_as_external_lsa_show (struct vty * /* bits */ snprintf (buf, sizeof (buf), "%c%c%c", - (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_E) ? 'E' : '-'), - (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_F) ? 'F' : '-'), - (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T) ? 'T' : '-')); + (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_E) ? 'E' : + '-'), (CHECK_FLAG (external->bits_metric, + OSPF6_ASBR_BIT_F) ? 'F' : '-'), + (CHECK_FLAG (external->bits_metric, OSPF6_ASBR_BIT_T) ? 'T' : + '-')); vty_out (vty, " Bits: %s%s", buf, VNL); vty_out (vty, " Metric: %5lu%s", (u_long) OSPF6_ASBR_METRIC (external), @@ -1138,12 +1121,10 @@ ospf6_as_external_lsa_show (struct vty * ospf6_prefix_options_printbuf (external->prefix.prefix_options, buf, sizeof (buf)); - vty_out (vty, " Prefix Options: %s%s", buf, - VNL); + vty_out (vty, " Prefix Options: %s%s", buf, VNL); vty_out (vty, " Referenced LSType: %d%s", - ntohs (external->prefix.prefix_refer_lstype), - VNL); + ntohs (external->prefix.prefix_refer_lstype), VNL); ospf6_prefix_in6_addr (&in6, &external->prefix); inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); @@ -1190,11 +1171,7 @@ ospf6_asbr_external_route_show (struct v DEFUN (show_ipv6_ospf6_redistribute, show_ipv6_ospf6_redistribute_cmd, "show ipv6 ospf6 redistribute", - SHOW_STR - IP6_STR - OSPF6_STR - "redistributing External information\n" - ) + SHOW_STR IP6_STR OSPF6_STR "redistributing External information\n") { struct ospf6_route *route; @@ -1207,8 +1184,7 @@ DEFUN (show_ipv6_ospf6_redistribute, return CMD_SUCCESS; } -struct ospf6_lsa_handler as_external_handler = -{ +struct ospf6_lsa_handler as_external_handler = { OSPF6_LSTYPE_AS_EXTERNAL, "AS-External", ospf6_as_external_lsa_show @@ -1232,11 +1208,7 @@ ospf6_asbr_init () DEFUN (debug_ospf6_asbr, debug_ospf6_asbr_cmd, - "debug ospf6 asbr", - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 ASBR function\n" - ) + "debug ospf6 asbr", DEBUG_STR OSPF6_STR "Debug OSPFv3 ASBR function\n") { OSPF6_DEBUG_ASBR_ON (); return CMD_SUCCESS; @@ -1245,11 +1217,7 @@ DEFUN (debug_ospf6_asbr, DEFUN (no_debug_ospf6_asbr, no_debug_ospf6_asbr_cmd, "no debug ospf6 asbr", - NO_STR - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 ASBR function\n" - ) + NO_STR DEBUG_STR OSPF6_STR "Debug OSPFv3 ASBR function\n") { OSPF6_DEBUG_ASBR_OFF (); return CMD_SUCCESS; --- quagga-0.99.9/ospf6d/ospf6_asbr.h 2004-05-18 14:27:50.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_asbr.h 2008-04-16 11:55:54.000000000 -0700 @@ -71,7 +71,9 @@ void ospf6_asbr_lsentry_remove (struct o int ospf6_asbr_is_asbr (struct ospf6 *o); void ospf6_asbr_redistribute_add (int type, int ifindex, struct prefix *prefix, - u_int nexthop_num, struct in6_addr *nexthop); + u_int nexthop_num, struct in6_addr *nexthop, + u_int32_t metric); + void ospf6_asbr_redistribute_remove (int type, int ifindex, struct prefix *prefix); --- quagga-0.99.9/ospf6d/ospf6d.c 2006-05-15 03:36:47.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6d.c 2008-04-16 11:55:54.000000000 -0700 @@ -86,19 +87,14 @@ route_prev (struct route_node *node) /* show database functions */ DEFUN (show_version_ospf6, show_version_ospf6_cmd, - "show version ospf6", - SHOW_STR - "Displays ospf6d version\n" - ) + "show version ospf6", SHOW_STR "Displays ospf6d version\n") { - vty_out (vty, "Zebra OSPF6d Version: %s%s", - ospf6_daemon_version, VNL); + vty_out (vty, "Zebra OSPF6d Version: %s%s", ospf6_daemon_version, VNL); return CMD_SUCCESS; } -struct cmd_node debug_node = -{ +struct cmd_node debug_node = { DEBUG_NODE, "", 1 /* VTYSH */ @@ -172,11 +168,7 @@ parse_type_spec (int argc, const char *a DEFUN (show_ipv6_ospf6_database, show_ipv6_ospf6_database_cmd, "show ipv6 ospf6 database", - SHOW_STR - IPV6_STR - OSPF6_STR - "Display Link state database\n" - ) + SHOW_STR IPV6_STR OSPF6_STR "Display Link state database\n") { int level; struct listnode *i, *j; @@ -219,9 +211,7 @@ ALIAS (show_ipv6_ospf6_database, OSPF6_STR "Display Link state database\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_type, show_ipv6_ospf6_database_type_cmd, @@ -239,9 +229,7 @@ DEFUN (show_ipv6_ospf6_database_type, "Display As-External LSAs\n" "Display Group-Membership LSAs\n" "Display Type-7 LSAs\n" - "Display Link LSAs\n" - "Display Intra-Area-Prefix LSAs\n" - ) + "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n") { int level; struct listnode *i, *j; @@ -313,9 +301,7 @@ ALIAS (show_ipv6_ospf6_database_type, "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_id, show_ipv6_ospf6_database_id_cmd, @@ -325,8 +311,7 @@ DEFUN (show_ipv6_ospf6_database_id, OSPF6_STR "Display Link state database\n" "Any Link state Type\n" - "Specify Link state ID as IPv4 address notation\n" - ) + "Specify Link state ID as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -339,8 +324,7 @@ DEFUN (show_ipv6_ospf6_database_id, if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link State ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link State ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -382,9 +366,7 @@ ALIAS (show_ipv6_ospf6_database_id, "Any Link state Type\n" "Specify Link state ID as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); ALIAS (show_ipv6_ospf6_database_id, show_ipv6_ospf6_database_linkstate_id_cmd, @@ -394,8 +376,7 @@ ALIAS (show_ipv6_ospf6_database_id, OSPF6_STR "Display Link state database\n" "Search by Link state ID\n" - "Specify Link state ID as IPv4 address notation\n" - ); + "Specify Link state ID as IPv4 address notation\n"); ALIAS (show_ipv6_ospf6_database_id, show_ipv6_ospf6_database_linkstate_id_detail_cmd, @@ -408,9 +389,7 @@ ALIAS (show_ipv6_ospf6_database_id, "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_router, show_ipv6_ospf6_database_router_cmd, @@ -421,8 +400,7 @@ DEFUN (show_ipv6_ospf6_database_router, "Display Link state database\n" "Any Link state Type\n" "Any Link state ID\n" - "Specify Advertising Router as IPv4 address notation\n" - ) + "Specify Advertising Router as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -435,8 +413,7 @@ DEFUN (show_ipv6_ospf6_database_router, if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) { - vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Advertising Router is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -479,9 +456,7 @@ ALIAS (show_ipv6_ospf6_database_router, "Any Link state ID\n" "Specify Advertising Router as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); ALIAS (show_ipv6_ospf6_database_router, show_ipv6_ospf6_database_adv_router_cmd, @@ -491,8 +466,7 @@ ALIAS (show_ipv6_ospf6_database_router, OSPF6_STR "Display Link state database\n" "Search by Advertising Router\n" - "Specify Advertising Router as IPv4 address notation\n" - ); + "Specify Advertising Router as IPv4 address notation\n"); ALIAS (show_ipv6_ospf6_database_router, show_ipv6_ospf6_database_adv_router_detail_cmd, @@ -505,9 +479,7 @@ ALIAS (show_ipv6_ospf6_database_router, "Search by Advertising Router\n" "Specify Advertising Router as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_id_cmd, @@ -527,8 +499,7 @@ DEFUN (show_ipv6_ospf6_database_type_id, "Display Type-7 LSAs\n" "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" - "Specify Link state ID as IPv4 address notation\n" - ) + "Specify Link state ID as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -546,8 +517,7 @@ DEFUN (show_ipv6_ospf6_database_type_id, if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link state ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -612,9 +582,7 @@ ALIAS (show_ipv6_ospf6_database_type_id, "Display Intra-Area-Prefix LSAs\n" "Specify Link state ID as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); ALIAS (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_linkstate_id_cmd, @@ -635,8 +603,7 @@ ALIAS (show_ipv6_ospf6_database_type_id, "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" "Search by Link state ID\n" - "Specify Link state ID as IPv4 address notation\n" - ); + "Specify Link state ID as IPv4 address notation\n"); ALIAS (show_ipv6_ospf6_database_type_id, show_ipv6_ospf6_database_type_linkstate_id_detail_cmd, @@ -660,9 +627,7 @@ ALIAS (show_ipv6_ospf6_database_type_id, "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_router_cmd, @@ -683,8 +648,7 @@ DEFUN (show_ipv6_ospf6_database_type_rou "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" "Any Link state ID\n" - "Specify Advertising Router as IPv4 address notation\n" - ) + "Specify Advertising Router as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -702,8 +666,7 @@ DEFUN (show_ipv6_ospf6_database_type_rou if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) { - vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Advertising Router is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -728,7 +691,8 @@ DEFUN (show_ipv6_ospf6_database_type_rou { vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, oi->interface->name, oa->name, VNL, VNL); - ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); + ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, + oi->lsdb); } } break; @@ -769,9 +733,7 @@ ALIAS (show_ipv6_ospf6_database_type_rou "Any Link state ID\n" "Specify Advertising Router as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); ALIAS (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_adv_router_cmd, @@ -792,8 +754,7 @@ ALIAS (show_ipv6_ospf6_database_type_rou "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" "Search by Advertising Router\n" - "Specify Advertising Router as IPv4 address notation\n" - ); + "Specify Advertising Router as IPv4 address notation\n"); ALIAS (show_ipv6_ospf6_database_type_router, show_ipv6_ospf6_database_type_adv_router_detail_cmd, @@ -817,9 +778,7 @@ ALIAS (show_ipv6_ospf6_database_type_rou "Search by Advertising Router\n" "Specify Advertising Router as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_id_router, show_ipv6_ospf6_database_id_router_cmd, @@ -830,8 +789,7 @@ DEFUN (show_ipv6_ospf6_database_id_route "Display Link state database\n" "Any Link state Type\n" "Specify Link state ID as IPv4 address notation\n" - "Specify Advertising Router as IPv4 address notation\n" - ) + "Specify Advertising Router as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -845,8 +803,7 @@ DEFUN (show_ipv6_ospf6_database_id_route if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link state ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -855,8 +812,7 @@ DEFUN (show_ipv6_ospf6_database_id_route if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) { - vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Advertising Router is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -899,9 +855,7 @@ ALIAS (show_ipv6_ospf6_database_id_route "Specify Link state ID as IPv4 address notation\n" "Specify Advertising Router as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id, show_ipv6_ospf6_database_adv_router_linkstate_id_cmd, @@ -913,8 +867,7 @@ DEFUN (show_ipv6_ospf6_database_adv_rout "Search by Advertising Router\n" "Specify Advertising Router as IPv4 address notation\n" "Search by Link state ID\n" - "Specify Link state ID as IPv4 address notation\n" - ) + "Specify Link state ID as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -928,8 +881,7 @@ DEFUN (show_ipv6_ospf6_database_adv_rout if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) { - vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Advertising Router is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -938,8 +890,7 @@ DEFUN (show_ipv6_ospf6_database_adv_rout if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link state ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -983,9 +934,7 @@ ALIAS (show_ipv6_ospf6_database_adv_rout "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_type_id_router, show_ipv6_ospf6_database_type_id_router_cmd, @@ -1006,8 +955,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_ "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" "Specify Link state ID as IPv4 address notation\n" - "Specify Advertising Router as IPv4 address notation\n" - ) + "Specify Advertising Router as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -1026,8 +974,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_ if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link state ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -1036,8 +983,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_ if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) { - vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Advertising Router is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -1102,9 +1048,7 @@ ALIAS (show_ipv6_ospf6_database_type_id_ "Display Intra-Area-Prefix LSAs\n" "Specify Link state ID as IPv4 address notation\n" "Specify Advertising Router as IPv4 address notation\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd, @@ -1128,8 +1072,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv "Search by Advertising Router\n" "Specify Advertising Router as IPv4 address notation\n" "Search by Link state ID\n" - "Specify Link state ID as IPv4 address notation\n" - ) + "Specify Link state ID as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -1148,8 +1091,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) { - vty_out (vty, "Advertising Router is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Advertising Router is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -1158,8 +1100,7 @@ DEFUN (show_ipv6_ospf6_database_type_adv if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link state ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link state ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -1227,18 +1168,12 @@ ALIAS (show_ipv6_ospf6_database_type_adv "Specify Advertising Router as IPv4 address notation\n" "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_self_originated, show_ipv6_ospf6_database_self_originated_cmd, "show ipv6 ospf6 database self-originated", - SHOW_STR - IPV6_STR - OSPF6_STR - "Display Self-originated LSAs\n" - ) + SHOW_STR IPV6_STR OSPF6_STR "Display Self-originated LSAs\n") { int level; struct listnode *i, *j; @@ -1286,9 +1221,7 @@ ALIAS (show_ipv6_ospf6_database_self_ori "Display Self-originated LSAs\n" "Display details of LSAs\n" "Dump LSAs\n" - "Display LSA's internal information\n" - ) - + "Display LSA's internal information\n") DEFUN (show_ipv6_ospf6_database_type_self_originated, show_ipv6_ospf6_database_type_self_originated_cmd, "show ipv6 ospf6 database " @@ -1306,9 +1239,7 @@ DEFUN (show_ipv6_ospf6_database_type_sel "Display Group-Membership LSAs\n" "Display Type-7 LSAs\n" "Display Link LSAs\n" - "Display Intra-Area-Prefix LSAs\n" - "Display Self-originated LSAs\n" - ) + "Display Intra-Area-Prefix LSAs\n" "Display Self-originated LSAs\n") { int level; struct listnode *i, *j; @@ -1344,7 +1275,8 @@ DEFUN (show_ipv6_ospf6_database_type_sel { vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, oi->interface->name, oa->name, VNL, VNL); - ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); + ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, + oi->lsdb); } } break; @@ -1384,9 +1316,7 @@ ALIAS (show_ipv6_ospf6_database_type_sel "Display Intra-Area-Prefix LSAs\n" "Display Self-originated LSAs\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd, @@ -1409,8 +1339,7 @@ DEFUN (show_ipv6_ospf6_database_type_sel "Display Intra-Area-Prefix LSAs\n" "Display Self-originated LSAs\n" "Search by Link state ID\n" - "Specify Link state ID as IPv4 address notation\n" - ) + "Specify Link state ID as IPv4 address notation\n") { int level; struct listnode *i, *j; @@ -1429,8 +1358,7 @@ DEFUN (show_ipv6_ospf6_database_type_sel if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link State ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link State ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -1499,9 +1427,7 @@ ALIAS (show_ipv6_ospf6_database_type_sel "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_database_type_id_self_originated, show_ipv6_ospf6_database_type_id_self_originated_cmd, @@ -1522,8 +1448,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_ "Display Link LSAs\n" "Display Intra-Area-Prefix LSAs\n" "Specify Link state ID as IPv4 address notation\n" - "Display Self-originated LSAs\n" - ) + "Display Self-originated LSAs\n") { int level; struct listnode *i, *j; @@ -1542,8 +1467,7 @@ DEFUN (show_ipv6_ospf6_database_type_id_ if ((inet_pton (AF_INET, argv[0], &id)) != 1) { - vty_out (vty, "Link State ID is not parsable: %s%s", - argv[0], VNL); + vty_out (vty, "Link State ID is not parsable: %s%s", argv[0], VNL); return CMD_SUCCESS; } @@ -1612,19 +1536,13 @@ ALIAS (show_ipv6_ospf6_database_type_id_ "Search by Link state ID\n" "Specify Link state ID as IPv4 address notation\n" "Display details of LSAs\n" - "Dump LSAs\n" - "Display LSA's internal information\n" - ); + "Dump LSAs\n" "Display LSA's internal information\n"); DEFUN (show_ipv6_ospf6_border_routers, show_ipv6_ospf6_border_routers_cmd, "show ipv6 ospf6 border-routers", - SHOW_STR - IP6_STR - OSPF6_STR - "Display routing table for ABR and ASBR\n" - ) + SHOW_STR IP6_STR OSPF6_STR "Display routing table for ABR and ASBR\n") { u_int32_t adv_router; void (*showfunc) (struct vty *, struct ospf6_route *); @@ -1673,18 +1591,12 @@ ALIAS (show_ipv6_ospf6_border_routers, IP6_STR OSPF6_STR "Display routing table for ABR and ASBR\n" - "Specify Router-ID\n" - "Display Detail\n" - ); + "Specify Router-ID\n" "Display Detail\n"); DEFUN (show_ipv6_ospf6_linkstate, show_ipv6_ospf6_linkstate_cmd, "show ipv6 ospf6 linkstate", - SHOW_STR - IP6_STR - OSPF6_STR - "Display linkstate routing table\n" - ) + SHOW_STR IP6_STR OSPF6_STR "Display linkstate routing table\n") { struct listnode *node; struct ospf6_area *oa; @@ -1708,8 +1620,7 @@ ALIAS (show_ipv6_ospf6_linkstate, OSPF6_STR "Display linkstate routing table\n" "Display Router Entry\n" - "Specify Router ID as IPv4 address notation\n" - ); + "Specify Router ID as IPv4 address notation\n"); ALIAS (show_ipv6_ospf6_linkstate, show_ipv6_ospf6_linkstate_network_cmd, @@ -1720,17 +1631,12 @@ ALIAS (show_ipv6_ospf6_linkstate, "Display linkstate routing table\n" "Display Network Entry\n" "Specify Router ID as IPv4 address notation\n" - "Specify Link state ID as IPv4 address notation\n" - ); + "Specify Link state ID as IPv4 address notation\n"); DEFUN (show_ipv6_ospf6_linkstate_detail, show_ipv6_ospf6_linkstate_detail_cmd, "show ipv6 ospf6 linkstate detail", - SHOW_STR - IP6_STR - OSPF6_STR - "Display linkstate routing table\n" - ) + SHOW_STR IP6_STR OSPF6_STR "Display linkstate routing table\n") { const char *sargv[CMD_ARGC_MAX]; int i, sargc; @@ -1788,6 +1693,7 @@ ospf6_init () install_element_ospf6_debug_asbr (); install_element_ospf6_debug_abr (); install_element_ospf6_debug_flood (); + install_element_ospf6_debug_database (); install_element (VIEW_NODE, &show_version_ospf6_cmd); install_element (ENABLE_NODE, &show_version_ospf6_cmd); @@ -1888,4 +1794,36 @@ ospf6_init () thread_add_read (master, ospf6_receive, NULL, ospf6_sock); } +char * +ip2str (u_int32_t addr) +{ + static char str[16]; + unsigned char *ip; + ip = (unsigned char *) &addr; + sprintf (str, "%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); + return str; +} + +void +set_time (struct timeval *t) +{ + struct timeval now; + + gettimeofday (&now, (struct timezone *) NULL); + t->tv_sec = now.tv_sec; + t->tv_usec = now.tv_usec; + return; +} +float +elapsed_time (struct timeval *t) +{ + struct timeval now; + float T; + + gettimeofday (&now, (struct timezone *) NULL); + T = (float) (now.tv_sec - t->tv_sec) + + (float) (now.tv_usec - t->tv_usec) / 1000000; + + return T; +} --- quagga-0.99.9/ospf6d/ospf6d.conf.sample 2004-05-18 14:28:01.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6d.conf.sample 2008-04-16 11:55:52.000000000 -0700 @@ -9,16 +9,30 @@ service advanced-vty ! debug ospf6 neighbor state ! -interface fxp0 - ipv6 ospf6 cost 1 - ipv6 ospf6 hello-interval 10 - ipv6 ospf6 dead-interval 40 - ipv6 ospf6 retransmit-interval 5 - ipv6 ospf6 priority 0 + interface eth0 + ip address 10.0.0.10/32 + ipv6 address a::a/128 + ipv6 ospf6 priority 1 ipv6 ospf6 transmit-delay 1 ipv6 ospf6 instance-id 0 + ipv6 ospf6 ifmtu 1500 + ipv6 ospf6 cost 1 + ipv6 ospf6 hello-interval 2 + ipv6 ospf6 dead-interval 6 + ipv6 ospf6 retransmit-interval 5 + ipv6 ospf6 network manet-designated-router + ipv6 ospf6 ackinterval 1800 + ipv6 ospf6 diffhellos + ipv6 ospf6 backupwaitinterval 2000 + ipv6 ospf6 twohoprefresh 3 + ipv6 ospf6 hellorepeatcount 3 + ipv6 ospf6 adjacencyconnectivity biconnected + ipv6 ospf6 lsafullness mincostlsa + ipv6 ospf6 flood-delay 100 + ipv6 ospf6 smf_mdr_talk ! interface lo0 + ipv6 address 5f0a::/128 ipv6 ospf6 cost 1 ipv6 ospf6 hello-interval 10 ipv6 ospf6 dead-interval 40 @@ -26,11 +40,12 @@ interface lo0 ipv6 ospf6 priority 1 ipv6 ospf6 transmit-delay 1 ipv6 ospf6 instance-id 0 + ipv6 ospf6 network loopback ! router ospf6 router-id 255.1.1.1 redistribute static route-map static-ospf6 - interface fxp0 area 0.0.0.0 + interface eth0 area 0.0.0.0 ! access-list access4 permit 127.0.0.1/32 ! --- quagga-0.99.9/ospf6d/ospf6d.h 2007-02-05 06:15:17.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6d.h 2008-04-16 11:55:54.000000000 -0700 @@ -117,6 +117,12 @@ struct route_node *route_prev (struct ro void ospf6_debug (); void ospf6_init (); -#endif /* OSPF6D_H */ - +char *ip2str (u_int32_t addr); +void set_time (struct timeval *t); +float elapsed_time (struct timeval *t); + +typedef char boolean; +#define false 0 +#define true 1 +#endif /* OSPF6D_H */ --- quagga-0.99.9/ospf6d/ospf6_flood.c 2005-01-26 04:46:48.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_flood.c 2008-04-16 11:55:54.000000000 -0700 @@ -42,6 +42,10 @@ #include "ospf6_flood.h" + +#include "ospf6d.h" //for settime() +#include "ospf6_mdr.h" + unsigned char conf_debug_ospf6_flooding; struct ospf6_lsdb * @@ -108,10 +112,18 @@ ospf6_lsa_originate (struct ospf6_lsa *l return; } + set_time (&lsa->originated); + + /* store it in the LSDB for self-originated LSAs */ lsdb_self = ospf6_get_scoped_lsdb_self (lsa); ospf6_lsdb_add (ospf6_lsa_copy (lsa), lsdb_self); + if (IS_OSPF6_DEBUG_DATABASE (DATABASE_DETAIL)) + ospf6_debug_lsdb_show (OSPF6_DEBUG_DATABASE_DETAIL, lsdb_self); + else if (IS_OSPF6_DEBUG_DATABASE (DATABASE)) + ospf6_debug_lsdb_show (OSPF6_DEBUG_DATABASE, lsdb_self); + lsa->refresh = thread_add_timer (master, ospf6_lsa_refresh, lsa, LS_REFRESH_TIME); @@ -129,16 +141,14 @@ ospf6_lsa_originate (struct ospf6_lsa *l } void -ospf6_lsa_originate_process (struct ospf6_lsa *lsa, - struct ospf6 *process) +ospf6_lsa_originate_process (struct ospf6_lsa *lsa, struct ospf6 *process) { lsa->lsdb = process->lsdb; ospf6_lsa_originate (lsa); } void -ospf6_lsa_originate_area (struct ospf6_lsa *lsa, - struct ospf6_area *oa) +ospf6_lsa_originate_area (struct ospf6_lsa *lsa, struct ospf6_area *oa) { lsa->lsdb = oa->lsdb; ospf6_lsa_originate (lsa); @@ -236,9 +247,208 @@ ospf6_install_lsa (struct ospf6_lsa *lsa lsa->installed = now; ospf6_lsdb_add (lsa, lsa->lsdb); + + if (IS_OSPF6_DEBUG_DATABASE (DATABASE_DETAIL)) + ospf6_debug_lsdb_show (OSPF6_DEBUG_DATABASE_DETAIL, lsa->lsdb); + else if (IS_OSPF6_DEBUG_DATABASE (DATABASE)) + ospf6_debug_lsdb_show (OSPF6_DEBUG_DATABASE, lsa->lsdb); return; } +void +ospf6_flood_interface_mdr (struct ospf6_neighbor *from, + struct ospf6_lsa *lsa, struct ospf6_interface *oi) +{ + struct listnode *node, *nnode; + struct ospf6_neighbor *on; + struct ospf6_lsa *req; + int retrans_added = 0; + int is_debug = 0; + struct ospf6_mack *mack; + struct list *flood_neighbors = list_new (); + boolean flood_lsa = true; + + if (IS_OSPF6_DEBUG_FLOODING || + IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type)) + { + is_debug++; + zlog_debug ("Flooding on %s: %s", oi->interface->name, lsa->name); + } + + /* (1) For each neighbor */ + for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) + { + if (is_debug) + zlog_debug ("To neighbor %s", on->name); + + /* (a) if neighbor state < Exchange, examin next */ + // Consider adjacent and (backup) dependent neighbors. + // Require all bidirectional neighbors to be covered + if (on->state < OSPF6_NEIGHBOR_TWOWAY) + { + if (is_debug) + zlog_debug ("Neighbor state less than TwoWay, next neighbor"); + continue; + } + + /* (b) if neighbor not yet Full, check request-list */ + if (on->state >= OSPF6_NEIGHBOR_EXCHANGE && + on->state != OSPF6_NEIGHBOR_FULL) + { + if (is_debug) + zlog_debug ("Neighbor not yet Full"); + + req = ospf6_lsdb_lookup (lsa->header->type, lsa->header->id, + lsa->header->adv_router, on->request_list); + if (req == NULL) + { + if (is_debug) + zlog_debug ("Not on request-list for this neighbor"); + /* fall through */ + } + else + { + /* If new LSA less recent, examin next neighbor */ + if (ospf6_lsa_compare (lsa, req) > 0) + { + if (is_debug) + zlog_debug ("Requesting is newer, next neighbor"); + continue; + } + + /* If the same instance, delete from request-list and + examin next neighbor */ + if (ospf6_lsa_compare (lsa, req) == 0) + { + if (is_debug) + zlog_debug + ("Requesting the same, remove it, next neighbor"); + ospf6_lsdb_remove (req, on->request_list); + continue; + } + + /* If the new LSA is more recent, delete from request-list */ + if (ospf6_lsa_compare (lsa, req) < 0) + { + if (is_debug) + zlog_debug ("Received is newer, remove requesting"); + ospf6_lsdb_remove (req, on->request_list); + /* fall through */ + } + } + } + + /* (c) If the new LSA was received from this neighbor, + examin next neighbor */ + if (from == on) + { + if (is_debug) + zlog_debug ("Received is from the neighbor, next neighbor"); + continue; + } + + //Ogierv3 Section 6 Par 3 + /* At this point, we are not positive that the neighbor has + an up-to-date instance of this new LSA */ + /* However, in the MANET case, we need to: + i) check whether neighbor sent a multicast ACK for it already + ii) whether I am an active relay for this originator */ + /* Has LSA been acked previously with multicast ack? */ + mack = ospf6_lookup_mack (on, lsa->header); + if (mack) + { //Don't add LSA to neighbor's retransmission list + continue; // examine next neighbor: neighbor already acked + } + /* Here, checking for coverage of this neighbor on the sender's RNL. + If not present, I add this to the flood_neighbors list. + If LSA was received as a unicast, however, can't assume that + neighbor "on" was covered by the transmission, so still need to + add to flood_neighbors regardless of from->rnl */ + if (from) + { + if (!from->Report2Hop || + (!CHECK_FLAG (lsa->flag, OSPF6_LSA_RECVMCAST)) || + !ospf6_mdr_lookup_neighbor (from->rnl, on->router_id)) + { + listnode_add (flood_neighbors, on); + } + } + + // Retransmit only to adjacent neighbors. + if (on->state < OSPF6_NEIGHBOR_EXCHANGE) + continue; + + /* (d) add retrans-list, schedule retransmission */ + if (is_debug) + zlog_debug ("Add retrans-list of this neighbor"); + ospf6_increment_retrans_count (lsa); + + set_time (&lsa->rxmt_time); + ospf6_lsdb_add (ospf6_lsa_copy (lsa), on->retrans_list); + on->thread_send_lsupdate = + ospf6_send_lsupdate_delayed_msec (master, + ospf6_lsupdate_send_neighbor, on, + oi->rxmt_interval * 1000, + on->thread_send_lsupdate); + retrans_added++; + } + /* (2) examin next interface if not added to retrans-list */ + // MDRs can flood an LSA without adding it to the retrans-list + + //Ogierv3 Section 6 - Remove (3) and (4) + + //Ogierv3 Section 6 - Replace (5) + //Ogierv3 Forwarding Procedure bullet(a) + if (from && oi->mdr_level == OSPF6_MDR) + { + //Flood the LSA unless all neighbors are already covered + if (flood_neighbors->count == 0) + flood_lsa = false; + else if (oi->nonflooding_mdr) + { + // Non-flooding MDR acts like a BMDR. + for (ALL_LIST_ELEMENTS (flood_neighbors, node, nnode, on)) + ospf6_backupwait_lsa_add (lsa, on); + flood_lsa = false; + } + } + //Ogierv3 Forwarding Procedure bullet(c) + else if (from && oi->mdr_level == OSPF6_BMDR) + { + //Don't Flood the LSA now, but backup the uncovered neighbors + for (ALL_LIST_ELEMENTS (flood_neighbors, node, nnode, on)) + ospf6_backupwait_lsa_add (lsa, on); + flood_lsa = false; + } + else if (from && oi->mdr_level == OSPF6_OTHER) + { + //OTHER routers do not flood + flood_lsa = false; + } + + list_delete (flood_neighbors); + + if (!flood_lsa) + { + return; + } + + if (from && from->ospf6_if == oi) + SET_FLAG (lsa->flag, OSPF6_LSA_FLOODBACK); + + /* (5) flood the LSA out the interface. */ + if (is_debug) + zlog_debug ("Schedule flooding for the interface"); + + + ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsupdate_list); + + oi->thread_send_lsupdate = + ospf6_send_lsupdate_delayed_msec (master, ospf6_lsupdate_send_interface, + oi, oi->flood_delay, + oi->thread_send_lsupdate); +} + /* RFC2740 section 3.5.2. Sending Link State Update packets */ /* RFC2328 section 13.3 Next step in the flooding procedure */ void @@ -251,6 +461,15 @@ ospf6_flood_interface (struct ospf6_neig int retrans_added = 0; int is_debug = 0; + if (oi->type == OSPF6_IFTYPE_LOOPBACK) + return; + + if (oi->type == OSPF6_IFTYPE_MDR) + { + ospf6_flood_interface_mdr (from, lsa, oi); + return; + } + if (IS_OSPF6_DEBUG_FLOODING || IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type)) { @@ -301,7 +520,8 @@ ospf6_flood_interface (struct ospf6_neig if (ospf6_lsa_compare (lsa, req) == 0) { if (is_debug) - zlog_debug ("Requesting the same, remove it, next neighbor"); + zlog_debug + ("Requesting the same, remove it, next neighbor"); ospf6_lsdb_remove (req, on->request_list); continue; } @@ -330,11 +550,14 @@ ospf6_flood_interface (struct ospf6_neig if (is_debug) zlog_debug ("Add retrans-list of this neighbor"); ospf6_increment_retrans_count (lsa); + + set_time (&lsa->rxmt_time); ospf6_lsdb_add (ospf6_lsa_copy (lsa), on->retrans_list); - if (on->thread_send_lsupdate == NULL) on->thread_send_lsupdate = - thread_add_timer (master, ospf6_lsupdate_send_neighbor, - on, on->ospf6_if->rxmt_interval); + ospf6_send_lsupdate_delayed_msec (master, + ospf6_lsupdate_send_neighbor, on, + oi->rxmt_interval * 1000, + on->thread_send_lsupdate); retrans_added++; } @@ -364,25 +587,36 @@ ospf6_flood_interface (struct ospf6_neig zlog_debug ("Received is from the I/F, itself BDR, next interface"); return; } + if (from && from->ospf6_if == oi) + SET_FLAG (lsa->flag, OSPF6_LSA_FLOODBACK); /* (5) flood the LSA out the interface. */ if (is_debug) zlog_debug ("Schedule flooding for the interface"); - if (if_is_broadcast (oi->interface)) + + + if (oi->type == OSPF6_IFTYPE_BROADCAST || + oi->type == OSPF6_IFTYPE_MDR || + oi->type == OSPF6_IFTYPE_POINTOMULTIPOINT || + oi->type == OSPF6_IFTYPE_NBMA) { ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsupdate_list); - if (oi->thread_send_lsupdate == NULL) oi->thread_send_lsupdate = - thread_add_event (master, ospf6_lsupdate_send_interface, oi, 0); + ospf6_send_lsupdate_delayed_msec (master, + ospf6_lsupdate_send_interface, oi, + oi->flood_delay, + oi->thread_send_lsupdate); } else { /* reschedule retransmissions to all neighbors */ for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) { - THREAD_OFF (on->thread_send_lsupdate); on->thread_send_lsupdate = - thread_add_event (master, ospf6_lsupdate_send_neighbor, on, 0); + ospf6_send_lsupdate_delayed_msec (master, + ospf6_lsupdate_send_neighbor, + on, oi->flood_delay, + on->thread_send_lsupdate); } } } @@ -441,11 +675,13 @@ ospf6_flood (struct ospf6_neighbor *from } void -ospf6_flood_clear_interface (struct ospf6_lsa *lsa, struct ospf6_interface *oi) +ospf6_flood_clear_interface (struct ospf6_lsa *lsa, + struct ospf6_interface *oi) { struct listnode *node, *nnode; struct ospf6_neighbor *on; struct ospf6_lsa *rem; + struct ospf6_lsa *update; for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) { @@ -460,6 +696,16 @@ ospf6_flood_clear_interface (struct ospf ospf6_decrement_retrans_count (rem); ospf6_lsdb_remove (rem, on->retrans_list); } + //remove stale LSA from neighbor update list + update = ospf6_lsdb_lookup (lsa->header->type, lsa->header->id, + lsa->header->adv_router, on->lsupdate_list); + if (update && ospf6_lsa_compare (update, lsa) == 0) + { //update is a stale lsa + if (IS_OSPF6_DEBUG_FLOODING) + zlog_info ("Remove %s from neighbor lsupdate_list of %s", + update->name, on->name); + ospf6_lsdb_remove (update, on->lsupdate_list); + } } } @@ -468,6 +714,7 @@ ospf6_flood_clear_area (struct ospf6_lsa { struct listnode *node, *nnode; struct ospf6_interface *oi; + struct ospf6_lsa *update; for (ALL_LIST_ELEMENTS (oa->if_list, node, nnode, oi)) { @@ -482,6 +729,16 @@ ospf6_flood_clear_area (struct ospf6_lsa #endif/*0*/ ospf6_flood_clear_interface (lsa, oi); + //remove stale LSA from interface update list + update = ospf6_lsdb_lookup (lsa->header->type, lsa->header->id, + lsa->header->adv_router, oi->lsupdate_list); + if (update && ospf6_lsa_compare (update, lsa) == 0) + { //update is a stale lsa + if (IS_OSPF6_DEBUG_FLOODING) + zlog_info ("Remove %s from interface lsupdate_list", + update->name); + ospf6_lsdb_remove (update, oi->lsupdate_list); + } } } @@ -511,6 +768,7 @@ ospf6_flood_clear_process (struct ospf6_ void ospf6_flood_clear (struct ospf6_lsa *lsa) { + ospf6_backupwait_lsa_delete (lsa); ospf6_flood_clear_process (lsa, ospf6); } @@ -522,6 +780,7 @@ ospf6_acknowledge_lsa_bdrouter (struct o { struct ospf6_interface *oi; int is_debug = 0; + struct ospf6_lsa *lsa_ack; if (IS_OSPF6_DEBUG_FLOODING || IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type)) @@ -548,12 +807,22 @@ ospf6_acknowledge_lsa_bdrouter (struct o if (oi->drouter == from->router_id) { if (is_debug) - zlog_debug ("Delayed acknowledgement (BDR & MoreRecent & from DR)"); + zlog_debug + ("Delayed acknowledgement (BDR & MoreRecent & from DR)"); /* Delayed acknowledgement */ ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list); if (oi->thread_send_lsack == NULL) + { + // Remove "3" magic number -- send ACK after ackInterval + if (oi->type == OSPF6_IFTYPE_MDR) oi->thread_send_lsack = - thread_add_timer (master, ospf6_lsack_send_interface, oi, 3); + thread_add_timer_msec (master, ospf6_lsack_send_interface, + oi, oi->ackInterval); + else + oi->thread_send_lsack = + thread_add_timer (master, ospf6_lsack_send_interface, oi, + 3); + } } else { @@ -572,17 +841,28 @@ ospf6_acknowledge_lsa_bdrouter (struct o if (oi->drouter == from->router_id) { if (is_debug) - zlog_debug ("Delayed acknowledgement (BDR & Duplicate & ImpliedAck & from DR)"); + zlog_debug + ("Delayed acknowledgement (BDR & Duplicate & ImpliedAck & from DR)"); /* Delayed acknowledgement */ ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list); if (oi->thread_send_lsack == NULL) + { + // Remove "3" magic number -- send ACK after ackInterval + if (oi->type == OSPF6_IFTYPE_MDR) oi->thread_send_lsack = - thread_add_timer (master, ospf6_lsack_send_interface, oi, 3); + thread_add_timer_msec (master, ospf6_lsack_send_interface, + oi, oi->ackInterval); + else + oi->thread_send_lsack = + thread_add_timer (master, ospf6_lsack_send_interface, oi, + 3); + } } else { if (is_debug) - zlog_debug ("No acknowledgement (BDR & Duplicate & ImpliedAck & ! from DR)"); + zlog_debug + ("No acknowledgement (BDR & Duplicate & ImpliedAck & ! from DR)"); } return; } @@ -594,10 +874,23 @@ ospf6_acknowledge_lsa_bdrouter (struct o { if (is_debug) zlog_debug ("Direct acknowledgement (BDR & Duplicate)"); + // This is implementing multicast ACK + /// Delay by ackInterval for coalescing ACKs + if (oi->type == OSPF6_IFTYPE_MDR) + { + ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list); + if (oi->thread_send_lsack == NULL) + oi->thread_send_lsack = + thread_add_timer_msec (master, ospf6_lsack_send_interface, + oi, oi->ackInterval); + } + else + { ospf6_lsdb_add (ospf6_lsa_copy (lsa), from->lsack_list); if (from->thread_send_lsack == NULL) from->thread_send_lsack = thread_add_event (master, ospf6_lsack_send_neighbor, from, 0); + } return; } @@ -610,10 +903,12 @@ ospf6_acknowledge_lsa_bdrouter (struct o static void ospf6_acknowledge_lsa_allother (struct ospf6_lsa *lsa, int ismore_recent, - struct ospf6_neighbor *from) + struct ospf6_neighbor *from, + struct in6_addr *dst) { struct ospf6_interface *oi; int is_debug = 0; + struct ospf6_lsa *lsa_ack; if (IS_OSPF6_DEBUG_FLOODING || IS_OSPF6_DEBUG_FLOOD_TYPE (lsa->header->type)) @@ -638,10 +933,67 @@ ospf6_acknowledge_lsa_allother (struct o if (is_debug) zlog_debug ("Delayed acknowledgement (AllOther & MoreRecent)"); /* Delayed acknowledgement */ - ospf6_lsdb_add (ospf6_lsa_copy (lsa), oi->lsack_list); + lsa_ack = ospf6_lsa_copy (lsa); + set_time (&lsa_ack->rxmt_time); + ospf6_lsdb_add (lsa_ack, oi->lsack_list); if (oi->thread_send_lsack == NULL) + { + // Remove "3" magic number -- send ACK after ackInterval + if (oi->type == OSPF6_IFTYPE_MDR) + oi->thread_send_lsack = + thread_add_timer_msec (master, ospf6_lsack_send_interface, + oi, oi->ackInterval); + else oi->thread_send_lsack = thread_add_timer (master, ospf6_lsack_send_interface, oi, 3); + } + return; + } + + if (oi->type == OSPF6_IFTYPE_MDR) + { + /* LSA is a duplicate */ + if (CHECK_FLAG (lsa->flag, OSPF6_LSA_DUPLICATE)) + { + //only acknowledge the first arrival of the lsa + if (IN6_IS_ADDR_MULTICAST (dst)) + return; //NO ACK + if (is_debug) + zlog_debug ("Direct acknowledgement (AllOther & Duplicate)"); + + lsa_ack = ospf6_lsdb_lookup (lsa->header->type, lsa->header->id, + lsa->header->adv_router, + oi->lsack_list); + // Add LSA to lsack_list only if it is not already on list, + // to keep same transmission time. + if (!lsa_ack) + { + lsa_ack = ospf6_lsa_copy (lsa); + set_time (&lsa_ack->rxmt_time); + ospf6_lsdb_add (lsa_ack, oi->lsack_list); + } + + // SICDS sends a multicast ACK immediately if full adjacencies + // are used, or router is MDR, or biconnected adjacencies are + // used and router is BMDR. + if (oi->AdjConnectivity == OSPF6_ADJ_FULLYCONNECTED || + oi->mdr_level == OSPF6_MDR || oi->mdr_level == OSPF6_BMDR && + oi->AdjConnectivity == OSPF6_ADJ_BICONNECTED) + { + timerclear (&lsa_ack->rxmt_time); // To send immediately. + if (oi->thread_send_lsack) + THREAD_OFF (oi->thread_send_lsack); + oi->thread_send_lsack = + thread_add_timer_msec (master, ospf6_lsack_send_interface, oi, + 0); + } + else if (oi->thread_send_lsack == NULL) + { + oi->thread_send_lsack = + thread_add_timer_msec (master, ospf6_lsack_send_interface, + oi, oi->ackInterval); + } + } return; } @@ -678,7 +1030,7 @@ ospf6_acknowledge_lsa_allother (struct o void ospf6_acknowledge_lsa (struct ospf6_lsa *lsa, int ismore_recent, - struct ospf6_neighbor *from) + struct ospf6_neighbor *from, struct in6_addr *dst) { struct ospf6_interface *oi; @@ -688,7 +1040,7 @@ ospf6_acknowledge_lsa (struct ospf6_lsa if (oi->state == OSPF6_INTERFACE_BDR) ospf6_acknowledge_lsa_bdrouter (lsa, ismore_recent, from); else - ospf6_acknowledge_lsa_allother (lsa, ismore_recent, from); + ospf6_acknowledge_lsa_allother (lsa, ismore_recent, from, dst); } /* RFC2328 section 13 (4): @@ -728,8 +1080,8 @@ ospf6_is_maxage_lsa_drop (struct ospf6_l /* RFC2328 section 13 The Flooding Procedure */ void -ospf6_receive_lsa (struct ospf6_neighbor *from, - struct ospf6_lsa_header *lsa_header) +ospf6_receive_lsa (struct ospf6_lsa_header *lsa_header, + struct ospf6_neighbor *from, struct in6_addr *dst) { struct ospf6_lsa *new = NULL, *old = NULL, *rem = NULL; int ismore_recent; @@ -766,7 +1118,8 @@ ospf6_receive_lsa (struct ospf6_neighbor OSPF6_LSA_SCOPE (new->header->type) == OSPF6_SCOPE_AS) { if (is_debug) - zlog_debug ("AS-External-LSA (or AS-scope LSA) in stub area, discard"); + zlog_debug + ("AS-External-LSA (or AS-scope LSA) in stub area, discard"); ospf6_lsa_delete (new); return; } @@ -793,6 +1146,11 @@ ospf6_receive_lsa (struct ospf6_neighbor return; } + /* If LSA was received as multicast, flag it (for later flooding decisions) */ + if (IN6_IS_ADDR_MULTICAST (dst)) + SET_FLAG (new->flag, OSPF6_LSA_RECVMCAST); + + /* (4) if MaxAge LSA and if we have no instance, and no neighbor is in states Exchange or Loading */ if (ospf6_is_maxage_lsa_drop (new, from)) @@ -802,10 +1160,23 @@ ospf6_receive_lsa (struct ospf6_neighbor zlog_debug ("Drop MaxAge LSA with direct acknowledgement."); /* a) Acknowledge back to neighbor (Direct acknowledgement, 13.5) */ + if (from->ospf6_if->type == OSPF6_IFTYPE_MDR) + { + ospf6_lsdb_add (ospf6_lsa_copy (new), from->ospf6_if->lsack_list); + if (from->ospf6_if->thread_send_lsack == NULL) + from->ospf6_if->thread_send_lsack = + thread_add_timer_msec (master, + ospf6_lsack_send_interface, + from->ospf6_if, + from->ospf6_if->ackInterval); + } + else + { ospf6_lsdb_add (ospf6_lsa_copy (new), from->lsack_list); if (from->thread_send_lsack == NULL) from->thread_send_lsack = thread_add_event (master, ospf6_lsack_send_neighbor, from, 0); + } /* b) Discard */ ospf6_lsa_delete (new); @@ -827,6 +1198,8 @@ ospf6_receive_lsa (struct ospf6_neighbor } } + ospf6_store_mack (from, new->header); + /* if no database copy or received is more recent */ if (old == NULL || ismore_recent < 0) { @@ -839,10 +1212,11 @@ ospf6_receive_lsa (struct ospf6_neighbor struct timeval now, res; gettimeofday (&now, (struct timezone *) NULL); timersub (&now, &old->installed, &res); - if (res.tv_sec < MIN_LS_ARRIVAL) + if (res.tv_sec < from->ospf6_if->area->ospf6->minLSArrival) { if (is_debug) - zlog_debug ("LSA can't be updated within MinLSArrival, discard"); + zlog_debug + ("LSA can't be updated within MinLSArrival, discard"); ospf6_lsa_delete (new); return; /* examin next lsa */ } @@ -869,7 +1243,7 @@ ospf6_receive_lsa (struct ospf6_neighbor ospf6_install_lsa (new); /* (e) possibly acknowledge */ - ospf6_acknowledge_lsa (new, ismore_recent, from); + ospf6_acknowledge_lsa (new, ismore_recent, from, dst); /* (f) Self Originated LSA, section 13.4 */ if (new->header->adv_router == from->ospf6_if->area->ospf6->router_id) @@ -897,7 +1271,8 @@ ospf6_receive_lsa (struct ospf6_neighbor if (is_debug) { - zlog_debug ("Received is not newer, on the neighbor's request-list"); + zlog_debug + ("Received is not newer, on the neighbor's request-list"); zlog_debug ("BadLSReq, discard the received LSA"); } @@ -914,6 +1289,34 @@ ospf6_receive_lsa (struct ospf6_neighbor if (is_debug) zlog_debug ("The same instance as database copy (neither recent)"); + if (from->ospf6_if->type == OSPF6_IFTYPE_MDR && + old->backupWaitTimer && ospf6_lsa_compare (new, old) == 0) + { + struct listnode *node, *nnode; + u_int32_t *id; + struct ospf6_neighbor *neigh; + + //remove sender from backupwait list + ospf6_backupwait_lsa_neighbor_delete (old, from); + //loop over neighbor neighbors + //RGO-- enforce that LSA was received as multicast-- otherwise, + // cannot assume that sender's neighbors received + if (IN6_IS_ADDR_MULTICAST (dst)) + { + for (ALL_LIST_ELEMENTS (from->rnl, node, nnode, id)) + { + if (!old->backupWaitTimer) + break; + if (*id == from->ospf6_if->area->ospf6->router_id) + continue; + neigh = ospf6_neighbor_lookup (*id, from->ospf6_if); + //remove sender's neighbors from backupwait list + if (neigh) + ospf6_backupwait_lsa_neighbor_delete (old, neigh); + } + } + } + /* (a) if on retrans-list, Treat this LSA as an Ack: Implied Ack */ rem = ospf6_lsdb_lookup (new->header->type, new->header->id, new->header->adv_router, from->retrans_list); @@ -933,7 +1336,7 @@ ospf6_receive_lsa (struct ospf6_neighbor zlog_debug ("Possibly acknowledge and then discard"); /* (b) possibly acknowledge */ - ospf6_acknowledge_lsa (new, ismore_recent, from); + ospf6_acknowledge_lsa (new, ismore_recent, from, dst); ospf6_lsa_delete (new); return; @@ -957,6 +1360,15 @@ ospf6_receive_lsa (struct ospf6_neighbor return; } + // SICDS does not send LSA to non-adjacent neighbor here. + if (from->ospf6_if->type == OSPF6_IFTYPE_MDR && + from->state < OSPF6_NEIGHBOR_EXCHANGE) + { + zlog_debug ("MDR does not send LSA to non-adjacent neighbor here."); + ospf6_lsa_delete (new); + return; + } + /* Otherwise, Send database copy of this LSA to this neighbor */ { if (is_debug) @@ -967,10 +1379,21 @@ ospf6_receive_lsa (struct ospf6_neighbor /* XXX, MinLSArrival check !? RFC 2328 13 (8) */ + // suppressing stale LSA responses + // when the LSA will be sent pushBack algorithm + if (old->backupWaitTimer) + { + ospf6_lsa_delete (new); + return; + } + ospf6_lsdb_add (ospf6_lsa_copy (old), from->lsupdate_list); - if (from->thread_send_lsupdate == NULL) + from->thread_send_lsupdate = - thread_add_event (master, ospf6_lsupdate_send_neighbor, from, 0); + ospf6_send_lsupdate_delayed_msec (master, + ospf6_lsupdate_send_neighbor, from, + from->ospf6_if->flood_delay, + from->thread_send_lsupdate); ospf6_lsa_delete (new); return; } @@ -982,10 +1405,7 @@ ospf6_receive_lsa (struct ospf6_neighbor DEFUN (debug_ospf6_flooding, debug_ospf6_flooding_cmd, "debug ospf6 flooding", - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 flooding function\n" - ) + DEBUG_STR OSPF6_STR "Debug OSPFv3 flooding function\n") { OSPF6_DEBUG_FLOODING_ON (); return CMD_SUCCESS; @@ -994,11 +1414,7 @@ DEFUN (debug_ospf6_flooding, DEFUN (no_debug_ospf6_flooding, no_debug_ospf6_flooding_cmd, "no debug ospf6 flooding", - NO_STR - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 flooding function\n" - ) + NO_STR DEBUG_STR OSPF6_STR "Debug OSPFv3 flooding function\n") { OSPF6_DEBUG_FLOODING_OFF (); return CMD_SUCCESS; --- quagga-0.99.9/ospf6d/ospf6_flood.h 2004-09-02 02:27:59.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_flood.h 2008-04-16 11:55:54.000000000 -0700 @@ -39,8 +39,7 @@ struct ospf6_lsdb *ospf6_get_scoped_lsdb void ospf6_lsa_originate (struct ospf6_lsa *lsa); void ospf6_lsa_originate_process (struct ospf6_lsa *lsa, struct ospf6 *process); -void ospf6_lsa_originate_area (struct ospf6_lsa *lsa, - struct ospf6_area *oa); +void ospf6_lsa_originate_area (struct ospf6_lsa *lsa, struct ospf6_area *oa); void ospf6_lsa_originate_interface (struct ospf6_lsa *lsa, struct ospf6_interface *oi); void ospf6_lsa_purge (struct ospf6_lsa *lsa); @@ -54,8 +53,8 @@ void ospf6_flood_clear (struct ospf6_lsa void ospf6_flood (struct ospf6_neighbor *from, struct ospf6_lsa *lsa); /* receive & install */ -void ospf6_receive_lsa (struct ospf6_neighbor *from, - struct ospf6_lsa_header *header); +void ospf6_receive_lsa (struct ospf6_lsa_header *header, + struct ospf6_neighbor *from, struct in6_addr *dst); void ospf6_install_lsa (struct ospf6_lsa *lsa); int config_write_ospf6_debug_flood (struct vty *vty); --- quagga-0.99.9/ospf6d/ospf6_ghc.c 1969-12-31 16:00:00.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_ghc.c 2008-04-16 11:55:54.000000000 -0700 @@ -0,0 +1,6 @@ +/* + * Copyright (C) Boeing Co. + */ + +#include + --- quagga-0.99.9/ospf6d/ospf6_ghc.h 1969-12-31 16:00:00.000000000 -0800 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_ghc.h 2008-04-16 11:55:54.000000000 -0700 @@ -0,0 +1,9 @@ +/* + * Copyright (C) 2005 Boeing + */ + +#ifndef OSPF6_GHC_H +#define OSPF6_GHC_H + + +#endif /* OSPF6_GHC_H */ --- quagga-0.99.9/ospf6d/ospf6_interface.c 2006-05-15 03:43:52.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_interface.c 2008-04-16 11:55:54.000000000 -0700 @@ -41,11 +41,15 @@ #include "ospf6_intra.h" #include "ospf6_spf.h" #include "ospf6d.h" +#include "ospf6_proto.h" +#include "ospf6_mdr.h" + + + unsigned char conf_debug_ospf6_interface = 0; -const char *ospf6_interface_state_str[] = -{ +const char *ospf6_interface_state_str[] = { "None", "Down", "Loopback", @@ -79,7 +83,8 @@ ospf6_interface_lsdb_hook (struct ospf6_ { case OSPF6_LSTYPE_LINK: if (OSPF6_INTERFACE (lsa->lsdb->data)->state == OSPF6_INTERFACE_DR) - OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (OSPF6_INTERFACE (lsa->lsdb->data)); + OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT (OSPF6_INTERFACE + (lsa->lsdb->data)); ospf6_spf_schedule (OSPF6_INTERFACE (lsa->lsdb->data)->area); break; @@ -121,9 +127,36 @@ ospf6_interface_create (struct interface oi->state = OSPF6_INTERFACE_DOWN; oi->flag = 0; + + oi->ackInterval = 1000; + oi->ack_cache_timeout = 100; //Sec + oi->diff_hellos = false; + oi->BackupWaitInterval = 500; //msec ( > flood_delay + prop delay) + oi->TwoHopRefresh = 3; + oi->HelloRepeatCount = 3; + oi->AdjConnectivity = OSPF6_ADJ_UNICONNECTED; + oi->LSAFullness = OSPF6_LSA_FULLNESS_MINCOST; + oi->MDRConstraint = 3; // constraint h for MPN, should be 2 or 3. + + + oi->flood_delay = 100; //msec + + + + if (if_is_broadcast (ifp)) + oi->type = OSPF6_IFTYPE_BROADCAST; + else if (if_is_pointopoint (ifp)) + oi->type = OSPF6_IFTYPE_POINTOPOINT; + else if (if_is_loopback (ifp)) + oi->type = OSPF6_IFTYPE_LOOPBACK; + else + oi->type = OSPF6_IFTYPE_BROADCAST; + /* Try to adjust I/O buffer size with IfMtu */ oi->ifmtu = ifp->mtu6; - iobuflen = ospf6_iobuf_size (ifp->mtu6); + // RGO. Sometimes an OSPF packet must exceed MTU, so make iobuflen + // twice as large as MTU. + iobuflen = ospf6_iobuf_size (2 * ifp->mtu6); if (oi->ifmtu > iobuflen) { if (IS_OSPF6_DEBUG_INTERFACE) @@ -139,7 +172,8 @@ ospf6_interface_create (struct interface oi->lsdb->hook_remove = ospf6_interface_lsdb_hook; oi->lsdb_self = ospf6_lsdb_create (oi); - oi->route_connected = OSPF6_ROUTE_TABLE_CREATE (INTERFACE, CONNECTED_ROUTES); + oi->route_connected = + OSPF6_ROUTE_TABLE_CREATE (INTERFACE, CONNECTED_ROUTES); oi->route_connected->scope = oi; /* link both */ @@ -160,6 +194,18 @@ ospf6_interface_delete (struct ospf6_int list_delete (oi->neighbor_list); + if (oi->type == OSPF6_IFTYPE_MDR) + { + if (oi->lnl) + { + struct ospf6_lnl_element *lnl_element; + //lnl + for (ALL_LIST_ELEMENTS (oi->lnl, node, nnode, lnl_element)) + free (lnl_element); + list_delete (oi->lnl); + } + } + THREAD_OFF (oi->thread_send_hello); THREAD_OFF (oi->thread_send_lsupdate); THREAD_OFF (oi->thread_send_lsack); @@ -191,8 +238,7 @@ ospf6_interface_enable (struct ospf6_int { UNSET_FLAG (oi->flag, OSPF6_INTERFACE_DISABLE); - oi->thread_send_hello = - thread_add_event (master, ospf6_hello_send, oi, 0); + oi->thread_send_hello = thread_add_event (master, ospf6_hello_send, oi, 0); } void @@ -233,7 +280,10 @@ ospf6_interface_get_linklocal_address (s /* linklocal scope check */ if (IN6_IS_ADDR_LINKLOCAL (&c->address->u.prefix6)) + { l = &c->address->u.prefix6; + break; + } } return l; } @@ -251,7 +301,10 @@ ospf6_interface_if_add (struct interface /* Try to adjust I/O buffer size with IfMtu */ if (oi->ifmtu == 0) oi->ifmtu = ifp->mtu6; - iobuflen = ospf6_iobuf_size (ifp->mtu6); + + // RGO. Sometimes an OSPF packet must exceed MTU, so make iobuflen + // twice as large as MTU. + iobuflen = ospf6_iobuf_size (2 * ifp->mtu6); if (oi->ifmtu > iobuflen) { if (IS_OSPF6_DEBUG_INTERFACE) @@ -322,6 +375,8 @@ ospf6_interface_connected_route_update ( /* reset linklocal pointer */ oi->linklocal_addr = ospf6_interface_get_linklocal_address (ifp); + oi->linklocal_addr_ipv4 = oi->linklocal_addr; + /* if area is null, do not make connected-route list */ if (oi->area == NULL) return; @@ -331,11 +386,77 @@ ospf6_interface_connected_route_update ( for (ALL_LIST_ELEMENTS (oi->interface->connected, node, nnode, c)) { - if (c->address->family != AF_INET6) + +//IPv4 Address Family + if (is_af_ipv4_unicast (oi) || is_af_ipv4_multicast (oi)) + { + if (c->address->family != AF_INET) //AF_INET = 2 + continue; + + //remove loopback interfaces + CONTINUE_IF_V4_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE, + c->address); + + /* apply filter */ + if (oi->plist_name) + { + struct prefix_list *plist; + enum prefix_list_type ret; + char buf[128]; + + prefix2str (c->address, buf, sizeof (buf)); + plist = prefix_list_lookup (AFI_IP, oi->plist_name); + ret = prefix_list_apply (plist, (void *) c->address); + if (ret == PREFIX_DENY) + { + if (IS_OSPF6_DEBUG_INTERFACE) + zlog_debug ("%s on %s filtered by prefix-list %s ", + buf, oi->interface->name, oi->plist_name); + continue; + } + } + route = ospf6_route_create (); + memcpy (&route->prefix, c->address, sizeof (struct prefix)); + +#ifdef GNU_LINUX + // move IPv4 address to the end of the IPv6 prefix + memcpy (&(route->prefix.u.prefix6.in6_u.u6_addr8[12]), + route->prefix.u.prefix6.in6_u.u6_addr8, 4); + memset (route->prefix.u.prefix6.in6_u.u6_addr8, 0, 4); // */ +#else + memcpy (&(route->prefix.u.prefix6.__u6_addr.__u6_addr8[12]), + route->prefix.u.prefix6.__u6_addr.__u6_addr8, 4); + memset (route->prefix.u.prefix6.__u6_addr.__u6_addr8, 0, 4); +#endif //GNU_LINUX + + //AF draft 05 Sec 2.5 - linklocal address should be the IPv4 address + //Set the linklocal address used in the link_lsa. + oi->linklocal_addr_ipv4 = &route->prefix.u.prefix6; + + //set the prefix to IPv6 + route->prefix.family = AF_INET6; + + //set the mask to an IPv6 mask + route->prefix.prefixlen = 128 - (32 - route->prefix.prefixlen); + + route->type = OSPF6_DEST_TYPE_NETWORK; + route->path.area_id = oi->area->area_id; + route->path.type = OSPF6_PATH_TYPE_INTRA; + route->path.cost = oi->cost; + route->nexthop[0].ifindex = oi->interface->ifindex; + inet_pton (AF_INET6, "::127.0.0.1", &route->nexthop[0].address); + ospf6_route_add (route, oi->route_connected); + } +//IPv6 Address Family + else if (is_af_ipv6_unicast (oi) || is_af_ipv6_multicast (oi)) + { + if (c->address->family != AF_INET6) //AF_INET6 = 10 continue; - CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE, c->address); - CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE, c->address); + CONTINUE_IF_ADDRESS_LINKLOCAL (IS_OSPF6_DEBUG_INTERFACE, + c->address); + CONTINUE_IF_ADDRESS_UNSPECIFIED (IS_OSPF6_DEBUG_INTERFACE, + c->address); CONTINUE_IF_ADDRESS_LOOPBACK (IS_OSPF6_DEBUG_INTERFACE, c->address); CONTINUE_IF_ADDRESS_V4COMPAT (IS_OSPF6_DEBUG_INTERFACE, c->address); CONTINUE_IF_ADDRESS_V4MAPPED (IS_OSPF6_DEBUG_INTERFACE, c->address); @@ -358,10 +479,8 @@ ospf6_interface_connected_route_update ( continue; } } - route = ospf6_route_create (); memcpy (&route->prefix, c->address, sizeof (struct prefix)); - apply_mask (&route->prefix); route->type = OSPF6_DEST_TYPE_NETWORK; route->path.area_id = oi->area->area_id; route->path.type = OSPF6_PATH_TYPE_INTRA; @@ -370,6 +489,7 @@ ospf6_interface_connected_route_update ( inet_pton (AF_INET6, "::1", &route->nexthop[0].address); ospf6_route_add (route, oi->route_connected); } + } /* create new Link-LSA */ OSPF6_LINK_LSA_SCHEDULE (oi); @@ -398,13 +518,11 @@ ospf6_interface_state_change (u_char nex if ((prev_state == OSPF6_INTERFACE_DR || prev_state == OSPF6_INTERFACE_BDR) && - (next_state != OSPF6_INTERFACE_DR && - next_state != OSPF6_INTERFACE_BDR)) + (next_state != OSPF6_INTERFACE_DR && next_state != OSPF6_INTERFACE_BDR)) ospf6_leave_alldrouters (oi->interface->ifindex); if ((prev_state != OSPF6_INTERFACE_DR && prev_state != OSPF6_INTERFACE_BDR) && - (next_state == OSPF6_INTERFACE_DR || - next_state == OSPF6_INTERFACE_BDR)) + (next_state == OSPF6_INTERFACE_DR || next_state == OSPF6_INTERFACE_BDR)) ospf6_join_alldrouters (oi->interface->ifindex); OSPF6_ROUTER_LSA_SCHEDULE (oi->area); @@ -591,8 +709,7 @@ interface_up (struct thread *thread) assert (oi && oi->interface); if (IS_OSPF6_DEBUG_INTERFACE) - zlog_debug ("Interface Event %s: [InterfaceUp]", - oi->interface->name); + zlog_debug ("Interface Event %s: [InterfaceUp]", oi->interface->name); /* check physical interface is up */ if (! if_is_up (oi->interface)) @@ -607,8 +724,7 @@ interface_up (struct thread *thread) if (oi->state > OSPF6_INTERFACE_DOWN) { if (IS_OSPF6_DEBUG_INTERFACE) - zlog_debug ("Interface %s already enabled", - oi->interface->name); + zlog_debug ("Interface %s already enabled", oi->interface->name); return 0; } @@ -623,7 +739,9 @@ interface_up (struct thread *thread) thread_add_event (master, ospf6_hello_send, oi, 0); /* decide next interface state */ - if (if_is_pointopoint (oi->interface)) + if (oi->type == OSPF6_IFTYPE_POINTOPOINT || + oi->type == OSPF6_IFTYPE_MDR || + oi->type == OSPF6_IFTYPE_POINTOMULTIPOINT) ospf6_interface_state_change (OSPF6_INTERFACE_POINTTOPOINT, oi); else if (oi->priority == 0) ospf6_interface_state_change (OSPF6_INTERFACE_DROTHER, oi); @@ -645,8 +763,7 @@ wait_timer (struct thread *thread) assert (oi && oi->interface); if (IS_OSPF6_DEBUG_INTERFACE) - zlog_debug ("Interface Event %s: [WaitTimer]", - oi->interface->name); + zlog_debug ("Interface Event %s: [WaitTimer]", oi->interface->name); if (oi->state == OSPF6_INTERFACE_WAITING) ospf6_interface_state_change (dr_election (oi), oi); @@ -663,8 +780,7 @@ backup_seen (struct thread *thread) assert (oi && oi->interface); if (IS_OSPF6_DEBUG_INTERFACE) - zlog_debug ("Interface Event %s: [BackupSeen]", - oi->interface->name); + zlog_debug ("Interface Event %s: [BackupSeen]", oi->interface->name); if (oi->state == OSPF6_INTERFACE_WAITING) ospf6_interface_state_change (dr_election (oi), oi); @@ -681,12 +797,10 @@ neighbor_change (struct thread *thread) assert (oi && oi->interface); if (IS_OSPF6_DEBUG_INTERFACE) - zlog_debug ("Interface Event %s: [NeighborChange]", - oi->interface->name); + zlog_debug ("Interface Event %s: [NeighborChange]", oi->interface->name); if (oi->state == OSPF6_INTERFACE_DROTHER || - oi->state == OSPF6_INTERFACE_BDR || - oi->state == OSPF6_INTERFACE_DR) + oi->state == OSPF6_INTERFACE_BDR || oi->state == OSPF6_INTERFACE_DR) ospf6_interface_state_change (dr_election (oi), oi); return 0; @@ -701,8 +815,7 @@ loopind (struct thread *thread) assert (oi && oi->interface); if (IS_OSPF6_DEBUG_INTERFACE) - zlog_debug ("Interface Event %s: [LoopInd]", - oi->interface->name); + zlog_debug ("Interface Event %s: [LoopInd]", oi->interface->name); /* XXX not yet */ @@ -720,8 +833,7 @@ interface_down (struct thread *thread) assert (oi && oi->interface); if (IS_OSPF6_DEBUG_INTERFACE) - zlog_debug ("Interface Event %s: [InterfaceDown]", - oi->interface->name); + zlog_debug ("Interface Event %s: [InterfaceDown]", oi->interface->name); /* Leave AllSPFRouters */ if (oi->state > OSPF6_INTERFACE_DOWN) @@ -764,8 +876,7 @@ ospf6_interface_show (struct vty *vty, s type = "UNKNOWN"; vty_out (vty, "%s is %s, type %s%s", - ifp->name, updown[if_is_up (ifp)], type, - VNL); + ifp->name, updown[if_is_up (ifp)], type, VNL); vty_out (vty, " Interface ID: %d%s", ifp->ifindex, VNL); if (ifp->info == NULL) @@ -776,6 +887,92 @@ ospf6_interface_show (struct vty *vty, s else oi = (struct ospf6_interface *) ifp->info; + if (oi->type == OSPF6_IFTYPE_BROADCAST) + type = "BROADCAST"; + else if (oi->type == OSPF6_IFTYPE_LOOPBACK) + type = "LOOPBACK"; + else if (oi->type == OSPF6_IFTYPE_NBMA) + type = "NBMA"; + else if (oi->type == OSPF6_IFTYPE_POINTOMULTIPOINT) + type = "POINT TO MULTIPOINT"; + else if (oi->type == OSPF6_IFTYPE_MDR) + type = "OSPF MANET MDR"; + else if (oi->type == OSPF6_IFTYPE_POINTOPOINT) + type = "POINT TO POINT"; + vty_out (vty, " OSPF6 type %s%s", type, VTY_NEWLINE); + + if (oi->type == OSPF6_IFTYPE_MDR) + { + struct listnode *node, *nnode; + struct ospf6_neighbor *on; + char router_id[32]; + switch (oi->mdr_level) + { + case OSPF6_MDR: + type = "MDR"; + break; + case OSPF6_BMDR: + type = "BMDR"; + break; + case OSPF6_OTHER: + type = "OTHER"; + break; + default: + type = "???"; + break; + } + vty_out (vty, " Router is an %s router%s", type, VTY_NEWLINE); + + if (oi->parent) + { + inet_ntop (AF_INET, &oi->parent->router_id, router_id, + sizeof (router_id)); + vty_out (vty, " Parent: %s %s", router_id, VTY_NEWLINE); + } + if (oi->bparent) + { + inet_ntop (AF_INET, &oi->bparent->router_id, router_id, + sizeof (router_id)); + vty_out (vty, " Backup Parent: %s %s", router_id, VTY_NEWLINE); + } + vty_out (vty, " Dependent Neighbors: "); + for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) + { + if (on->dependent && on->state > OSPF6_NEIGHBOR_INIT) + { + inet_ntop (AF_INET, &on->router_id, router_id, + sizeof (router_id)); + vty_out (vty, "%s,", router_id); + } + } + vty_out (vty, "%s", VTY_NEWLINE); + + vty_out (vty, " Dependent Selectors: "); + for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) + { + if (on->dependent_selector && on->state > OSPF6_NEIGHBOR_INIT) + { + inet_ntop (AF_INET, &on->router_id, router_id, + sizeof (router_id)); + vty_out (vty, "%s,", router_id); + } + } + vty_out (vty, "%s", VTY_NEWLINE); + + vty_out (vty, " Children: "); + for (ALL_LIST_ELEMENTS (oi->neighbor_list, node, nnode, on)) + { + if (on->child && on->state > OSPF6_NEIGHBOR_INIT) + { + inet_ntop (AF_INET, &on->router_id, router_id, + sizeof (router_id)); + vty_out (vty, "%s,", router_id); + } + } + vty_out (vty, "%s", VTY_NEWLINE); + + } + vty_out (vty, " Internet Address:%s", VNL); for (ALL_LIST_ELEMENTS_RO (ifp->connected, i, c)) @@ -785,16 +982,13 @@ ospf6_interface_show (struct vty *vty, s switch (p->family) { case AF_INET: - vty_out (vty, " inet : %s%s", strbuf, - VNL); + vty_out (vty, " inet : %s%s", strbuf, VNL); break; case AF_INET6: - vty_out (vty, " inet6: %s%s", strbuf, - VNL); + vty_out (vty, " inet6: %s%s", strbuf, VNL); break; default: - vty_out (vty, " ??? : %s%s", strbuf, - VNL); + vty_out (vty, " ??? : %s%s", strbuf, VNL); break; } } @@ -803,29 +997,24 @@ ospf6_interface_show (struct vty *vty, s { vty_out (vty, " Instance ID %d, Interface MTU %d (autodetect: %d)%s", oi->instance_id, oi->ifmtu, ifp->mtu6, VNL); - inet_ntop (AF_INET, &oi->area->area_id, - strbuf, sizeof (strbuf)); - vty_out (vty, " Area ID %s, Cost %hu%s", strbuf, oi->cost, - VNL); + inet_ntop (AF_INET, &oi->area->area_id, strbuf, sizeof (strbuf)); + vty_out (vty, " Area ID %s, Cost %hu%s", strbuf, oi->cost, VNL); } else vty_out (vty, " Not Attached to Area%s", VNL); vty_out (vty, " State %s, Transmit Delay %d sec, Priority %d%s", ospf6_interface_state_str[oi->state], - oi->transdelay, oi->priority, - VNL); + oi->transdelay, oi->priority, VNL); vty_out (vty, " Timer intervals configured:%s", VNL); vty_out (vty, " Hello %d, Dead %d, Retransmit %d%s", - oi->hello_interval, oi->dead_interval, oi->rxmt_interval, - VNL); + oi->hello_interval, oi->dead_interval, oi->rxmt_interval, VNL); inet_ntop (AF_INET, &oi->drouter, drouter, sizeof (drouter)); inet_ntop (AF_INET, &oi->bdrouter, bdrouter, sizeof (bdrouter)); vty_out (vty, " DR: %s BDR: %s%s", drouter, bdrouter, VNL); - vty_out (vty, " Number of I/F scoped LSAs is %u%s", - oi->lsdb->count, VNL); + vty_out (vty, " Number of I/F scoped LSAs is %u%s", oi->lsdb->count, VNL); gettimeofday (&now, (struct timezone *) NULL); @@ -835,8 +1024,7 @@ ospf6_interface_show (struct vty *vty, s timerstring (&res, duration, sizeof (duration)); vty_out (vty, " %d Pending LSAs for LSUpdate in Time %s [thread %s]%s", oi->lsupdate_list->count, duration, - (oi->thread_send_lsupdate ? "on" : "off"), - VNL); + (oi->thread_send_lsupdate ? "on" : "off"), VNL); for (lsa = ospf6_lsdb_head (oi->lsupdate_list); lsa; lsa = ospf6_lsdb_next (lsa)) vty_out (vty, " %s%s", lsa->name, VNL); @@ -847,8 +1035,7 @@ ospf6_interface_show (struct vty *vty, s timerstring (&res, duration, sizeof (duration)); vty_out (vty, " %d Pending LSAs for LSAck in Time %s [thread %s]%s", oi->lsack_list->count, duration, - (oi->thread_send_lsack ? "on" : "off"), - VNL); + (oi->thread_send_lsack ? "on" : "off"), VNL); for (lsa = ospf6_lsdb_head (oi->lsack_list); lsa; lsa = ospf6_lsdb_next (lsa)) vty_out (vty, " %s%s", lsa->name, VNL); @@ -860,12 +1047,7 @@ ospf6_interface_show (struct vty *vty, s DEFUN (show_ipv6_ospf6_interface, show_ipv6_ospf6_interface_ifname_cmd, "show ipv6 ospf6 interface IFNAME", - SHOW_STR - IP6_STR - OSPF6_STR - INTERFACE_STR - IFNAME_STR - ) + SHOW_STR IP6_STR OSPF6_STR INTERFACE_STR IFNAME_STR) { struct interface *ifp; struct listnode *i; @@ -875,8 +1057,7 @@ DEFUN (show_ipv6_ospf6_interface, ifp = if_lookup_by_name (argv[0]); if (ifp == NULL) { - vty_out (vty, "No such Interface: %s%s", argv[0], - VNL); + vty_out (vty, "No such Interface: %s%s", argv[0], VNL); return CMD_WARNING; } ospf6_interface_show (vty, ifp); @@ -892,12 +1073,7 @@ DEFUN (show_ipv6_ospf6_interface, ALIAS (show_ipv6_ospf6_interface, show_ipv6_ospf6_interface_cmd, - "show ipv6 ospf6 interface", - SHOW_STR - IP6_STR - OSPF6_STR - INTERFACE_STR - ); + "show ipv6 ospf6 interface", SHOW_STR IP6_STR OSPF6_STR INTERFACE_STR); DEFUN (show_ipv6_ospf6_interface_ifname_prefix, show_ipv6_ospf6_interface_ifname_prefix_cmd, @@ -905,10 +1081,7 @@ DEFUN (show_ipv6_ospf6_interface_ifname_ SHOW_STR IP6_STR OSPF6_STR - INTERFACE_STR - IFNAME_STR - "Display connected prefixes to advertise\n" - ) + INTERFACE_STR IFNAME_STR "Display connected prefixes to advertise\n") { struct interface *ifp; struct ospf6_interface *oi; @@ -944,9 +1117,7 @@ ALIAS (show_ipv6_ospf6_interface_ifname_ IFNAME_STR "Display connected prefixes to advertise\n" OSPF6_ROUTE_ADDRESS_STR - OSPF6_ROUTE_PREFIX_STR - "Dispaly details of the prefixes\n" - ); + OSPF6_ROUTE_PREFIX_STR "Dispaly details of the prefixes\n"); ALIAS (show_ipv6_ospf6_interface_ifname_prefix, show_ipv6_ospf6_interface_ifname_prefix_match_cmd, @@ -958,19 +1129,14 @@ ALIAS (show_ipv6_ospf6_interface_ifname_ IFNAME_STR "Display connected prefixes to advertise\n" OSPF6_ROUTE_PREFIX_STR - OSPF6_ROUTE_MATCH_STR - "Dispaly details of the prefixes\n" - ); + OSPF6_ROUTE_MATCH_STR "Dispaly details of the prefixes\n"); DEFUN (show_ipv6_ospf6_interface_prefix, show_ipv6_ospf6_interface_prefix_cmd, "show ipv6 ospf6 interface prefix", SHOW_STR IP6_STR - OSPF6_STR - INTERFACE_STR - "Display connected prefixes to advertise\n" - ) + OSPF6_STR INTERFACE_STR "Display connected prefixes to advertise\n") { struct listnode *i; struct ospf6_interface *oi; @@ -997,9 +1163,7 @@ ALIAS (show_ipv6_ospf6_interface_prefix, INTERFACE_STR "Display connected prefixes to advertise\n" OSPF6_ROUTE_ADDRESS_STR - OSPF6_ROUTE_PREFIX_STR - "Dispaly details of the prefixes\n" - ); + OSPF6_ROUTE_PREFIX_STR "Dispaly details of the prefixes\n"); ALIAS (show_ipv6_ospf6_interface_prefix, show_ipv6_ospf6_interface_prefix_match_cmd, @@ -1010,20 +1174,14 @@ ALIAS (show_ipv6_ospf6_interface_prefix, INTERFACE_STR "Display connected prefixes to advertise\n" OSPF6_ROUTE_PREFIX_STR - OSPF6_ROUTE_MATCH_STR - "Dispaly details of the prefixes\n" - ); + OSPF6_ROUTE_MATCH_STR "Dispaly details of the prefixes\n"); /* interface variable set command */ DEFUN (ipv6_ospf6_ifmtu, ipv6_ospf6_ifmtu_cmd, "ipv6 ospf6 ifmtu <1-65535>", - IP6_STR - OSPF6_STR - "Interface MTU\n" - "OSPFv3 Interface MTU\n" - ) + IP6_STR OSPF6_STR "Interface MTU\n" "OSPFv3 Interface MTU\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1053,7 +1211,9 @@ DEFUN (ipv6_ospf6_ifmtu, if (oi->ifmtu < ifmtu) { - iobuflen = ospf6_iobuf_size (ifmtu); + // RGO. Sometimes an OSPF packet must exceed MTU, so make iobuflen + // twice as large as MTU. + iobuflen = ospf6_iobuf_size (2 * ifmtu); if (iobuflen < ifmtu) { vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", @@ -1078,12 +1238,7 @@ DEFUN (ipv6_ospf6_ifmtu, DEFUN (no_ipv6_ospf6_ifmtu, no_ipv6_ospf6_ifmtu_cmd, - "no ipv6 ospf6 ifmtu", - NO_STR - IP6_STR - OSPF6_STR - "Interface MTU\n" - ) + "no ipv6 ospf6 ifmtu", NO_STR IP6_STR OSPF6_STR "Interface MTU\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1101,7 +1256,10 @@ DEFUN (no_ipv6_ospf6_ifmtu, if (oi->ifmtu < ifp->mtu) { - iobuflen = ospf6_iobuf_size (ifp->mtu); + // RGO. Sometimes an OSPF packet must exceed MTU, so make iobuflen + // twice as large as MTU. + iobuflen = ospf6_iobuf_size (2 * ifp->mtu); + if (iobuflen < ifp->mtu) { vty_out (vty, "%s's ifmtu is adjusted to I/O buffer size (%d).%s", @@ -1128,10 +1286,7 @@ DEFUN (ipv6_ospf6_cost, ipv6_ospf6_cost_cmd, "ipv6 ospf6 cost <1-65535>", IP6_STR - OSPF6_STR - "Interface cost\n" - "Outgoing metric of this interface\n" - ) + OSPF6_STR "Interface cost\n" "Outgoing metric of this interface\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1177,11 +1333,110 @@ DEFUN (ipv6_ospf6_cost, DEFUN (ipv6_ospf6_hellointerval, ipv6_ospf6_hellointerval_cmd, "ipv6 ospf6 hello-interval <1-65535>", + IP6_STR OSPF6_STR "Interval time of Hello packets\n" SECONDS_STR) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->hello_interval = strtol (argv[0], NULL, 10); + return CMD_SUCCESS; +} + +DEFUN (ipv6_ospf6_flooddelay, + ipv6_ospf6_flooddelay_cmd, + "ipv6 ospf6 flood-delay <1-65535>", + IP6_STR + OSPF6_STR "Time in msec to coalesce LSAs before sending\n" SECONDS_STR) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->flood_delay = strtol (argv[0], NULL, 10); + return CMD_SUCCESS; +} + + +DEFUN (ipv6_ospf6_ackinterval, + ipv6_ospf6_ackinterval_cmd, + "ipv6 ospf6 ackinterval <1-65535>", + IP6_STR OSPF6_STR "Interval of time to coalesce acks\n" SECONDS_STR) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->ackInterval = strtol (argv[0], NULL, 10); + return CMD_SUCCESS; +} + +DEFUN (ipv6_ospf6_diffhellos, + ipv6_ospf6_diffhellos_cmd, "ipv6 ospf6 diffhellos", IP6_STR OSPF6_STR) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->diff_hellos = true; + + return CMD_SUCCESS; +} + +DEFUN (no_ipv6_ospf6_diffhellos, + no_ipv6_ospf6_diffhellos_cmd, + "no ipv6 ospf6 diffhellos", NO_STR IP6_STR OSPF6_STR) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->diff_hellos = false; + + return CMD_SUCCESS; +} + +DEFUN (ipv6_ospf6_backupwaitinterval, + ipv6_ospf6_backupwaitinterval_cmd, + "ipv6 ospf6 backupwaitinterval <1-65535>", IP6_STR OSPF6_STR - "Interval time of Hello packets\n" - SECONDS_STR - ) + "Interval of time for MBDRs to wait before flooding\n" SECONDS_STR) { struct ospf6_interface *oi; struct interface *ifp; @@ -1194,7 +1449,167 @@ DEFUN (ipv6_ospf6_hellointerval, oi = ospf6_interface_create (ifp); assert (oi); - oi->hello_interval = strtol (argv[0], NULL, 10); + oi->BackupWaitInterval = strtol (argv[0], NULL, 10); + return CMD_SUCCESS; +} + +DEFUN (ipv6_ospf6_twohoprefresh, + ipv6_ospf6_twohoprefresh_cmd, + "ipv6 ospf6 twohoprefresh <1-65535>", + IP6_STR + OSPF6_STR + "Full Hellos are sent every TwoHopRefresh Hellos\n" SECONDS_STR) +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->TwoHopRefresh = strtol (argv[0], NULL, 10); + return CMD_SUCCESS; +} + +DEFUN (ipv6_ospf6_hellorepeatcount, + ipv6_ospf6_hellorepeatcount_cmd, + "ipv6 ospf6 hellorepeatcount <1-65535>", + IP6_STR + OSPF6_STR + "Total hellos in succession that cannot be missed using diff hellos\n" + "Number of successive losses\n") +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->HelloRepeatCount = strtol (argv[0], NULL, 10); + return CMD_SUCCESS; +} + +DEFUN (ipv6_ospf6_adjacencyconnectivity, + ipv6_ospf6_adjacencyconnectivity_cmd, + "ipv6 ospf6 adjacencyconnectivity (uniconnected|biconnected|fully)", + IP6_STR + OSPF6_STR + "Level of adjacencies between neighbors\n" + "Specify uniconnected adjacencies between routers\n" + "Specify biconnected adjacencies between routers\n" + "Specify fully connected adjacencies between routers\n") +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (!oi) + oi = ospf6_interface_create (ifp); + assert (oi); + + if (strncmp (argv[0], "uni", 3) == 0) + oi->AdjConnectivity = OSPF6_ADJ_UNICONNECTED; + else if (strncmp (argv[0], "bi", 2) == 0) + oi->AdjConnectivity = OSPF6_ADJ_BICONNECTED; + else if (strncmp (argv[0], "ful", 3) == 0) + oi->AdjConnectivity = OSPF6_ADJ_FULLYCONNECTED; + else + oi->AdjConnectivity = OSPF6_ADJ_BICONNECTED; + + return CMD_SUCCESS; +} + +DEFUN (ipv6_ospf6_lsafullnesss, + ipv6_ospf6_lsafullness_cmd, + "ipv6 ospf6 lsafullness (minlsa|mincostlsa|mincost2lsa|mdrfulllsa|fulllsa)", + IP6_STR + OSPF6_STR + "Level of LSA fullness\n" + "Specify min size LSAs (only adjacent neighbors)\n" + "Specify partial LSAs for min-hop routing\n" + "Specify partial LSAs for two min-hop routing paths\n" + "Specify full LSAs from MDR/MBDRs\n" + "Specify full LSAs (all routable neighbors)\n") +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (!oi) + oi = ospf6_interface_create (ifp); + assert (oi); + + if (strncmp (argv[0], "minlsa", 6) == 0) + oi->LSAFullness = OSPF6_LSA_FULLNESS_MIN; + else if (strncmp (argv[0], "mincost", 6) == 0) + oi->LSAFullness = OSPF6_LSA_FULLNESS_MINCOST; + else if (strncmp (argv[0], "mincost2paths", 6) == 0) + oi->LSAFullness = OSPF6_LSA_FULLNESS_MINCOST2PATHS; + else if (strncmp (argv[0], "mdrfull", 6) == 0) + oi->LSAFullness = OSPF6_LSA_FULLNESS_MDRFULL; + else if (strncmp (argv[0], "full", 4) == 0) + oi->LSAFullness = OSPF6_LSA_FULLNESS_FULL; + else + oi->LSAFullness = OSPF6_LSA_FULLNESS_MIN; + + return CMD_SUCCESS; + +} + +DEFUN (ipv6_ospf6_smf_mdr_talk, + ipv6_ospf6_smf_mdr_talk_cmd, + "ipv6 ospf6 smf_mdr_talk", + IP6_STR OSPF6_STR "Tell SMF about the MDR flooding set\n") +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->smf_mdr_talk = true; + + return CMD_SUCCESS; +} + +DEFUN (no_ipv6_ospf6_smf_mdr_talk, + no_ipv6_ospf6_smf_mdr_talk_cmd, + "no ipv6 ospf6 smf_mdr_talk", + IP6_STR OSPF6_STR "Tell SMF about the MDR flooding set\n") +{ + struct ospf6_interface *oi; + struct interface *ifp; + + ifp = (struct interface *) vty->index; + assert (ifp); + + oi = (struct ospf6_interface *) ifp->info; + if (oi == NULL) + oi = ospf6_interface_create (ifp); + assert (oi); + + oi->smf_mdr_talk = false; + return CMD_SUCCESS; } @@ -1204,9 +1621,7 @@ DEFUN (ipv6_ospf6_deadinterval, "ipv6 ospf6 dead-interval <1-65535>", IP6_STR OSPF6_STR - "Interval time after which a neighbor is declared down\n" - SECONDS_STR - ) + "Interval time after which a neighbor is declared down\n" SECONDS_STR) { struct ospf6_interface *oi; struct interface *ifp; @@ -1227,11 +1642,7 @@ DEFUN (ipv6_ospf6_deadinterval, DEFUN (ipv6_ospf6_transmitdelay, ipv6_ospf6_transmitdelay_cmd, "ipv6 ospf6 transmit-delay <1-3600>", - IP6_STR - OSPF6_STR - "Transmit delay of this interface\n" - SECONDS_STR - ) + IP6_STR OSPF6_STR "Transmit delay of this interface\n" SECONDS_STR) { struct ospf6_interface *oi; struct interface *ifp; @@ -1255,8 +1666,7 @@ DEFUN (ipv6_ospf6_retransmitinterval, IP6_STR OSPF6_STR "Time between retransmitting lost link state advertisements\n" - SECONDS_STR - ) + SECONDS_STR) { struct ospf6_interface *oi; struct interface *ifp; @@ -1277,11 +1687,7 @@ DEFUN (ipv6_ospf6_retransmitinterval, DEFUN (ipv6_ospf6_priority, ipv6_ospf6_priority_cmd, "ipv6 ospf6 priority <0-255>", - IP6_STR - OSPF6_STR - "Router priority\n" - "Priority value\n" - ) + IP6_STR OSPF6_STR "Router priority\n" "Priority value\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1306,13 +1712,11 @@ DEFUN (ipv6_ospf6_instance, ipv6_ospf6_instance_cmd, "ipv6 ospf6 instance-id <0-255>", IP6_STR - OSPF6_STR - "Instance ID for this interface\n" - "Instance ID value\n" - ) + OSPF6_STR "Instance ID for this interface\n" "Instance ID value\n") { struct ospf6_interface *oi; struct interface *ifp; + u_char instance_id; ifp = (struct interface *)vty->index; assert (ifp); @@ -1322,7 +1726,25 @@ DEFUN (ipv6_ospf6_instance, oi = ospf6_interface_create (ifp); assert (oi); - oi->instance_id = strtol (argv[0], NULL, 10); + instance_id = (u_char) strtol (argv[0], NULL, 10); + + if (instance_id == oi->instance_id) + { + if (IS_OSPF6_DEBUG_INTERFACE) + zlog_warn + ("%s: ignoring new instance id (same as current instance id): %d", + __func__, instance_id); + } + else + { + oi->instance_id = instance_id; + if (oi->state > OSPF6_INTERFACE_DOWN) + { + thread_execute (master, interface_down, oi, 0); + thread_execute (master, interface_up, oi, 0); + } + } + return CMD_SUCCESS; } @@ -1331,8 +1753,7 @@ DEFUN (ipv6_ospf6_passive, "ipv6 ospf6 passive", IP6_STR OSPF6_STR - "passive interface, No adjacency will be formed on this interface\n" - ) + "passive interface, No adjacency will be formed on this interface\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1365,8 +1786,7 @@ DEFUN (no_ipv6_ospf6_passive, NO_STR IP6_STR OSPF6_STR - "passive interface: No Adjacency will be formed on this I/F\n" - ) + "passive interface: No Adjacency will be formed on this I/F\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1381,8 +1801,7 @@ DEFUN (no_ipv6_ospf6_passive, UNSET_FLAG (oi->flag, OSPF6_INTERFACE_PASSIVE); THREAD_OFF (oi->thread_send_hello); - oi->thread_send_hello = - thread_add_event (master, ospf6_hello_send, oi, 0); + oi->thread_send_hello = thread_add_event (master, ospf6_hello_send, oi, 0); return CMD_SUCCESS; } @@ -1393,9 +1812,7 @@ DEFUN (ipv6_ospf6_advertise_prefix_list, IP6_STR OSPF6_STR "Advertising options\n" - "Filter prefix using prefix-list\n" - "Prefix list name\n" - ) + "Filter prefix using prefix-list\n" "Prefix list name\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1424,15 +1841,98 @@ DEFUN (ipv6_ospf6_advertise_prefix_list, return CMD_SUCCESS; } +DEFUN (ipv6_ospf6_network, + ipv6_ospf6_network_cmd, + "ipv6 ospf6 network (broadcast|non-broadcast|point-to-multipoint|point-to-point|loopback|manet-designated-router)", + "IPv6 Information\n" + "OSPF6 interface commands\n" + "Network type\n" + "Specify OSPF6 broadcast multi-access network\n" + "Specify OSPF6 NBMA network\n" + "Specify OSPF6 point-to-multipoint network\n" + "Specify OSPF6 point-to-point network\n" + "Specify OSPF6 loopback\n" + "Specify OSPF6 manet-designated-router (MDR) network\n") +{ + + struct ospf6_interface *oi; + struct interface *ifp; + int old_type; + + ifp = (struct interface *) vty->index; + assert (ifp); + oi = (struct ospf6_interface *) ifp->info; + if (!oi) + oi = ospf6_interface_create (ifp); + assert (oi); + old_type = oi->type; + + if (strncmp (argv[0], "b", 1) == 0) + oi->type = OSPF6_IFTYPE_BROADCAST; + else if (strncmp (argv[0], "n", 1) == 0) + oi->type = OSPF6_IFTYPE_NBMA; + else if (strncmp (argv[0], "point-to-m", 10) == 0) + oi->type = OSPF6_IFTYPE_POINTOMULTIPOINT; + else if (strncmp (argv[0], "point-to-p", 10) == 0) + oi->type = OSPF6_IFTYPE_POINTOPOINT; + else if (strncmp (argv[0], "l", 1) == 0) + oi->type = OSPF6_IFTYPE_LOOPBACK; + else if (strncmp (argv[0], "manet-designated-router", 5) == 0) + { + oi->type = OSPF6_IFTYPE_MDR; + //install extra structures neccesary for manet-designated-router interface + oi->lnl = list_new (); + oi->hsn = 0; + oi->full_hello_count = 0; + } + + return CMD_SUCCESS; +} + +ALIAS (ipv6_ospf6_network, + ospf6_network_cmd, + "ospf6 network (broadcast|non-broadcast|point-to-multipoint|point-to-point|loopback|manet-designated-router)", + "OSPF interface commands\n" + "Network type\n" + "Specify OSPF6 broadcast multi-access network\n" + "Specify OSPF6 NBMA network\n" + "Specify OSPF6 point-to-multipoint network\n" + "Specify OSPF6 point-to-point network\n" + "Specify OSPF6 loopback\n" + "Specify OSPF6 manet-designated-router (MDR) network\n") +DEFUN (no_ipv6_ospf6_network, + no_ipv6_ospf6_network_cmd, + "no ipv6 ospf6 network", + NO_STR + "IP Information\n" "OSPF6 interface commands\n" "Network type\n") +{ + struct ospf6_interface *oi; + struct interface *ifp; + int old_type; + + ifp = (struct interface *) vty->index; + assert (ifp); + oi = (struct ospf6_interface *) ifp->info; + if (!oi) + oi = ospf6_interface_create (ifp); + assert (oi); + old_type = oi->type; + + oi->type = OSPF6_IFTYPE_NONE; + + return CMD_SUCCESS; +} + +ALIAS (no_ipv6_ospf6_network, + no_ospf6_network_cmd, + "no ospf6 network", + NO_STR "OSPF6 interface commands\n" "Network type\n") DEFUN (no_ipv6_ospf6_advertise_prefix_list, no_ipv6_ospf6_advertise_prefix_list_cmd, "no ipv6 ospf6 advertise prefix-list", NO_STR IP6_STR - OSPF6_STR - "Advertising options\n" - "Filter prefix using prefix-list\n" - ) + OSPF6_STR "Advertising options\n" "Filter prefix using prefix-list\n") { struct ospf6_interface *oi; struct interface *ifp; @@ -1476,28 +1976,90 @@ config_write_ospf6_interface (struct vty if (oi == NULL) continue; - vty_out (vty, "interface %s%s", - oi->interface->name, VNL); + vty_out (vty, "interface %s%s", oi->interface->name, VNL); if (ifp->desc) vty_out (vty, " description %s%s", ifp->desc, VNL); if (ifp->mtu6 != oi->ifmtu) vty_out (vty, " ipv6 ospf6 ifmtu %d%s", oi->ifmtu, VNL); - vty_out (vty, " ipv6 ospf6 cost %d%s", - oi->cost, VNL); + vty_out (vty, " ipv6 ospf6 cost %d%s", oi->cost, VNL); vty_out (vty, " ipv6 ospf6 hello-interval %d%s", oi->hello_interval, VNL); - vty_out (vty, " ipv6 ospf6 dead-interval %d%s", - oi->dead_interval, VNL); + vty_out (vty, " ipv6 ospf6 dead-interval %d%s", oi->dead_interval, VNL); vty_out (vty, " ipv6 ospf6 retransmit-interval %d%s", oi->rxmt_interval, VNL); - vty_out (vty, " ipv6 ospf6 priority %d%s", - oi->priority, VNL); - vty_out (vty, " ipv6 ospf6 transmit-delay %d%s", - oi->transdelay, VNL); - vty_out (vty, " ipv6 ospf6 instance-id %d%s", - oi->instance_id, VNL); + vty_out (vty, " ipv6 ospf6 priority %d%s", oi->priority, VNL); + vty_out (vty, " ipv6 ospf6 transmit-delay %d%s", oi->transdelay, VNL); + vty_out (vty, " ipv6 ospf6 instance-id %d%s", oi->instance_id, VNL); + switch (oi->type) + { + case OSPF6_IFTYPE_BROADCAST: + vty_out (vty, " ipv6 ospf6 network broadcast%s", VNL); + break; + case OSPF6_IFTYPE_NBMA: + vty_out (vty, " ipv6 ospf6 network non-broadcast%s", VNL); + break; + case OSPF6_IFTYPE_POINTOMULTIPOINT: + vty_out (vty, " ipv6 ospf6 network point-to-multipoint%s", VNL); + break; + case OSPF6_IFTYPE_POINTOPOINT: + vty_out (vty, " ipv6 ospf6 network point-to-point %s", VNL); + break; + case OSPF6_IFTYPE_LOOPBACK: + vty_out (vty, " ipv6 ospf6 network loopback%s", VNL); + break; + case OSPF6_IFTYPE_MDR: + vty_out (vty, " ipv6 ospf6 network manet-designated-router %s", + VNL); + vty_out (vty, " ipv6 ospf6 ackinterval %ld%s", oi->ackInterval, + VNL); + vty_out (vty, " ipv6 ospf6 backupwaitinterval %ld%s", + oi->BackupWaitInterval, VNL); + vty_out (vty, " ipv6 ospf6 twohoprefresh %d%s", oi->TwoHopRefresh, + VNL); + vty_out (vty, " ipv6 ospf6 hellorepeatcount %d%s", + oi->HelloRepeatCount, VNL); + switch (oi->AdjConnectivity) + { + case OSPF6_ADJ_UNICONNECTED: + vty_out (vty, + " ipv6 ospf6 adjacencyconnectivity uniconnected%s", + VNL); + break; + case OSPF6_ADJ_BICONNECTED: + vty_out (vty, " ipv6 ospf6 adjacencyconnectivity biconnected%s", + VNL); + break; + case OSPF6_ADJ_FULLYCONNECTED: + vty_out (vty, " ipv6 ospf6 adjacencyconnectivity fully%s", VNL); + break; + } + switch (oi->LSAFullness) + { + case OSPF6_LSA_FULLNESS_MIN: + vty_out (vty, " ipv6 ospf6 lsafullness minlsa%s", VNL); + break; + case OSPF6_LSA_FULLNESS_FULL: + vty_out (vty, " ipv6 ospf6 lsafullness fulllsa%s", VNL); + break; + case OSPF6_LSA_FULLNESS_MDRFULL: + vty_out (vty, " ipv6 ospf6 lsafullness mdrfulllsa%s", VNL); + break; + case OSPF6_LSA_FULLNESS_MINCOST: + vty_out (vty, " ipv6 ospf6 lsafullness mincostlsa%s", VNL); + break; + case OSPF6_LSA_FULLNESS_MINCOST2PATHS: + vty_out (vty, " ipv6 ospf6 lsafullness mincost2lsa%s", VNL); + break; + } + if (oi->diff_hellos) + vty_out (vty, " ipv6 ospf6 diffhellos%s", VNL); + break; + } + + vty_out (vty, " ipv6 ospf6 flood-delay %d%s", oi->flood_delay, VNL); + if (oi->plist_name) vty_out (vty, " ipv6 ospf6 advertise prefix-list %s%s", @@ -1511,8 +2073,7 @@ config_write_ospf6_interface (struct vty return 0; } -struct cmd_node interface_node = -{ +struct cmd_node interface_node = { INTERFACE_NODE, "%s(config-if)# ", 1 /* VTYSH */ @@ -1530,16 +2091,20 @@ ospf6_interface_init () install_element (VIEW_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_cmd); install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd); - install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd); - install_element (VIEW_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd); + install_element (VIEW_NODE, + &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd); + install_element (VIEW_NODE, + &show_ipv6_ospf6_interface_ifname_prefix_match_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_detail_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_prefix_match_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_cmd); install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_cmd); - install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd); - install_element (ENABLE_NODE, &show_ipv6_ospf6_interface_ifname_prefix_match_cmd); + install_element (ENABLE_NODE, + &show_ipv6_ospf6_interface_ifname_prefix_detail_cmd); + install_element (ENABLE_NODE, + &show_ipv6_ospf6_interface_ifname_prefix_match_cmd); install_element (CONFIG_NODE, &interface_cmd); install_default (INTERFACE_NODE); @@ -1560,15 +2125,32 @@ ospf6_interface_init () install_element (INTERFACE_NODE, &ipv6_ospf6_advertise_prefix_list_cmd); install_element (INTERFACE_NODE, &no_ipv6_ospf6_advertise_prefix_list_cmd); + + install_element (INTERFACE_NODE, &ipv6_ospf6_network_cmd); + install_element (INTERFACE_NODE, &ospf6_network_cmd); + install_element (INTERFACE_NODE, &no_ipv6_ospf6_network_cmd); + install_element (INTERFACE_NODE, &no_ospf6_network_cmd); + + install_element (INTERFACE_NODE, &ipv6_ospf6_flooddelay_cmd); + + + install_element (INTERFACE_NODE, &ipv6_ospf6_ackinterval_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_diffhellos_cmd); + install_element (INTERFACE_NODE, &no_ipv6_ospf6_diffhellos_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_backupwaitinterval_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_twohoprefresh_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_hellorepeatcount_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_adjacencyconnectivity_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_lsafullness_cmd); + install_element (INTERFACE_NODE, &ipv6_ospf6_smf_mdr_talk_cmd); + install_element (INTERFACE_NODE, &no_ipv6_ospf6_smf_mdr_talk_cmd); + } DEFUN (debug_ospf6_interface, debug_ospf6_interface_cmd, "debug ospf6 interface", - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 Interface\n" - ) + DEBUG_STR OSPF6_STR "Debug OSPFv3 Interface\n") { OSPF6_DEBUG_INTERFACE_ON (); return CMD_SUCCESS; @@ -1577,11 +2159,7 @@ DEFUN (debug_ospf6_interface, DEFUN (no_debug_ospf6_interface, no_debug_ospf6_interface_cmd, "no debug ospf6 interface", - NO_STR - DEBUG_STR - OSPF6_STR - "Debug OSPFv3 Interface\n" - ) + NO_STR DEBUG_STR OSPF6_STR "Debug OSPFv3 Interface\n") { OSPF6_DEBUG_INTERFACE_OFF (); return CMD_SUCCESS; --- quagga-0.99.9/ospf6d/ospf6_interface.h 2005-04-04 21:48:42.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_interface.h 2008-04-16 11:55:54.000000000 -0700 @@ -24,6 +24,9 @@ #include "if.h" +#include "vty.h" + + /* Debug option */ extern unsigned char conf_debug_ospf6_interface; #define OSPF6_DEBUG_INTERFACE_ON() \ @@ -33,6 +36,24 @@ extern unsigned char conf_debug_ospf6_in #define IS_OSPF6_DEBUG_INTERFACE \ (conf_debug_ospf6_interface) +typedef enum +{ + OSPF6_ADJ_FULLYCONNECTED = 0, + OSPF6_ADJ_UNICONNECTED, + OSPF6_ADJ_BICONNECTED +} ospf6_AdjConnectivity; + +//How much information to include in LSAs +//These are defined in Ogier's draft, Appendix C +typedef enum +{ + OSPF6_LSA_FULLNESS_MIN = 0, //minimal LSAs (only adjacent neighbors) + OSPF6_LSA_FULLNESS_MINCOST, //partial LSAs for min-cost routing + OSPF6_LSA_FULLNESS_MINCOST2PATHS, //same as above, with some path redundancy + OSPF6_LSA_FULLNESS_MDRFULL, //full LSAs from MDR/MBDRs + OSPF6_LSA_FULLNESS_FULL //full LSAs (all routable neighbors) +} ospf6_LSAFullness; + /* Interface structure */ struct ospf6_interface { @@ -48,6 +69,9 @@ struct ospf6_interface /* linklocal address of this I/F */ struct in6_addr *linklocal_addr; + /* IPv4 linklocal address of this I/F */ + struct in6_addr *linklocal_addr_ipv4; + /* Interface ID; use interface->ifindex */ /* ospf6 instance id */ @@ -102,8 +126,59 @@ struct ospf6_interface /* prefix-list name to filter connected prefix */ char *plist_name; + + + /* OSPF6 Interface Type */ + u_char type; + + int flood_delay; //msec + + + + long ackInterval; + int ack_cache_timeout; + boolean diff_hellos; + boolean nonflooding_mdr; + long BackupWaitInterval; + int **cost_matrix; + int **lsa_cost_matrix; + int **adj_matrix; // RGO2. Indicates which nbr pairs are adjacent + int **san_matrix; // RGO2. Selected advertised nbr matrix + int AdjConnectivity; //1=uniconnected, 2=biconnected, 0=fully connected + int LSAFullness; + int MDRConstraint; // MPN parameter h, should be 2 or 3. + int mdr_level; + boolean smf_mdr_talk; + boolean smf_mdr; + int mdr_count; + struct ospf6_neighbor *parent; + struct ospf6_neighbor *bparent; + u_int16_t TwoHopRefresh; + u_int16_t HelloRepeatCount; + + struct list *lnl; + u_int16_t hsn; + u_int full_hello_count; + +}; + +struct drop_neighbor +{ + u_int32_t router_id; + struct timeval *expire_time; + boolean first; }; +#define OSPF6_IFTYPE_NONE 0 +#define OSPF6_IFTYPE_POINTOPOINT 1 +#define OSPF6_IFTYPE_BROADCAST 2 +#define OSPF6_IFTYPE_NBMA 3 +#define OSPF6_IFTYPE_POINTOMULTIPOINT 4 +#define OSPF6_IFTYPE_VIRTUALLINK 5 +#define OSPF6_IFTYPE_LOOPBACK 6 +#define OSPF6_IFTYPE_MDR 7 +#define OSPF6_IFTYPE_MAX 8 + /* interface state */ #define OSPF6_INTERFACE_NONE 0 #define OSPF6_INTERFACE_DOWN 1 @@ -148,5 +223,7 @@ void ospf6_interface_init (); int config_write_ospf6_debug_interface (struct vty *vty); void install_element_ospf6_debug_interface (); -#endif /* OSPF6_INTERFACE_H */ + + +#endif /* OSPF6_INTERFACE_H */ --- quagga-0.99.9/ospf6d/ospf6_intra.c 2006-05-15 03:43:52.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_intra.c 2008-04-16 11:55:54.000000000 -0700 @@ -47,6 +47,9 @@ #include "ospf6_flood.h" #include "ospf6d.h" +#include "ospf6_mdr.h" + +#include "ospf6_flood.h" unsigned char conf_debug_ospf6_brouter = 0; u_int32_t conf_debug_ospf6_brouter_specific_router_id; @@ -135,12 +138,16 @@ ospf6_router_lsa_originate (struct threa router_lsa = (struct ospf6_router_lsa *) ((caddr_t) lsa_header + sizeof (struct ospf6_lsa_header)); - OSPF6_OPT_SET (router_lsa->options, OSPF6_OPT_V6); - OSPF6_OPT_SET (router_lsa->options, OSPF6_OPT_E); - OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_MC); - OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_N); - OSPF6_OPT_SET (router_lsa->options, OSPF6_OPT_R); - OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_DC); + OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_AF, 2); + + OSPF6_OPT_SET (router_lsa->options, OSPF6_OPT_V6, 2); + OSPF6_OPT_SET (router_lsa->options, OSPF6_OPT_E, 2); + OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_MC, 2); + OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_N, 2); + OSPF6_OPT_SET (router_lsa->options, OSPF6_OPT_R, 2); + OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_DC, 2); + OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_L, 1); + OSPF6_OPT_CLEAR (router_lsa->options, OSPF6_OPT_D, 1); if (ospf6_is_router_abr (ospf6)) SET_FLAG (router_lsa->bits, OSPF6_ROUTER_BIT_B); @@ -165,13 +172,19 @@ ospf6_router_lsa_originate (struct threa continue; /* Nor are interfaces without any full adjacencies described */ + //MDR may include non-adjacent neighbors in LSA + //except when fully connected adjacencies are used + if (!(oi->type == OSPF6_IFTYPE_MDR && + oi->AdjConnectivity > OSPF6_ADJ_FULLYCONNECTED)) + { + //If there are 0 neighbors in state FULL then go to next interface count = 0; for (ALL_LIST_ELEMENTS_RO (oi->neighbor_list, j, on)) if (on->state == OSPF6_NEIGHBOR_FULL) count++; - if (count == 0) continue; + } /* Multiple Router-LSA instance according to size limit setting */ if ( (oa->router_lsa_size_limit != 0) @@ -215,10 +228,18 @@ ospf6_router_lsa_originate (struct threa } /* Point-to-Point interfaces */ - if (if_is_pointopoint (oi->interface)) + if (oi->type == OSPF6_IFTYPE_POINTOPOINT || + oi->type == OSPF6_IFTYPE_MDR || + oi->type == OSPF6_IFTYPE_POINTOMULTIPOINT) { for (ALL_LIST_ELEMENTS_RO (oi->neighbor_list, j, on)) { + if (oi->type == OSPF6_IFTYPE_MDR) + { + if (!on->adv) + continue; + } + else if (on->state != OSPF6_NEIGHBOR_FULL) continue; @@ -233,7 +253,7 @@ ospf6_router_lsa_originate (struct threa } /* Broadcast and NBMA interfaces */ - if (if_is_broadcast (oi->interface)) + if (oi->type == OSPF6_IFTYPE_BROADCAST || oi->type == OSPF6_IFTYPE_NBMA) { /* If this router is not DR, and If this router not fully adjacent with DR, @@ -380,7 +400,8 @@ ospf6_network_lsa_originate (struct thre } if (IS_OSPF6_DEBUG_ORIGINATE (NETWORK)) - zlog_debug ("Originate Network-LSA for Interface %s", oi->interface->name); + zlog_debug ("Originate Network-LSA for Interface %s", + oi->interface->name); /* If none of neighbor is adjacent to us */ count = 0; @@ -470,7 +491,7 @@ ospf6_link_lsa_show (struct vty *vty, st int prefixnum; char buf[128], options[32]; struct ospf6_prefix *prefix; - const char *p, *mc, *la, *nu; + const char *p, *la, *nu; struct in6_addr in6; link_lsa = (struct ospf6_link_lsa *) @@ -496,21 +517,19 @@ ospf6_link_lsa_show (struct vty *vty, st p = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_P) ? "P" : "--"); - mc = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_MC) ? - "MC" : "--"); la = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_LA) ? "LA" : "--"); nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ? "NU" : "--"); - vty_out (vty, " Prefix Options: %s|%s|%s|%s%s", - p, mc, la, nu, VNL); + //AF draft 05 Sec 2.2.2 + //The MC bit is not used in other AF's introduced in this document. + vty_out (vty, " Prefix Options: %s|**|%s|%s%s", p, la, nu, VNL); memset (&in6, 0, sizeof (in6)); memcpy (&in6, OSPF6_PREFIX_BODY (prefix), OSPF6_PREFIX_SPACE (prefix->prefix_length)); inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); - vty_out (vty, " Prefix: %s/%d%s", - buf, prefix->prefix_length, VNL); + vty_out (vty, " Prefix: %s/%d%s", buf, prefix->prefix_length, VNL); } return 0; @@ -569,8 +588,16 @@ ospf6_link_lsa_originate (struct thread /* Fill Link-LSA */ link_lsa->priority = oi->priority; memcpy (link_lsa->options, oi->area->options, 3); + + //AF draft 05 Sec 2.5 - linklocal address should be the IPv4 address + //for the link_lsa. + if (is_af_ipv4_unicast (oi) || is_af_ipv4_multicast (oi)) + memcpy (&link_lsa->linklocal_addr, oi->linklocal_addr_ipv4, + sizeof (struct in6_addr)); + else memcpy (&link_lsa->linklocal_addr, oi->linklocal_addr, sizeof (struct in6_addr)); + link_lsa->prefix_num = htonl (oi->route_connected->count); op = (struct ospf6_prefix *) @@ -624,7 +651,8 @@ ospf6_intra_prefix_lsa_show (struct vty char buf[128]; struct ospf6_prefix *prefix; char id[16], adv_router[16]; - const char *p, *mc, *la, *nu; + const char *p, *la, *nu; + struct in6_addr in6; intra_prefix_lsa = (struct ospf6_intra_prefix_lsa *) @@ -652,21 +680,17 @@ ospf6_intra_prefix_lsa_show (struct vty p = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_P) ? "P" : "--"); - mc = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_MC) ? - "MC" : "--"); la = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_LA) ? "LA" : "--"); nu = (CHECK_FLAG (prefix->prefix_options, OSPF6_PREFIX_OPTION_NU) ? "NU" : "--"); - vty_out (vty, " Prefix Options: %s|%s|%s|%s%s", - p, mc, la, nu, VNL); + vty_out (vty, " Prefix Options: %s|**|%s|%s%s", p, la, nu, VNL); memset (&in6, 0, sizeof (in6)); memcpy (&in6, OSPF6_PREFIX_BODY (prefix), OSPF6_PREFIX_SPACE (prefix->prefix_length)); inet_ntop (AF_INET6, &in6, buf, sizeof (buf)); - vty_out (vty, " Prefix: %s/%d%s", - buf, prefix->prefix_length, VNL); + vty_out (vty, " Prefix: %s/%d%s", buf, prefix->prefix_length, VNL); } return 0; @@ -721,14 +745,17 @@ ospf6_intra_prefix_lsa_originate_stub (s intra_prefix_lsa->ref_id = htonl (0); intra_prefix_lsa->ref_adv_router = oa->ospf6->router_id; - route_advertise = ospf6_route_table_create (0, 0); + prefix_num = 0; + op = (struct ospf6_prefix *) + ((caddr_t) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa)); for (ALL_LIST_ELEMENTS_RO (oa->if_list, i, oi)) { if (oi->state == OSPF6_INTERFACE_DOWN) { if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX)) - zlog_debug (" Interface %s is down, ignore", oi->interface->name); + zlog_debug (" Interface %s is down, ignore", + oi->interface->name); continue; } @@ -739,8 +766,7 @@ ospf6_intra_prefix_lsa_originate_stub (s full_count++; if (oi->state != OSPF6_INTERFACE_LOOPBACK && - oi->state != OSPF6_INTERFACE_POINTTOPOINT && - full_count != 0) + oi->state != OSPF6_INTERFACE_POINTTOPOINT && full_count != 0) { if (IS_OSPF6_DEBUG_ORIGINATE (INTRA_PREFIX)) zlog_debug (" Interface %s is not stub, ignore", @@ -760,35 +786,27 @@ ospf6_intra_prefix_lsa_originate_stub (s prefix2str (&route->prefix, buf, sizeof (buf)); zlog_debug (" include %s", buf); } - ospf6_route_add (ospf6_route_copy (route), route_advertise); - } - } - - if (route_advertise->count == 0) - { - if (old) - ospf6_lsa_purge (old); - ospf6_route_table_delete (route_advertise); - return 0; - } - - /* put prefixes to advertise */ - prefix_num = 0; - op = (struct ospf6_prefix *) - ((caddr_t) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa)); - for (route = ospf6_route_head (route_advertise); route; - route = ospf6_route_best_next (route)) - { +//RFC 2740 3.4.3.7 Bullet 5 -- + if (oi->type == OSPF6_IFTYPE_MDR || + oi->type == OSPF6_IFTYPE_POINTOMULTIPOINT) + op->prefix_length = 128; + else op->prefix_length = route->prefix.prefixlen; op->prefix_options = route->path.prefix_options; + op->prefix_options |= OSPF6_PREFIX_OPTION_LA; op->prefix_metric = htons (route->path.cost); memcpy (OSPF6_PREFIX_BODY (op), &route->prefix.u.prefix6, OSPF6_PREFIX_SPACE (op->prefix_length)); + //must add mask application here because it was removed + //in ospf6_interface.c, ospf6_interface_connected_route_update() + ospf6_prefix_apply_mask (op); op = OSPF6_PREFIX_NEXT (op); prefix_num++; } + } - ospf6_route_table_delete (route_advertise); + if (prefix_num == 0 && old) + ospf6_lsa_purge (old); if (prefix_num == 0) { @@ -943,6 +961,9 @@ ospf6_intra_prefix_lsa_originate_transit route->prefix.family = AF_INET6; route->prefix.prefixlen = op->prefix_length; memset (&route->prefix.u.prefix6, 0, sizeof (struct in6_addr)); + //must add mask application here because it was removed + //in ospf6_interface.c, ospf6_interface_connected_route_update() + ospf6_prefix_apply_mask (op); memcpy (&route->prefix.u.prefix6, OSPF6_PREFIX_BODY (op), OSPF6_PREFIX_SPACE (op->prefix_length)); @@ -1065,9 +1086,14 @@ ospf6_intra_prefix_lsa_add (struct ospf6 return; } + //There is no need to add my own networks because the kernel routing + //table already installs them + if ((is_af_ipv6_unicast (NULL) || is_af_ipv6_multicast (NULL)) && + (lsa->header->adv_router == oa->ospf6->router_id)) + return; + prefix_num = ntohs (intra_prefix_lsa->prefix_num); - start = (caddr_t) intra_prefix_lsa + - sizeof (struct ospf6_intra_prefix_lsa); + start = (caddr_t) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa); end = OSPF6_LSA_END (lsa->header); for (current = start; current < end; current += OSPF6_PREFIX_SIZE (op)) { @@ -1092,13 +1118,62 @@ ospf6_intra_prefix_lsa_add (struct ospf6 route->path.area_id = oa->area_id; route->path.type = OSPF6_PATH_TYPE_INTRA; route->path.metric_type = 1; - route->path.cost = ls_entry->path.cost + - ntohs (op->prefix_metric); + route->path.cost = ls_entry->path.cost + ntohs (op->prefix_metric); + + { + boolean directly_connected = false; + struct prefix_ipv6 addr6; + if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX)) + { + char ipv6[128]; + inet_ntop (AF_INET6, &route->prefix.u.prefix6, ipv6, + sizeof (ipv6)); + zlog_debug ("route %s/%d", ipv6, route->prefix.prefixlen); + } for (i = 0; ospf6_nexthop_is_set (&ls_entry->nexthop[i]) && i < OSPF6_MULTI_PATH_LIMIT; i++) + { ospf6_nexthop_copy (&route->nexthop[i], &ls_entry->nexthop[i]); + addr6.family = AF_INET6; + addr6.prefixlen = route->prefix.prefixlen; + memcpy (&addr6.prefix, &route->nexthop[i].address, + sizeof (addr6)); + apply_mask_ipv6 (&addr6); + + if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX)) + { + char ipv6[128]; + inet_ntop (AF_INET6, &addr6.prefix, ipv6, sizeof (ipv6)); + zlog_debug ("nexthop %s", ipv6); + } + + if (IN6_ARE_ADDR_EQUAL (&addr6.prefix, &route->prefix.u.prefix6)) + { + if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX)) + zlog_debug (" match"); + directly_connected = true; + } + if (lsa->header->adv_router == oa->ospf6->router_id) + //This is the router's own lsa + route->nexthop[i].directly_connected = true; + //See ospf6_nexthop_calc() for settting nexthop->ifindex + //this check assumes that ifindex is being set for directly + //connected nexthops + else if (ls_entry->nexthop[i].ifindex && + (IN6_IS_ADDR_UNSPECIFIED (&ls_entry->nexthop[i].address) + || IN6_IS_ADDR_LINKLOCAL (&ls_entry->nexthop[i]. + address))) + route->nexthop[i].directly_connected = true; + else if (directly_connected) + //This is a one-hop neighbor - cost_e2 is hopcount + route->nexthop[i].directly_connected = true; + else + route->nexthop[i].directly_connected = false; + } + } + if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX)) { prefix2str (&route->prefix, buf, sizeof (buf)); @@ -1134,8 +1209,7 @@ ospf6_intra_prefix_lsa_remove (struct os OSPF6_LSA_HEADER_END (lsa->header); prefix_num = ntohs (intra_prefix_lsa->prefix_num); - start = (caddr_t) intra_prefix_lsa + - sizeof (struct ospf6_intra_prefix_lsa); + start = (caddr_t) intra_prefix_lsa + sizeof (struct ospf6_intra_prefix_lsa); end = OSPF6_LSA_END (lsa->header); for (current = start; current < end; current += OSPF6_PREFIX_SIZE (op)) { @@ -1191,6 +1265,7 @@ ospf6_intra_route_calculation (struct os struct ospf6_lsa *lsa; void (*hook_add) (struct ospf6_route *) = NULL; void (*hook_remove) (struct ospf6_route *) = NULL; + int pass; if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX)) zlog_debug ("Re-examin intra-routes for area %s", oa->name); @@ -1212,26 +1287,101 @@ ospf6_intra_route_calculation (struct os oa->route_table->hook_add = hook_add; oa->route_table->hook_remove = hook_remove; + for (pass = 0; pass < 2; pass++) + { + int skipped = 0; + for (route = ospf6_route_head (oa->route_table); route; route = ospf6_route_next (route)) { if (CHECK_FLAG (route->flag, OSPF6_ROUTE_REMOVE) && CHECK_FLAG (route->flag, OSPF6_ROUTE_ADD)) { - UNSET_FLAG (route->flag, OSPF6_ROUTE_REMOVE); - UNSET_FLAG (route->flag, OSPF6_ROUTE_ADD); + /* route unchanged */ + route->flag = 0; } - - if (CHECK_FLAG (route->flag, OSPF6_ROUTE_REMOVE)) + else if (CHECK_FLAG (route->flag, OSPF6_ROUTE_REMOVE)) + { + /* remove route */ ospf6_route_remove (route, oa->route_table); + route->flag = 0; + } else if (CHECK_FLAG (route->flag, OSPF6_ROUTE_ADD) || CHECK_FLAG (route->flag, OSPF6_ROUTE_CHANGE)) { + /* add route */ + int i; + + for (i = 0; ospf6_nexthop_is_set (&route->nexthop[i]) && + i < OSPF6_MULTI_PATH_LIMIT; i++) + { + int routablenexthop = 0; + + if (route->nexthop[i].ifindex && + IN6_IS_ADDR_UNSPECIFIED (&route->nexthop[i].address)) + routablenexthop = 1; + else if (route->nexthop[i].directly_connected) + routablenexthop = 1; + else + { + struct prefix prefix; + struct ospf6_route *nhroute; + + memset (&prefix, 0, sizeof (prefix)); + prefix.family = AF_INET6; + prefix.prefixlen = IPV6_MAX_PREFIXLEN; + IPV6_ADDR_COPY (&prefix.u.prefix6, + &route->nexthop[i].address); + + nhroute = + ospf6_route_lookup_bestmatch (&prefix, + oa->route_table); + + /* nhroute->flag == 0 implies that nhroute has already + * been processed since route->flag is cleared in each + * case. route is skipped if nhroute has not been + * processed yet because zebra or the kernel can reject + * routes with unreachable nexthops. If skipped, route + * will get added in the second pass since any + * prerequisite nexthops should have been added during the + * first pass. + */ + if (nhroute && nhroute->flag == 0) + routablenexthop = 1; + } + + if (routablenexthop) + { if (hook_add) (*hook_add) (route); - } route->flag = 0; + break; + } + else + { + if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX) || pass > 0) + { + char buf[INET6_ADDRSTRLEN]; + + inet_ntop (AF_INET6, &route->prefix.u.prefix6, buf, + sizeof (buf)); + zlog_debug + ("%s: pass %d skipping route to %s/%d because nexthop is not routable%s", + __func__, pass, buf, route->prefix.prefixlen, + pass > 0 ? "; this shouldn't happen" : ""); + } + skipped++; + } + } + } + else if (route->flag) + zlog_warn ("%s: unknown route flag(s): 0x%x", __func__, + route->flag); + } + + if (skipped == 0) + break; } if (IS_OSPF6_DEBUG_EXAMIN (INTRA_PREFIX)) @@ -1248,7 +1398,7 @@ ospf6_brouter_debug_print (struct ospf6_ char installed[16], changed[16]; struct timeval now, res; char id[16], adv_router[16]; - char capa[16], options[16]; + char capa[16], options[OSPF6OPTSTRLEN]; brouter_id = ADV_ROUTER_IN_PREFIX (&brouter->prefix); inet_ntop (AF_INET, &brouter_id, brouter_name, sizeof (brouter_name)); @@ -1283,8 +1433,7 @@ ospf6_brouter_debug_print (struct ospf6_ (CHECK_FLAG (brouter->flag, OSPF6_ROUTE_CHANGE) ? "C" : "-")); zlog_info (" path type: %s ls-origin %s id: %s adv-router %s", OSPF6_PATH_TYPE_NAME (brouter->path.type), - ospf6_lstype_name (brouter->path.origin.type), - id, adv_router); + ospf6_lstype_name (brouter->path.origin.type), id, adv_router); zlog_info (" options: %s router-bits: %s metric-type: %d metric: %d/%d", options, capa, brouter->path.metric_type, brouter->path.cost, brouter->path.cost_e2); @@ -1413,29 +1562,25 @@ ospf6_intra_brouter_calculation (struct zlog_info ("border-router calculation for area %s: done", oa->name); } -struct ospf6_lsa_handler router_handler = -{ +struct ospf6_lsa_handler router_handler = { OSPF6_LSTYPE_ROUTER, "Router", ospf6_router_lsa_show }; -struct ospf6_lsa_handler network_handler = -{ +struct ospf6_lsa_handler network_handler = { OSPF6_LSTYPE_NETWORK, "Network", ospf6_network_lsa_show }; -struct ospf6_lsa_handler link_handler = -{ +struct ospf6_lsa_handler link_handler = { OSPF6_LSTYPE_LINK, "Link", ospf6_link_lsa_show }; -struct ospf6_lsa_handler intra_prefix_handler = -{ +struct ospf6_lsa_handler intra_prefix_handler = { OSPF6_LSTYPE_INTRA_PREFIX, "Intra-Prefix", ospf6_intra_prefix_lsa_show @@ -1450,13 +1595,152 @@ ospf6_intra_init (void) ospf6_install_lsa_handler (&intra_prefix_handler); } +//prevent LSAs from being originated before MinLSInterval +void +ospf6_lsa_schedule (struct ospf6_area *oa, struct ospf6_interface *oi, + int type, boolean stub) +{ + struct ospf6 *o = NULL; + struct ospf6_lsa *old; + int link_state_id; + long time_msec = -1; + + switch (type) + { + case OSPF6_LSTYPE_ROUTER: + link_state_id = 0; + o = oa->ospf6; + old = ospf6_lsdb_lookup (htons (type), link_state_id, + o->router_id, oa->lsdb); + break; + case OSPF6_LSTYPE_NETWORK: + link_state_id = oi->interface->ifindex; + o = oi->area->ospf6; + old = ospf6_lsdb_lookup (htons (type), htonl (link_state_id), + o->router_id, oi->area->lsdb); + break; + case OSPF6_LSTYPE_LINK: + link_state_id = oi->interface->ifindex; + o = oi->area->ospf6; + old = ospf6_lsdb_lookup (htons (type), htonl (link_state_id), + o->router_id, oi->lsdb); + break; + case OSPF6_LSTYPE_INTRA_PREFIX: + if (stub) + { + link_state_id = 0; + o = oa->ospf6; + old = ospf6_lsdb_lookup (htons (type), link_state_id, + o->router_id, oa->lsdb); + } + else + { + link_state_id = oi->interface->ifindex; + o = oi->area->ospf6; + old = ospf6_lsdb_lookup (htons (type), htonl (link_state_id), + o->router_id, oi->area->lsdb); + } + break; + default: + zlog_warn ("No such LSA type"); + return; + break; + } + if (old) + { + time_msec = + (long) (((float) o->minLSInterval - + elapsed_time (&old->originated)) * 1000); + } + switch (type) + { + case OSPF6_LSTYPE_ROUTER: + if (time_msec > 0) + { + THREAD_OFF (oa->thread_router_lsa); + oa->thread_router_lsa = + thread_add_timer_msec (master, ospf6_router_lsa_originate, oa, + time_msec); + } + else + { + oa->thread_router_lsa = + thread_add_event (master, ospf6_router_lsa_originate, oa, 0); + } + break; + case OSPF6_LSTYPE_NETWORK: + if (time_msec > 0) + { + THREAD_OFF (oi->thread_network_lsa); + oi->thread_network_lsa = + thread_add_timer_msec (master, ospf6_network_lsa_originate, oi, + time_msec); + } + else + { + oi->thread_network_lsa = + thread_add_event (master, ospf6_network_lsa_originate, oi, 0); + } + break; + case OSPF6_LSTYPE_LINK: + if (time_msec > 0) + { + THREAD_OFF (oi->thread_link_lsa); + oi->thread_link_lsa = + thread_add_timer_msec (master, ospf6_link_lsa_originate, oi, + time_msec); + } + else + { + oi->thread_link_lsa = + thread_add_event (master, ospf6_link_lsa_originate, oi, 0); + } + break; + case OSPF6_LSTYPE_INTRA_PREFIX: + if (stub) + { + if (time_msec > 0) + { + THREAD_OFF (oa->thread_intra_prefix_lsa); + oa->thread_intra_prefix_lsa = + thread_add_timer_msec (master, + ospf6_intra_prefix_lsa_originate_stub, + oa, time_msec); + } + else + { + oa->thread_intra_prefix_lsa = + thread_add_event (master, + ospf6_intra_prefix_lsa_originate_stub, oa, + 0); + } + } + else + { + if (time_msec > 0) + { + THREAD_OFF (oi->thread_intra_prefix_lsa); + oi->thread_intra_prefix_lsa = + thread_add_timer_msec (master, + ospf6_intra_prefix_lsa_originate_transit, + oi, time_msec); + } + else + { + oi->thread_intra_prefix_lsa = + thread_add_event (master, + ospf6_intra_prefix_lsa_originate_transit, + oi, 0); + } + } + break; + } +} + DEFUN (debug_ospf6_brouter, debug_ospf6_brouter_cmd, "debug ospf6 border-routers", - DEBUG_STR - OSPF6_STR - "Debug border router\n" - ) + DEBUG_STR OSPF6_STR "Debug border router\n") { OSPF6_DEBUG_BROUTER_ON (); return CMD_SUCCESS; @@ -1465,11 +1749,7 @@ DEFUN (debug_ospf6_brouter, DEFUN (no_debug_ospf6_brouter, no_debug_ospf6_brouter_cmd, "no debug ospf6 border-routers", - NO_STR - DEBUG_STR - OSPF6_STR - "Debug border router\n" - ) + NO_STR DEBUG_STR OSPF6_STR "Debug border router\n") { OSPF6_DEBUG_BROUTER_OFF (); return CMD_SUCCESS; @@ -1481,9 +1761,7 @@ DEFUN (debug_ospf6_brouter_router, DEBUG_STR OSPF6_STR "Debug border router\n" - "Debug specific border router\n" - "Specify border-router's router-id\n" - ) + "Debug specific border router\n" "Specify border-router's router-id\n") { u_int32_t router_id; inet_pton (AF_INET, argv[0], &router_id); @@ -1496,10 +1774,7 @@ DEFUN (no_debug_ospf6_brouter_router, "no debug ospf6 border-routers router-id", NO_STR DEBUG_STR - OSPF6_STR - "Debug border router\n" - "Debug specific border router\n" - ) + OSPF6_STR "Debug border router\n" "Debug specific border router\n") { OSPF6_DEBUG_BROUTER_SPECIFIC_ROUTER_OFF (); return CMD_SUCCESS; @@ -1511,9 +1786,7 @@ DEFUN (debug_ospf6_brouter_area, DEBUG_STR OSPF6_STR "Debug border router\n" - "Debug border routers in specific Area\n" - "Specify Area-ID\n" - ) + "Debug border routers in specific Area\n" "Specify Area-ID\n") { u_int32_t area_id; inet_pton (AF_INET, argv[0], &area_id); @@ -1527,9 +1800,7 @@ DEFUN (no_debug_ospf6_brouter_area, NO_STR DEBUG_STR OSPF6_STR - "Debug border router\n" - "Debug border routers in specific Area\n" - ) + "Debug border router\n" "Debug border routers in specific Area\n") { OSPF6_DEBUG_BROUTER_SPECIFIC_AREA_OFF (); return CMD_SUCCESS; --- quagga-0.99.9/ospf6d/ospf6_intra.h 2006-05-15 03:36:47.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_intra.h 2008-04-16 11:55:54.000000000 -0700 @@ -22,6 +22,9 @@ #ifndef OSPF6_INTRA_H #define OSPF6_INTRA_H +#include "ospf6d.h" +#include "ospf6_area.h" + /* Debug option */ extern unsigned char conf_debug_ospf6_brouter; extern u_int32_t conf_debug_ospf6_brouter_specific_router_id; @@ -140,38 +143,33 @@ struct ospf6_intra_prefix_lsa /* followed by ospf6 prefix(es) */ }; - +struct ospf6_interface; +void ospf6_lsa_schedule (struct ospf6_area *oa, struct ospf6_interface *oi, + int type, boolean stub); #define OSPF6_ROUTER_LSA_SCHEDULE(oa) \ do { \ if (! (oa)->thread_router_lsa) \ - (oa)->thread_router_lsa = \ - thread_add_event (master, ospf6_router_lsa_originate, oa, 0); \ + ospf6_lsa_schedule(oa, NULL, OSPF6_LSTYPE_ROUTER, false); \ } while (0) #define OSPF6_NETWORK_LSA_SCHEDULE(oi) \ do { \ if (! (oi)->thread_network_lsa) \ - (oi)->thread_network_lsa = \ - thread_add_event (master, ospf6_network_lsa_originate, oi, 0); \ + ospf6_lsa_schedule(NULL, oi, OSPF6_LSTYPE_NETWORK, false); \ } while (0) #define OSPF6_LINK_LSA_SCHEDULE(oi) \ do { \ if (! (oi)->thread_link_lsa) \ - (oi)->thread_link_lsa = \ - thread_add_event (master, ospf6_link_lsa_originate, oi, 0); \ + ospf6_lsa_schedule(NULL, oi, OSPF6_LSTYPE_LINK, false); \ } while (0) #define OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(oa) \ do { \ if (! (oa)->thread_intra_prefix_lsa) \ - (oa)->thread_intra_prefix_lsa = \ - thread_add_event (master, ospf6_intra_prefix_lsa_originate_stub, \ - oa, 0); \ + ospf6_lsa_schedule(oa, NULL, OSPF6_LSTYPE_INTRA_PREFIX, true); \ } while (0) #define OSPF6_INTRA_PREFIX_LSA_SCHEDULE_TRANSIT(oi) \ do { \ if (! (oi)->thread_intra_prefix_lsa) \ - (oi)->thread_intra_prefix_lsa = \ - thread_add_event (master, ospf6_intra_prefix_lsa_originate_transit, \ - oi, 0); \ + ospf6_lsa_schedule(NULL, oi, OSPF6_LSTYPE_INTRA_PREFIX, false); \ } while (0) #define OSPF6_NETWORK_LSA_EXECUTE(oi) \ --- quagga-0.99.9/ospf6d/ospf6_lsa.c 2007-06-14 03:02:14.000000000 -0700 +++ quagga-0.99.9.ospfv3-manetmdr.tmp/ospf6d/ospf6_lsa.c 2008-04-16 11:55:54.000000000 -0700 @@ -70,8 +70,7 @@ ospf6_unknown_lsa_show (struct vty *vty, return 0;