+++ /dev/null
-#
-# Copyright (C) 2009-2010 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=quagga-unstable
-PKG_VERSION:=0.99.17
-PKG_RELEASE:=2
-
-PKG_SOURCE:=quagga-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://www.quagga.net/download/ \
- http://www.de.quagga.net/download/ \
- http://www.uk.quagga.net/download/
-PKG_MD5SUM:=37b9022adca04b03863d2d79787e643f
-
-PKG_BUILD_PARALLEL:=1
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/quagga-$(PKG_VERSION)
-
-PKG_CONFIG_DEPENDS:= \
- CONFIG_PACKAGE_quagga-unstable-isisd \
- CONFIG_PACKAGE_quagga-unstable-ripngd
-
-PKG_INSTALL:=1
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/quagga-unstable/Default
- SECTION:=net
- CATEGORY:=Network
- DEPENDS:=quagga-unstable
- TITLE:=The Quagga Software Routing Suite
- URL:=http://www.quagga.net
- MAINTAINER:=Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
-endef
-
-define Package/quagga-unstable
- $(call Package/quagga-unstable/Default)
- DEPENDS:= +librt
- MENU:=1
-endef
-
-define Package/quagga-unstable/description
- A routing software package that provides TCP/IP based routing services
- with routing protocols support such as RIPv1, RIPv2, RIPng, OSPFv2,
- OSPFv3, BGP-4, and BGP-4+
-endef
-
-define Package/quagga-unstable-libzebra
- $(call Package/quagga-unstable/Default)
- TITLE:=zebra library
-endef
-
-define Package/quagga-unstable-libospf
- $(call Package/quagga-unstable/Default)
- TITLE:=OSPF library
-endef
-
-define Package/quagga-unstable-bgpd
- $(call Package/quagga-unstable/Default)
- DEPENDS+= +quagga-unstable-libzebra
- TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
-endef
-
-define Package/quagga-unstable-isisd
- $(call Package/quagga-unstable/Default)
- TITLE:=IS-IS routing engine
-endef
-
-define Package/quagga-unstable-ospfd
- $(call Package/quagga-unstable/Default)
- DEPENDS+= +quagga-unstable-libospf +quagga-unstable-libzebra
- TITLE:=OSPFv2 routing engine
-endef
-
-define Package/quagga-unstable-ospf6d
- $(call Package/quagga-unstable/Default)
- DEPENDS+= +quagga-unstable-libospf +quagga-unstable-libzebra @IPV6
- TITLE:=OSPFv3 routing engine
-endef
-
-define Package/quagga-unstable-ripd
- $(call Package/quagga-unstable/Default)
- DEPENDS+= +quagga-unstable-libzebra
- TITLE:=RIP routing engine
-endef
-
-define Package/quagga-unstable-ripngd
- $(call Package/quagga-unstable/Default)
- DEPENDS+= +quagga-unstable-libzebra @BROKEN
- TITLE:=RIPNG routing engine
-endef
-
-define Package/quagga-unstable-vtysh
- $(call Package/quagga-unstable/Default)
- DEPENDS+= quagga-unstable-libzebra +libreadline +libncurses
- TITLE:=integrated shell for Quagga routing software
-endef
-
-define Package/quagga-unstable/conffiles
-/etc/quagga/zebra.conf
-endef
-
-define Package/quagga-unstable-bgpd/conffiles
-/etc/quagga/bgpd.conf
-endef
-
-define Package/quagga-unstable-isisd/conffiles
-/etc/quagga/isisd.conf
-endef
-
-define Package/quagga-unstable-ospfd/conffiles
-/etc/quagga/ospfd.conf
-endef
-
-define Package/quagga-unstable-ospf6d/conffiles
-/etc/quagga/ospf6d.conf
-endef
-
-define Package/quagga-unstable-ripd/conffiles
-/etc/quagga/ripd.conf
-endef
-
-define Package/quagga-unstable-ripngd/conffiles
-/etc/quagga/ripngd.conf
-endef
-
-CONFIGURE_ARGS+= \
- --localstatedir=/var/run/quagga \
- --sysconfdir=/etc/quagga/ \
- --enable-shared \
- --disable-static \
- --enable-vtysh \
- --enable-user=quagga \
- --enable-group=quagga \
- --enable-pie=no \
- --enable-multipath=8 \
-
-ifneq ($(CONFIG_PACKAGE_quagga-unstable-isisd),)
- CONFIGURE_ARGS+= --enable-isisd
-endif
-
-ifneq ($(CONFIG_PACKAGE_quagga-unstable-ripngd),)
- CONFIGURE_ARGS+= --enable-ripngd
-endif
-
-define Package/quagga-unstable/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/zebra $(1)/usr/sbin/
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/watchquagga $(1)/usr/sbin/
- # avoid /etc being set to 0750
- $(INSTALL_DIR) $(1)/etc/quagga
- chmod 0750 $(1)/etc/quagga
- $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/zebra.conf
- $(INSTALL_DIR) $(1)/etc/init.d
- $(INSTALL_BIN) ./files/quagga $(1)/usr/sbin/quagga.init
- $(INSTALL_BIN) ./files/quagga.init $(1)/etc/init.d/quagga
-endef
-
-define Package/quagga-unstable/postinst
-#!/bin/sh
-
-name=quagga
-id=51
-
-# do not change below
-# check if we are on real system
-if [ -z "$${IPKG_INSTROOT}" ]; then
- # create copies of passwd and group, if we use squashfs
- rootfs=`mount |awk '/root/ { print $$5 }'`
- if [ "$$rootfs" = "squashfs" ]; then
- if [ -h /etc/group ]; then
- rm /etc/group
- cp /rom/etc/group /etc/group
- fi
- if [ -h /etc/passwd ]; then
- rm /etc/passwd
- cp /rom/etc/passwd /etc/passwd
- fi
- fi
-fi
-
-echo ""
-if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/group)" ]; then
- echo "adding group $$name to /etc/group"
- echo "$${name}:x:$${id}:" >> $${IPKG_INSTROOT}/etc/group
-fi
-
-if [ -z "$$(grep ^\\$${name}: $${IPKG_INSTROOT}/etc/passwd)" ]; then
- echo "adding user $$name to /etc/passwd"
- echo "$${name}:x:$${id}:$${id}:$${name}:/tmp/.$${name}:/bin/false" >> $${IPKG_INSTROOT}/etc/passwd
-fi
-
-grep -q '^zebra[[:space:]]*2601/tcp' $${IPKG_INSTROOT}/etc/services 2>/dev/null
-if [ $$? -ne 0 ]; then
-echo "zebrasrv 2600/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "zebra 2601/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "ripd 2602/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "ripngd 2603/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "ospfd 2604/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "bgpd 2605/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "ospf6d 2606/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "ospfapi 2607/tcp" >>$${IPKG_INSTROOT}/etc/services
-echo "isisd 2608/tcp" >>$${IPKG_INSTROOT}/etc/services
-fi
-endef
-
-define Package/quagga-unstable-bgpd/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/bgpd $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/quagga
- chmod 0750 $(1)/etc/quagga
- $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/bgpd.conf
-endef
-
-define Package/quagga-unstable-isisd/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/isisd $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/quagga
- chmod 0750 $(1)/etc/quagga
- $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/isisd.conf
-endef
-
-define Package/quagga-unstable-ospfd/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospfd $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/quagga
- chmod 0750 $(1)/etc/quagga
- $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospfd.conf
-endef
-
-define Package/quagga-unstable-ospf6d/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ospf6d $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/quagga
- chmod 0750 $(1)/etc/quagga
- $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ospf6d.conf
-endef
-
-define Package/quagga-unstable-ripd/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripd $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/quagga
- chmod 0750 $(1)/etc/quagga
- $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripd.conf
-endef
-
-define Package/quagga-unstable-ripngd/install
- $(INSTALL_DIR) $(1)/usr/sbin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/ripngd $(1)/usr/sbin/
- $(INSTALL_DIR) $(1)/etc/quagga
- chmod 0750 $(1)/etc/quagga
- $(INSTALL_CONF) ./files/quagga.conf $(1)/etc/quagga/ripngd.conf
-endef
-
-define Package/quagga-unstable-vtysh/install
- $(INSTALL_DIR) $(1)/usr/bin
- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/vtysh $(1)/usr/bin/
-endef
-
-define Package/quagga-unstable-libospf/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libospf.so.* $(1)/usr/lib/
-endef
-
-define Package/quagga-unstable-libzebra/install
- $(INSTALL_DIR) $(1)/usr/lib
- $(CP) $(PKG_INSTALL_DIR)/usr/lib/libzebra.so.* $(1)/usr/lib/
-endef
-
-$(eval $(call BuildPackage,quagga-unstable))
-$(eval $(call BuildPackage,quagga-unstable-libzebra))
-$(eval $(call BuildPackage,quagga-unstable-libospf))
-$(eval $(call BuildPackage,quagga-unstable-bgpd))
-$(eval $(call BuildPackage,quagga-unstable-isisd))
-$(eval $(call BuildPackage,quagga-unstable-ospfd))
-$(eval $(call BuildPackage,quagga-unstable-ospf6d))
-$(eval $(call BuildPackage,quagga-unstable-ripd))
-$(eval $(call BuildPackage,quagga-unstable-ripngd))
-$(eval $(call BuildPackage,quagga-unstable-vtysh))
+++ /dev/null
-#!/bin/sh
-#
-# quagga Starts/stops quagga daemons and watchquagga.
-# Create a daemon.conf file to have that routing daemon
-# started/stopped automagically when using this script
-# without any daemon names as args.
-# If watchquagga is available, it will also be
-# started/stopped if the script is called without
-# any daemon names.
-#
-
-ME=$(basename $0)
-
-usage() {
- echo "Usage: ${ME} {start|stop|restart} [daemon ...]"
- exit 2
-}
-
-if [ -z "$1" ]
-then
- usage
-else
- COMMAND=$1
-fi
-shift
-ARG_DAEMONS=$*
-BINDIR=/usr/sbin
-CONFDIR=/etc/quagga
-STATEDIR=/var/run/quagga
-DAEMONS="zebra ripd ripngd ospfd ospf6d bgpd"
-DAEMON_FLAGS=-d
-WATCHQUAGGA_FLAGS="-d -z -T 60 -R"
-WATCHQUAGGA_CMD="$0 watchrestart"
-if [ ${COMMAND} != "watchrestart" ]
-then
- DAEMONS="${DAEMONS} watchquagga"
-fi
-DAEMONS_STARTSEQ=${DAEMONS}
-
-reverse()
-{
- local revlist r
- revlist=
- for r
- do
- revlist="$r $revlist"
- done
- echo $revlist
-}
-
-DAEMONS_STOPSEQ=$(reverse ${DAEMONS_STARTSEQ})
-
-#pidof() {
-# ps ax | awk 'match($5, "(^|/)'"$1"'$") > 0 { printf " %s", $1 }'
-#}
-
-quit() {
- echo "${ME}: $1"
- exit 0
-}
-
-die() {
- echo "${ME}: $1"
- exit 1
-}
-
-is_in() {
- local i
- for i in $2
- do
- [ "$1" = "$i" ] && return 0
- done
- return 1
-}
-
-select_subset() {
- local unknown i j
- unknown=
- RESULT=
- for i in $1
- do
- is_in $i "$2" || unknown="$unknown $i"
- done
- if [ -n "$unknown" ]
- then
- RESULT=$unknown
- return 1
- else
- for j in $2
- do
- is_in $j "$1" && RESULT="$RESULT $j"
- done
- return 0
- fi
-}
-
-# check command
-
-case ${COMMAND}
-in
- start|stop|restart)
- ;;
- watchrestart)
- if [ -n "$ARG_DAEMONS" ]
- then
- echo "${ME}: watchrestart mode is only for use by watchquagga"
- exit 2
- fi
- ;;
- *)
- usage
- ;;
-esac
-
-# select daemons to start
-
-case ${COMMAND}
-in
- start|restart|watchrestart)
- START_DAEMONS=
- for d in ${DAEMONS_STARTSEQ}
- do
- [ -x "${BINDIR}/${d}" -a -f "${CONFDIR}/${d}.conf" ] \
- && START_DAEMONS="${START_DAEMONS}${d} "
- done
- WATCHQUAGGA_DAEMONS=${START_DAEMONS}
- if is_in watchquagga "${DAEMONS_STARTSEQ}"
- then
- START_DAEMONS="${START_DAEMONS} watchquagga"
- fi
- if [ -n "${ARG_DAEMONS}" ]
- then
- if select_subset "${ARG_DAEMONS}" "${DAEMONS}"
- then
- if select_subset "${ARG_DAEMONS}" "${START_DAEMONS}"
- then
- START_DAEMONS=${RESULT}
- else
- die "these daemons are not startable:${RESULT}."
- fi
- else
- die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
- fi
- fi
- ;;
-esac
-
-# select daemons to stop
-
-case ${COMMAND}
-in
- stop|restart|watchrestart)
- STOP_DAEMONS=${DAEMONS_STOPSEQ}
- if [ -n "${ARG_DAEMONS}" ]
- then
- if select_subset "${ARG_DAEMONS}" "${STOP_DAEMONS}"
- then
- STOP_DAEMONS=${RESULT}
- else
- die "unknown daemons:${RESULT}; choose from: ${DAEMONS}."
- fi
- fi
- stop_daemons=
- for d in ${STOP_DAEMONS}
- do
- pidfile=${STATEDIR}/${d}.pid
- if [ -f "${pidfile}" -o -n "$(pidof ${d})" ]
- then
- stop_daemons="${stop_daemons}${d} "
- elif [ -n "${ARG_DAEMONS}" ]
- then
- echo "${ME}: found no ${d} process running."
- fi
- done
- STOP_DAEMONS=${stop_daemons}
- ;;
-esac
-
-# stop daemons
-
-for d in $STOP_DAEMONS
-do
- echo -n "${ME}: Stopping ${d} ... "
- pidfile=${STATEDIR}/${d}.pid
- if [ -f "${pidfile}" ]
- then
- file_pid=$(cat ${pidfile})
- if [ -z "${file_pid}" ]
- then
- echo -n "no pid file entry found ... "
- fi
- else
- file_pid=
- echo -n "no pid file found ... "
- fi
- proc_pid=$(pidof ${d})
- if [ -z "${proc_pid}" ]
- then
- echo -n "found no ${d} process running ... "
- else
- count=0
- notinpidfile=
- for p in ${proc_pid}
- do
- count=$((${count}+1))
- if kill ${p}
- then
- echo -n "killed ${p} ... "
- else
- echo -n "failed to kill ${p} ... "
- fi
- [ "${p}" = "${file_pid}" ] \
- || notinpidfile="${notinpidfile} ${p}"
- done
- [ ${count} -le 1 ] \
- || echo -n "WARNING: ${count} ${d} processes were found running ... "
- for n in ${notinpidfile}
- do
- echo -n "WARNING: process ${n} was not in pid file ... "
- done
- fi
- count=0
- survivors=$(pidof ${d})
- while [ -n "${survivors}" ]
- do
- sleep 1
- count=$((${count}+1))
- survivors=$(pidof ${d})
- [ -z "${survivors}" -o ${count} -gt 5 ] && break
- for p in ${survivors}
- do
- sleep 1
- echo -n "${p} "
- kill ${p}
- done
- done
- survivors=$(pidof ${d})
- [ -n "${survivors}" ] && \
- if kill -KILL ${survivors}
- then
- echo -n "KILLed ${survivors} ... "
- else
- echo -n "failed to KILL ${survivors} ... "
- fi
- sleep 1
- survivors=$(pidof ${d})
- if [ -z "${survivors}" ]
- then
- echo -n "done."
- if [ -f "${pidfile}" ]
- then
- rm -f ${pidfile} \
- || echo -n " Failed to remove pidfile."
- fi
- else
- echo -n "failed to stop ${survivors} - giving up."
- if [ "${survivors}" != "${file_pid}" ]
- then
- if echo "${survivors}" > ${pidfile}
- then
- chown quagga:quagga ${pidfile}
- echo -n " Wrote ${survivors} to pidfile."
- else
- echo -n " Failed to write ${survivors} to pidfile."
- fi
- fi
- fi
- echo
-done
-
-# start daemons
-
-if [ -n "$START_DAEMONS" ]
-then
- [ -d ${CONFDIR} ] \
- || quit "${ME}: no config directory ${CONFDIR} - exiting."
- chown -R quagga:quagga ${CONFDIR}
- [ -d ${STATEDIR} ] || mkdir -p ${STATEDIR} \
- || die "${ME}: could not create state directory ${STATEDIR} - exiting."
- chown -R quagga:quagga ${STATEDIR}
-
- for d in $START_DAEMONS
- do
- echo -n "${ME}: Starting ${d} ... "
- proc_pid=$(pidof ${d})
- pidfile=${STATEDIR}/${d}.pid
- file_pid=
- if [ -f "${pidfile}" ]
- then
- file_pid=$(cat ${pidfile})
- if [ -n "${file_pid}" ]
- then
- echo -n "found old pid file entry ${file_pid} ... "
- fi
- fi
- if [ -n "${proc_pid}" ]
- then
- echo -n "found ${d} running (${proc_pid}) - skipping ${d}."
- if [ "${proc_pid}" != "${file_pid}" ]
- then
- if echo "${proc_pid}" > ${pidfile}
- then
- chown quagga:quagga ${pidfile}
- echo -n " Wrote ${proc_pid} to pidfile."
- else
- echo -n " Failed to write ${proc_pid} to pidfile."
- fi
- fi
- elif rm -f "${pidfile}"
- then
- if [ "${d}" = "watchquagga" ]
- then
- "${BINDIR}/${d}" \
- ${WATCHQUAGGA_FLAGS} \
- "${WATCHQUAGGA_CMD}" \
- ${WATCHQUAGGA_DAEMONS}
- status=$?
- else
- "${BINDIR}/${d}" ${DAEMON_FLAGS}
- status=$?
- fi
- if [ $status -eq 0 ]
- then
- echo -n "done."
- else
- echo -n "failed."
- fi
- else
- echo -n " failed to remove pidfile."
- fi
- echo
- done
-fi
+++ /dev/null
-password zebra
-!
-access-list vty permit 127.0.0.0/8
-access-list vty deny any
-!
-line vty
- access-class vty
+++ /dev/null
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-
-START=60
-start() {
- /usr/sbin/quagga.init start
-}
-
-stop() {
- /usr/sbin/quagga.init stop
-}
+++ /dev/null
---- a/zebra/zserv.c
-+++ b/zebra/zserv.c
-@@ -451,7 +451,7 @@ zsend_route_multipath (int cmd, struct zserv *client, struct prefix *p,
- }
-
- /* Metric */
-- if (cmd == ZEBRA_IPV4_ROUTE_ADD || ZEBRA_IPV6_ROUTE_ADD)
-+ if (cmd == ZEBRA_IPV4_ROUTE_ADD || cmd == ZEBRA_IPV6_ROUTE_ADD)
- {
- SET_FLAG (zapi_flags, ZAPI_MESSAGE_DISTANCE);
- stream_putc (s, rib->distance);
+++ /dev/null
---- a/lib/vty.c
-+++ b/lib/vty.c
-@@ -250,7 +250,7 @@ vty_hello (struct vty *vty)
- vty_out (vty, "MOTD file not found%s", VTY_NEWLINE);
- }
- else if (host.motd)
-- vty_out (vty, host.motd);
-+ vty_out (vty, "%s", host.motd);
- }
-
- /* Put out prompt and wait input from user. */
+++ /dev/null
---- a/bgpd/bgp_packet.c
-+++ b/bgpd/bgp_packet.c
-@@ -177,10 +177,11 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi)
-
- if (rn->prn)
- prd = (struct prefix_rd *) &rn->prn->p;
-- if (binfo && binfo->extra)
-+ if (binfo)
- {
-- tag = binfo->extra->tag;
- from = binfo->peer;
-+ if (binfo->extra)
-+ tag = binfo->extra->tag;
- }
-
- bgp_packet_set_marker (s, BGP_MSG_UPDATE);
+++ /dev/null
-Add definitions for IPCTL_FORWARDING and IP6CTL_FORWARDING.
-
-Inspired from
-http://svn.gnumonks.org/trunk/grouter/build/src/quagga/quagga/quagga-0.99.1-forward_sysctl-2.6.14.patch
-
-Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-
-Index: quagga-0.99.16/zebra/ipforward_sysctl.c
-===================================================================
---- quagga-0.99.16.orig/zebra/ipforward_sysctl.c 2010-06-20 23:40:45.000000000 +0200
-+++ quagga-0.99.16/zebra/ipforward_sysctl.c 2010-06-20 23:41:37.000000000 +0200
-@@ -31,6 +31,15 @@
-
- #define MIB_SIZ 4
-
-+/* Fix for recent (2.6.14) kernel headers */
-+#ifndef IPCTL_FORWARDING
-+#define IPCTL_FORWARDING NET_IPV4_FORWARD
-+#endif
-+
-+#ifndef IP6CTL_FORWARDING
-+#define IP6CTL_FORWARDING NET_IPV6_FORWARDING
-+#endif
-+
- extern struct zebra_privs_t zserv_privs;
-
- /* IPv4 forwarding control MIB. */
+++ /dev/null
---- a/bgpd/bgp_vty.c
-+++ b/bgpd/bgp_vty.c
-@@ -8228,8 +8228,14 @@ bgp_str2route_type (int afi, const char
- return ZEBRA_ROUTE_STATIC;
- else if (strncmp (str, "r", 1) == 0)
- return ZEBRA_ROUTE_RIP;
-- else if (strncmp (str, "o", 1) == 0)
-+ else if (strncmp (str, "os", 2) == 0)
- return ZEBRA_ROUTE_OSPF;
-+ else if (strncmp (str, "h", 1) == 0)
-+ return ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (str, "ol", 2) == 0)
-+ return ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (str, "b", 1) == 0)
-+ return ZEBRA_ROUTE_BATMAN;
- }
- if (afi == AFI_IP6)
- {
-@@ -8241,21 +8247,30 @@ bgp_str2route_type (int afi, const char
- return ZEBRA_ROUTE_STATIC;
- else if (strncmp (str, "r", 1) == 0)
- return ZEBRA_ROUTE_RIPNG;
-- else if (strncmp (str, "o", 1) == 0)
-+ else if (strncmp (str, "os", 2) == 0)
- return ZEBRA_ROUTE_OSPF6;
-+ else if (strncmp (str, "h", 1) == 0)
-+ return ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (str, "ol", 2) == 0)
-+ return ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (str, "b", 1) == 0)
-+ return ZEBRA_ROUTE_BATMAN;
- }
- return 0;
- }
-
- DEFUN (bgp_redistribute_ipv4,
- bgp_redistribute_ipv4_cmd,
-- "redistribute (connected|kernel|ospf|rip|static)",
-+ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman)",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
-- "Static routes\n")
-+ "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
- {
- int type;
-
-@@ -8270,13 +8285,16 @@ DEFUN (bgp_redistribute_ipv4,
-
- DEFUN (bgp_redistribute_ipv4_rmap,
- bgp_redistribute_ipv4_rmap_cmd,
-- "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
-+ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
-@@ -8295,13 +8313,16 @@ DEFUN (bgp_redistribute_ipv4_rmap,
-
- DEFUN (bgp_redistribute_ipv4_metric,
- bgp_redistribute_ipv4_metric_cmd,
-- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295>",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n")
- {
-@@ -8322,13 +8343,16 @@ DEFUN (bgp_redistribute_ipv4_metric,
-
- DEFUN (bgp_redistribute_ipv4_rmap_metric,
- bgp_redistribute_ipv4_rmap_metric_cmd,
-- "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n"
- "Metric for redistributed routes\n"
-@@ -8352,13 +8376,16 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
-
- DEFUN (bgp_redistribute_ipv4_metric_rmap,
- bgp_redistribute_ipv4_metric_rmap_cmd,
-- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
-+ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n"
- "Route map reference\n"
-@@ -8382,14 +8409,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
-
- DEFUN (no_bgp_redistribute_ipv4,
- no_bgp_redistribute_ipv4_cmd,
-- "no redistribute (connected|kernel|ospf|rip|static)",
-+ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman)",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
-- "Static routes\n")
-+ "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
- {
- int type;
-
-@@ -8405,7 +8435,7 @@ DEFUN (no_bgp_redistribute_ipv4,
-
- DEFUN (no_bgp_redistribute_ipv4_rmap,
- no_bgp_redistribute_ipv4_rmap_cmd,
-- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
-+ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8413,6 +8443,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
-@@ -8431,7 +8464,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
-
- DEFUN (no_bgp_redistribute_ipv4_metric,
- no_bgp_redistribute_ipv4_metric_cmd,
-- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8439,6 +8472,9 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n")
- {
-@@ -8457,7 +8493,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
-
- DEFUN (no_bgp_redistribute_ipv4_rmap_metric,
- no_bgp_redistribute_ipv4_rmap_metric_cmd,
-- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8465,6 +8501,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n"
- "Metric for redistributed routes\n"
-@@ -8486,7 +8525,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
-
- ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
- no_bgp_redistribute_ipv4_metric_rmap_cmd,
-- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
-+ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8494,6 +8533,9 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
- "Open Shurtest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n"
- "Route map reference\n"
-@@ -8502,13 +8544,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
- #ifdef HAVE_IPV6
- DEFUN (bgp_redistribute_ipv6,
- bgp_redistribute_ipv6_cmd,
-- "redistribute (connected|kernel|ospf6|ripng|static)",
-+ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman)",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
-- "Static routes\n")
-+ "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
- {
- int type;
-
-@@ -8524,13 +8569,16 @@ DEFUN (bgp_redistribute_ipv6,
-
- DEFUN (bgp_redistribute_ipv6_rmap,
- bgp_redistribute_ipv6_rmap_cmd,
-- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
-+ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
-@@ -8549,13 +8597,16 @@ DEFUN (bgp_redistribute_ipv6_rmap,
-
- DEFUN (bgp_redistribute_ipv6_metric,
- bgp_redistribute_ipv6_metric_cmd,
-- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295>",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n")
- {
-@@ -8576,13 +8627,16 @@ DEFUN (bgp_redistribute_ipv6_metric,
-
- DEFUN (bgp_redistribute_ipv6_rmap_metric,
- bgp_redistribute_ipv6_rmap_metric_cmd,
-- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n"
- "Metric for redistributed routes\n"
-@@ -8606,13 +8660,16 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
-
- DEFUN (bgp_redistribute_ipv6_metric_rmap,
- bgp_redistribute_ipv6_metric_rmap_cmd,
-- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
-+ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n"
- "Route map reference\n"
-@@ -8636,14 +8693,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
-
- DEFUN (no_bgp_redistribute_ipv6,
- no_bgp_redistribute_ipv6_cmd,
-- "no redistribute (connected|kernel|ospf6|ripng|static)",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman)",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
- "Kernel routes\n"
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
-- "Static routes\n")
-+ "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
- {
- int type;
-
-@@ -8659,7 +8719,7 @@ DEFUN (no_bgp_redistribute_ipv6,
-
- DEFUN (no_bgp_redistribute_ipv6_rmap,
- no_bgp_redistribute_ipv6_rmap_cmd,
-- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8667,6 +8727,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
-@@ -8685,7 +8748,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
-
- DEFUN (no_bgp_redistribute_ipv6_metric,
- no_bgp_redistribute_ipv6_metric_cmd,
-- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8693,6 +8756,9 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n")
- {
-@@ -8711,7 +8777,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
-
- DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
- no_bgp_redistribute_ipv6_rmap_metric_cmd,
-- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8719,6 +8785,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n"
- "Metric for redistributed routes\n"
-@@ -8740,7 +8809,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
-
- ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
- no_bgp_redistribute_ipv6_metric_rmap_cmd,
-- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Connected\n"
-@@ -8748,6 +8817,9 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
- "Open Shurtest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
- "Static routes\n"
-+ "Hazy-Sighted Link State Protocol (HSLS)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "Default metric\n"
- "Route map reference\n"
---- a/lib/log.c
-+++ b/lib/log.c
-@@ -835,6 +835,8 @@ static const struct zebra_desc_table rou
- DESC_ENTRY (ZEBRA_ROUTE_ISIS, "isis", 'I' ),
- DESC_ENTRY (ZEBRA_ROUTE_BGP, "bgp", 'B' ),
- DESC_ENTRY (ZEBRA_ROUTE_HSLS, "hsls", 'H' ),
-+ DESC_ENTRY (ZEBRA_ROUTE_OLSR, "olsr", 'o' ),
-+ DESC_ENTRY (ZEBRA_ROUTE_BATMAN, "batman", 'b' ),
- };
- #undef DESC_ENTRY
-
---- a/lib/route_types.txt
-+++ b/lib/route_types.txt
-@@ -51,13 +51,9 @@ ZEBRA_ROUTE_OSPF, ospf, ospfd
- ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'O', 0, 1, "OSPF"
- ZEBRA_ROUTE_ISIS, isis, isisd, 'I', 1, 1, "IS-IS"
- ZEBRA_ROUTE_BGP, bgp, bgpd, 'B', 1, 1, "BGP"
--# HSLS and OLSR both are AFI independent (so: 1, 1), however
--# we want to disable for them for general Quagga distribution.
--# This at least makes it trivial for users of these protocols
--# to 'switch on' redist support (direct numeric entry remaining
--# possible).
--ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 0, 0, "HSLS"
--ZEBRA_ROUTE_OLSR, olsr, oslrd, 'o', 0, 0, "OLSR"
-+ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 1, 1, "HSLS"
-+ZEBRA_ROUTE_OLSR, olsr, olsrd, 'o', 1, 1, "OLSR"
-+ZEBRA_ROUTE_BATMAN, batman, batmand,'b', 1, 1, "BATMAN"
-
- ## help strings
- ZEBRA_ROUTE_SYSTEM, "Reserved route type, for internal use only"
-@@ -71,4 +67,5 @@ ZEBRA_ROUTE_OSPF6, "Open Shortest Path
- ZEBRA_ROUTE_ISIS, "Intermediate System to Intermediate System (IS-IS)"
- ZEBRA_ROUTE_BGP, "Border Gateway Protocol (BGP)"
- ZEBRA_ROUTE_HSLS, "Hazy-Sighted Link State Protocol (HSLS)"
--ZEBRA_ROUTE_OLSR, "Optimised Link State Routing (OLSR)"
-+ZEBRA_ROUTE_OLSR, "Optimized Link State Routing (OLSR)"
-+ZEBRA_ROUTE_BATMAN, "Better Approach to Mobile Ad-Hoc Networking (BATMAN)"
---- a/lib/zebra.h
-+++ b/lib/zebra.h
-@@ -441,7 +441,9 @@ struct in_pktinfo
- #define ZEBRA_ROUTE_ISIS 8
- #define ZEBRA_ROUTE_BGP 9
- #define ZEBRA_ROUTE_HSLS 10
--#define ZEBRA_ROUTE_MAX 11
-+#define ZEBRA_ROUTE_OLSR 11
-+#define ZEBRA_ROUTE_BATMAN 12
-+#define ZEBRA_ROUTE_MAX 13
-
- /* Note: whenever a new route-type or zserv-command is added the
- * corresponding {command,route}_types[] table in lib/log.c MUST be
---- a/ospf6d/ospf6_asbr.c
-+++ b/ospf6d/ospf6_asbr.c
-@@ -616,13 +616,16 @@ ospf6_asbr_redistribute_remove (int type
-
- DEFUN (ospf6_redistribute,
- ospf6_redistribute_cmd,
-- "redistribute (static|kernel|connected|ripng|bgp)",
-+ "redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman)",
- "Redistribute\n"
- "Static route\n"
- "Kernel route\n"
- "Connected route\n"
- "RIPng route\n"
- "BGP route\n"
-+ "HSLS route\n"
-+ "OLSR route\n"
-+ "BATMAN route\n"
- )
- {
- int type = 0;
-@@ -637,6 +640,12 @@ DEFUN (ospf6_redistribute,
- type = ZEBRA_ROUTE_RIPNG;
- else if (strncmp (argv[0], "bgp", 3) == 0)
- type = ZEBRA_ROUTE_BGP;
-+ else if (strncmp (argv[0], "h", 1) == 0)
-+ type = ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (argv[0], "o", 1) == 0)
-+ type = ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (argv[0], "ba", 2) == 0)
-+ type = ZEBRA_ROUTE_BATMAN;
-
- ospf6_asbr_redistribute_unset (type);
- ospf6_asbr_routemap_unset (type);
-@@ -646,13 +655,16 @@ DEFUN (ospf6_redistribute,
-
- DEFUN (ospf6_redistribute_routemap,
- ospf6_redistribute_routemap_cmd,
-- "redistribute (static|kernel|connected|ripng|bgp) route-map WORD",
-+ "redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman) route-map WORD",
- "Redistribute\n"
- "Static routes\n"
- "Kernel route\n"
- "Connected route\n"
- "RIPng route\n"
- "BGP route\n"
-+ "HSLS route\n"
-+ "OLSR route\n"
-+ "BATMAN route\n"
- "Route map reference\n"
- "Route map name\n"
- )
-@@ -669,6 +681,12 @@ 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], "h", 1) == 0)
-+ type = ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (argv[0], "o", 1) == 0)
-+ type = ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (argv[0], "ba", 2) == 0)
-+ type = ZEBRA_ROUTE_BATMAN;
-
- ospf6_asbr_redistribute_unset (type);
- ospf6_asbr_routemap_set (type, argv[1]);
-@@ -678,7 +696,7 @@ DEFUN (ospf6_redistribute_routemap,
-
- DEFUN (no_ospf6_redistribute,
- no_ospf6_redistribute_cmd,
-- "no redistribute (static|kernel|connected|ripng|bgp)",
-+ "no redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman)",
- NO_STR
- "Redistribute\n"
- "Static route\n"
-@@ -686,6 +704,9 @@ DEFUN (no_ospf6_redistribute,
- "Connected route\n"
- "RIPng route\n"
- "BGP route\n"
-+ "HSLS route\n"
-+ "OLSR route\n"
-+ "BATMAN route\n"
- )
- {
- int type = 0;
-@@ -700,6 +721,12 @@ 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], "h", 1) == 0)
-+ type = ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (argv[0], "o", 1) == 0)
-+ type = ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (argv[0], "ba", 2) == 0)
-+ type = ZEBRA_ROUTE_BATMAN;
-
- ospf6_asbr_redistribute_unset (type);
- ospf6_asbr_routemap_unset (type);
---- a/ospfd/ospf_vty.c
-+++ b/ospfd/ospf_vty.c
-@@ -107,8 +107,14 @@ str2distribute_source (const char *str,
- *source = ZEBRA_ROUTE_STATIC;
- else if (strncmp (str, "r", 1) == 0)
- *source = ZEBRA_ROUTE_RIP;
-- else if (strncmp (str, "b", 1) == 0)
-+ else if (strncmp (str, "bg", 2) == 0)
- *source = ZEBRA_ROUTE_BGP;
-+ else if (strncmp (str, "h", 1) == 0)
-+ *source = ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (str, "o", 1) == 0)
-+ *source = ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (str, "ba", 2) == 0)
-+ *source = ZEBRA_ROUTE_BATMAN;
- else
- return 0;
-
---- a/ripd/rip_zebra.c
-+++ b/ripd/rip_zebra.c
-@@ -204,8 +204,11 @@ static struct {
- {ZEBRA_ROUTE_KERNEL, 1, "kernel"},
- {ZEBRA_ROUTE_CONNECT, 1, "connected"},
- {ZEBRA_ROUTE_STATIC, 1, "static"},
-- {ZEBRA_ROUTE_OSPF, 1, "ospf"},
-- {ZEBRA_ROUTE_BGP, 1, "bgp"},
-+ {ZEBRA_ROUTE_OSPF, 2, "ospf"},
-+ {ZEBRA_ROUTE_BGP, 2, "bgp"},
-+ {ZEBRA_ROUTE_HSLS, 1, "hsls"},
-+ {ZEBRA_ROUTE_OLSR, 2, "olsr"},
-+ {ZEBRA_ROUTE_BATMAN, 2, "batman"},
- {0, 0, NULL}
- };
-
---- a/ripngd/ripng_zebra.c
-+++ b/ripngd/ripng_zebra.c
-@@ -214,8 +214,11 @@ static struct {
- {ZEBRA_ROUTE_KERNEL, 1, "kernel"},
- {ZEBRA_ROUTE_CONNECT, 1, "connected"},
- {ZEBRA_ROUTE_STATIC, 1, "static"},
-- {ZEBRA_ROUTE_OSPF6, 1, "ospf6"},
-- {ZEBRA_ROUTE_BGP, 1, "bgp"},
-+ {ZEBRA_ROUTE_OSPF6, 2, "ospf6"},
-+ {ZEBRA_ROUTE_BGP, 2, "bgp"},
-+ {ZEBRA_ROUTE_HSLS, 1, "hsls"},
-+ {ZEBRA_ROUTE_OLSR, 2, "olsr"},
-+ {ZEBRA_ROUTE_BATMAN, 2, "batman"},
- {0, 0, NULL}
- };
-
---- a/zebra/redistribute.c
-+++ b/zebra/redistribute.c
-@@ -255,6 +255,9 @@ zebra_redistribute_add (int command, str
- case ZEBRA_ROUTE_OSPF:
- case ZEBRA_ROUTE_OSPF6:
- case ZEBRA_ROUTE_BGP:
-+ case ZEBRA_ROUTE_HSLS:
-+ case ZEBRA_ROUTE_OLSR:
-+ case ZEBRA_ROUTE_BATMAN:
- if (! client->redist[type])
- {
- client->redist[type] = 1;
-@@ -283,6 +286,9 @@ zebra_redistribute_delete (int command,
- case ZEBRA_ROUTE_OSPF:
- case ZEBRA_ROUTE_OSPF6:
- case ZEBRA_ROUTE_BGP:
-+ case ZEBRA_ROUTE_HSLS:
-+ case ZEBRA_ROUTE_OLSR:
-+ case ZEBRA_ROUTE_BATMAN:
- client->redist[type] = 0;
- break;
- default:
---- a/zebra/zebra_rib.c
-+++ b/zebra/zebra_rib.c
-@@ -66,7 +66,10 @@ static const struct
- {ZEBRA_ROUTE_OSPF, 110},
- {ZEBRA_ROUTE_OSPF6, 110},
- {ZEBRA_ROUTE_ISIS, 115},
-- {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */}
-+ {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */},
-+ {ZEBRA_ROUTE_HSLS, 0},
-+ {ZEBRA_ROUTE_OLSR, 0},
-+ {ZEBRA_ROUTE_BATMAN, 0}
- };
- \f
- /* Vector for routing table. */
-@@ -1229,6 +1232,8 @@ static const u_char meta_queue_map[ZEBRA
- [ZEBRA_ROUTE_ISIS] = 2,
- [ZEBRA_ROUTE_BGP] = 3,
- [ZEBRA_ROUTE_HSLS] = 4,
-+ [ZEBRA_ROUTE_OLSR] = 4,
-+ [ZEBRA_ROUTE_BATMAN] = 4,
- };
-
- /* Look into the RN and queue it into one or more priority queues,
---- a/zebra/zebra_snmp.c
-+++ b/zebra/zebra_snmp.c
-@@ -251,6 +251,12 @@ proto_trans(int type)
- return 1; /* shouldn't happen */
- case ZEBRA_ROUTE_BGP:
- return 14; /* bgp */
-+ case ZEBRA_ROUTE_HSLS:
-+ return 1; /* other */
-+ case ZEBRA_ROUTE_OLSR:
-+ return 1; /* other */
-+ case ZEBRA_ROUTE_BATMAN:
-+ return 1; /* other */
- default:
- return 1; /* other */
- }
---- a/zebra/zebra_vty.c
-+++ b/zebra/zebra_vty.c
-@@ -557,7 +557,10 @@ vty_show_ip_route_detail (struct vty *vt
- if (rib->type == ZEBRA_ROUTE_RIP
- || rib->type == ZEBRA_ROUTE_OSPF
- || rib->type == ZEBRA_ROUTE_ISIS
-- || rib->type == ZEBRA_ROUTE_BGP)
-+ || rib->type == ZEBRA_ROUTE_BGP
-+ || rib->type == ZEBRA_ROUTE_HSLS
-+ || rib->type == ZEBRA_ROUTE_OLSR
-+ || rib->type == ZEBRA_ROUTE_BATMAN)
- {
- time_t uptime;
- struct tm *tm;
-@@ -775,7 +778,10 @@ vty_show_ip_route (struct vty *vty, stru
- if (rib->type == ZEBRA_ROUTE_RIP
- || rib->type == ZEBRA_ROUTE_OSPF
- || rib->type == ZEBRA_ROUTE_ISIS
-- || rib->type == ZEBRA_ROUTE_BGP)
-+ || rib->type == ZEBRA_ROUTE_BGP
-+ || rib->type == ZEBRA_ROUTE_HSLS
-+ || rib->type == ZEBRA_ROUTE_OLSR
-+ || rib->type == ZEBRA_ROUTE_BATMAN)
- {
- time_t uptime;
- struct tm *tm;
-@@ -803,8 +809,8 @@ vty_show_ip_route (struct vty *vty, stru
- }
-
- #define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
-- "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, " \
-- "> - selected route, * - FIB route%s%s"
-+ "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, H - HSLS, " \
-+ "o - OLSR, b - BATMAN,%s > - selected route, * - FIB route%s%s"
-
- DEFUN (show_ip_route,
- show_ip_route_cmd,
-@@ -829,7 +835,7 @@ DEFUN (show_ip_route,
- if (first)
- {
- vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE, VTY_NEWLINE,
-- VTY_NEWLINE);
-+ VTY_NEWLINE, VTY_NEWLINE);
- first = 0;
- }
- vty_show_ip_route (vty, rn, rib);
-@@ -872,7 +878,7 @@ DEFUN (show_ip_route_prefix_longer,
- if (first)
- {
- vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
-- VTY_NEWLINE, VTY_NEWLINE);
-+ VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
- first = 0;
- }
- vty_show_ip_route (vty, rn, rib);
-@@ -911,7 +917,7 @@ DEFUN (show_ip_route_supernets,
- if (first)
- {
- vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
-- VTY_NEWLINE, VTY_NEWLINE);
-+ VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
- first = 0;
- }
- vty_show_ip_route (vty, rn, rib);
-@@ -922,7 +928,7 @@ DEFUN (show_ip_route_supernets,
-
- DEFUN (show_ip_route_protocol,
- show_ip_route_protocol_cmd,
-- "show ip route (bgp|connected|isis|kernel|ospf|rip|static)",
-+ "show ip route (bgp|connected|isis|kernel|ospf|rip|static|hsls|olsr|batman)",
- SHOW_STR
- IP_STR
- "IP routing table\n"
-@@ -940,13 +946,13 @@ DEFUN (show_ip_route_protocol,
- struct rib *rib;
- int first = 1;
-
-- if (strncmp (argv[0], "b", 1) == 0)
-+ if (strncmp (argv[0], "bg", 2) == 0)
- type = ZEBRA_ROUTE_BGP;
- else if (strncmp (argv[0], "c", 1) == 0)
- type = ZEBRA_ROUTE_CONNECT;
- else if (strncmp (argv[0], "k", 1) ==0)
- type = ZEBRA_ROUTE_KERNEL;
-- else if (strncmp (argv[0], "o", 1) == 0)
-+ else if (strncmp (argv[0], "os", 2) == 0)
- type = ZEBRA_ROUTE_OSPF;
- else if (strncmp (argv[0], "i", 1) == 0)
- type = ZEBRA_ROUTE_ISIS;
-@@ -954,6 +960,12 @@ DEFUN (show_ip_route_protocol,
- type = ZEBRA_ROUTE_RIP;
- else if (strncmp (argv[0], "s", 1) == 0)
- type = ZEBRA_ROUTE_STATIC;
-+ else if (strncmp (argv[0], "h", 1) == 0)
-+ type = ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (argv[0], "ol", 2) == 0)
-+ type = ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (argv[0], "ba", 2) == 0)
-+ type = ZEBRA_ROUTE_BATMAN;
- else
- {
- vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
-@@ -971,7 +983,7 @@ DEFUN (show_ip_route_protocol,
- {
- if (first)
- {
-- vty_out (vty, SHOW_ROUTE_V4_HEADER,
-+ vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
- VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
- first = 0;
- }
-@@ -1560,7 +1572,10 @@ vty_show_ipv6_route_detail (struct vty *
- if (rib->type == ZEBRA_ROUTE_RIPNG
- || rib->type == ZEBRA_ROUTE_OSPF6
- || rib->type == ZEBRA_ROUTE_ISIS
-- || rib->type == ZEBRA_ROUTE_BGP)
-+ || rib->type == ZEBRA_ROUTE_BGP
-+ || rib->type == ZEBRA_ROUTE_HSLS
-+ || rib->type == ZEBRA_ROUTE_OLSR
-+ || rib->type == ZEBRA_ROUTE_BATMAN)
- {
- time_t uptime;
- struct tm *tm;
-@@ -1739,7 +1754,10 @@ vty_show_ipv6_route (struct vty *vty, st
- if (rib->type == ZEBRA_ROUTE_RIPNG
- || rib->type == ZEBRA_ROUTE_OSPF6
- || rib->type == ZEBRA_ROUTE_ISIS
-- || rib->type == ZEBRA_ROUTE_BGP)
-+ || rib->type == ZEBRA_ROUTE_BGP
-+ || rib->type == ZEBRA_ROUTE_HSLS
-+ || rib->type == ZEBRA_ROUTE_OLSR
-+ || rib->type == ZEBRA_ROUTE_BATMAN)
- {
- time_t uptime;
- struct tm *tm;
-@@ -1766,7 +1784,7 @@ vty_show_ipv6_route (struct vty *vty, st
- }
- }
-
--#define SHOW_ROUTE_V6_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,%s I - ISIS, B - BGP, * - FIB route.%s%s"
-+#define SHOW_ROUTE_V6_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,%s I - ISIS, B - BGP, H - HSLS, o - OLSR, b - BATMAN, * - FIB route.%s%s"
-
- DEFUN (show_ipv6_route,
- show_ipv6_route_cmd,
-@@ -1842,7 +1860,7 @@ DEFUN (show_ipv6_route_prefix_longer,
-
- DEFUN (show_ipv6_route_protocol,
- show_ipv6_route_protocol_cmd,
-- "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static)",
-+ "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static|hsls|olsr|batman)",
- SHOW_STR
- IP_STR
- "IP routing table\n"
-@@ -1860,13 +1878,13 @@ DEFUN (show_ipv6_route_protocol,
- struct rib *rib;
- int first = 1;
-
-- if (strncmp (argv[0], "b", 1) == 0)
-+ if (strncmp (argv[0], "bg", 2) == 0)
- type = ZEBRA_ROUTE_BGP;
- else if (strncmp (argv[0], "c", 1) == 0)
- type = ZEBRA_ROUTE_CONNECT;
- else if (strncmp (argv[0], "k", 1) ==0)
- type = ZEBRA_ROUTE_KERNEL;
-- else if (strncmp (argv[0], "o", 1) == 0)
-+ else if (strncmp (argv[0], "os", 2) == 0)
- type = ZEBRA_ROUTE_OSPF6;
- else if (strncmp (argv[0], "i", 1) == 0)
- type = ZEBRA_ROUTE_ISIS;
-@@ -1874,6 +1892,12 @@ DEFUN (show_ipv6_route_protocol,
- type = ZEBRA_ROUTE_RIPNG;
- else if (strncmp (argv[0], "s", 1) == 0)
- type = ZEBRA_ROUTE_STATIC;
-+ else if (strncmp (argv[0], "h", 1) == 0)
-+ type = ZEBRA_ROUTE_HSLS;
-+ else if (strncmp (argv[0], "ol", 2) == 0)
-+ type = ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (argv[0], "ba", 2) == 0)
-+ type = ZEBRA_ROUTE_BATMAN;
- else
- {
- vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
+++ /dev/null
---- a/vtysh/extract.pl.in
-+++ b/vtysh/extract.pl.in
-@@ -62,7 +62,7 @@ $ignore{'"show history"'} = "ignore";
- foreach (@ARGV) {
- $file = $_;
-
-- open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ $file |");
-+ open (FH, "@CPP@ @CPPFLAGS@ -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ $file |");
- local $/; undef $/;
- $line = <FH>;
- close (FH);
+++ /dev/null
---- a/configure.ac
-+++ b/configure.ac
-@@ -397,7 +397,7 @@ dnl -------------------------
- AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
- sys/types.h linux/version.h netdb.h asm/types.h \
- sys/param.h limits.h signal.h libutil.h \
-- sys/socket.h netinet/in.h time.h sys/time.h])
-+ sys/socket.h netinet/in.h time.h sys/time.h linux/ip_mp_alg.h])
-
- dnl Utility macro to avoid retyping includes all the time
- m4_define([QUAGGA_INCLUDES],
-@@ -779,6 +779,17 @@ AC_SUBST(RT_METHOD)
- AC_SUBST(KERNEL_METHOD)
- AC_SUBST(OTHER_METHOD)
-
-+dnl ----------
-+dnl Check for RTA_MP_ALGO in linux/rtnetlink.h
-+dnl ----------
-+AC_MSG_CHECKING(for support of multipath alg. in netlink)
-+ if grep RTA_MP_ALGO linux/rtnetlink.h >/dev/null 2>&1; then
-+ AC_DEFINE(HAVE_RT_MP_ALGO,,RTA_MP exist in rtnetlink)
-+ AC_MSG_RESULT(yes)
-+ else
-+ AC_MSG_RESULT(no)
-+ fi
-+
- dnl --------------------------
- dnl Determine IS-IS I/O method
- dnl --------------------------
---- a/lib/command.h
-+++ b/lib/command.h
-@@ -101,6 +101,7 @@ enum node_type
- DUMP_NODE, /* Packet dump node. */
- FORWARDING_NODE, /* IP forwarding node. */
- PROTOCOL_NODE, /* protocol filtering node */
-+ MULTIPATH_NODE, /* Multipath policy node */
- VTY_NODE, /* Vty node. */
- };
-
-@@ -272,6 +273,7 @@ struct desc
- /* Common descriptions. */
- #define SHOW_STR "Show running system information\n"
- #define IP_STR "IP information\n"
-+#define MULTIPATH_STR "Configure multipath policy\n"
- #define IPV6_STR "IPv6 information\n"
- #define NO_STR "Negate a command or set its defaults\n"
- #define REDIST_STR "Redistribute information from another routing protocol\n"
---- a/lib/zebra.h
-+++ b/lib/zebra.h
-@@ -176,6 +176,10 @@ typedef int socklen_t;
- #define RT_TABLE_MAIN 0
- #endif /* HAVE_NETLINK */
-
-+#ifdef HAVE_LINUX_IP_MP_ALG_H
-+#include <linux/ip_mp_alg.h>
-+#endif /* HAVE_LINUX_IP_MP_ALG_H */
-+
- #ifdef HAVE_NETDB_H
- #include <netdb.h>
- #endif /* HAVE_NETDB_H */
---- a/zebra/main.c
-+++ b/zebra/main.c
-@@ -44,6 +44,7 @@
- struct zebra_t zebrad =
- {
- .rtm_table_default = 0,
-+ .mpath = 0,
- };
-
- /* process id. */
---- /dev/null
-+++ b/zebra/multipath.h
-@@ -0,0 +1,37 @@
-+/*
-+ * multipath policy names.
-+ *
-+ * This file is part of Quagga routing suite.
-+ *
-+ * Quagga 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.
-+ *
-+ * Quagga is distributed in the hope that it will be useful, but
-+ * WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ * General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with GNU Zebra; see the file COPYING. If not, write to the Free
-+ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-+ * 02111-1307, USA.
-+ */
-+
-+#ifndef ZEBRA_MULTIPATH_H
-+#define ZEBRA_MULTIPATH_H
-+#include <zebra.h>
-+
-+#ifdef HAVE_LINUX_IP_MP_ALG_H
-+
-+static char *mp_alg_names[IP_MP_ALG_MAX+1] = {
-+ [IP_MP_ALG_NONE] = "none",
-+ [IP_MP_ALG_RR] = "rr",
-+ [IP_MP_ALG_DRR] = "drr",
-+ [IP_MP_ALG_RANDOM] = "random",
-+ [IP_MP_ALG_WRANDOM] = "wrandom"
-+ };
-+#endif
-+#endif
-+
---- a/zebra/rt_netlink.c
-+++ b/zebra/rt_netlink.c
-@@ -36,6 +36,7 @@
- #include "thread.h"
- #include "privs.h"
-
-+#include "multipath.h"
- #include "zebra/zserv.h"
- #include "zebra/rt.h"
- #include "zebra/redistribute.h"
-@@ -1694,6 +1695,16 @@ netlink_route_multipath (int cmd, struct
- if (src)
- addattr_l (&req.n, sizeof req, RTA_PREFSRC, &src->ipv4, bytelen);
-
-+#ifdef HAVE_RT_MP_ALGO
-+ if (zebrad.mpath != IP_MP_ALG_NONE)
-+ {
-+ if (IS_ZEBRA_DEBUG_KERNEL)
-+ zlog_debug("netlink_route_multipath() (multihop): "
-+ "multipath policy : %s",mp_alg_names[zebrad.mpath]);
-+
-+ addattr_l (&req.n, 1024, RTA_MP_ALGO, &zebrad.mpath, sizeof(zebrad.mpath));
-+ }
-+#endif
- if (rta->rta_len > RTA_LENGTH (0))
- addattr_l (&req.n, 1024, RTA_MULTIPATH, RTA_DATA (rta),
- RTA_PAYLOAD (rta));
---- a/zebra/zserv.c
-+++ b/zebra/zserv.c
-@@ -36,6 +36,7 @@
- #include "privs.h"
- #include "network.h"
- #include "buffer.h"
-+#include "multipath.h"
-
- #include "zebra/zserv.h"
- #include "zebra/router-id.h"
-@@ -1120,6 +1121,9 @@ zebra_client_create (int sock)
- /* Set table number. */
- client->rtm_table = zebrad.rtm_table_default;
-
-+ /* Set multipath policy */
-+ client->mpath = zebrad.mpath;
-+
- /* Add this client to linked list. */
- listnode_add (zebrad.client_list, client);
-
-@@ -1697,6 +1701,91 @@ static struct cmd_node forwarding_node =
- };
-
- \f
-+#ifdef HAVE_RT_MP_ALGO
-+DEFUN (multipath_rr,
-+ multipath_rr_cmd,
-+ "multipath rr",
-+ MULTIPATH_STR
-+ "Round Robin multipath policy")
-+{
-+ zebrad.mpath=IP_MP_ALG_RR;
-+ return CMD_SUCCESS;
-+}
-+
-+DEFUN (multipath_drr,
-+ multipath_drr_cmd,
-+ "multipath drr",
-+ MULTIPATH_STR
-+ "Device round robin multipath policy")
-+{
-+ zebrad.mpath=IP_MP_ALG_DRR;
-+ return CMD_SUCCESS;
-+}
-+
-+DEFUN (multipath_random,
-+ multipath_random_cmd,
-+ "multipath random",
-+ MULTIPATH_STR
-+ "Random multipath policy")
-+{
-+ zebrad.mpath=IP_MP_ALG_RANDOM;
-+ return CMD_SUCCESS;
-+}
-+
-+DEFUN (multipath_wrandom,
-+ multipath_wrandom_cmd,
-+ "multipath wrandom",
-+ MULTIPATH_STR
-+ "Weighted random multipath policy")
-+{
-+ zebrad.mpath=IP_MP_ALG_WRANDOM;
-+ return CMD_SUCCESS;
-+}
-+
-+DEFUN (no_multipath,
-+ no_multipath_cmd,
-+ "no multipath",
-+ NO_STR
-+ MULTIPATH_STR
-+ "Remove multipath policy")
-+{
-+ zebrad.mpath=IP_MP_ALG_NONE;
-+ return CMD_SUCCESS;
-+}
-+
-+DEFUN (show_multipath,
-+ show_multipath_cmd,
-+ "show multipath",
-+ SHOW_STR
-+ "Show multipath policy")
-+{
-+ vty_out (vty, "multipath %s%s", mp_alg_names[zebrad.mpath],
-+ VTY_NEWLINE);
-+ return CMD_SUCCESS;
-+}
-+
-+/* multipath policy configuration write function. */
-+static int
-+config_write_multipath (struct vty *vty)
-+{
-+
-+
-+ if (zebrad.mpath)
-+ vty_out (vty, "multipath %s%s", mp_alg_names[zebrad.mpath],
-+ VTY_NEWLINE);
-+ return 0;
-+}
-+
-+/* table node for multipath policy. */
-+struct cmd_node multipath_node =
-+{
-+ MULTIPATH_NODE,
-+ "",
-+ 1
-+};
-+
-+#endif /* HAVE_RT_MP_ALGO */
-+
- /* Initialisation of zebra and installation of commands. */
- void
- zebra_init (void)
-@@ -1708,6 +1797,10 @@ zebra_init (void)
- install_node (&table_node, config_write_table);
- install_node (&forwarding_node, config_write_forwarding);
-
-+#ifdef HAVE_RT_MP_ALGO
-+ install_node (&multipath_node, config_write_multipath);
-+#endif
-+
- install_element (VIEW_NODE, &show_ip_forwarding_cmd);
- install_element (ENABLE_NODE, &show_ip_forwarding_cmd);
- install_element (CONFIG_NODE, &ip_forwarding_cmd);
-@@ -1718,6 +1811,14 @@ zebra_init (void)
- install_element (VIEW_NODE, &show_table_cmd);
- install_element (ENABLE_NODE, &show_table_cmd);
- install_element (CONFIG_NODE, &config_table_cmd);
-+#ifdef HAVE_RT_MP_ALGO
-+ install_element (CONFIG_NODE, &multipath_rr_cmd);
-+ install_element (CONFIG_NODE, &multipath_drr_cmd);
-+ install_element (CONFIG_NODE, &multipath_random_cmd);
-+ install_element (CONFIG_NODE, &multipath_wrandom_cmd);
-+ install_element (CONFIG_NODE, &no_multipath_cmd);
-+ install_element (ENABLE_NODE, &show_multipath_cmd);
-+#endif /* HAVE_RT_MP_ALGO */
- #endif /* HAVE_NETLINK */
-
- #ifdef HAVE_IPV6
---- a/zebra/zserv.h
-+++ b/zebra/zserv.h
-@@ -55,6 +55,9 @@ struct zserv
- /* default routing table this client munges */
- int rtm_table;
-
-+ /* multipath policy */
-+ u_int32_t mpath;
-+
- /* This client's redistribute flag. */
- u_char redist[ZEBRA_ROUTE_MAX];
-
-@@ -78,6 +81,9 @@ struct zebra_t
- /* default table */
- int rtm_table_default;
-
-+ /* multipath policy */
-+ u_int32_t mpath;
-+
- /* rib work queue */
- struct work_queue *ribq;
- struct meta_queue *mq;
+++ /dev/null
---- a/bgpd/bgp_network.c
-+++ b/bgpd/bgp_network.c
-@@ -188,8 +188,7 @@ bgp_accept (struct thread *thread)
- peer->fd = bgp_sock;
- peer->status = Active;
- peer->local_id = peer1->local_id;
-- peer->v_holdtime = peer1->v_holdtime;
-- peer->v_keepalive = peer1->v_keepalive;
-+ peer->v_holdtime = BGP_LARGE_HOLDTIME;
-
- /* Make peer's address string. */
- sockunion2str (&su, buf, SU_ADDRSTRLEN);
---- a/bgpd/bgpd.h
-+++ b/bgpd/bgpd.h
-@@ -709,6 +709,7 @@ struct bgp_nlri
- /* BGP timers default value. */
- #define BGP_INIT_START_TIMER 5
- #define BGP_ERROR_START_TIMER 30
-+#define BGP_LARGE_HOLDTIME 240
- #define BGP_DEFAULT_HOLDTIME 180
- #define BGP_DEFAULT_KEEPALIVE 60
- #define BGP_DEFAULT_ASORIGINATE 15
+++ /dev/null
---- a/lib/command.c
-+++ b/lib/command.c
-@@ -2601,6 +2601,13 @@ DEFUN (config_write_file,
- VTY_NEWLINE);
- goto finished;
- }
-+
-+#if 0
-+ /* This code fails on UNION MOUNTs and similar filesystems if the
-+ * config file is still on the RO layer. Hardlinks across layers
-+ * will not work and cause quagga to fail saving the configuration...
-+ * should use rename() to move files around...
-+ */
- if (link (config_file, config_file_sav) != 0)
- {
- vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
-@@ -2614,7 +2621,23 @@ DEFUN (config_write_file,
- VTY_NEWLINE);
- goto finished;
- }
-+#else
-+ /* And this is the code that hopefully does work */
-+ if (rename (config_file, config_file_sav) != 0)
-+ {
-+ vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
-+ VTY_NEWLINE);
-+ goto finished;
-+ }
-+ sync ();
-+#endif
-+
-+#if 0
-+ /* same here. Please no cross-filesystem hardlinks... */
- if (link (config_file_tmp, config_file) != 0)
-+#else
-+ if (rename (config_file_tmp, config_file) != 0)
-+#endif
- {
- vty_out (vty, "Can't save configuration file %s.%s", config_file,
- VTY_NEWLINE);
--- /dev/null
+# Quagga configuration
+
+choice
+ prompt "Quagga version"
+ depends on PACKAGE_quagga
+ default QUAGGA_STABLE
+ help
+ This option allows you to select the version of Quagga to be built.
+
+config QUAGGA_STABLE
+ bool "Use the latest stable version of Quagga"
+
+config QUAGGA_OLD
+ depends BROKEN
+ bool "Use the old release version 0.98.6"
+
+endchoice
include $(TOPDIR)/rules.mk
PKG_NAME:=quagga
-PKG_VERSION:=0.98.6
-PKG_RELEASE:=5
-PKG_MD5SUM:=b0d4132039953a0214256873b7d23d68
+ifneq ($(CONFIG_QUAGGA_OLD),)
+ PKG_VERSION:=0.98.6
+ PKG_RELEASE:=5
+ PKG_MD5SUM:=b0d4132039953a0214256873b7d23d68
+ PATCH_DIR:=./patches-old
+else
+ PKG_VERSION:=0.99.17
+ PKG_RELEASE:=1
+ PKG_MD5SUM:=37b9022adca04b03863d2d79787e643f
+endif
+PKG_SOURCE:=quagga-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://www.quagga.net/download/ \
http://www.de.quagga.net/download/ \
http://www.uk.quagga.net/download/
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-
PKG_CONFIG_DEPENDS:= \
+ CONFIG_QUAGGA_STABLE \
CONFIG_IPV6 \
CONFIG_PACKAGE_quagga-unstable-isisd \
CONFIG_PACKAGE_quagga-unstable-ripngd
-
+PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=libtool
PKG_INSTALL:=1
define Package/quagga
$(call Package/quagga/Default)
- DEPENDS:=
+ DEPENDS:=+QUAGGA_STABLE:librt
MENU:=1
endef
OSPFv3, BGP-4, and BGP-4+
endef
+define Package/quagga/config
+ source "$(SOURCE)/Config.in"
+endef
+
define Package/quagga-libzebra
$(call Package/quagga/Default)
TITLE:=zebra library
define Package/quagga-bgpd
$(call Package/quagga/Default)
- DEPENDS += quagga-libzebra
+ DEPENDS+=+quagga-libzebra
TITLE:=BGPv4, BGPv4+, BGPv4- routing engine
endef
define Package/quagga-ospfd
$(call Package/quagga/Default)
- DEPENDS += quagga-libospf quagga-libzebra
+ DEPENDS+=+quagga-libospf +quagga-libzebra
TITLE:=OSPFv2 routing engine
endef
define Package/quagga-ospf6d
$(call Package/quagga/Default)
- DEPENDS += quagga-libospf quagga-libzebra @IPV6
+ DEPENDS+=+quagga-libospf +quagga-libzebra @IPV6
TITLE:=OSPFv3 routing engine
endef
define Package/quagga-ripd
$(call Package/quagga/Default)
- DEPENDS += quagga-libzebra
+ DEPENDS+=+quagga-libzebra
TITLE:=RIP routing engine
endef
define Package/quagga-ripngd
$(call Package/quagga/Default)
- DEPENDS += quagga-libzebra @BROKEN
+ DEPENDS+=+quagga-libzebra @BROKEN
TITLE:=RIPNG routing engine
endef
define Package/quagga-vtysh
$(call Package/quagga/Default)
- DEPENDS += quagga-libzebra +libreadline +libncurses
+ DEPENDS+=quagga-libzebra +libreadline +libncurses
TITLE:=integrated shell for Quagga routing software
endef
--enable-vtysh \
--enable-user=quagga \
--enable-group=quagga \
+ --enable-pie=no \
--enable-multipath=8 \
ifneq ($(CONFIG_PACKAGE_quagga-isisd),)
--- /dev/null
+--- a/configure
++++ b/configure
+@@ -12675,69 +12675,6 @@ fi
+
+
+
+-echo "$as_me:$LINENO: checking for broken CMSG_FIRSTHDR" >&5
+-echo $ECHO_N "checking for broken CMSG_FIRSTHDR... $ECHO_C" >&6
+-if test "$cross_compiling" = yes; then
+- echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
+-else
+- cat >conftest.$ac_ext <<_ACEOF
+-/* confdefs.h. */
+-_ACEOF
+-cat confdefs.h >>conftest.$ac_ext
+-cat >>conftest.$ac_ext <<_ACEOF
+-/* end confdefs.h. */
+-
+-#ifdef SUNOS_5
+-#define _XPG4_2
+-#define __EXTENSIONS__
+-#endif
+-#include <stdlib.h>
+-#include <sys/types.h>
+-#include <sys/socket.h>
+-
+-main()
+-{
+- struct msghdr msg;
+- char buf[4];
+-
+- msg.msg_control = buf;
+- msg.msg_controllen = 0;
+-
+- if (CMSG_FIRSTHDR(&msg) != NULL)
+- exit(0);
+- exit (1);
+-}
+-_ACEOF
+-rm -f conftest$ac_exeext
+-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+- (eval $ac_link) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:$LINENO: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- echo "$as_me:$LINENO: result: yes - using workaround" >&5
+-echo "${ECHO_T}yes - using workaround" >&6
+-cat >>confdefs.h <<\_ACEOF
+-#define HAVE_BROKEN_CMSG_FIRSTHDR
+-_ACEOF
+-
+-else
+- echo "$as_me: program exited with status $ac_status" >&5
+-echo "$as_me: failed program was:" >&5
+-sed 's/^/| /' conftest.$ac_ext >&5
+-
+-( exit $ac_status )
+-echo "$as_me:$LINENO: result: no" >&5
+-echo "${ECHO_T}no" >&6
+-fi
+-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+-fi
+-
+ echo "$as_me:$LINENO: checking route read method check" >&5
+ echo $ECHO_N "checking route read method check... $ECHO_C" >&6
+ if test "${zebra_rtread+set}" = set; then
+@@ -12835,10 +12772,7 @@ echo $ECHO_N "checking ipforward method
+ if test "${zebra_ipforward_path+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+- for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
+-do
+- test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
+-done
++ zebra_ipforward_path="/proc/net/snmp"
+ case $zebra_ipforward_path in
+ "/proc/net/snmp") IPFORWARD=ipforward_proc.o
+ zebra_ipforward_path="proc";;
--- /dev/null
+--- a/configure
++++ b/configure
+@@ -10972,7 +10972,7 @@ if test "${ac_cv_lib_curses_tputs+set}"
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lcurses $LIBS"
++#LIBS="-lcurses $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -11108,7 +11108,8 @@ if test $ac_cv_lib_ncurses_tputs = yes;
+ #define HAVE_LIBNCURSES 1
+ _ACEOF
+
+- LIBS="-lncurses $LIBS"
++# LIBS="-lncurses $LIBS"
++CURSES=-lncurses
+
+ fi
+
+@@ -11125,7 +11126,7 @@ if test "${ac_cv_lib_readline_main+set}"
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lreadline $LIBS"
++LIBS="-lreadline $CURSES $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -11182,7 +11183,8 @@ if test $ac_cv_lib_readline_main = yes;
+ #define HAVE_LIBREADLINE 1
+ _ACEOF
+
+- LIBS="-lreadline $LIBS"
++# LIBS="-lreadline $LIBS"
++CURSES="$CURSES -lreadline"
+
+ fi
+
+@@ -11342,7 +11344,7 @@ if test "${ac_cv_lib_readline_rl_complet
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lreadline $LIBS"
++LIBS="-lreadline $CURSES $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ /* confdefs.h. */
+ _ACEOF
+@@ -11405,7 +11407,7 @@ if test $ac_cv_lib_readline_rl_completio
+ #define HAVE_LIBREADLINE 1
+ _ACEOF
+
+- LIBS="-lreadline $LIBS"
++# LIBS="-lreadline $LIBS"
+
+ fi
+
--- /dev/null
+--- a/bgpd/bgp_vty.c
++++ b/bgpd/bgp_vty.c
+@@ -3,6 +3,9 @@
+
+ This file is part of GNU Zebra.
+
++This file was modified from the original on 30/12/2007
++by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
++
+ 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
+@@ -7793,8 +7796,12 @@ bgp_str2route_type (int afi, const char
+ return ZEBRA_ROUTE_STATIC;
+ else if (strncmp (str, "r", 1) == 0)
+ return ZEBRA_ROUTE_RIP;
+- else if (strncmp (str, "o", 1) == 0)
++ else if (strncmp (str, "ol", 2) == 0)
++ return ZEBRA_ROUTE_OLSR;
++ else if (strncmp (str, "os", 2) == 0)
+ return ZEBRA_ROUTE_OSPF;
++ else if (strncmp (str, "ba", 2) == 0)
++ return ZEBRA_ROUTE_BATMAN;
+ }
+ if (afi == AFI_IP6)
+ {
+@@ -7806,21 +7813,28 @@ bgp_str2route_type (int afi, const char
+ return ZEBRA_ROUTE_STATIC;
+ else if (strncmp (str, "r", 1) == 0)
+ return ZEBRA_ROUTE_RIPNG;
+- else if (strncmp (str, "o", 1) == 0)
++ else if (strncmp (str, "os", 2) == 0)
+ return ZEBRA_ROUTE_OSPF6;
++ else if (strncmp (str, "ol", 2) == 0)
++ return ZEBRA_ROUTE_OLSR;
++ else if (strncmp (str, "ba", 2) == 0)
++ return ZEBRA_ROUTE_BATMAN;
+ }
+ return 0;
+ }
+
+ DEFUN (bgp_redistribute_ipv4,
+ bgp_redistribute_ipv4_cmd,
+- "redistribute (connected|kernel|ospf|rip|static)",
++ "redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+- "Static routes\n")
++ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++ )
+ {
+ int type;
+
+@@ -7835,13 +7849,15 @@ DEFUN (bgp_redistribute_ipv4,
+
+ DEFUN (bgp_redistribute_ipv4_rmap,
+ bgp_redistribute_ipv4_rmap_cmd,
+- "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
++ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
+ {
+@@ -7860,13 +7876,15 @@ DEFUN (bgp_redistribute_ipv4_rmap,
+
+ DEFUN (bgp_redistribute_ipv4_metric,
+ bgp_redistribute_ipv4_metric_cmd,
+- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n")
+ {
+@@ -7887,13 +7905,15 @@ DEFUN (bgp_redistribute_ipv4_metric,
+
+ DEFUN (bgp_redistribute_ipv4_rmap_metric,
+ bgp_redistribute_ipv4_rmap_metric_cmd,
+- "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD metric <0-4294967295>",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n"
+ "Metric for redistributed routes\n"
+@@ -7917,13 +7937,15 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
+
+ DEFUN (bgp_redistribute_ipv4_metric_rmap,
+ bgp_redistribute_ipv4_metric_rmap_cmd,
+- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
++ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n"
+ "Route map reference\n"
+@@ -7947,14 +7969,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
+
+ DEFUN (no_bgp_redistribute_ipv4,
+ no_bgp_redistribute_ipv4_cmd,
+- "no redistribute (connected|kernel|ospf|rip|static)",
++ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+- "Static routes\n")
++ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++ )
+ {
+ int type;
+
+@@ -7970,7 +7995,7 @@ DEFUN (no_bgp_redistribute_ipv4,
+
+ DEFUN (no_bgp_redistribute_ipv4_rmap,
+ no_bgp_redistribute_ipv4_rmap_cmd,
+- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
++ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -7978,6 +8003,8 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
+ {
+@@ -7996,7 +8023,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
+
+ DEFUN (no_bgp_redistribute_ipv4_metric,
+ no_bgp_redistribute_ipv4_metric_cmd,
+- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -8004,6 +8031,8 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n")
+ {
+@@ -8022,7 +8051,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
+
+ DEFUN (no_bgp_redistribute_ipv4_rmap_metric,
+ no_bgp_redistribute_ipv4_rmap_metric_cmd,
+- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD metric <0-4294967295>",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -8030,6 +8059,8 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n"
+ "Metric for redistributed routes\n"
+@@ -8051,7 +8082,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
+
+ ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
+ no_bgp_redistribute_ipv4_metric_rmap_cmd,
+- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
++ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -8059,6 +8090,8 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
+ "Open Shurtest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n"
+ "Route map reference\n"
+@@ -8067,13 +8100,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
+ #ifdef HAVE_IPV6
+ DEFUN (bgp_redistribute_ipv6,
+ bgp_redistribute_ipv6_cmd,
+- "redistribute (connected|kernel|ospf6|ripng|static)",
++ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+- "Static routes\n")
++ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++ )
+ {
+ int type;
+
+@@ -8089,13 +8125,15 @@ DEFUN (bgp_redistribute_ipv6,
+
+ DEFUN (bgp_redistribute_ipv6_rmap,
+ bgp_redistribute_ipv6_rmap_cmd,
+- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
++ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
+ {
+@@ -8114,13 +8152,15 @@ DEFUN (bgp_redistribute_ipv6_rmap,
+
+ DEFUN (bgp_redistribute_ipv6_metric,
+ bgp_redistribute_ipv6_metric_cmd,
+- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n")
+ {
+@@ -8141,13 +8181,15 @@ DEFUN (bgp_redistribute_ipv6_metric,
+
+ DEFUN (bgp_redistribute_ipv6_rmap_metric,
+ bgp_redistribute_ipv6_rmap_metric_cmd,
+- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n"
+ "Metric for redistributed routes\n"
+@@ -8171,13 +8213,15 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
+
+ DEFUN (bgp_redistribute_ipv6_metric_rmap,
+ bgp_redistribute_ipv6_metric_rmap_cmd,
+- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
++ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n"
+ "Route map reference\n"
+@@ -8201,14 +8245,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
+
+ DEFUN (no_bgp_redistribute_ipv6,
+ no_bgp_redistribute_ipv6_cmd,
+- "no redistribute (connected|kernel|ospf6|ripng|static)",
++ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+ "Kernel routes\n"
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+- "Static routes\n")
++ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++ )
+ {
+ int type;
+
+@@ -8224,7 +8271,7 @@ DEFUN (no_bgp_redistribute_ipv6,
+
+ DEFUN (no_bgp_redistribute_ipv6_rmap,
+ no_bgp_redistribute_ipv6_rmap_cmd,
+- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
++ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -8232,6 +8279,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
+ {
+@@ -8250,7 +8299,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
+
+ DEFUN (no_bgp_redistribute_ipv6_metric,
+ no_bgp_redistribute_ipv6_metric_cmd,
+- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -8258,6 +8307,8 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n")
+ {
+@@ -8276,7 +8327,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
+
+ DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
+ no_bgp_redistribute_ipv6_rmap_metric_cmd,
+- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -8284,6 +8335,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n"
+ "Metric for redistributed routes\n"
+@@ -8305,7 +8358,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
+
+ ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
+ no_bgp_redistribute_ipv6_metric_rmap_cmd,
+- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
++ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Connected\n"
+@@ -8313,6 +8366,8 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
+ "Open Shurtest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
+ "Static routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "Default metric\n"
+ "Route map reference\n"
+@@ -8325,7 +8380,7 @@ bgp_config_write_redistribute (struct vt
+ {
+ int i;
+ const char *str[] = { "system", "kernel", "connected", "static", "rip",
+- "ripng", "ospf", "ospf6", "isis", "bgp"};
++ "ripng", "ospf", "ospf6", "isis", "bgp", "hsls", "olsr", "batman"};
+
+ /* Unicast redistribution only. */
+ if (safi != SAFI_UNICAST)
+--- a/lib/zebra.h
++++ b/lib/zebra.h
+@@ -3,6 +3,9 @@
+
+ This file is part of GNU Zebra.
+
++This file was modified from the original on 30/12/2007
++by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
++
+ 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
+@@ -378,7 +381,9 @@ struct in_pktinfo
+ #define ZEBRA_ROUTE_ISIS 8
+ #define ZEBRA_ROUTE_BGP 9
+ #define ZEBRA_ROUTE_HSLS 10
+-#define ZEBRA_ROUTE_MAX 11
++#define ZEBRA_ROUTE_OLSR 11
++#define ZEBRA_ROUTE_BATMAN 12
++#define ZEBRA_ROUTE_MAX 13
+
+ /* Zebra's family types. */
+ #define ZEBRA_FAMILY_IPV4 1
+--- a/ospfd/ospf_vty.c
++++ b/ospfd/ospf_vty.c
+@@ -3,6 +3,9 @@
+ *
+ * This file is part of GNU Zebra.
+ *
++ * This file was modified from the original on 30/12/2007
++ * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
++ *
+ * 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
+@@ -106,11 +109,15 @@ str2distribute_source (const char *str,
+ *source = ZEBRA_ROUTE_STATIC;
+ else if (strncmp (str, "r", 1) == 0)
+ *source = ZEBRA_ROUTE_RIP;
+- else if (strncmp (str, "b", 1) == 0)
++ else if (strncmp (str, "bg", 2) == 0)
+ *source = ZEBRA_ROUTE_BGP;
++ else if (strncmp (str, "ol", 2) == 0)
++ *source = ZEBRA_ROUTE_OLSR;
++ else if (strncmp (str, "ba", 2) == 0)
++ *source = ZEBRA_ROUTE_BATMAN;
+ else
+ return 0;
+-
++
+ return 1;
+ }
+
+@@ -5302,13 +5309,15 @@ ALIAS (no_ip_ospf_transmit_delay,
+ \f
+ DEFUN (ospf_redistribute_source_metric_type,
+ ospf_redistribute_source_metric_type_routemap_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2) route-map WORD",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2) route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "OSPF default metric\n"
+ "OSPF exterior metric type for redistributed routes\n"
+@@ -5346,13 +5355,15 @@ DEFUN (ospf_redistribute_source_metric_t
+
+ ALIAS (ospf_redistribute_source_metric_type,
+ ospf_redistribute_source_metric_type_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2)",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2)",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "OSPF default metric\n"
+ "OSPF exterior metric type for redistributed routes\n"
+@@ -5361,25 +5372,29 @@ ALIAS (ospf_redistribute_source_metric_t
+
+ ALIAS (ospf_redistribute_source_metric_type,
+ ospf_redistribute_source_metric_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214>",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "OSPF default metric\n")
+
+ DEFUN (ospf_redistribute_source_type_metric,
+ ospf_redistribute_source_type_metric_routemap_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map WORD",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214> route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "OSPF exterior metric type for redistributed routes\n"
+ "Set OSPF External Type 1 metrics\n"
+ "Set OSPF External Type 2 metrics\n"
+@@ -5417,13 +5432,15 @@ DEFUN (ospf_redistribute_source_type_met
+
+ ALIAS (ospf_redistribute_source_type_metric,
+ ospf_redistribute_source_type_metric_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214>",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "OSPF exterior metric type for redistributed routes\n"
+ "Set OSPF External Type 1 metrics\n"
+ "Set OSPF External Type 2 metrics\n"
+@@ -5432,7 +5449,7 @@ ALIAS (ospf_redistribute_source_type_met
+
+ ALIAS (ospf_redistribute_source_type_metric,
+ ospf_redistribute_source_type_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2)",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+@@ -5440,28 +5457,35 @@ ALIAS (ospf_redistribute_source_type_met
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
+ "OSPF exterior metric type for redistributed routes\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Set OSPF External Type 1 metrics\n"
+ "Set OSPF External Type 2 metrics\n")
+
+ ALIAS (ospf_redistribute_source_type_metric,
+ ospf_redistribute_source_cmd,
+- "redistribute (kernel|connected|static|rip|bgp)",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+- "Border Gateway Protocol (BGP)\n")
++ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++ )
+
+ DEFUN (ospf_redistribute_source_metric_routemap,
+ ospf_redistribute_source_metric_routemap_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map WORD",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Metric for redistributed routes\n"
+ "OSPF default metric\n"
+ "Route map reference\n"
+@@ -5490,13 +5514,15 @@ DEFUN (ospf_redistribute_source_metric_r
+
+ DEFUN (ospf_redistribute_source_type_routemap,
+ ospf_redistribute_source_type_routemap_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "OSPF exterior metric type for redistributed routes\n"
+ "Set OSPF External Type 1 metrics\n"
+ "Set OSPF External Type 2 metrics\n"
+@@ -5526,13 +5552,15 @@ DEFUN (ospf_redistribute_source_type_rou
+
+ DEFUN (ospf_redistribute_source_routemap,
+ ospf_redistribute_source_routemap_cmd,
+- "redistribute (kernel|connected|static|rip|bgp) route-map WORD",
++ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) route-map WORD",
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Route map reference\n"
+ "Pointer to route-map entries\n")
+ {
+@@ -5553,14 +5581,17 @@ DEFUN (ospf_redistribute_source_routemap
+
+ DEFUN (no_ospf_redistribute_source,
+ no_ospf_redistribute_source_cmd,
+- "no redistribute (kernel|connected|static|rip|bgp)",
++ "no redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
+ NO_STR
+ "Redistribute information from another routing protocol\n"
+ "Kernel routes\n"
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+- "Border Gateway Protocol (BGP)\n")
++ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++ )
+ {
+ struct ospf *ospf = vty->index;
+ int source;
+@@ -5574,7 +5605,7 @@ DEFUN (no_ospf_redistribute_source,
+
+ DEFUN (ospf_distribute_list_out,
+ ospf_distribute_list_out_cmd,
+- "distribute-list WORD out (kernel|connected|static|rip|bgp)",
++ "distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
+ "Filter networks in routing updates\n"
+ "Access-list name\n"
+ OUT_STR
+@@ -5582,7 +5613,10 @@ DEFUN (ospf_distribute_list_out,
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+- "Border Gateway Protocol (BGP)\n")
++ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++)
+ {
+ struct ospf *ospf = vty->index;
+ int source;
+@@ -5596,7 +5630,7 @@ DEFUN (ospf_distribute_list_out,
+
+ DEFUN (no_ospf_distribute_list_out,
+ no_ospf_distribute_list_out_cmd,
+- "no distribute-list WORD out (kernel|connected|static|rip|bgp)",
++ "no distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
+ NO_STR
+ "Filter networks in routing updates\n"
+ "Access-list name\n"
+@@ -5605,7 +5639,10 @@ DEFUN (no_ospf_distribute_list_out,
+ "Connected\n"
+ "Static routes\n"
+ "Routing Information Protocol (RIP)\n"
+- "Border Gateway Protocol (BGP)\n")
++ "Border Gateway Protocol (BGP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
++)
+ {
+ struct ospf *ospf = vty->index;
+ int source;
+@@ -7121,7 +7158,8 @@ config_write_virtual_link (struct vty *v
+
+ \f
+ const char *distribute_str[] = { "system", "kernel", "connected", "static",
+- "rip", "ripng", "ospf", "ospf6", "isis", "bgp"};
++ "rip", "ripng", "ospf", "ospf6", "isis", "bgp",
++ "hsls","olsr","batman"};
+ int
+ config_write_ospf_redistribute (struct vty *vty, struct ospf *ospf)
+ {
+--- a/zebra/redistribute.c
++++ b/zebra/redistribute.c
+@@ -3,6 +3,9 @@
+ *
+ * This file is part of GNU Zebra.
+ *
++ * This file was modified from the original on 30/12/2007
++ * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
++ *
+ * 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
+@@ -253,6 +256,8 @@ zebra_redistribute_add (int command, str
+ case ZEBRA_ROUTE_OSPF:
+ case ZEBRA_ROUTE_OSPF6:
+ case ZEBRA_ROUTE_BGP:
++ case ZEBRA_ROUTE_OLSR:
++ case ZEBRA_ROUTE_BATMAN:
+ if (! client->redist[type])
+ {
+ client->redist[type] = 1;
+@@ -281,6 +286,8 @@ zebra_redistribute_delete (int command,
+ case ZEBRA_ROUTE_OSPF:
+ case ZEBRA_ROUTE_OSPF6:
+ case ZEBRA_ROUTE_BGP:
++ case ZEBRA_ROUTE_OLSR:
++ case ZEBRA_ROUTE_BATMAN:
+ client->redist[type] = 0;
+ break;
+ default:
+--- a/zebra/zebra_vty.c
++++ b/zebra/zebra_vty.c
+@@ -53,6 +53,10 @@ route_type_str (u_char type)
+ return "isis";
+ case ZEBRA_ROUTE_BGP:
+ return "bgp";
++ case ZEBRA_ROUTE_OLSR:
++ return "olsr";
++ case ZEBRA_ROUTE_BATMAN:
++ return "batman";
+ default:
+ return "unknown";
+ }
+@@ -84,6 +88,12 @@ route_type_char (u_char type)
+ return 'I';
+ case ZEBRA_ROUTE_BGP:
+ return 'B';
++ case ZEBRA_ROUTE_HSLS:
++ return 'H';
++ case ZEBRA_ROUTE_OLSR:
++ return 'L';
++ case ZEBRA_ROUTE_BATMAN:
++ return 'M';
+ default:
+ return '?';
+ }
+@@ -755,8 +765,8 @@ vty_show_ip_route (struct vty *vty, stru
+ }
+
+ #define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
+- "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, " \
+- "> - selected route, * - FIB route%s%s"
++ "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, H - HSLS, " \
++ "L - OLSR, M - BATMAN, > - selected route, * - FIB route%s%s"
+
+ DEFUN (show_ip_route,
+ show_ip_route_cmd,
+@@ -874,7 +884,7 @@ DEFUN (show_ip_route_supernets,
+
+ DEFUN (show_ip_route_protocol,
+ show_ip_route_protocol_cmd,
+- "show ip route (bgp|connected|isis|kernel|ospf|rip|static)",
++ "show ip route (bgp|connected|isis|kernel|ospf|rip|olsr|batman|static)",
+ SHOW_STR
+ IP_STR
+ "IP routing table\n"
+@@ -884,6 +894,8 @@ DEFUN (show_ip_route_protocol,
+ "Kernel\n"
+ "Open Shortest Path First (OSPF)\n"
+ "Routing Information Protocol (RIP)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Static routes\n")
+ {
+ int type;
+@@ -892,13 +904,13 @@ DEFUN (show_ip_route_protocol,
+ struct rib *rib;
+ int first = 1;
+
+- if (strncmp (argv[0], "b", 1) == 0)
++ if (strncmp (argv[0], "bg", 2) == 0)
+ type = ZEBRA_ROUTE_BGP;
+ else if (strncmp (argv[0], "c", 1) == 0)
+ type = ZEBRA_ROUTE_CONNECT;
+ else if (strncmp (argv[0], "k", 1) ==0)
+ type = ZEBRA_ROUTE_KERNEL;
+- else if (strncmp (argv[0], "o", 1) == 0)
++ else if (strncmp (argv[0], "os", 2) == 0)
+ type = ZEBRA_ROUTE_OSPF;
+ else if (strncmp (argv[0], "i", 1) == 0)
+ type = ZEBRA_ROUTE_ISIS;
+@@ -906,6 +918,10 @@ DEFUN (show_ip_route_protocol,
+ type = ZEBRA_ROUTE_RIP;
+ else if (strncmp (argv[0], "s", 1) == 0)
+ type = ZEBRA_ROUTE_STATIC;
++ else if (strncmp (argv[0], "ol", 2) == 0)
++ type = ZEBRA_ROUTE_OLSR;
++ else if (strncmp (argv[0], "ba", 2) == 0)
++ type = ZEBRA_ROUTE_BATMAN;
+ else
+ {
+ vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
+@@ -1732,7 +1748,7 @@ DEFUN (show_ipv6_route_prefix_longer,
+
+ DEFUN (show_ipv6_route_protocol,
+ show_ipv6_route_protocol_cmd,
+- "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static)",
++ "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|olsr|batman|static)",
+ SHOW_STR
+ IP_STR
+ "IP routing table\n"
+@@ -1742,6 +1758,8 @@ DEFUN (show_ipv6_route_protocol,
+ "Kernel\n"
+ "Open Shortest Path First (OSPFv3)\n"
+ "Routing Information Protocol (RIPng)\n"
++ "Optimized Link State Routing (OLSR)\n"
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
+ "Static routes\n")
+ {
+ int type;
+@@ -1750,13 +1768,13 @@ DEFUN (show_ipv6_route_protocol,
+ struct rib *rib;
+ int first = 1;
+
+- if (strncmp (argv[0], "b", 1) == 0)
++ if (strncmp (argv[0], "bg", 2) == 0)
+ type = ZEBRA_ROUTE_BGP;
+ else if (strncmp (argv[0], "c", 1) == 0)
+ type = ZEBRA_ROUTE_CONNECT;
+ else if (strncmp (argv[0], "k", 1) ==0)
+ type = ZEBRA_ROUTE_KERNEL;
+- else if (strncmp (argv[0], "o", 1) == 0)
++ else if (strncmp (argv[0], "os", 2) == 0)
+ type = ZEBRA_ROUTE_OSPF6;
+ else if (strncmp (argv[0], "i", 1) == 0)
+ type = ZEBRA_ROUTE_ISIS;
+@@ -1764,7 +1782,11 @@ DEFUN (show_ipv6_route_protocol,
+ type = ZEBRA_ROUTE_RIPNG;
+ else if (strncmp (argv[0], "s", 1) == 0)
+ type = ZEBRA_ROUTE_STATIC;
+- else
++ else if (strncmp (argv[0], "ol", 2) == 0)
++ type = ZEBRA_ROUTE_OLSR;
++ else if (strncmp (argv[0], "ba", 2) == 0)
++ type = ZEBRA_ROUTE_BATMAN;
++ else
+ {
+ vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
+ return CMD_WARNING;
--- /dev/null
+--- a/bgpd/bgp_route.c
++++ b/bgpd/bgp_route.c
+@@ -1815,6 +1815,7 @@ bgp_update_main (struct peer *peer, stru
+ if ((afi == AFI_IP || afi == AFI_IP6)
+ && safi == SAFI_UNICAST
+ && (peer_sort (peer) == BGP_PEER_IBGP
++ || peer_sort (peer) == BGP_PEER_CONFED
+ || (peer_sort (peer) == BGP_PEER_EBGP && peer->ttl != 1)
+ || CHECK_FLAG (peer->flags, PEER_FLAG_ENFORCE_MULTIHOP)))
+ {
+@@ -1862,6 +1863,7 @@ bgp_update_main (struct peer *peer, stru
+ if ((afi == AFI_IP || afi == AFI_IP6)
+ && safi == SAFI_UNICAST
+ && (peer_sort (peer) == BGP_PEER_IBGP
++ || peer_sort (peer) == BGP_PEER_CONFED
+ || (peer_sort (peer) == BGP_PEER_EBGP && peer->ttl != 1)
+ || CHECK_FLAG (peer->flags, PEER_FLAG_ENFORCE_MULTIHOP)))
+ {
--- /dev/null
+--- a/bgpd/bgp_aspath.c
++++ b/bgpd/bgp_aspath.c
+@@ -614,6 +614,47 @@ aspath_private_as_check (struct aspath *
+ return 1;
+ }
+
++/* AS path confed check. If aspath contains confed set or sequence then return 1. */
++int
++aspath_confed_check (struct aspath *aspath)
++{
++ caddr_t pnt;
++ caddr_t end;
++ struct assegment *assegment;
++
++ if (aspath == NULL)
++ return 0;
++
++ pnt = aspath->data;
++ end = aspath->data + aspath->length;
++
++ while (pnt < end)
++ {
++ assegment = (struct assegment *) pnt;
++ if (assegment->type == AS_CONFED_SET || assegment->type == AS_CONFED_SEQUENCE)
++ return 1;
++ pnt += (assegment->length * AS_VALUE_SIZE) + AS_HEADER_SIZE;
++ }
++ return 0;
++}
++
++/* Leftmost AS path segment confed check. If leftmost AS segment is of type
++ AS_CONFED_SEQUENCE or AS_CONFED_SET then return 1. */
++int
++aspath_left_confed_check (struct aspath *aspath)
++{
++ struct assegment *assegment;
++
++ if (aspath == NULL)
++ return 0;
++
++ assegment = (struct assegment *) aspath->data;
++ if (assegment->type == AS_CONFED_SEQUENCE || assegment->type == AS_CONFED_SET)
++ return 1;
++
++ return 0;
++}
++
+ /* Merge as1 to as2. as2 should be uninterned aspath. */
+ struct aspath *
+ aspath_merge (struct aspath *as1, struct aspath *as2)
+@@ -671,6 +712,10 @@ aspath_prepend (struct aspath *as1, stru
+ if (seg1 == NULL)
+ return as2;
+
++ /* Delete any AS_CONFED_SEQUENCE segment from as2. */
++ if (seg1->type == AS_SEQUENCE && seg2->type == AS_CONFED_SEQUENCE)
++ as2 = aspath_delete_confed_seq (as2);
++
+ /* Compare last segment type of as1 and first segment type of as2. */
+ if (seg1->type != seg2->type)
+ return aspath_merge (as1, as2);
+--- a/bgpd/bgp_aspath.h
++++ b/bgpd/bgp_aspath.h
+@@ -76,4 +76,6 @@ unsigned int aspath_key_make (struct asp
+ int aspath_loop_check (struct aspath *, as_t);
+ int aspath_private_as_check (struct aspath *);
+ int aspath_firstas_check (struct aspath *, as_t);
++int aspath_confed_check (struct aspath *);
++int aspath_left_confed_check (struct aspath *);
+ unsigned long aspath_count ();
+--- a/bgpd/bgp_attr.c
++++ b/bgpd/bgp_attr.c
+@@ -673,6 +673,17 @@ bgp_attr_aspath (struct peer *peer, bgp_
+ return -1;
+ }
+
++ /* Confederation sanity check. */
++ if ((peer_sort (peer) == BGP_PEER_CONFED && ! aspath_left_confed_check (attr->aspath)) ||
++ (peer_sort (peer) == BGP_PEER_EBGP && aspath_confed_check (attr->aspath)))
++ {
++ zlog (peer->log, LOG_ERR, "Malformed AS path from %s", peer->host);
++ bgp_notify_send (peer,
++ BGP_NOTIFY_UPDATE_ERR,
++ BGP_NOTIFY_UPDATE_MAL_AS_PATH);
++ return -1;
++ }
++
+ bgp = peer->bgp;
+
+ /* First AS check for EBGP. */
--- /dev/null
+--- a/zebra/rt_netlink.c
++++ b/zebra/rt_netlink.c
+@@ -487,6 +487,17 @@ netlink_interface (struct sockaddr_nl *s
+ /* Looking up interface name. */
+ memset (tb, 0, sizeof tb);
+ netlink_parse_rtattr (tb, IFLA_MAX, IFLA_RTA (ifi), len);
++
++#ifdef IFLA_WIRELESS
++ /* check for wireless messages to ignore */
++ if ((tb[IFLA_WIRELESS] != NULL) && (ifi->ifi_change == 0))
++ {
++ if (IS_ZEBRA_DEBUG_KERNEL)
++ zlog_debug ("%s: ignoring IFLA_WIRELESS message", __func__);
++ return 0;
++ }
++#endif /* IFLA_WIRELESS */
++
+ if (tb[IFLA_IFNAME] == NULL)
+ return -1;
+ name = (char *) RTA_DATA (tb[IFLA_IFNAME]);
+@@ -943,6 +954,17 @@ netlink_link_change (struct sockaddr_nl
+ /* Looking up interface name. */
+ memset (tb, 0, sizeof tb);
+ netlink_parse_rtattr (tb, IFLA_MAX, IFLA_RTA (ifi), len);
++
++#ifdef IFLA_WIRELESS
++ /* check for wireless messages to ignore */
++ if ((tb[IFLA_WIRELESS] != NULL) && (ifi->ifi_change == 0))
++ {
++ if (IS_ZEBRA_DEBUG_KERNEL)
++ zlog_debug ("%s: ignoring IFLA_WIRELESS message", __func__);
++ return 0;
++ }
++#endif /* IFLA_WIRELESS */
++
+ if (tb[IFLA_IFNAME] == NULL)
+ return -1;
+ name = (char *) RTA_DATA (tb[IFLA_IFNAME]);
--- /dev/null
+--- a/bgpd/bgp_network.c
++++ b/bgpd/bgp_network.c
+@@ -109,6 +109,7 @@ bgp_accept (struct thread *thread)
+ peer->fd = bgp_sock;
+ peer->status = Active;
+ peer->local_id = peer1->local_id;
++ peer->v_holdtime = BGP_LARGE_HOLDTIME;
+
+ /* Make peer's address string. */
+ sockunion2str (&su, buf, SU_ADDRSTRLEN);
+--- a/bgpd/bgpd.h
++++ b/bgpd/bgpd.h
+@@ -656,6 +656,7 @@ struct bgp_nlri
+ /* BGP timers default value. */
+ #define BGP_INIT_START_TIMER 5
+ #define BGP_ERROR_START_TIMER 30
++#define BGP_LARGE_HOLDTIME 240
+ #define BGP_DEFAULT_HOLDTIME 180
+ #define BGP_DEFAULT_KEEPALIVE 60
+ #define BGP_DEFAULT_ASORIGINATE 15
--- /dev/null
+--- a/lib/command.c
++++ b/lib/command.c
+@@ -2567,6 +2567,13 @@
+ unlink (config_file_tmp);
+ return CMD_WARNING;
+ }
++
++#if 0
++ /* This code fails on UNION MOUNTs and similar filesystems if the
++ * config file is still on the RO layer. Hardlinks across layers
++ * will not work and cause quagga to fail saving the configuration...
++ * should use rename() to move files around...
++ */
+ if (link (config_file, config_file_sav) != 0)
+ {
+ vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
+@@ -2586,7 +2593,23 @@
+ unlink (config_file_tmp);
+ return CMD_WARNING;
+ }
++#else
++ /* And this is the code that hopefully does work */
++ if (rename (config_file, config_file_sav) != 0)
++ {
++ vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
++ VTY_NEWLINE);
++ return CMD_WARNING;
++ }
++ sync ();
++#endif
++
++#if 0
++ /* same here. Please no cross-filesystem hardlinks... */
+ if (link (config_file_tmp, config_file) != 0)
++#else
++ if (rename (config_file_tmp, config_file) != 0)
++#endif
+ {
+ vty_out (vty, "Can't save configuration file %s.%s", config_file,
+ VTY_NEWLINE);
--- /dev/null
+--- a/zebra/zserv.c
++++ b/zebra/zserv.c
+@@ -451,7 +451,7 @@ zsend_route_multipath (int cmd, struct zserv *client, struct prefix *p,
+ }
+
+ /* Metric */
+- if (cmd == ZEBRA_IPV4_ROUTE_ADD || ZEBRA_IPV6_ROUTE_ADD)
++ if (cmd == ZEBRA_IPV4_ROUTE_ADD || cmd == ZEBRA_IPV6_ROUTE_ADD)
+ {
+ SET_FLAG (zapi_flags, ZAPI_MESSAGE_DISTANCE);
+ stream_putc (s, rib->distance);
--- /dev/null
+--- a/lib/vty.c
++++ b/lib/vty.c
+@@ -250,7 +250,7 @@ vty_hello (struct vty *vty)
+ vty_out (vty, "MOTD file not found%s", VTY_NEWLINE);
+ }
+ else if (host.motd)
+- vty_out (vty, host.motd);
++ vty_out (vty, "%s", host.motd);
+ }
+
+ /* Put out prompt and wait input from user. */
--- /dev/null
+--- a/bgpd/bgp_packet.c
++++ b/bgpd/bgp_packet.c
+@@ -177,10 +177,11 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi)
+
+ if (rn->prn)
+ prd = (struct prefix_rd *) &rn->prn->p;
+- if (binfo && binfo->extra)
++ if (binfo)
+ {
+- tag = binfo->extra->tag;
+ from = binfo->peer;
++ if (binfo->extra)
++ tag = binfo->extra->tag;
+ }
+
+ bgp_packet_set_marker (s, BGP_MSG_UPDATE);
--- /dev/null
+Add definitions for IPCTL_FORWARDING and IP6CTL_FORWARDING.
+
+Inspired from
+http://svn.gnumonks.org/trunk/grouter/build/src/quagga/quagga/quagga-0.99.1-forward_sysctl-2.6.14.patch
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: quagga-0.99.16/zebra/ipforward_sysctl.c
+===================================================================
+--- quagga-0.99.16.orig/zebra/ipforward_sysctl.c 2010-06-20 23:40:45.000000000 +0200
++++ quagga-0.99.16/zebra/ipforward_sysctl.c 2010-06-20 23:41:37.000000000 +0200
+@@ -31,6 +31,15 @@
+
+ #define MIB_SIZ 4
+
++/* Fix for recent (2.6.14) kernel headers */
++#ifndef IPCTL_FORWARDING
++#define IPCTL_FORWARDING NET_IPV4_FORWARD
++#endif
++
++#ifndef IP6CTL_FORWARDING
++#define IP6CTL_FORWARDING NET_IPV6_FORWARDING
++#endif
++
+ extern struct zebra_privs_t zserv_privs;
+
+ /* IPv4 forwarding control MIB. */
+++ /dev/null
---- a/configure
-+++ b/configure
-@@ -12675,69 +12675,6 @@ fi
-
-
-
--echo "$as_me:$LINENO: checking for broken CMSG_FIRSTHDR" >&5
--echo $ECHO_N "checking for broken CMSG_FIRSTHDR... $ECHO_C" >&6
--if test "$cross_compiling" = yes; then
-- echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--else
-- cat >conftest.$ac_ext <<_ACEOF
--/* confdefs.h. */
--_ACEOF
--cat confdefs.h >>conftest.$ac_ext
--cat >>conftest.$ac_ext <<_ACEOF
--/* end confdefs.h. */
--
--#ifdef SUNOS_5
--#define _XPG4_2
--#define __EXTENSIONS__
--#endif
--#include <stdlib.h>
--#include <sys/types.h>
--#include <sys/socket.h>
--
--main()
--{
-- struct msghdr msg;
-- char buf[4];
--
-- msg.msg_control = buf;
-- msg.msg_controllen = 0;
--
-- if (CMSG_FIRSTHDR(&msg) != NULL)
-- exit(0);
-- exit (1);
--}
--_ACEOF
--rm -f conftest$ac_exeext
--if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-- (eval $ac_link) 2>&5
-- ac_status=$?
-- echo "$as_me:$LINENO: \$? = $ac_status" >&5
-- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-- (eval $ac_try) 2>&5
-- ac_status=$?
-- echo "$as_me:$LINENO: \$? = $ac_status" >&5
-- (exit $ac_status); }; }; then
-- echo "$as_me:$LINENO: result: yes - using workaround" >&5
--echo "${ECHO_T}yes - using workaround" >&6
--cat >>confdefs.h <<\_ACEOF
--#define HAVE_BROKEN_CMSG_FIRSTHDR
--_ACEOF
--
--else
-- echo "$as_me: program exited with status $ac_status" >&5
--echo "$as_me: failed program was:" >&5
--sed 's/^/| /' conftest.$ac_ext >&5
--
--( exit $ac_status )
--echo "$as_me:$LINENO: result: no" >&5
--echo "${ECHO_T}no" >&6
--fi
--rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
--fi
--
- echo "$as_me:$LINENO: checking route read method check" >&5
- echo $ECHO_N "checking route read method check... $ECHO_C" >&6
- if test "${zebra_rtread+set}" = set; then
-@@ -12835,10 +12772,7 @@ echo $ECHO_N "checking ipforward method
- if test "${zebra_ipforward_path+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
-- for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null;
--do
-- test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break
--done
-+ zebra_ipforward_path="/proc/net/snmp"
- case $zebra_ipforward_path in
- "/proc/net/snmp") IPFORWARD=ipforward_proc.o
- zebra_ipforward_path="proc";;
+++ /dev/null
---- a/configure
-+++ b/configure
-@@ -10972,7 +10972,7 @@ if test "${ac_cv_lib_curses_tputs+set}"
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lcurses $LIBS"
-+#LIBS="-lcurses $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -11108,7 +11108,8 @@ if test $ac_cv_lib_ncurses_tputs = yes;
- #define HAVE_LIBNCURSES 1
- _ACEOF
-
-- LIBS="-lncurses $LIBS"
-+# LIBS="-lncurses $LIBS"
-+CURSES=-lncurses
-
- fi
-
-@@ -11125,7 +11126,7 @@ if test "${ac_cv_lib_readline_main+set}"
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lreadline $LIBS"
-+LIBS="-lreadline $CURSES $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -11182,7 +11183,8 @@ if test $ac_cv_lib_readline_main = yes;
- #define HAVE_LIBREADLINE 1
- _ACEOF
-
-- LIBS="-lreadline $LIBS"
-+# LIBS="-lreadline $LIBS"
-+CURSES="$CURSES -lreadline"
-
- fi
-
-@@ -11342,7 +11344,7 @@ if test "${ac_cv_lib_readline_rl_complet
- echo $ECHO_N "(cached) $ECHO_C" >&6
- else
- ac_check_lib_save_LIBS=$LIBS
--LIBS="-lreadline $LIBS"
-+LIBS="-lreadline $CURSES $LIBS"
- cat >conftest.$ac_ext <<_ACEOF
- /* confdefs.h. */
- _ACEOF
-@@ -11405,7 +11407,7 @@ if test $ac_cv_lib_readline_rl_completio
- #define HAVE_LIBREADLINE 1
- _ACEOF
-
-- LIBS="-lreadline $LIBS"
-+# LIBS="-lreadline $LIBS"
-
- fi
-
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
-@@ -3,6 +3,9 @@
-
- This file is part of GNU Zebra.
-
-+This file was modified from the original on 30/12/2007
-+by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
-+
- 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
-@@ -7793,8 +7796,12 @@ bgp_str2route_type (int afi, const char
+@@ -8228,8 +8228,14 @@ bgp_str2route_type (int afi, const char
return ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
return ZEBRA_ROUTE_RIP;
- else if (strncmp (str, "o", 1) == 0)
-+ else if (strncmp (str, "ol", 2) == 0)
-+ return ZEBRA_ROUTE_OLSR;
+ else if (strncmp (str, "os", 2) == 0)
return ZEBRA_ROUTE_OSPF;
-+ else if (strncmp (str, "ba", 2) == 0)
++ else if (strncmp (str, "h", 1) == 0)
++ return ZEBRA_ROUTE_HSLS;
++ else if (strncmp (str, "ol", 2) == 0)
++ return ZEBRA_ROUTE_OLSR;
++ else if (strncmp (str, "b", 1) == 0)
+ return ZEBRA_ROUTE_BATMAN;
}
if (afi == AFI_IP6)
{
-@@ -7806,21 +7813,28 @@ bgp_str2route_type (int afi, const char
+@@ -8241,21 +8247,30 @@ bgp_str2route_type (int afi, const char
return ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
return ZEBRA_ROUTE_RIPNG;
- else if (strncmp (str, "o", 1) == 0)
+ else if (strncmp (str, "os", 2) == 0)
return ZEBRA_ROUTE_OSPF6;
++ else if (strncmp (str, "h", 1) == 0)
++ return ZEBRA_ROUTE_HSLS;
+ else if (strncmp (str, "ol", 2) == 0)
+ return ZEBRA_ROUTE_OLSR;
-+ else if (strncmp (str, "ba", 2) == 0)
++ else if (strncmp (str, "b", 1) == 0)
+ return ZEBRA_ROUTE_BATMAN;
}
return 0;
DEFUN (bgp_redistribute_ipv4,
bgp_redistribute_ipv4_cmd,
- "redistribute (connected|kernel|ospf|rip|static)",
-+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
++ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman)",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Routing Information Protocol (RIP)\n"
- "Static routes\n")
+ "Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+ )
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
{
int type;
-@@ -7835,13 +7849,15 @@ DEFUN (bgp_redistribute_ipv4,
+@@ -8270,13 +8285,16 @@ DEFUN (bgp_redistribute_ipv4,
DEFUN (bgp_redistribute_ipv4_rmap,
bgp_redistribute_ipv4_rmap_cmd,
- "redistribute (connected|kernel|ospf|rip|static) route-map WORD",
-+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
++ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -7860,13 +7876,15 @@ DEFUN (bgp_redistribute_ipv4_rmap,
+@@ -8295,13 +8313,16 @@ DEFUN (bgp_redistribute_ipv4_rmap,
DEFUN (bgp_redistribute_ipv4_metric,
bgp_redistribute_ipv4_metric_cmd,
- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -7887,13 +7905,15 @@ DEFUN (bgp_redistribute_ipv4_metric,
+@@ -8322,13 +8343,16 @@ DEFUN (bgp_redistribute_ipv4_metric,
DEFUN (bgp_redistribute_ipv4_rmap_metric,
bgp_redistribute_ipv4_rmap_metric_cmd,
- "redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -7917,13 +7937,15 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
+@@ -8352,13 +8376,16 @@ DEFUN (bgp_redistribute_ipv4_rmap_metric
DEFUN (bgp_redistribute_ipv4_metric_rmap,
bgp_redistribute_ipv4_metric_rmap_cmd,
- "redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
-+ "redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
++ "redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
-@@ -7947,14 +7969,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
+@@ -8382,14 +8409,17 @@ DEFUN (bgp_redistribute_ipv4_metric_rmap
DEFUN (no_bgp_redistribute_ipv4,
no_bgp_redistribute_ipv4_cmd,
- "no redistribute (connected|kernel|ospf|rip|static)",
-+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman)",
++ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman)",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
"Routing Information Protocol (RIP)\n"
- "Static routes\n")
+ "Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+ )
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
{
int type;
-@@ -7970,7 +7995,7 @@ DEFUN (no_bgp_redistribute_ipv4,
+@@ -8405,7 +8435,7 @@ DEFUN (no_bgp_redistribute_ipv4,
DEFUN (no_bgp_redistribute_ipv4_rmap,
no_bgp_redistribute_ipv4_rmap_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD",
-+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD",
++ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -7978,6 +8003,8 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
+@@ -8413,6 +8443,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -7996,7 +8023,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
+@@ -8431,7 +8464,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap,
DEFUN (no_bgp_redistribute_ipv4_metric,
no_bgp_redistribute_ipv4_metric_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8004,6 +8031,8 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
+@@ -8439,6 +8472,9 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -8022,7 +8051,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
+@@ -8457,7 +8493,7 @@ DEFUN (no_bgp_redistribute_ipv4_metric,
DEFUN (no_bgp_redistribute_ipv4_rmap_metric,
no_bgp_redistribute_ipv4_rmap_metric_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) route-map WORD metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) route-map WORD metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8030,6 +8059,8 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
+@@ -8465,6 +8501,9 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -8051,7 +8082,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
+@@ -8486,7 +8525,7 @@ DEFUN (no_bgp_redistribute_ipv4_rmap_met
ALIAS (no_bgp_redistribute_ipv4_rmap_metric,
no_bgp_redistribute_ipv4_metric_rmap_cmd,
- "no redistribute (connected|kernel|ospf|rip|static) metric <0-4294967295> route-map WORD",
-+ "no redistribute (connected|kernel|ospf|rip|static|olsr|batman) metric <0-4294967295> route-map WORD",
++ "no redistribute (connected|kernel|ospf|rip|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8059,6 +8090,8 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
+@@ -8494,6 +8533,9 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
"Open Shurtest Path First (OSPF)\n"
"Routing Information Protocol (RIP)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
-@@ -8067,13 +8100,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
+@@ -8502,13 +8544,16 @@ ALIAS (no_bgp_redistribute_ipv4_rmap_met
#ifdef HAVE_IPV6
DEFUN (bgp_redistribute_ipv6,
bgp_redistribute_ipv6_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static)",
-+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
++ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman)",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Routing Information Protocol (RIPng)\n"
- "Static routes\n")
+ "Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+ )
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
{
int type;
-@@ -8089,13 +8125,15 @@ DEFUN (bgp_redistribute_ipv6,
+@@ -8524,13 +8569,16 @@ DEFUN (bgp_redistribute_ipv6,
DEFUN (bgp_redistribute_ipv6_rmap,
bgp_redistribute_ipv6_rmap_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
-+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
++ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -8114,13 +8152,15 @@ DEFUN (bgp_redistribute_ipv6_rmap,
+@@ -8549,13 +8597,16 @@ DEFUN (bgp_redistribute_ipv6_rmap,
DEFUN (bgp_redistribute_ipv6_metric,
bgp_redistribute_ipv6_metric_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -8141,13 +8181,15 @@ DEFUN (bgp_redistribute_ipv6_metric,
+@@ -8576,13 +8627,16 @@ DEFUN (bgp_redistribute_ipv6_metric,
DEFUN (bgp_redistribute_ipv6_rmap_metric,
bgp_redistribute_ipv6_rmap_metric_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
-+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
++ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -8171,13 +8213,15 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
+@@ -8606,13 +8660,16 @@ DEFUN (bgp_redistribute_ipv6_rmap_metric
DEFUN (bgp_redistribute_ipv6_metric_rmap,
bgp_redistribute_ipv6_metric_rmap_cmd,
- "redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
-+ "redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
++ "redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
"Redistribute information from another routing protocol\n"
"Connected\n"
"Kernel routes\n"
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
-@@ -8201,14 +8245,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
+@@ -8636,14 +8693,17 @@ DEFUN (bgp_redistribute_ipv6_metric_rmap
DEFUN (no_bgp_redistribute_ipv6,
no_bgp_redistribute_ipv6_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static)",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman)",
++ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman)",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
"Routing Information Protocol (RIPng)\n"
- "Static routes\n")
+ "Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+ )
++ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n")
{
int type;
-@@ -8224,7 +8271,7 @@ DEFUN (no_bgp_redistribute_ipv6,
+@@ -8659,7 +8719,7 @@ DEFUN (no_bgp_redistribute_ipv6,
DEFUN (no_bgp_redistribute_ipv6_rmap,
no_bgp_redistribute_ipv6_rmap_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD",
++ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8232,6 +8279,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
+@@ -8667,6 +8727,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n")
{
-@@ -8250,7 +8299,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
+@@ -8685,7 +8748,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap,
DEFUN (no_bgp_redistribute_ipv6_metric,
no_bgp_redistribute_ipv6_metric_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8258,6 +8307,8 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
+@@ -8693,6 +8756,9 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n")
{
-@@ -8276,7 +8327,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
+@@ -8711,7 +8777,7 @@ DEFUN (no_bgp_redistribute_ipv6_metric,
DEFUN (no_bgp_redistribute_ipv6_rmap_metric,
no_bgp_redistribute_ipv6_rmap_metric_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) route-map WORD metric <0-4294967295>",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) route-map WORD metric <0-4294967295>",
++ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) route-map WORD metric <0-4294967295>",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8284,6 +8335,8 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
+@@ -8719,6 +8785,9 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Route map reference\n"
"Pointer to route-map entries\n"
"Metric for redistributed routes\n"
-@@ -8305,7 +8358,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
+@@ -8740,7 +8809,7 @@ DEFUN (no_bgp_redistribute_ipv6_rmap_met
ALIAS (no_bgp_redistribute_ipv6_rmap_metric,
no_bgp_redistribute_ipv6_metric_rmap_cmd,
- "no redistribute (connected|kernel|ospf6|ripng|static) metric <0-4294967295> route-map WORD",
-+ "no redistribute (connected|kernel|ospf6|ripng|static|olsr|batman) metric <0-4294967295> route-map WORD",
++ "no redistribute (connected|kernel|ospf6|ripng|static|hsls|olsr|batman) metric <0-4294967295> route-map WORD",
NO_STR
"Redistribute information from another routing protocol\n"
"Connected\n"
-@@ -8313,6 +8366,8 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
+@@ -8748,6 +8817,9 @@ ALIAS (no_bgp_redistribute_ipv6_rmap_met
"Open Shurtest Path First (OSPFv3)\n"
"Routing Information Protocol (RIPng)\n"
"Static routes\n"
++ "Hazy-Sighted Link State Protocol (HSLS)\n"
+ "Optimized Link State Routing (OLSR)\n"
+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
"Metric for redistributed routes\n"
"Default metric\n"
"Route map reference\n"
-@@ -8325,7 +8380,7 @@ bgp_config_write_redistribute (struct vt
- {
- int i;
- const char *str[] = { "system", "kernel", "connected", "static", "rip",
-- "ripng", "ospf", "ospf6", "isis", "bgp"};
-+ "ripng", "ospf", "ospf6", "isis", "bgp", "hsls", "olsr", "batman"};
-
- /* Unicast redistribution only. */
- if (safi != SAFI_UNICAST)
+--- a/lib/log.c
++++ b/lib/log.c
+@@ -835,6 +835,8 @@ static const struct zebra_desc_table rou
+ DESC_ENTRY (ZEBRA_ROUTE_ISIS, "isis", 'I' ),
+ DESC_ENTRY (ZEBRA_ROUTE_BGP, "bgp", 'B' ),
+ DESC_ENTRY (ZEBRA_ROUTE_HSLS, "hsls", 'H' ),
++ DESC_ENTRY (ZEBRA_ROUTE_OLSR, "olsr", 'o' ),
++ DESC_ENTRY (ZEBRA_ROUTE_BATMAN, "batman", 'b' ),
+ };
+ #undef DESC_ENTRY
+
+--- a/lib/route_types.txt
++++ b/lib/route_types.txt
+@@ -51,13 +51,9 @@ ZEBRA_ROUTE_OSPF, ospf, ospfd
+ ZEBRA_ROUTE_OSPF6, ospf6, ospf6d, 'O', 0, 1, "OSPF"
+ ZEBRA_ROUTE_ISIS, isis, isisd, 'I', 1, 1, "IS-IS"
+ ZEBRA_ROUTE_BGP, bgp, bgpd, 'B', 1, 1, "BGP"
+-# HSLS and OLSR both are AFI independent (so: 1, 1), however
+-# we want to disable for them for general Quagga distribution.
+-# This at least makes it trivial for users of these protocols
+-# to 'switch on' redist support (direct numeric entry remaining
+-# possible).
+-ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 0, 0, "HSLS"
+-ZEBRA_ROUTE_OLSR, olsr, oslrd, 'o', 0, 0, "OLSR"
++ZEBRA_ROUTE_HSLS, hsls, hslsd, 'H', 1, 1, "HSLS"
++ZEBRA_ROUTE_OLSR, olsr, olsrd, 'o', 1, 1, "OLSR"
++ZEBRA_ROUTE_BATMAN, batman, batmand,'b', 1, 1, "BATMAN"
+
+ ## help strings
+ ZEBRA_ROUTE_SYSTEM, "Reserved route type, for internal use only"
+@@ -71,4 +67,5 @@ ZEBRA_ROUTE_OSPF6, "Open Shortest Path
+ ZEBRA_ROUTE_ISIS, "Intermediate System to Intermediate System (IS-IS)"
+ ZEBRA_ROUTE_BGP, "Border Gateway Protocol (BGP)"
+ ZEBRA_ROUTE_HSLS, "Hazy-Sighted Link State Protocol (HSLS)"
+-ZEBRA_ROUTE_OLSR, "Optimised Link State Routing (OLSR)"
++ZEBRA_ROUTE_OLSR, "Optimized Link State Routing (OLSR)"
++ZEBRA_ROUTE_BATMAN, "Better Approach to Mobile Ad-Hoc Networking (BATMAN)"
--- a/lib/zebra.h
+++ b/lib/zebra.h
-@@ -3,6 +3,9 @@
-
- This file is part of GNU Zebra.
-
-+This file was modified from the original on 30/12/2007
-+by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
-+
- 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
-@@ -378,7 +381,9 @@ struct in_pktinfo
+@@ -441,7 +441,9 @@ struct in_pktinfo
#define ZEBRA_ROUTE_ISIS 8
#define ZEBRA_ROUTE_BGP 9
#define ZEBRA_ROUTE_HSLS 10
+#define ZEBRA_ROUTE_BATMAN 12
+#define ZEBRA_ROUTE_MAX 13
- /* Zebra's family types. */
- #define ZEBRA_FAMILY_IPV4 1
+ /* Note: whenever a new route-type or zserv-command is added the
+ * corresponding {command,route}_types[] table in lib/log.c MUST be
+--- a/ospf6d/ospf6_asbr.c
++++ b/ospf6d/ospf6_asbr.c
+@@ -616,13 +616,16 @@ ospf6_asbr_redistribute_remove (int type
+
+ DEFUN (ospf6_redistribute,
+ ospf6_redistribute_cmd,
+- "redistribute (static|kernel|connected|ripng|bgp)",
++ "redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman)",
+ "Redistribute\n"
+ "Static route\n"
+ "Kernel route\n"
+ "Connected route\n"
+ "RIPng route\n"
+ "BGP route\n"
++ "HSLS route\n"
++ "OLSR route\n"
++ "BATMAN route\n"
+ )
+ {
+ int type = 0;
+@@ -637,6 +640,12 @@ DEFUN (ospf6_redistribute,
+ type = ZEBRA_ROUTE_RIPNG;
+ else if (strncmp (argv[0], "bgp", 3) == 0)
+ type = ZEBRA_ROUTE_BGP;
++ else if (strncmp (argv[0], "h", 1) == 0)
++ type = ZEBRA_ROUTE_HSLS;
++ else if (strncmp (argv[0], "o", 1) == 0)
++ type = ZEBRA_ROUTE_OLSR;
++ else if (strncmp (argv[0], "ba", 2) == 0)
++ type = ZEBRA_ROUTE_BATMAN;
+
+ ospf6_asbr_redistribute_unset (type);
+ ospf6_asbr_routemap_unset (type);
+@@ -646,13 +655,16 @@ DEFUN (ospf6_redistribute,
+
+ DEFUN (ospf6_redistribute_routemap,
+ ospf6_redistribute_routemap_cmd,
+- "redistribute (static|kernel|connected|ripng|bgp) route-map WORD",
++ "redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman) route-map WORD",
+ "Redistribute\n"
+ "Static routes\n"
+ "Kernel route\n"
+ "Connected route\n"
+ "RIPng route\n"
+ "BGP route\n"
++ "HSLS route\n"
++ "OLSR route\n"
++ "BATMAN route\n"
+ "Route map reference\n"
+ "Route map name\n"
+ )
+@@ -669,6 +681,12 @@ 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], "h", 1) == 0)
++ type = ZEBRA_ROUTE_HSLS;
++ else if (strncmp (argv[0], "o", 1) == 0)
++ type = ZEBRA_ROUTE_OLSR;
++ else if (strncmp (argv[0], "ba", 2) == 0)
++ type = ZEBRA_ROUTE_BATMAN;
+
+ ospf6_asbr_redistribute_unset (type);
+ ospf6_asbr_routemap_set (type, argv[1]);
+@@ -678,7 +696,7 @@ DEFUN (ospf6_redistribute_routemap,
+
+ DEFUN (no_ospf6_redistribute,
+ no_ospf6_redistribute_cmd,
+- "no redistribute (static|kernel|connected|ripng|bgp)",
++ "no redistribute (static|kernel|connected|ripng|bgp|hsls|olsr|batman)",
+ NO_STR
+ "Redistribute\n"
+ "Static route\n"
+@@ -686,6 +704,9 @@ DEFUN (no_ospf6_redistribute,
+ "Connected route\n"
+ "RIPng route\n"
+ "BGP route\n"
++ "HSLS route\n"
++ "OLSR route\n"
++ "BATMAN route\n"
+ )
+ {
+ int type = 0;
+@@ -700,6 +721,12 @@ 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], "h", 1) == 0)
++ type = ZEBRA_ROUTE_HSLS;
++ else if (strncmp (argv[0], "o", 1) == 0)
++ type = ZEBRA_ROUTE_OLSR;
++ else if (strncmp (argv[0], "ba", 2) == 0)
++ type = ZEBRA_ROUTE_BATMAN;
+
+ ospf6_asbr_redistribute_unset (type);
+ ospf6_asbr_routemap_unset (type);
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
-@@ -3,6 +3,9 @@
- *
- * This file is part of GNU Zebra.
- *
-+ * This file was modified from the original on 30/12/2007
-+ * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
-+ *
- * 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
-@@ -106,11 +109,15 @@ str2distribute_source (const char *str,
+@@ -107,8 +107,14 @@ str2distribute_source (const char *str,
*source = ZEBRA_ROUTE_STATIC;
else if (strncmp (str, "r", 1) == 0)
*source = ZEBRA_ROUTE_RIP;
- else if (strncmp (str, "b", 1) == 0)
+ else if (strncmp (str, "bg", 2) == 0)
*source = ZEBRA_ROUTE_BGP;
-+ else if (strncmp (str, "ol", 2) == 0)
++ else if (strncmp (str, "h", 1) == 0)
++ *source = ZEBRA_ROUTE_HSLS;
++ else if (strncmp (str, "o", 1) == 0)
+ *source = ZEBRA_ROUTE_OLSR;
+ else if (strncmp (str, "ba", 2) == 0)
+ *source = ZEBRA_ROUTE_BATMAN;
else
return 0;
--
-+
- return 1;
- }
-@@ -5302,13 +5309,15 @@ ALIAS (no_ip_ospf_transmit_delay,
- \f
- DEFUN (ospf_redistribute_source_metric_type,
- ospf_redistribute_source_metric_type_routemap_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2) route-map WORD",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2) route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "OSPF default metric\n"
- "OSPF exterior metric type for redistributed routes\n"
-@@ -5346,13 +5355,15 @@ DEFUN (ospf_redistribute_source_metric_t
-
- ALIAS (ospf_redistribute_source_metric_type,
- ospf_redistribute_source_metric_type_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> metric-type (1|2)",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> metric-type (1|2)",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "OSPF default metric\n"
- "OSPF exterior metric type for redistributed routes\n"
-@@ -5361,25 +5372,29 @@ ALIAS (ospf_redistribute_source_metric_t
-
- ALIAS (ospf_redistribute_source_metric_type,
- ospf_redistribute_source_metric_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214>",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214>",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "OSPF default metric\n")
+--- a/ripd/rip_zebra.c
++++ b/ripd/rip_zebra.c
+@@ -204,8 +204,11 @@ static struct {
+ {ZEBRA_ROUTE_KERNEL, 1, "kernel"},
+ {ZEBRA_ROUTE_CONNECT, 1, "connected"},
+ {ZEBRA_ROUTE_STATIC, 1, "static"},
+- {ZEBRA_ROUTE_OSPF, 1, "ospf"},
+- {ZEBRA_ROUTE_BGP, 1, "bgp"},
++ {ZEBRA_ROUTE_OSPF, 2, "ospf"},
++ {ZEBRA_ROUTE_BGP, 2, "bgp"},
++ {ZEBRA_ROUTE_HSLS, 1, "hsls"},
++ {ZEBRA_ROUTE_OLSR, 2, "olsr"},
++ {ZEBRA_ROUTE_BATMAN, 2, "batman"},
+ {0, 0, NULL}
+ };
+
+--- a/ripngd/ripng_zebra.c
++++ b/ripngd/ripng_zebra.c
+@@ -214,8 +214,11 @@ static struct {
+ {ZEBRA_ROUTE_KERNEL, 1, "kernel"},
+ {ZEBRA_ROUTE_CONNECT, 1, "connected"},
+ {ZEBRA_ROUTE_STATIC, 1, "static"},
+- {ZEBRA_ROUTE_OSPF6, 1, "ospf6"},
+- {ZEBRA_ROUTE_BGP, 1, "bgp"},
++ {ZEBRA_ROUTE_OSPF6, 2, "ospf6"},
++ {ZEBRA_ROUTE_BGP, 2, "bgp"},
++ {ZEBRA_ROUTE_HSLS, 1, "hsls"},
++ {ZEBRA_ROUTE_OLSR, 2, "olsr"},
++ {ZEBRA_ROUTE_BATMAN, 2, "batman"},
+ {0, 0, NULL}
+ };
- DEFUN (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_type_metric_routemap_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214> route-map WORD",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214> route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
-@@ -5417,13 +5432,15 @@ DEFUN (ospf_redistribute_source_type_met
-
- ALIAS (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_type_metric_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) metric <0-16777214>",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) metric <0-16777214>",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
-@@ -5432,7 +5449,7 @@ ALIAS (ospf_redistribute_source_type_met
-
- ALIAS (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_type_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2)",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2)",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
-@@ -5440,28 +5457,35 @@ ALIAS (ospf_redistribute_source_type_met
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
- "OSPF exterior metric type for redistributed routes\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n")
-
- ALIAS (ospf_redistribute_source_type_metric,
- ospf_redistribute_source_cmd,
-- "redistribute (kernel|connected|static|rip|bgp)",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
-- "Border Gateway Protocol (BGP)\n")
-+ "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+ )
-
- DEFUN (ospf_redistribute_source_metric_routemap,
- ospf_redistribute_source_metric_routemap_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric <0-16777214> route-map WORD",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric <0-16777214> route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Metric for redistributed routes\n"
- "OSPF default metric\n"
- "Route map reference\n"
-@@ -5490,13 +5514,15 @@ DEFUN (ospf_redistribute_source_metric_r
-
- DEFUN (ospf_redistribute_source_type_routemap,
- ospf_redistribute_source_type_routemap_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) metric-type (1|2) route-map WORD",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) metric-type (1|2) route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "OSPF exterior metric type for redistributed routes\n"
- "Set OSPF External Type 1 metrics\n"
- "Set OSPF External Type 2 metrics\n"
-@@ -5526,13 +5552,15 @@ DEFUN (ospf_redistribute_source_type_rou
-
- DEFUN (ospf_redistribute_source_routemap,
- ospf_redistribute_source_routemap_cmd,
-- "redistribute (kernel|connected|static|rip|bgp) route-map WORD",
-+ "redistribute (kernel|connected|static|rip|bgp|olsr|batman) route-map WORD",
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
- "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Route map reference\n"
- "Pointer to route-map entries\n")
- {
-@@ -5553,14 +5581,17 @@ DEFUN (ospf_redistribute_source_routemap
-
- DEFUN (no_ospf_redistribute_source,
- no_ospf_redistribute_source_cmd,
-- "no redistribute (kernel|connected|static|rip|bgp)",
-+ "no redistribute (kernel|connected|static|rip|bgp|olsr|batman)",
- NO_STR
- "Redistribute information from another routing protocol\n"
- "Kernel routes\n"
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
-- "Border Gateway Protocol (BGP)\n")
-+ "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+ )
- {
- struct ospf *ospf = vty->index;
- int source;
-@@ -5574,7 +5605,7 @@ DEFUN (no_ospf_redistribute_source,
-
- DEFUN (ospf_distribute_list_out,
- ospf_distribute_list_out_cmd,
-- "distribute-list WORD out (kernel|connected|static|rip|bgp)",
-+ "distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
- "Filter networks in routing updates\n"
- "Access-list name\n"
- OUT_STR
-@@ -5582,7 +5613,10 @@ DEFUN (ospf_distribute_list_out,
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
-- "Border Gateway Protocol (BGP)\n")
-+ "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+)
- {
- struct ospf *ospf = vty->index;
- int source;
-@@ -5596,7 +5630,7 @@ DEFUN (ospf_distribute_list_out,
-
- DEFUN (no_ospf_distribute_list_out,
- no_ospf_distribute_list_out_cmd,
-- "no distribute-list WORD out (kernel|connected|static|rip|bgp)",
-+ "no distribute-list WORD out (kernel|connected|static|rip|bgp|olsr|batman)",
- NO_STR
- "Filter networks in routing updates\n"
- "Access-list name\n"
-@@ -5605,7 +5639,10 @@ DEFUN (no_ospf_distribute_list_out,
- "Connected\n"
- "Static routes\n"
- "Routing Information Protocol (RIP)\n"
-- "Border Gateway Protocol (BGP)\n")
-+ "Border Gateway Protocol (BGP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
-+)
- {
- struct ospf *ospf = vty->index;
- int source;
-@@ -7121,7 +7158,8 @@ config_write_virtual_link (struct vty *v
-
- \f
- const char *distribute_str[] = { "system", "kernel", "connected", "static",
-- "rip", "ripng", "ospf", "ospf6", "isis", "bgp"};
-+ "rip", "ripng", "ospf", "ospf6", "isis", "bgp",
-+ "hsls","olsr","batman"};
- int
- config_write_ospf_redistribute (struct vty *vty, struct ospf *ospf)
- {
--- a/zebra/redistribute.c
+++ b/zebra/redistribute.c
-@@ -3,6 +3,9 @@
- *
- * This file is part of GNU Zebra.
- *
-+ * This file was modified from the original on 30/12/2007
-+ * by Vasilis Tsiligiannis <acinonyxs@yahoo.gr>
-+ *
- * 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
-@@ -253,6 +256,8 @@ zebra_redistribute_add (int command, str
+@@ -255,6 +255,9 @@ zebra_redistribute_add (int command, str
case ZEBRA_ROUTE_OSPF:
case ZEBRA_ROUTE_OSPF6:
case ZEBRA_ROUTE_BGP:
++ case ZEBRA_ROUTE_HSLS:
+ case ZEBRA_ROUTE_OLSR:
+ case ZEBRA_ROUTE_BATMAN:
if (! client->redist[type])
{
client->redist[type] = 1;
-@@ -281,6 +286,8 @@ zebra_redistribute_delete (int command,
+@@ -283,6 +286,9 @@ zebra_redistribute_delete (int command,
case ZEBRA_ROUTE_OSPF:
case ZEBRA_ROUTE_OSPF6:
case ZEBRA_ROUTE_BGP:
++ case ZEBRA_ROUTE_HSLS:
+ case ZEBRA_ROUTE_OLSR:
+ case ZEBRA_ROUTE_BATMAN:
client->redist[type] = 0;
break;
default:
---- a/zebra/zebra_vty.c
-+++ b/zebra/zebra_vty.c
-@@ -53,6 +53,10 @@ route_type_str (u_char type)
- return "isis";
- case ZEBRA_ROUTE_BGP:
- return "bgp";
-+ case ZEBRA_ROUTE_OLSR:
-+ return "olsr";
-+ case ZEBRA_ROUTE_BATMAN:
-+ return "batman";
- default:
- return "unknown";
- }
-@@ -84,6 +88,12 @@ route_type_char (u_char type)
- return 'I';
+--- a/zebra/zebra_rib.c
++++ b/zebra/zebra_rib.c
+@@ -66,7 +66,10 @@ static const struct
+ {ZEBRA_ROUTE_OSPF, 110},
+ {ZEBRA_ROUTE_OSPF6, 110},
+ {ZEBRA_ROUTE_ISIS, 115},
+- {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */}
++ {ZEBRA_ROUTE_BGP, 20 /* IBGP is 200. */},
++ {ZEBRA_ROUTE_HSLS, 0},
++ {ZEBRA_ROUTE_OLSR, 0},
++ {ZEBRA_ROUTE_BATMAN, 0}
+ };
+ \f
+ /* Vector for routing table. */
+@@ -1229,6 +1232,8 @@ static const u_char meta_queue_map[ZEBRA
+ [ZEBRA_ROUTE_ISIS] = 2,
+ [ZEBRA_ROUTE_BGP] = 3,
+ [ZEBRA_ROUTE_HSLS] = 4,
++ [ZEBRA_ROUTE_OLSR] = 4,
++ [ZEBRA_ROUTE_BATMAN] = 4,
+ };
+
+ /* Look into the RN and queue it into one or more priority queues,
+--- a/zebra/zebra_snmp.c
++++ b/zebra/zebra_snmp.c
+@@ -251,6 +251,12 @@ proto_trans(int type)
+ return 1; /* shouldn't happen */
case ZEBRA_ROUTE_BGP:
- return 'B';
+ return 14; /* bgp */
+ case ZEBRA_ROUTE_HSLS:
-+ return 'H';
++ return 1; /* other */
+ case ZEBRA_ROUTE_OLSR:
-+ return 'L';
++ return 1; /* other */
+ case ZEBRA_ROUTE_BATMAN:
-+ return 'M';
++ return 1; /* other */
default:
- return '?';
+ return 1; /* other */
}
-@@ -755,8 +765,8 @@ vty_show_ip_route (struct vty *vty, stru
+--- a/zebra/zebra_vty.c
++++ b/zebra/zebra_vty.c
+@@ -557,7 +557,10 @@ vty_show_ip_route_detail (struct vty *vt
+ if (rib->type == ZEBRA_ROUTE_RIP
+ || rib->type == ZEBRA_ROUTE_OSPF
+ || rib->type == ZEBRA_ROUTE_ISIS
+- || rib->type == ZEBRA_ROUTE_BGP)
++ || rib->type == ZEBRA_ROUTE_BGP
++ || rib->type == ZEBRA_ROUTE_HSLS
++ || rib->type == ZEBRA_ROUTE_OLSR
++ || rib->type == ZEBRA_ROUTE_BATMAN)
+ {
+ time_t uptime;
+ struct tm *tm;
+@@ -775,7 +778,10 @@ vty_show_ip_route (struct vty *vty, stru
+ if (rib->type == ZEBRA_ROUTE_RIP
+ || rib->type == ZEBRA_ROUTE_OSPF
+ || rib->type == ZEBRA_ROUTE_ISIS
+- || rib->type == ZEBRA_ROUTE_BGP)
++ || rib->type == ZEBRA_ROUTE_BGP
++ || rib->type == ZEBRA_ROUTE_HSLS
++ || rib->type == ZEBRA_ROUTE_OLSR
++ || rib->type == ZEBRA_ROUTE_BATMAN)
+ {
+ time_t uptime;
+ struct tm *tm;
+@@ -803,8 +809,8 @@ vty_show_ip_route (struct vty *vty, stru
}
#define SHOW_ROUTE_V4_HEADER "Codes: K - kernel route, C - connected, " \
- "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, " \
- "> - selected route, * - FIB route%s%s"
+ "S - static, R - RIP, O - OSPF,%s I - ISIS, B - BGP, H - HSLS, " \
-+ "L - OLSR, M - BATMAN, > - selected route, * - FIB route%s%s"
++ "o - OLSR, b - BATMAN,%s > - selected route, * - FIB route%s%s"
DEFUN (show_ip_route,
show_ip_route_cmd,
-@@ -874,7 +884,7 @@ DEFUN (show_ip_route_supernets,
+@@ -829,7 +835,7 @@ DEFUN (show_ip_route,
+ if (first)
+ {
+ vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE, VTY_NEWLINE,
+- VTY_NEWLINE);
++ VTY_NEWLINE, VTY_NEWLINE);
+ first = 0;
+ }
+ vty_show_ip_route (vty, rn, rib);
+@@ -872,7 +878,7 @@ DEFUN (show_ip_route_prefix_longer,
+ if (first)
+ {
+ vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
+- VTY_NEWLINE, VTY_NEWLINE);
++ VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ first = 0;
+ }
+ vty_show_ip_route (vty, rn, rib);
+@@ -911,7 +917,7 @@ DEFUN (show_ip_route_supernets,
+ if (first)
+ {
+ vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
+- VTY_NEWLINE, VTY_NEWLINE);
++ VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ first = 0;
+ }
+ vty_show_ip_route (vty, rn, rib);
+@@ -922,7 +928,7 @@ DEFUN (show_ip_route_supernets,
DEFUN (show_ip_route_protocol,
show_ip_route_protocol_cmd,
- "show ip route (bgp|connected|isis|kernel|ospf|rip|static)",
-+ "show ip route (bgp|connected|isis|kernel|ospf|rip|olsr|batman|static)",
++ "show ip route (bgp|connected|isis|kernel|ospf|rip|static|hsls|olsr|batman)",
SHOW_STR
IP_STR
"IP routing table\n"
-@@ -884,6 +894,8 @@ DEFUN (show_ip_route_protocol,
- "Kernel\n"
- "Open Shortest Path First (OSPF)\n"
- "Routing Information Protocol (RIP)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Static routes\n")
- {
- int type;
-@@ -892,13 +904,13 @@ DEFUN (show_ip_route_protocol,
+@@ -940,13 +946,13 @@ DEFUN (show_ip_route_protocol,
struct rib *rib;
int first = 1;
type = ZEBRA_ROUTE_OSPF;
else if (strncmp (argv[0], "i", 1) == 0)
type = ZEBRA_ROUTE_ISIS;
-@@ -906,6 +918,10 @@ DEFUN (show_ip_route_protocol,
+@@ -954,6 +960,12 @@ DEFUN (show_ip_route_protocol,
type = ZEBRA_ROUTE_RIP;
else if (strncmp (argv[0], "s", 1) == 0)
type = ZEBRA_ROUTE_STATIC;
++ else if (strncmp (argv[0], "h", 1) == 0)
++ type = ZEBRA_ROUTE_HSLS;
+ else if (strncmp (argv[0], "ol", 2) == 0)
+ type = ZEBRA_ROUTE_OLSR;
+ else if (strncmp (argv[0], "ba", 2) == 0)
else
{
vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
-@@ -1732,7 +1748,7 @@ DEFUN (show_ipv6_route_prefix_longer,
+@@ -971,7 +983,7 @@ DEFUN (show_ip_route_protocol,
+ {
+ if (first)
+ {
+- vty_out (vty, SHOW_ROUTE_V4_HEADER,
++ vty_out (vty, SHOW_ROUTE_V4_HEADER, VTY_NEWLINE,
+ VTY_NEWLINE, VTY_NEWLINE, VTY_NEWLINE);
+ first = 0;
+ }
+@@ -1560,7 +1572,10 @@ vty_show_ipv6_route_detail (struct vty *
+ if (rib->type == ZEBRA_ROUTE_RIPNG
+ || rib->type == ZEBRA_ROUTE_OSPF6
+ || rib->type == ZEBRA_ROUTE_ISIS
+- || rib->type == ZEBRA_ROUTE_BGP)
++ || rib->type == ZEBRA_ROUTE_BGP
++ || rib->type == ZEBRA_ROUTE_HSLS
++ || rib->type == ZEBRA_ROUTE_OLSR
++ || rib->type == ZEBRA_ROUTE_BATMAN)
+ {
+ time_t uptime;
+ struct tm *tm;
+@@ -1739,7 +1754,10 @@ vty_show_ipv6_route (struct vty *vty, st
+ if (rib->type == ZEBRA_ROUTE_RIPNG
+ || rib->type == ZEBRA_ROUTE_OSPF6
+ || rib->type == ZEBRA_ROUTE_ISIS
+- || rib->type == ZEBRA_ROUTE_BGP)
++ || rib->type == ZEBRA_ROUTE_BGP
++ || rib->type == ZEBRA_ROUTE_HSLS
++ || rib->type == ZEBRA_ROUTE_OLSR
++ || rib->type == ZEBRA_ROUTE_BATMAN)
+ {
+ time_t uptime;
+ struct tm *tm;
+@@ -1766,7 +1784,7 @@ vty_show_ipv6_route (struct vty *vty, st
+ }
+ }
+
+-#define SHOW_ROUTE_V6_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,%s I - ISIS, B - BGP, * - FIB route.%s%s"
++#define SHOW_ROUTE_V6_HEADER "Codes: K - kernel route, C - connected, S - static, R - RIPng, O - OSPFv3,%s I - ISIS, B - BGP, H - HSLS, o - OLSR, b - BATMAN, * - FIB route.%s%s"
+
+ DEFUN (show_ipv6_route,
+ show_ipv6_route_cmd,
+@@ -1842,7 +1860,7 @@ DEFUN (show_ipv6_route_prefix_longer,
DEFUN (show_ipv6_route_protocol,
show_ipv6_route_protocol_cmd,
- "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static)",
-+ "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|olsr|batman|static)",
++ "show ipv6 route (bgp|connected|isis|kernel|ospf6|ripng|static|hsls|olsr|batman)",
SHOW_STR
IP_STR
"IP routing table\n"
-@@ -1742,6 +1758,8 @@ DEFUN (show_ipv6_route_protocol,
- "Kernel\n"
- "Open Shortest Path First (OSPFv3)\n"
- "Routing Information Protocol (RIPng)\n"
-+ "Optimized Link State Routing (OLSR)\n"
-+ "Better Approach to Mobile Ad-Hoc Networking (BATMAN)\n"
- "Static routes\n")
- {
- int type;
-@@ -1750,13 +1768,13 @@ DEFUN (show_ipv6_route_protocol,
+@@ -1860,13 +1878,13 @@ DEFUN (show_ipv6_route_protocol,
struct rib *rib;
int first = 1;
type = ZEBRA_ROUTE_OSPF6;
else if (strncmp (argv[0], "i", 1) == 0)
type = ZEBRA_ROUTE_ISIS;
-@@ -1764,7 +1782,11 @@ DEFUN (show_ipv6_route_protocol,
+@@ -1874,6 +1892,12 @@ DEFUN (show_ipv6_route_protocol,
type = ZEBRA_ROUTE_RIPNG;
else if (strncmp (argv[0], "s", 1) == 0)
type = ZEBRA_ROUTE_STATIC;
-- else
++ else if (strncmp (argv[0], "h", 1) == 0)
++ type = ZEBRA_ROUTE_HSLS;
+ else if (strncmp (argv[0], "ol", 2) == 0)
-+ type = ZEBRA_ROUTE_OLSR;
++ type = ZEBRA_ROUTE_OLSR;
+ else if (strncmp (argv[0], "ba", 2) == 0)
-+ type = ZEBRA_ROUTE_BATMAN;
-+ else
++ type = ZEBRA_ROUTE_BATMAN;
+ else
{
vty_out (vty, "Unknown route type%s", VTY_NEWLINE);
- return CMD_WARNING;
--- /dev/null
+--- a/vtysh/extract.pl.in
++++ b/vtysh/extract.pl.in
+@@ -62,7 +62,7 @@ $ignore{'"show history"'} = "ignore";
+ foreach (@ARGV) {
+ $file = $_;
+
+- open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ $file |");
++ open (FH, "@CPP@ @CPPFLAGS@ -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ $file |");
+ local $/; undef $/;
+ $line = <FH>;
+ close (FH);
+++ /dev/null
---- a/bgpd/bgp_route.c
-+++ b/bgpd/bgp_route.c
-@@ -1815,6 +1815,7 @@ bgp_update_main (struct peer *peer, stru
- if ((afi == AFI_IP || afi == AFI_IP6)
- && safi == SAFI_UNICAST
- && (peer_sort (peer) == BGP_PEER_IBGP
-+ || peer_sort (peer) == BGP_PEER_CONFED
- || (peer_sort (peer) == BGP_PEER_EBGP && peer->ttl != 1)
- || CHECK_FLAG (peer->flags, PEER_FLAG_ENFORCE_MULTIHOP)))
- {
-@@ -1862,6 +1863,7 @@ bgp_update_main (struct peer *peer, stru
- if ((afi == AFI_IP || afi == AFI_IP6)
- && safi == SAFI_UNICAST
- && (peer_sort (peer) == BGP_PEER_IBGP
-+ || peer_sort (peer) == BGP_PEER_CONFED
- || (peer_sort (peer) == BGP_PEER_EBGP && peer->ttl != 1)
- || CHECK_FLAG (peer->flags, PEER_FLAG_ENFORCE_MULTIHOP)))
- {
--- /dev/null
+--- a/configure.ac
++++ b/configure.ac
+@@ -397,7 +397,7 @@ dnl -------------------------
+ AC_CHECK_HEADERS([stropts.h sys/ksym.h sys/times.h sys/select.h \
+ sys/types.h linux/version.h netdb.h asm/types.h \
+ sys/param.h limits.h signal.h libutil.h \
+- sys/socket.h netinet/in.h time.h sys/time.h])
++ sys/socket.h netinet/in.h time.h sys/time.h linux/ip_mp_alg.h])
+
+ dnl Utility macro to avoid retyping includes all the time
+ m4_define([QUAGGA_INCLUDES],
+@@ -779,6 +779,17 @@ AC_SUBST(RT_METHOD)
+ AC_SUBST(KERNEL_METHOD)
+ AC_SUBST(OTHER_METHOD)
+
++dnl ----------
++dnl Check for RTA_MP_ALGO in linux/rtnetlink.h
++dnl ----------
++AC_MSG_CHECKING(for support of multipath alg. in netlink)
++ if grep RTA_MP_ALGO linux/rtnetlink.h >/dev/null 2>&1; then
++ AC_DEFINE(HAVE_RT_MP_ALGO,,RTA_MP exist in rtnetlink)
++ AC_MSG_RESULT(yes)
++ else
++ AC_MSG_RESULT(no)
++ fi
++
+ dnl --------------------------
+ dnl Determine IS-IS I/O method
+ dnl --------------------------
+--- a/lib/command.h
++++ b/lib/command.h
+@@ -101,6 +101,7 @@ enum node_type
+ DUMP_NODE, /* Packet dump node. */
+ FORWARDING_NODE, /* IP forwarding node. */
+ PROTOCOL_NODE, /* protocol filtering node */
++ MULTIPATH_NODE, /* Multipath policy node */
+ VTY_NODE, /* Vty node. */
+ };
+
+@@ -272,6 +273,7 @@ struct desc
+ /* Common descriptions. */
+ #define SHOW_STR "Show running system information\n"
+ #define IP_STR "IP information\n"
++#define MULTIPATH_STR "Configure multipath policy\n"
+ #define IPV6_STR "IPv6 information\n"
+ #define NO_STR "Negate a command or set its defaults\n"
+ #define REDIST_STR "Redistribute information from another routing protocol\n"
+--- a/lib/zebra.h
++++ b/lib/zebra.h
+@@ -176,6 +176,10 @@ typedef int socklen_t;
+ #define RT_TABLE_MAIN 0
+ #endif /* HAVE_NETLINK */
+
++#ifdef HAVE_LINUX_IP_MP_ALG_H
++#include <linux/ip_mp_alg.h>
++#endif /* HAVE_LINUX_IP_MP_ALG_H */
++
+ #ifdef HAVE_NETDB_H
+ #include <netdb.h>
+ #endif /* HAVE_NETDB_H */
+--- a/zebra/main.c
++++ b/zebra/main.c
+@@ -44,6 +44,7 @@
+ struct zebra_t zebrad =
+ {
+ .rtm_table_default = 0,
++ .mpath = 0,
+ };
+
+ /* process id. */
+--- /dev/null
++++ b/zebra/multipath.h
+@@ -0,0 +1,37 @@
++/*
++ * multipath policy names.
++ *
++ * This file is part of Quagga routing suite.
++ *
++ * Quagga 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.
++ *
++ * Quagga is distributed in the hope that it will be useful, but
++ * WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ * General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with GNU Zebra; see the file COPYING. If not, write to the Free
++ * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
++ * 02111-1307, USA.
++ */
++
++#ifndef ZEBRA_MULTIPATH_H
++#define ZEBRA_MULTIPATH_H
++#include <zebra.h>
++
++#ifdef HAVE_LINUX_IP_MP_ALG_H
++
++static char *mp_alg_names[IP_MP_ALG_MAX+1] = {
++ [IP_MP_ALG_NONE] = "none",
++ [IP_MP_ALG_RR] = "rr",
++ [IP_MP_ALG_DRR] = "drr",
++ [IP_MP_ALG_RANDOM] = "random",
++ [IP_MP_ALG_WRANDOM] = "wrandom"
++ };
++#endif
++#endif
++
+--- a/zebra/rt_netlink.c
++++ b/zebra/rt_netlink.c
+@@ -36,6 +36,7 @@
+ #include "thread.h"
+ #include "privs.h"
+
++#include "multipath.h"
+ #include "zebra/zserv.h"
+ #include "zebra/rt.h"
+ #include "zebra/redistribute.h"
+@@ -1694,6 +1695,16 @@ netlink_route_multipath (int cmd, struct
+ if (src)
+ addattr_l (&req.n, sizeof req, RTA_PREFSRC, &src->ipv4, bytelen);
+
++#ifdef HAVE_RT_MP_ALGO
++ if (zebrad.mpath != IP_MP_ALG_NONE)
++ {
++ if (IS_ZEBRA_DEBUG_KERNEL)
++ zlog_debug("netlink_route_multipath() (multihop): "
++ "multipath policy : %s",mp_alg_names[zebrad.mpath]);
++
++ addattr_l (&req.n, 1024, RTA_MP_ALGO, &zebrad.mpath, sizeof(zebrad.mpath));
++ }
++#endif
+ if (rta->rta_len > RTA_LENGTH (0))
+ addattr_l (&req.n, 1024, RTA_MULTIPATH, RTA_DATA (rta),
+ RTA_PAYLOAD (rta));
+--- a/zebra/zserv.c
++++ b/zebra/zserv.c
+@@ -36,6 +36,7 @@
+ #include "privs.h"
+ #include "network.h"
+ #include "buffer.h"
++#include "multipath.h"
+
+ #include "zebra/zserv.h"
+ #include "zebra/router-id.h"
+@@ -1120,6 +1121,9 @@ zebra_client_create (int sock)
+ /* Set table number. */
+ client->rtm_table = zebrad.rtm_table_default;
+
++ /* Set multipath policy */
++ client->mpath = zebrad.mpath;
++
+ /* Add this client to linked list. */
+ listnode_add (zebrad.client_list, client);
+
+@@ -1697,6 +1701,91 @@ static struct cmd_node forwarding_node =
+ };
+
+ \f
++#ifdef HAVE_RT_MP_ALGO
++DEFUN (multipath_rr,
++ multipath_rr_cmd,
++ "multipath rr",
++ MULTIPATH_STR
++ "Round Robin multipath policy")
++{
++ zebrad.mpath=IP_MP_ALG_RR;
++ return CMD_SUCCESS;
++}
++
++DEFUN (multipath_drr,
++ multipath_drr_cmd,
++ "multipath drr",
++ MULTIPATH_STR
++ "Device round robin multipath policy")
++{
++ zebrad.mpath=IP_MP_ALG_DRR;
++ return CMD_SUCCESS;
++}
++
++DEFUN (multipath_random,
++ multipath_random_cmd,
++ "multipath random",
++ MULTIPATH_STR
++ "Random multipath policy")
++{
++ zebrad.mpath=IP_MP_ALG_RANDOM;
++ return CMD_SUCCESS;
++}
++
++DEFUN (multipath_wrandom,
++ multipath_wrandom_cmd,
++ "multipath wrandom",
++ MULTIPATH_STR
++ "Weighted random multipath policy")
++{
++ zebrad.mpath=IP_MP_ALG_WRANDOM;
++ return CMD_SUCCESS;
++}
++
++DEFUN (no_multipath,
++ no_multipath_cmd,
++ "no multipath",
++ NO_STR
++ MULTIPATH_STR
++ "Remove multipath policy")
++{
++ zebrad.mpath=IP_MP_ALG_NONE;
++ return CMD_SUCCESS;
++}
++
++DEFUN (show_multipath,
++ show_multipath_cmd,
++ "show multipath",
++ SHOW_STR
++ "Show multipath policy")
++{
++ vty_out (vty, "multipath %s%s", mp_alg_names[zebrad.mpath],
++ VTY_NEWLINE);
++ return CMD_SUCCESS;
++}
++
++/* multipath policy configuration write function. */
++static int
++config_write_multipath (struct vty *vty)
++{
++
++
++ if (zebrad.mpath)
++ vty_out (vty, "multipath %s%s", mp_alg_names[zebrad.mpath],
++ VTY_NEWLINE);
++ return 0;
++}
++
++/* table node for multipath policy. */
++struct cmd_node multipath_node =
++{
++ MULTIPATH_NODE,
++ "",
++ 1
++};
++
++#endif /* HAVE_RT_MP_ALGO */
++
+ /* Initialisation of zebra and installation of commands. */
+ void
+ zebra_init (void)
+@@ -1708,6 +1797,10 @@ zebra_init (void)
+ install_node (&table_node, config_write_table);
+ install_node (&forwarding_node, config_write_forwarding);
+
++#ifdef HAVE_RT_MP_ALGO
++ install_node (&multipath_node, config_write_multipath);
++#endif
++
+ install_element (VIEW_NODE, &show_ip_forwarding_cmd);
+ install_element (ENABLE_NODE, &show_ip_forwarding_cmd);
+ install_element (CONFIG_NODE, &ip_forwarding_cmd);
+@@ -1718,6 +1811,14 @@ zebra_init (void)
+ install_element (VIEW_NODE, &show_table_cmd);
+ install_element (ENABLE_NODE, &show_table_cmd);
+ install_element (CONFIG_NODE, &config_table_cmd);
++#ifdef HAVE_RT_MP_ALGO
++ install_element (CONFIG_NODE, &multipath_rr_cmd);
++ install_element (CONFIG_NODE, &multipath_drr_cmd);
++ install_element (CONFIG_NODE, &multipath_random_cmd);
++ install_element (CONFIG_NODE, &multipath_wrandom_cmd);
++ install_element (CONFIG_NODE, &no_multipath_cmd);
++ install_element (ENABLE_NODE, &show_multipath_cmd);
++#endif /* HAVE_RT_MP_ALGO */
+ #endif /* HAVE_NETLINK */
+
+ #ifdef HAVE_IPV6
+--- a/zebra/zserv.h
++++ b/zebra/zserv.h
+@@ -55,6 +55,9 @@ struct zserv
+ /* default routing table this client munges */
+ int rtm_table;
+
++ /* multipath policy */
++ u_int32_t mpath;
++
+ /* This client's redistribute flag. */
+ u_char redist[ZEBRA_ROUTE_MAX];
+
+@@ -78,6 +81,9 @@ struct zebra_t
+ /* default table */
+ int rtm_table_default;
+
++ /* multipath policy */
++ u_int32_t mpath;
++
+ /* rib work queue */
+ struct work_queue *ribq;
+ struct meta_queue *mq;
+++ /dev/null
---- a/bgpd/bgp_aspath.c
-+++ b/bgpd/bgp_aspath.c
-@@ -614,6 +614,47 @@ aspath_private_as_check (struct aspath *
- return 1;
- }
-
-+/* AS path confed check. If aspath contains confed set or sequence then return 1. */
-+int
-+aspath_confed_check (struct aspath *aspath)
-+{
-+ caddr_t pnt;
-+ caddr_t end;
-+ struct assegment *assegment;
-+
-+ if (aspath == NULL)
-+ return 0;
-+
-+ pnt = aspath->data;
-+ end = aspath->data + aspath->length;
-+
-+ while (pnt < end)
-+ {
-+ assegment = (struct assegment *) pnt;
-+ if (assegment->type == AS_CONFED_SET || assegment->type == AS_CONFED_SEQUENCE)
-+ return 1;
-+ pnt += (assegment->length * AS_VALUE_SIZE) + AS_HEADER_SIZE;
-+ }
-+ return 0;
-+}
-+
-+/* Leftmost AS path segment confed check. If leftmost AS segment is of type
-+ AS_CONFED_SEQUENCE or AS_CONFED_SET then return 1. */
-+int
-+aspath_left_confed_check (struct aspath *aspath)
-+{
-+ struct assegment *assegment;
-+
-+ if (aspath == NULL)
-+ return 0;
-+
-+ assegment = (struct assegment *) aspath->data;
-+ if (assegment->type == AS_CONFED_SEQUENCE || assegment->type == AS_CONFED_SET)
-+ return 1;
-+
-+ return 0;
-+}
-+
- /* Merge as1 to as2. as2 should be uninterned aspath. */
- struct aspath *
- aspath_merge (struct aspath *as1, struct aspath *as2)
-@@ -671,6 +712,10 @@ aspath_prepend (struct aspath *as1, stru
- if (seg1 == NULL)
- return as2;
-
-+ /* Delete any AS_CONFED_SEQUENCE segment from as2. */
-+ if (seg1->type == AS_SEQUENCE && seg2->type == AS_CONFED_SEQUENCE)
-+ as2 = aspath_delete_confed_seq (as2);
-+
- /* Compare last segment type of as1 and first segment type of as2. */
- if (seg1->type != seg2->type)
- return aspath_merge (as1, as2);
---- a/bgpd/bgp_aspath.h
-+++ b/bgpd/bgp_aspath.h
-@@ -76,4 +76,6 @@ unsigned int aspath_key_make (struct asp
- int aspath_loop_check (struct aspath *, as_t);
- int aspath_private_as_check (struct aspath *);
- int aspath_firstas_check (struct aspath *, as_t);
-+int aspath_confed_check (struct aspath *);
-+int aspath_left_confed_check (struct aspath *);
- unsigned long aspath_count ();
---- a/bgpd/bgp_attr.c
-+++ b/bgpd/bgp_attr.c
-@@ -673,6 +673,17 @@ bgp_attr_aspath (struct peer *peer, bgp_
- return -1;
- }
-
-+ /* Confederation sanity check. */
-+ if ((peer_sort (peer) == BGP_PEER_CONFED && ! aspath_left_confed_check (attr->aspath)) ||
-+ (peer_sort (peer) == BGP_PEER_EBGP && aspath_confed_check (attr->aspath)))
-+ {
-+ zlog (peer->log, LOG_ERR, "Malformed AS path from %s", peer->host);
-+ bgp_notify_send (peer,
-+ BGP_NOTIFY_UPDATE_ERR,
-+ BGP_NOTIFY_UPDATE_MAL_AS_PATH);
-+ return -1;
-+ }
-+
- bgp = peer->bgp;
-
- /* First AS check for EBGP. */
+++ /dev/null
---- a/zebra/rt_netlink.c
-+++ b/zebra/rt_netlink.c
-@@ -487,6 +487,17 @@ netlink_interface (struct sockaddr_nl *s
- /* Looking up interface name. */
- memset (tb, 0, sizeof tb);
- netlink_parse_rtattr (tb, IFLA_MAX, IFLA_RTA (ifi), len);
-+
-+#ifdef IFLA_WIRELESS
-+ /* check for wireless messages to ignore */
-+ if ((tb[IFLA_WIRELESS] != NULL) && (ifi->ifi_change == 0))
-+ {
-+ if (IS_ZEBRA_DEBUG_KERNEL)
-+ zlog_debug ("%s: ignoring IFLA_WIRELESS message", __func__);
-+ return 0;
-+ }
-+#endif /* IFLA_WIRELESS */
-+
- if (tb[IFLA_IFNAME] == NULL)
- return -1;
- name = (char *) RTA_DATA (tb[IFLA_IFNAME]);
-@@ -943,6 +954,17 @@ netlink_link_change (struct sockaddr_nl
- /* Looking up interface name. */
- memset (tb, 0, sizeof tb);
- netlink_parse_rtattr (tb, IFLA_MAX, IFLA_RTA (ifi), len);
-+
-+#ifdef IFLA_WIRELESS
-+ /* check for wireless messages to ignore */
-+ if ((tb[IFLA_WIRELESS] != NULL) && (ifi->ifi_change == 0))
-+ {
-+ if (IS_ZEBRA_DEBUG_KERNEL)
-+ zlog_debug ("%s: ignoring IFLA_WIRELESS message", __func__);
-+ return 0;
-+ }
-+#endif /* IFLA_WIRELESS */
-+
- if (tb[IFLA_IFNAME] == NULL)
- return -1;
- name = (char *) RTA_DATA (tb[IFLA_IFNAME]);
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
-@@ -109,6 +109,7 @@ bgp_accept (struct thread *thread)
+@@ -188,8 +188,7 @@ bgp_accept (struct thread *thread)
peer->fd = bgp_sock;
peer->status = Active;
peer->local_id = peer1->local_id;
+- peer->v_holdtime = peer1->v_holdtime;
+- peer->v_keepalive = peer1->v_keepalive;
+ peer->v_holdtime = BGP_LARGE_HOLDTIME;
/* Make peer's address string. */
sockunion2str (&su, buf, SU_ADDRSTRLEN);
--- a/bgpd/bgpd.h
+++ b/bgpd/bgpd.h
-@@ -656,6 +656,7 @@ struct bgp_nlri
+@@ -709,6 +709,7 @@ struct bgp_nlri
/* BGP timers default value. */
#define BGP_INIT_START_TIMER 5
#define BGP_ERROR_START_TIMER 30
--- a/lib/command.c
+++ b/lib/command.c
-@@ -2567,6 +2567,13 @@
- unlink (config_file_tmp);
- return CMD_WARNING;
+@@ -2601,6 +2601,13 @@ DEFUN (config_write_file,
+ VTY_NEWLINE);
+ goto finished;
}
+
+#if 0
if (link (config_file, config_file_sav) != 0)
{
vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
-@@ -2586,7 +2593,23 @@
- unlink (config_file_tmp);
- return CMD_WARNING;
+@@ -2614,7 +2621,23 @@ DEFUN (config_write_file,
+ VTY_NEWLINE);
+ goto finished;
}
+#else
+ /* And this is the code that hopefully does work */
+ {
+ vty_out (vty, "Can't backup old configuration file %s.%s", config_file_sav,
+ VTY_NEWLINE);
-+ return CMD_WARNING;
++ goto finished;
+ }
+ sync ();
+#endif