[Xorp-cvs] SF.net SVN: xorp:[11702] trunk/xorp
greear at users.sourceforge.net
greear at users.sourceforge.net
Wed May 12 09:39:46 PDT 2010
Revision: 11702
http://xorp.svn.sourceforge.net/xorp/?rev=11702&view=rev
Author: greear
Date: 2010-05-12 16:39:45 +0000 (Wed, 12 May 2010)
Log Message:
-----------
bgp/harness: Backport bgp harness fixups from xorp.ct
* Makes bgp compile with shared libraries.
* Fixes up some utils and libxipc stuff to compile for the bgp harness.
* Fixes bgp harness logic to work with new path layout.
* Runs xorp bgp harness logic when 'scons check' is requested.
* Fixes some BGP asserts I found in xorp.ct testing.
Signed-off-by: Ben Greear <greearb at candelatech.com>
Modified Paths:
--------------
trunk/xorp/SConscript
trunk/xorp/bgp/SConscript
trunk/xorp/bgp/configure_bgp.sh
trunk/xorp/bgp/harness/SConscript
trunk/xorp/bgp/harness/args.sh
trunk/xorp/bgp/harness/coord.hh
trunk/xorp/bgp/harness/harness.py
trunk/xorp/bgp/harness/inject.sh
trunk/xorp/bgp/harness/test_path_attribute1.sh
trunk/xorp/bgp/harness/test_path_attribute2.sh
trunk/xorp/bgp/harness/test_path_attribute3.sh
trunk/xorp/bgp/harness/test_peer.hh
trunk/xorp/bgp/harness/test_peering1.sh
trunk/xorp/bgp/harness/test_peering2.sh
trunk/xorp/bgp/harness/test_peering3.sh
trunk/xorp/bgp/harness/test_rib1.sh
trunk/xorp/bgp/harness/test_rib_fea1.sh
trunk/xorp/bgp/harness/test_route_flap_damping1.sh
trunk/xorp/bgp/harness/test_route_reflection1.sh
trunk/xorp/bgp/harness/test_route_reflection2.sh
trunk/xorp/bgp/harness/test_routing1.sh
trunk/xorp/bgp/harness/test_routing2.sh
trunk/xorp/bgp/harness/test_terminate.sh
trunk/xorp/bgp/harness/xrl_shell_funcs.sh
trunk/xorp/bgp/path_attribute.cc
trunk/xorp/bgp/path_attribute.hh
trunk/xorp/bgp/plumbing.cc
trunk/xorp/bgp/route_table_filter.cc
trunk/xorp/bgp/route_table_ribin.cc
trunk/xorp/bgp/run_tests
trunk/xorp/bgp/socket.cc
trunk/xorp/bgp/tools/SConscript
trunk/xorp/libxipc/SConscript
trunk/xorp/libxipc/call_xrl.cc
trunk/xorp/libxipc/finder.cc
trunk/xorp/libxipc/finder.hh
trunk/xorp/libxipc/finder_xrl_target.cc
trunk/xorp/utils/runit.cc
Added Paths:
-----------
trunk/xorp/bgp/bgp_xrl_shell_funcs.sh
trunk/xorp/fea/fea_xrl_shell_funcs.sh
trunk/xorp/rib/rib_xrl_shell_funcs.sh
Removed Paths:
-------------
trunk/xorp/bgp/xrl_shell_funcs.sh
trunk/xorp/fea/xrl_shell_funcs.sh
trunk/xorp/rib/xrl_shell_funcs.sh
Modified: trunk/xorp/SConscript
===================================================================
--- trunk/xorp/SConscript 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/SConscript 2010-05-12 16:39:45 UTC (rev 11702)
@@ -41,6 +41,7 @@
'rip',
'rtrmgr',
'static_routes',
+ 'utils',
'vrrp',
'bgp',
]
Modified: trunk/xorp/bgp/SConscript
===================================================================
--- trunk/xorp/bgp/SConscript 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/SConscript 2010-05-12 16:39:45 UTC (rev 11702)
@@ -21,25 +21,23 @@
Import('env')
subdirs = [
- #'harness',
+ 'tools',
'tests',
- 'tools',
+ 'harness',
]
SConscript(dirs = subdirs, exports='env')
-env = env.Clone()
+bgp_env = env.Clone()
-# XXX Not used, bgp linkage must remain static until we fix the
-# dependency graph in here.
-#is_shared = env.has_key('SHAREDLIBS')
+is_shared = bgp_env.has_key('SHAREDLIBS')
-env.AppendUnique(CPPPATH = [
+bgp_env.AppendUnique(CPPPATH = [
'#',
'$BUILDDIR',
])
-env.PrependUnique(LIBPATH = [
+bgp_env.PrependUnique(LIBPATH = [
'.',
'$BUILDDIR/policy/backend',
'$BUILDDIR/policy/common',
@@ -51,7 +49,7 @@
'$BUILDDIR/libcomm',
])
-env.AppendUnique(LIBS = [
+bgp_env.AppendUnique(LIBS = [
'xorp_policy_backend',
'xorp_policy_common',
'xorp_fea_client',
@@ -59,7 +57,6 @@
'xst_fea_ifmgr_mirror',
'xif_rib',
'xif_finder_event_notifier',
- 'xif_profile_client',
'xif_fea_ifmgr_mirror',
'xif_fea_ifmgr_replicator',
'xorp_ipc',
@@ -67,17 +64,21 @@
'xorp_comm',
])
-env.Replace(RPATH = [
- env.Literal(env['xorp_module_rpath'])
+if not (bgp_env.has_key('disable_profile') and bgp_env['disable_profile']):
+ bgp_env.AppendUnique(LIBS = [ 'xif_profile_client' ])
+
+bgp_env.Replace(RPATH = [
+ bgp_env.Literal(bgp_env['xorp_module_rpath'])
])
### libxorp_bgp
-libxorp_bgp_env = env.Clone()
+libxorp_bgp_env = bgp_env.Clone()
libxorp_bgp_srcs = [
'aspath.cc',
'attribute_manager.cc',
+ 'bgp.cc',
'bgp_trie.cc',
'bgp_varrw.cc',
'bgp_varrw_export.cc',
@@ -99,7 +100,6 @@
'peer_list.cc',
'plumbing.cc',
'process_watch.cc',
- 'profile_vars.cc',
'rib_ipc_handler.cc',
'route_queue.cc',
'route_table_aggregation.cc',
@@ -126,29 +126,43 @@
'xrl_target.cc',
]
-#libxorp_bgp = libxorp_bgp_env.SharedLibrary(target = 'libxorp_bgp', source = libxorp_bgp_srcs)
+if not (bgp_env.has_key('disable_profile') and bgp_env['disable_profile']):
+ libxorp_bgp_srcs.append('profile_vars.cc')
-# XXX Static until ASPath and other objects are dealt with.
-libxorp_bgp = libxorp_bgp_env.StaticLibrary(target = 'libxorp_bgp',
- source = libxorp_bgp_srcs)
+if is_shared:
+ libxorp_bgp = bgp_env.SharedLibrary(target = 'libxorp_bgp',
+ source = libxorp_bgp_srcs,
+ LIBS = '')
+ if bgp_env['rtld_origin']:
+ for obj in libxorp_bgp:
+ bgp_env.AddPostAction(libxorp_bgp,
+ bgp_env.Symlink(obj.abspath,
+ os.path.join(bgp_env['xorp_alias_libdir'], str(obj))))
+else:
+ libxorp_ospf = bgp_env.StaticLibrary(target = 'libxorp_bgp',
+ source = libxorp_bgp_srcs,
+ LIBS = '')
-#env.Alias('install',
-# env.InstallLibrary('$libdir', libxorp_bgp))
-
### xorp_bgp
-bgp_env = env.Clone()
+#bgp_env2 = bgp_env.Clone()
bgp_env.PrependUnique(LIBS = [
'xorp_bgp',
])
bgpsrcs = [
- 'bgp.cc',
- 'main.cc',
- ]
+ 'main.cc',
+ ]
bgp = bgp_env.Program(target = 'xorp_bgp', source = bgpsrcs)
-env.Alias('install', env.InstallProgram(env['xorp_moduledir'], bgp))
+bgp_env.Alias('install', bgp_env.InstallProgram(bgp_env['xorp_moduledir'], bgp))
-Default(libxorp_bgp, bgp)
+
+if is_shared:
+ bgp_env.Alias('install', env.InstallLibrary(bgp_env['xorp_libdir'], libxorp_bgp))
+
+# Install scripts
+env.Alias('install', env.InstallProgram('$exec_prefix/sbin/', env.Entry('bgp_xrl_shell_funcs.sh')))
+
+Default(bgp)
Copied: trunk/xorp/bgp/bgp_xrl_shell_funcs.sh (from rev 11701, trunk/xorp/bgp/xrl_shell_funcs.sh)
===================================================================
--- trunk/xorp/bgp/bgp_xrl_shell_funcs.sh (rev 0)
+++ trunk/xorp/bgp/bgp_xrl_shell_funcs.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -0,0 +1,178 @@
+#!/bin/sh
+
+#
+# $XORP: xorp/bgp/xrl_shell_funcs.sh,v 1.15 2006/03/06 02:27:52 atanu Exp $
+#
+
+CALLXRL=${CALLXRL:-../libxipc/call_xrl}
+
+local_config()
+{
+ echo "local_config" $*
+# $CALLXRL "finder://bgp/bgp/0.1/local_config?localhost:txt=$1&port:i32=$2&as_num:i32=$3&id:ipv4=$4&version:i32=$5&holdtime:i32=$6"
+ $CALLXRL "finder://bgp/bgp/0.3/local_config?as:txt=$1&id:ipv4=$2&use_4byte_asnums:bool=$3"
+}
+
+route_reflector()
+{
+ echo "route_reflector" $*
+ $CALLXRL "finder://bgp/bgp/0.3/set_cluster_id?cluster_id:ipv4=$1&disable:bool=$2"
+}
+
+set_damping()
+{
+ echo "route_flap_damping" $*
+ $CALLXRL "finder://bgp/bgp/0.3/set_damping?half_life:u32=$1&max_suppress:u32=$2&reuse:u32=$3&suppress:u32=$4&disable:bool=$5"
+}
+
+add_peer()
+{
+ echo "add_peer" $*
+ if [ $1 == "lo" ]
+ then
+ # This is using xorp.ct syntax..easier this small hack than changing all the test harness scripts.
+ $CALLXRL "finder://bgp/bgp/0.3/add_peer?local_ip:txt=$2&local_port:u32=$3&peer_ip:txt=$4&peer_port:u32=$5&as:txt=$6&next_hop:ipv4=$7&holdtime:u32=$8"
+ else
+ $CALLXRL "finder://bgp/bgp/0.3/add_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&as:txt=$5&next_hop:ipv4=$6&holdtime:u32=$7"
+ fi
+}
+
+delete_peer()
+{
+ echo "delete_peer" $*
+# $CALLXRL "finder://bgp/bgp/0.1/delete_peer?peer:txt=$1&as:i32=$2"
+ $CALLXRL "finder://bgp/bgp/0.3/delete_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&as:txt=$5"
+}
+
+enable_peer()
+{
+ echo "enable_peer" $*
+# $CALLXRL "finder://bgp/bgp/0.1/enable_peer?peer:txt=$1&as:i32=$2"
+ $CALLXRL "finder://bgp/bgp/0.3/enable_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4"
+}
+
+set_parameter()
+{
+ echo "set_parameter" $*
+# $CALLXRL "finder://bgp/bgp/0.3/set_parameter?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4¶meter:txt=$5"
+
+ $CALLXRL "finder://bgp/bgp/0.3/set_parameter?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4¶meter:txt=$5&toggle:bool=$6"
+}
+
+disable_peer()
+{
+ echo "disable_peer" $*
+# $CALLXRL "finder://bgp/bgp/0.1/disable_peer?peer:txt=$1&as:i32=$2"
+ $CALLXRL "finder://bgp/bgp/0.3/disable_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4"
+}
+
+route_reflector_client()
+{
+ echo "route_reflector_client" $*
+ $CALLXRL "finder://bgp/bgp/0.3/set_route_reflector_client?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$3&state:bool=$5"
+}
+
+set_peer_md5_password()
+{
+ echo "set_peer_md5_password" $*
+ $CALLXRL "finder://bgp/bgp/0.3/set_peer_md5_password?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&password:txt=$5"
+}
+
+next_hop_rewrite_filter()
+{
+ echo "next_hop_rewrite_filter" $*
+ $CALLXRL "finder://bgp/bgp/0.3/next_hop_rewrite_filter?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&next_hop:ipv4=$5"
+}
+
+register_rib()
+{
+ echo "register_rib" $*
+ $CALLXRL "finder://bgp/bgp/0.3/register_rib?name:txt=$1"
+}
+
+originate_route4()
+{
+ echo "originate_route4" $*
+ $CALLXRL "finder://bgp/bgp/0.3/originate_route4?nlri:ipv4net=$1&next_hop:ipv4=$2&unicast:bool=$3&multicast:bool=$4"
+}
+
+originate_route6()
+{
+ echo "originate_route6" $*
+ $CALLXRL "finder://bgp/bgp/0.3/originate_route6?nlri:ipv6net=$1&next_hop:ipv6=$2&unicast:bool=$3&multicast:bool=$4"
+}
+
+withdraw_route4()
+{
+ echo "withdraw_route4" $*
+ $CALLXRL "finder://bgp/bgp/0.3/withdraw_route4?nlri:ipv4net=$1&unicast:bool&=$2multicast:bool=$3"
+}
+
+withdraw_route6()
+{
+ echo "withdraw_route6" $*
+ $CALLXRL "finder://bgp/bgp/0.3/withdraw_route6?nlri:ipv6net=$1&unicast:bool&=$2multicast:bool=$3"
+}
+
+shutdown()
+{
+ echo "shutdown" $*
+ $CALLXRL "finder://bgp/common/0.1/shutdown"
+}
+
+time_wait_seconds()
+{
+ # If there are less than 200 PCB's in TIMEWAIT then return 0.
+
+ local twc
+ twc=`netstat -n | grep TIME_WAIT | grep 19999 | wc -l`
+ if [ $twc -lt 200 ]
+ then
+ echo "0"
+ return
+ fi
+
+ local tw os
+
+ os=`uname -s`
+ case $os in
+ Linux)
+ tw=`sysctl -n net.ipv4.tcp_fin_timeout 2>/dev/null`
+ if [ $? -eq 0 ] ; then
+ echo $tw
+ return
+ fi
+ ;;
+
+ FreeBSD)
+ local msl
+ msl=`sysctl -n net.inet.tcp.msl 2>/dev/null`
+ if [ $? -eq 0 ] ; then
+ # Timewait is 2 * msl and msl is in milliseconds
+ tw=`expr $msl + $msl + 1`
+ tw=`expr $tw / 1000`
+ echo $tw
+ return
+ fi
+ ;;
+
+ *)
+ # All other OS: use the default value below
+ ;;
+ esac
+
+ # Defailt to 60 seconds
+ echo "60"
+}
+
+# We have arguments.
+if [ $# != 0 ]
+then
+ $*
+fi
+
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 4
+# End:
Modified: trunk/xorp/bgp/configure_bgp.sh
===================================================================
--- trunk/xorp/bgp/configure_bgp.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/configure_bgp.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -8,7 +8,7 @@
# Send configuration commands to a running bgp process.
#
-. ./xrl_shell_funcs.sh
+. ./bgp_xrl_shell_funcs.sh
case `hostname` in
aardvark)
Modified: trunk/xorp/bgp/harness/SConscript
===================================================================
--- trunk/xorp/bgp/harness/SConscript 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/SConscript 2010-05-12 16:39:45 UTC (rev 11702)
@@ -31,8 +31,13 @@
'$BUILDDIR/libxorp',
'$BUILDDIR/libcomm',
'$BUILDDIR/libxipc',
+ '$BUILDDIR/libfeaclient',
'$BUILDDIR/xrl/interfaces',
'$BUILDDIR/xrl/targets',
+ '$BUILDDIR/policy/backend',
+ '$BUILDDIR/policy/common',
+ '$BUILDDIR/bgp',
+ '$BUILDDIR/fea',
'.',
])
@@ -41,6 +46,114 @@
'xorp_ipc',
'xorp_core',
'xorp_comm',
+ 'xst_test_peer',
+ 'xorp_bgp',
+ 'xif_test_peer',
+ 'xst_coord',
+ 'xif_coord',
+ 'xif_rib',
+ 'xif_datain',
+ 'xorp_fea_client',
+ 'xorp_policy_backend',
+ 'xorp_policy_common',
+ 'xif_fea_ifmgr_mirror',
+ 'xif_fea_ifmgr_replicator',
+ 'xst_fea_ifmgr_mirror',
+ 'xst_bgp',
+ 'xif_profile_client',
+ 'xif_finder_event_notifier',
])
-# XXX FIXME
+coord_srcs = [
+ 'bgppp.cc',
+ 'command.cc',
+ 'coord.cc',
+ 'peer.cc',
+ 'trie.cc',
+ ]
+
+test_peer_srcs = [
+ 'test_peer.cc',
+ 'bgppp.cc',
+ ]
+
+test_trie_srcs = [
+ 'test_peer.cc',
+ 'bgppp.cc',
+ ]
+
+script_srcs = [
+ 'args.sh',
+ 'test_path_attribute1.sh',
+ 'test_rib1.sh',
+ 'test_routing2.sh',
+ 'inject.sh',
+ 'test_path_attribute2.sh',
+ 'test_rib_fea1.sh',
+ 'test_terminate.sh',
+ 'notification_codes.sh',
+ 'test_path_attribute3.sh',
+ 'test_route_flap_damping1.sh',
+ 'xrl_shell_funcs.sh',
+ 'setup_paths.sh',
+ 'soak.sh',
+ 'test_peering1.sh',
+ 'test_route_reflection1.sh',
+ 'test1.sh',
+ 'test_peering2.sh',
+ 'test_route_reflection2.sh',
+ 'test2.sh',
+ 'test_peering3.sh',
+ 'test_routing1.sh',
+ 'harness.py',
+ 'lookup.py',
+ 'NOTES',
+ 'originate_routes.pl',
+ ]
+
+
+coord = env.Program(target = 'coord', source = coord_srcs)
+test_peer = env.Program(target = 'test_peer', source = test_peer_srcs)
+test_trie = env.Program(target = 'test_trie', source = test_trie_srcs)
+
+harnesspath = '$exec_prefix/bgp/harness'
+
+#if env['WITH_TESTS']:
+# env.Alias('install', env.InstallProgram(harnesspath, coord))
+# env.Alias('install', env.InstallProgram(harnesspath, test_peer))
+# env.Alias('install', env.InstallProgram(harnesspath, test_trie))
+
+# for ss in script_srcs:
+# env.Alias('install', env.InstallProgram(harnesspath, env.Entry('%s' % ss)))
+
+if 'check' in COMMAND_LINE_TARGETS:
+ from subprocess import call
+
+ for ss in script_srcs:
+ env.Alias('check', env.Execute(Copy('%s' % ss, '../../../../bgp/harness/%s' %ss)))
+
+ # Tests to run automatically with 'scons test'
+ # This 'Execute' recipe doesn't work right, because if a program fails,
+ # then scons will exit. Use 'call' instead to force them to be run.
+ #env.Alias('check', env.Execute(env.Action('./test_peering1.sh')))
+
+ call("./test_peering1.sh")
+ call("./test_peering2.sh")
+ call('./test_peering3.sh')
+ call('./test_routing1.sh')
+ call('./test_routing2.sh')
+ call('./test_rib1.sh')
+ call('./test_rib_fea1.sh')
+ call('./test_path_attribute1.sh')
+ call('./test_path_attribute2.sh')
+ call('./test_path_attribute3.sh')
+ call('./test_route_reflection1.sh')
+ call('./test_route_reflection2.sh')
+ call('./test_route_flap_damping1.sh')
+ call('./test_terminate.sh')
+
+#for t in tests:
+# test_targets.append(env.AutoTest(target = 'test_%s' % t,
+# source = 'test_%s.cc' % t))
+
+Default(coord, test_peer, test_trie)
Modified: trunk/xorp/bgp/harness/args.sh
===================================================================
--- trunk/xorp/bgp/harness/args.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/args.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -14,7 +14,12 @@
# Perform Win32 path conversion for runit if required.
RUNIT="runit"
-RUNITDIR="../../utils"
+if [ -x ../../utils/runit ]
+then
+ RUNITDIR="../../utils"
+else
+ RUNITDIR="../../lib/xorp/bin/"
+fi
RUNITPRE=""
if [ x"$OSTYPE" = xmsys ]; then
RUNITPRE="cmd //c"
Modified: trunk/xorp/bgp/harness/coord.hh
===================================================================
--- trunk/xorp/bgp/harness/coord.hh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/coord.hh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -72,6 +72,8 @@
uint32_t& status,
string& reason);
+ XrlCmdError common_0_1_startup() { return XrlCmdError::OKAY(); }
+
/**
* shutdown target
*/
Modified: trunk/xorp/bgp/harness/harness.py
===================================================================
--- trunk/xorp/bgp/harness/harness.py 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/harness.py 2010-05-12 16:39:45 UTC (rev 11702)
@@ -16,8 +16,11 @@
import sys
import getopt
-CALL_XRL_LOCATION="../../libxipc/call_xrl"
+CALL_XRL_LOCATION="../../sbin/call_xrl"
+if (not os.path.isfile(CALL_XRL_LOCATION)):
+ CALL_XRL_LOCATION="../../libxipc/call_xrl"
+
def call_xrl(command):
"""
Call an XRL
Modified: trunk/xorp/bgp/harness/inject.sh
===================================================================
--- trunk/xorp/bgp/harness/inject.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/inject.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -19,6 +19,8 @@
set -e
+. ./setup_paths.sh
+
# Configure an interface and re-write all next hops to go through this
# interface
VIF0="dc0"
@@ -28,7 +30,14 @@
NEXT_HOP_REWRITE2="10.1.0.3"
LOCALHOST=$(hostname)
-MY_IP=$(host $LOCALHOST | cut -f 4 -d ' ')
+if host $LOCALHOST
+then
+ MY_IP=$(host $LOCALHOST | cut -f 4 -d ' '|head -1)
+else
+ LOCALHOST=localhost
+ MY_IP=127.0.0.1
+fi
+echo "MY_IP: $MY_IP"
MY_AS=65008
MY_ID=$MY_IP
@@ -46,6 +55,15 @@
TREETOP=${PWD}/../../../xorp
DUMPNAME=${DUMPNAME:-$TREETOP/../data/bgp/icsi1.mrtd}
+if [ ! -f $DUMPNAME ]
+then
+ DUMPNAME=/root/icsi1.mrtd
+ if [ ! -f $DUMPNAME ]
+ then
+ echo "ERROR: Cannot find iscsi1.mrtd file."
+ exit 1
+ fi
+fi
#
# Start all the required processes
@@ -53,7 +71,7 @@
start_processes()
{
(cd $TREETOP
- for i in libxipc/xorp_finder fea/xorp_fea_dummy rib/xorp_rib bgp/xorp_bgp \
+ for i in lib/xorp/sbin/xorp_finder lib/xorp/sbin/xorp_fea_dummy lib/xorp/sbin/xorp_rib lib/xorp/sbin/xorp_bgp \
"bgp/harness/test_peer -s peer1 -v" \
"bgp/harness/test_peer -s peer2 -v" \
bgp/harness/coord
@@ -70,8 +88,6 @@
{
echo "Configuring fea"
- export CALLXRL=$TREETOP/libxipc/call_xrl
- FEA_FUNCS=$TREETOP/fea/xrl_shell_funcs.sh
local tid=$($FEA_FUNCS start_fea_transaction)
$FEA_FUNCS create_interface $tid $VIF0
@@ -92,36 +108,35 @@
bgp()
{
- echo "Configuring bgp"
- export CALLXRL=$TREETOP/libxipc/call_xrl
- BGP_FUNCS=$TREETOP/bgp/xrl_shell_funcs.sh
-
PORT=$MY_PORT
AS=$MY_AS
ID=$MY_ID
USE4BYTEAS=false
HOLDTIME=0
+ echo "Configuring bgp, AS: $AS ID: $ID USE4BYTEAS: $USE4BYTEAS"
$BGP_FUNCS local_config $AS $ID $USE4BYTEAS
# register_rib "rib"
# Test peer used for route injection
-
- PEER=$LOCALHOST
+
+ MY_DEV="lo"
+ PEER=$MY_IP
PEER_AS=$INJECT_PEER_AS
PEER_PORT=$INJECT_PEER_PORT
- IPTUPLE="$LOCALHOST $MY_INJECT_PORT $PEER $PEER_PORT"
- $BGP_FUNCS add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ IPTUPLE="$MY_IP $MY_INJECT_PORT $PEER $PEER_PORT"
+ $BGP_FUNCS add_peer $MY_DEV $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
# Rewrite the next hop onto our test net
$BGP_FUNCS next_hop_rewrite_filter $IPTUPLE $NEXT_HOP_REWRITE1
$BGP_FUNCS enable_peer $IPTUPLE
# Our test peer.
- PEER=$LOCALHOST
+
+ PEER=$MY_IP
PEER_AS=$TEST_PEER_AS
PEER_PORT=$TEST_PEER_PORT
- IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- $BGP_FUNCS add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ IPTUPLE="$MY_IP $PORT $PEER $PEER_PORT"
+ $BGP_FUNCS add_peer $MY_DEV $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
# Rewrite the next hop onto our test net
$BGP_FUNCS next_hop_rewrite_filter $IPTUPLE $NEXT_HOP_REWRITE2
$BGP_FUNCS enable_peer $IPTUPLE
@@ -130,9 +145,6 @@
bgp_enable()
{
echo "Enable peering to main router"
- export CALLXRL=$TREETOP/libxipc/call_xrl
- BGP_FUNCS=$TREETOP/bgp/xrl_shell_funcs.sh
-
PORT=$MY_PORT
PEER=$BORDER_ROUTER_NAME
PEER_AS=$BORDER_ROUTER_AS
@@ -144,9 +156,6 @@
bgp_disable()
{
echo "Disable peering to main router"
- export CALLXRL=$TREETOP/libxipc/call_xrl
- BGP_FUNCS=$TREETOP/bgp/xrl_shell_funcs.sh
-
PORT=$MY_PORT
PEER=$BORDER_ROUTER_NAME
PEER_AS=$BORDER_ROUTER_AS
@@ -159,7 +168,6 @@
{
echo "Resetting coordinator"
- export CALLXRL=$TREETOP/libxipc/call_xrl
TEST_FUNCS=$TREETOP/bgp/harness/xrl_shell_funcs.sh
$TEST_FUNCS coord reset
@@ -168,7 +176,6 @@
test_peer()
{
echo "Configuring test peer"
- export CALLXRL=$TREETOP/libxipc/call_xrl
TEST_FUNCS=$TREETOP/bgp/harness/xrl_shell_funcs.sh
PEER=$LOCALHOST
@@ -192,7 +199,6 @@
return
fi
- export CALLXRL=$TREETOP/libxipc/call_xrl
TEST_FUNCS=$TREETOP/bgp/harness/xrl_shell_funcs.sh
PEER=$LOCALHOST
Modified: trunk/xorp/bgp/harness/test_path_attribute1.sh
===================================================================
--- trunk/xorp/bgp/harness/test_path_attribute1.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_path_attribute1.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -21,11 +21,12 @@
# 8) Run "./coord"
#
set -e
+. ./setup_paths.sh
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
onexit()
{
@@ -75,19 +76,19 @@
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT1 $PEER $PEER1_PORT"
- add_peer $IPTUPLE $PEER1_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER1_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT2 $PEER $PEER2_PORT"
- add_peer $IPTUPLE $PEER2_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER2_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT3 $PEER $PEER3_PORT"
- add_peer $IPTUPLE $PEER3_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER3_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
}
@@ -456,10 +457,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer1/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_path_attribute2.sh
===================================================================
--- trunk/xorp/bgp/harness/test_path_attribute2.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_path_attribute2.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -21,11 +21,12 @@
# 8) Run "./coord"
#
set -e
+. ./setup_paths.sh
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
onexit()
{
@@ -75,19 +76,19 @@
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT1 $PEER $PEER1_PORT"
- add_peer $IPTUPLE $PEER1_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER1_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT2 $PEER $PEER2_PORT"
- add_peer $IPTUPLE $PEER2_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER2_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT3 $PEER $PEER3_PORT"
- add_peer $IPTUPLE $PEER3_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER3_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
}
@@ -182,10 +183,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer1/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_path_attribute3.sh
===================================================================
--- trunk/xorp/bgp/harness/test_path_attribute3.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_path_attribute3.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -20,11 +20,12 @@
# 8) Run "./coord"
#
set -e
+. ./setup_paths.sh
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
onexit()
{
@@ -70,13 +71,13 @@
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT1 $PEER $PEER1_PORT"
- add_peer $IPTUPLE $PEER1_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER1_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
PEER=$HOST
IPTUPLE="$LOCALHOST $PORT2 $PEER $PEER2_PORT"
- add_peer $IPTUPLE $PEER2_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER2_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
}
@@ -348,10 +349,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer1/common/0.1/get_target_name
./coord = $CXRL finder://coord/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_peer.hh
===================================================================
--- trunk/xorp/bgp/harness/test_peer.hh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_peer.hh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -117,6 +117,8 @@
// Output values,
string& name);
+ XrlCmdError common_0_1_startup() { return XrlCmdError::OKAY(); }
+
/**
* Get version string from Xrl Target
*/
Modified: trunk/xorp/bgp/harness/test_peering1.sh
===================================================================
--- trunk/xorp/bgp/harness/test_peering1.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_peering1.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -21,10 +21,12 @@
set -e
+. ./setup_paths.sh
+
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
. ${srcdir}/notification_codes.sh
onexit()
@@ -84,28 +86,28 @@
# IBGP - IPV4
PEER=$PEER1
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT1 $PEER $PEER1_PORT $PEER1_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT1 $PEER $PEER1_PORT $PEER1_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT1 $PEER $PEER1_PORT MultiProtocol.IPv4.Unicast true
enable_peer $LOCALHOST $PORT1 $PEER $PEER1_PORT
# EBGP - IPV4
PEER=$PEER2
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT2 $PEER $PEER2_PORT $PEER2_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT2 $PEER $PEER2_PORT $PEER2_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT2 $PEER $PEER2_PORT MultiProtocol.IPv4.Unicast true
enable_peer $LOCALHOST $PORT2 $PEER $PEER2_PORT
# IBGP - IPV6
PEER=$PEER3
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT3 $PEER $PEER3_PORT $PEER3_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT3 $PEER $PEER3_PORT $PEER3_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT3 $PEER $PEER3_PORT MultiProtocol.IPv6.Unicast true
enable_peer $LOCALHOST $PORT3 $PEER $PEER3_PORT
# IBGP - IPV6
PEER=$PEER4
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT4 $PEER $PEER4_PORT $PEER4_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT4 $PEER $PEER4_PORT $PEER4_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT4 $PEER $PEER4_PORT MultiProtocol.IPv6.Unicast true
enable_peer $LOCALHOST $PORT4 $PEER $PEER4_PORT
}
@@ -973,6 +975,7 @@
test28_ipv6()
{
echo "TEST28 (IPV6) - Verify that routes originated by BGP reach an EBGP peer"
+ echo "Test that next-hop of :: fails (but does not crash)"
echo "Also verify that the nexthop is rewritten and the provided nexthop"
echo "is ignored"
@@ -998,8 +1001,46 @@
coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 ipv6 true
sleep 2
+ # This is supposed to fail..nexthop :: is invalid above.
+ # TODO: Figure out how to do test for failure here that doesn't fail
+ # the test.
+ #coord peer1 trie recv lookup 2000::/3 aspath 65008
+ coord peer1 assert queue 1
+ coord peer1 assert established
+}
+
+test28_ipv6_ok()
+{
+ echo "TEST28 (IPV6-OK) - Verify that routes originated by BGP reach an EBGP peer"
+ echo "Also verify that the nexthop is rewritten and the provided nexthop"
+ echo "is ignored"
+
+ # NOTE: This fails because somehow a route with zero destination
+ # gets into the routing tables. See route_table_ribin::dump_next_route
+
+ coord reset
+ coord target $HOST $PORT4
+ coord initialise attach peer1
+
+ coord peer1 expect packet open asnum $AS bgpid $ID holdtime $HOLDTIME \
+ afi 2 safi 1
+
+ coord peer1 expect packet keepalive
+
+ coord peer1 expect packet update \
+ origin 0 \
+ aspath 65008 \
+ med 1 \
+ nlri6 2000::/3 \
+ nexthop6 2000:77:88::1
+
+ # Introduce a route
+ originate_route6 2000::/3 20:20:20:20:20:20:20:20 true false
+
+ coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100 ipv6 true
+
+ sleep 2
coord peer1 trie recv lookup 2000::/3 aspath 65008
-
coord peer1 assert queue 0
coord peer1 assert established
}
@@ -1738,8 +1779,9 @@
coord peer1 establish AS $PEER2_AS holdtime 0 id 192.150.187.100
- coord peer1 expect packet notify $UPDATEMSGERR $INVALNHATTR \
- 64 3 4 255 255 255 255
+ #coord peer1 expect packet notify $UPDATEMSGERR $INVALNHATTR \
+ # 64 3 4 255 255 255 255
+ coord peer1 expect packet notify $UPDATEMSGERR $INVALNHATTR
# 64 - Attribute Flags
# 3 - Attribute Type Code (NEXT_HOP)
@@ -1990,7 +2032,7 @@
coord peer1 assert idle
}
-TESTS_NOT_FIXED='test26'
+TESTS_NOT_FIXED='test26 test28_ipv6_ok'
TESTS='test1 test2 test3 test4 test5 test6 test7 test8 test8_ipv6
test9 test10 test11 test12 test12_ipv6 test13 test14 test15 test16
test17 test18 test19 test20 test20_ipv6 test21 test22 test23 test24
@@ -2007,12 +2049,12 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
- ./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
- ./coord = $CXRL finder://coord/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
+ ./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
+ ./coord = $CXRL finder://coord/common/0.1/get_target_name
EOF
trap '' 0
exit $?
Modified: trunk/xorp/bgp/harness/test_peering2.sh
===================================================================
--- trunk/xorp/bgp/harness/test_peering2.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_peering2.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -22,11 +22,13 @@
#
set -e
+. ./setup_paths.sh
+
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
. ${srcdir}/notification_codes.sh
onexit()
@@ -83,6 +85,10 @@
HOLDTIME=5
TRAFFIC_DIR="${srcdir}/../../../data/bgp"
+if [ ! -d $TRAFFIC_DIR ]
+ then
+ TRAFFIC_DIR=/usr/local/xorp_data
+fi
TRAFFIC_FILES="${TRAFFIC_DIR}/icsi1.mrtd"
# NOTE: The Win32 versions of coord and peer will perform
@@ -100,42 +106,42 @@
# IBGP - IPV4
PEER=$HOST
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT1 $PEER $PEER1_PORT $PEER1_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT1 $PEER $PEER1_PORT $PEER1_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT1 $PEER $PEER1_PORT MultiProtocol.IPv4.Unicast true
enable_peer $LOCALHOST $PORT1 $PEER $PEER1_PORT
# EBGP - IPV4
PEER=$HOST
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT2 $PEER $PEER2_PORT $PEER2_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT2 $PEER $PEER2_PORT $PEER2_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT2 $PEER $PEER2_PORT MultiProtocol.IPv4.Unicast true
enable_peer $LOCALHOST $PORT2 $PEER $PEER2_PORT
# EBGP - IPV4
PEER=$HOST
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT3 $PEER $PEER3_PORT $PEER3_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT3 $PEER $PEER3_PORT $PEER3_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT3 $PEER $PEER3_PORT MultiProtocol.IPv4.Unicast true
enable_peer $LOCALHOST $PORT3 $PEER $PEER3_PORT
# IBGP - IPV6
PEER=$HOST
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT4 $PEER $PEER4_PORT $PEER4_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT4 $PEER $PEER4_PORT $PEER4_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT4 $PEER $PEER4_PORT MultiProtocol.IPv6.Unicast true
enable_peer $LOCALHOST $PORT4 $PEER $PEER4_PORT
# EBGP - IPV6
PEER=$HOST
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT5 $PEER $PEER5_PORT $PEER5_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT5 $PEER $PEER5_PORT $PEER5_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT5 $PEER $PEER5_PORT MultiProtocol.IPv6.Unicast true
enable_peer $LOCALHOST $PORT5 $PEER $PEER5_PORT
# EBGP - IPV6
PEER=$HOST
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT6 $PEER $PEER6_PORT $PEER6_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT6 $PEER $PEER6_PORT $PEER6_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT6 $PEER $PEER6_PORT MultiProtocol.IPv6.Unicast true
enable_peer $LOCALHOST $PORT6 $PEER $PEER6_PORT
}
@@ -146,7 +152,7 @@
# gone down. If we are not testing the XORP bgp then replace with the
# sleep.
- while ../tools/print_peers -v | grep 'Peer State' | grep ESTABLISHED
+ while $PRINT_PEERS show bgp peers detail | grep 'Peer State' | grep ESTABLISHED
do
sleep 2
done
@@ -453,7 +459,7 @@
# Debugging to demonstrate that the BGP process believes that both peerings
# have been taken down.
- ../tools/print_peers -v
+ $PRINT_PEERS show bgp peers detail || exit 10
# debug
status peer1
@@ -1067,10 +1073,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer1/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_peering3.sh
===================================================================
--- trunk/xorp/bgp/harness/test_peering3.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_peering3.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -38,11 +38,13 @@
#
set -e
+. ./setup_paths.sh
+
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
. ${srcdir}/notification_codes.sh
onexit()
@@ -92,7 +94,7 @@
# EBGP - IPV4
PEER=$HOST
NEXT_HOP=192.150.187.78
- add_peer $LOCALHOST $PORT1 $PEER $PEER1_PORT $PEER1_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $LOCALHOST $PORT1 $PEER $PEER1_PORT $PEER1_AS $NEXT_HOP $HOLDTIME
set_parameter $LOCALHOST $PORT1 $PEER $PEER1_PORT MultiProtocol.IPv4.Unicast true
enable_peer $LOCALHOST $PORT1 $PEER $PEER1_PORT
}
@@ -217,7 +219,7 @@
}
TESTS_NOT_FIXED='test1'
-TESTS=''
+TESTS='test1'
# Sanity check that python is present on the host system.
PYTHON=${PYTHON:=python}
@@ -235,12 +237,12 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
- ./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
- ./coord = $CXRL finder://coord/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
+ ./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
+ ./coord = $CXRL finder://coord/common/0.1/get_target_name
EOF
trap '' 0
exit $?
Modified: trunk/xorp/bgp/harness/test_rib1.sh
===================================================================
--- trunk/xorp/bgp/harness/test_rib1.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_rib1.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -21,6 +21,7 @@
#
set -e
+. ./setup_paths.sh
onexit()
{
@@ -40,8 +41,8 @@
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
HOST=127.0.0.1
AS=65008
@@ -80,7 +81,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT1;PEER_PORT=$PEER1_PORT;PEER_AS=$PEER1_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -89,7 +90,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT2;PEER_PORT=$PEER2_PORT;PEER_AS=$PEER2_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -98,7 +99,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT1_IPV6;PEER_PORT=$PEER1_PORT_IPV6;PEER_AS=$PEER1_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -107,7 +108,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT2_IPV6;PEER_PORT=$PEER2_PORT_IPV6;PEER_AS=$PEER2_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
}
@@ -563,15 +564,16 @@
# Include command line
. ${srcdir}/args.sh
+. ./setup_paths.sh
if [ $START_PROGRAMS = "yes" ]
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./coord = $CXRL finder://coord/common/0.1/get_target_name
EOF
Modified: trunk/xorp/bgp/harness/test_rib_fea1.sh
===================================================================
--- trunk/xorp/bgp/harness/test_rib_fea1.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_rib_fea1.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -22,6 +22,7 @@
#
set -e
+. ./setup_paths.sh
onexit()
{
@@ -41,8 +42,8 @@
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
HOST=127.0.0.1
AS=65008
@@ -103,7 +104,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT1;PEER_PORT=$PEER_PORT1;PEER_AS=$PEER1_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -112,7 +113,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT2;PEER_PORT=$PEER_PORT2;PEER_AS=$PEER2_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -121,7 +122,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT3;PEER_PORT=$PEER_PORT3;PEER_AS=$PEER3_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -130,7 +131,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT1_IPV6;PEER_PORT=$PEER_PORT1_IPV6;PEER_AS=$PEER1_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -139,7 +140,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT2_IPV6;PEER_PORT=$PEER_PORT2_IPV6;PEER_AS=$PEER2_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -148,7 +149,7 @@
NEXT_HOP=192.150.187.78
PORT=$PORT3_IPV6;PEER_PORT=$PEER_PORT3_IPV6;PEER_AS=$PEER3_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
}
@@ -157,7 +158,6 @@
{
echo "Configuring rib"
export CALLXRL
- RIB_FUNCS=${srcdir}/../../rib/xrl_shell_funcs.sh
$RIB_FUNCS make_rib_errors_fatal
}
@@ -166,7 +166,6 @@
echo "Configuring fea"
export CALLXRL
- FEA_FUNCS=${srcdir}/../../fea/xrl_shell_funcs.sh
local tid=$($FEA_FUNCS start_fea_transaction)
$FEA_FUNCS create_interface $tid $VIF0
@@ -632,10 +631,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer2/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer3/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_route_flap_damping1.sh
===================================================================
--- trunk/xorp/bgp/harness/test_route_flap_damping1.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_route_flap_damping1.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -25,6 +25,7 @@
# Peer 3 I-BGP
set -e
+. ./setup_paths.sh
onexit()
{
@@ -43,8 +44,8 @@
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
HOST=127.0.0.1
PORT1=10001
@@ -94,7 +95,7 @@
PEER=$HOST
PORT=$PORT1;PEER_PORT=$PEER_PORT1;PEER_AS=$PEER1_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -102,7 +103,7 @@
PEER=$HOST
PORT=$PORT2;PEER_PORT=$PEER_PORT2;PEER_AS=$PEER2_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -110,7 +111,7 @@
PEER=$HOST
PORT=$PORT3;PEER_PORT=$PEER_PORT3;PEER_AS=$PEER3_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -118,7 +119,7 @@
PEER=$HOST
PORT=$PORT1_IPV6;PEER_PORT=$PEER_PORT1_IPV6;PEER_AS=$PEER1_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -126,7 +127,7 @@
PEER=$HOST
PORT=$PORT2_IPV6;PEER_PORT=$PEER_PORT2_IPV6;PEER_AS=$PEER2_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -134,7 +135,7 @@
PEER=$HOST
PORT=$PORT3_IPV6;PEER_PORT=$PEER_PORT3_IPV6;PEER_AS=$PEER3_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
}
@@ -321,10 +322,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer2/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer3/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_route_reflection1.sh
===================================================================
--- trunk/xorp/bgp/harness/test_route_reflection1.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_route_reflection1.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -25,6 +25,7 @@
# Peers 2 and 3 are RR clients
set -e
+. ./setup_paths.sh
onexit()
{
@@ -43,8 +44,8 @@
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
HOST=127.0.0.1
PORT1=10001
@@ -96,7 +97,7 @@
PEER=$HOST
PORT=$PORT1;PEER_PORT=$PEER_PORT1;PEER_AS=$PEER1_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -104,7 +105,7 @@
PEER=$HOST
PORT=$PORT2;PEER_PORT=$PEER_PORT2;PEER_AS=$PEER2_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
route_reflector_client $IPTUPLE true
enable_peer $IPTUPLE
@@ -113,7 +114,7 @@
PEER=$HOST
PORT=$PORT3;PEER_PORT=$PEER_PORT3;PEER_AS=$PEER3_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
route_reflector_client $IPTUPLE true
enable_peer $IPTUPLE
@@ -122,7 +123,7 @@
PEER=$HOST
PORT=$PORT1_IPV6;PEER_PORT=$PEER_PORT1_IPV6;PEER_AS=$PEER1_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -130,7 +131,7 @@
PEER=$HOST
PORT=$PORT2_IPV6;PEER_PORT=$PEER_PORT2_IPV6;PEER_AS=$PEER2_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
route_reflector_client $IPTUPLE true
enable_peer $IPTUPLE
@@ -139,7 +140,7 @@
PEER=$HOST
PORT=$PORT3_IPV6;PEER_PORT=$PEER_PORT3_IPV6;PEER_AS=$PEER3_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
route_reflector_client $IPTUPLE true
enable_peer $IPTUPLE
@@ -339,10 +340,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer2/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer3/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_route_reflection2.sh
===================================================================
--- trunk/xorp/bgp/harness/test_route_reflection2.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_route_reflection2.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -26,6 +26,7 @@
# Peer 3 E-BGP
set -e
+. ./setup_paths.sh
onexit()
{
@@ -44,8 +45,8 @@
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
HOST=127.0.0.1
PORT1=10001
@@ -97,7 +98,7 @@
PEER=$HOST
PORT=$PORT1;PEER_PORT=$PEER_PORT1;PEER_AS=$PEER1_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -105,7 +106,7 @@
PEER=$HOST
PORT=$PORT2;PEER_PORT=$PEER_PORT2;PEER_AS=$PEER2_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
route_reflector_client $IPTUPLE true
enable_peer $IPTUPLE
@@ -114,7 +115,7 @@
PEER=$HOST
PORT=$PORT3;PEER_PORT=$PEER_PORT3;PEER_AS=$PEER3_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -122,7 +123,7 @@
PEER=$HOST
PORT=$PORT1_IPV6;PEER_PORT=$PEER_PORT1_IPV6;PEER_AS=$PEER1_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -130,7 +131,7 @@
PEER=$HOST
PORT=$PORT2_IPV6;PEER_PORT=$PEER_PORT2_IPV6;PEER_AS=$PEER2_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
route_reflector_client $IPTUPLE true
enable_peer $IPTUPLE
@@ -139,7 +140,7 @@
PEER=$HOST
PORT=$PORT3_IPV6;PEER_PORT=$PEER_PORT3_IPV6;PEER_AS=$PEER3_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
}
@@ -321,10 +322,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer2/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer3/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_routing1.sh
===================================================================
--- trunk/xorp/bgp/harness/test_routing1.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_routing1.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -40,10 +40,12 @@
trap onexit 0 2
+. ./setup_paths.sh
+
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
HOST=127.0.0.1
PORT1=10001
@@ -99,7 +101,7 @@
PEER=$HOST
PORT=$PORT1;PEER_PORT=$PEER_PORT1;PEER_AS=$PEER1_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -107,7 +109,7 @@
PEER=$HOST
PORT=$PORT2;PEER_PORT=$PEER_PORT2;PEER_AS=$PEER2_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -115,7 +117,7 @@
PEER=$HOST
PORT=$PORT3;PEER_PORT=$PEER_PORT3;PEER_AS=$PEER3_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -123,7 +125,7 @@
PEER=$HOST
PORT=$PORT1_IPV6;PEER_PORT=$PEER_PORT1_IPV6;PEER_AS=$PEER1_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -131,7 +133,7 @@
PEER=$HOST
PORT=$PORT2_IPV6;PEER_PORT=$PEER_PORT2_IPV6;PEER_AS=$PEER2_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -139,7 +141,7 @@
PEER=$HOST
PORT=$PORT3_IPV6;PEER_PORT=$PEER_PORT3_IPV6;PEER_AS=$PEER3_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
}
@@ -941,16 +943,17 @@
# Include command line
. ${srcdir}/args.sh
+. ./setup_paths.sh
#START_PROGRAMS="no"
if [ $START_PROGRAMS = "yes" ]
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer2/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer3/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_routing2.sh
===================================================================
--- trunk/xorp/bgp/harness/test_routing2.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_routing2.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -25,6 +25,8 @@
set -e
+. ./setup_paths.sh
+
onexit()
{
last=$?
@@ -42,8 +44,8 @@
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
-. ${srcdir}/../../rib/xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
+. $RIB_FUNCS ""
HOST=127.0.0.1
PORT1=10001
@@ -105,7 +107,7 @@
PEER=$HOST
PORT=$PORT1;PEER_PORT=$PEER_PORT1;PEER_AS=$PEER1_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -113,7 +115,7 @@
PEER=$HOST
PORT=$PORT2;PEER_PORT=$PEER_PORT2;PEER_AS=$PEER2_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -121,7 +123,7 @@
PEER=$HOST
PORT=$PORT3;PEER_PORT=$PEER_PORT3;PEER_AS=$PEER3_AS
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv4.Unicast true
enable_peer $IPTUPLE
@@ -129,7 +131,7 @@
PEER=$HOST
PORT=$PORT1_IPV6;PEER_PORT=$PEER_PORT1_IPV6;PEER_AS=$PEER1_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -137,7 +139,7 @@
PEER=$HOST
PORT=$PORT2_IPV6;PEER_PORT=$PEER_PORT2_IPV6;PEER_AS=$PEER2_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
@@ -145,7 +147,7 @@
PEER=$HOST
PORT=$PORT3_IPV6;PEER_PORT=$PEER_PORT3_IPV6;PEER_AS=$PEER3_AS_IPV6
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
set_parameter $IPTUPLE MultiProtocol.IPv6.Unicast true
enable_peer $IPTUPLE
}
@@ -861,15 +863,16 @@
# Include command line
. ${srcdir}/args.sh
+. ./setup_paths.sh
if [ $START_PROGRAMS = "yes" ]
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
./test_peer -s peer1 = $CXRL finder://peer1/common/0.1/get_target_name
./test_peer -s peer2 = $CXRL finder://peer2/common/0.1/get_target_name
./test_peer -s peer3 = $CXRL finder://peer3/common/0.1/get_target_name
Modified: trunk/xorp/bgp/harness/test_terminate.sh
===================================================================
--- trunk/xorp/bgp/harness/test_terminate.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/test_terminate.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -17,11 +17,12 @@
# 4) Run "../xorp_bgp"
set -e
+. ./setup_paths.sh
# srcdir is set by make for check target
if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
. ${srcdir}/xrl_shell_funcs.sh ""
-. ${srcdir}/../xrl_shell_funcs.sh ""
+. $BGP_FUNCS ""
onexit()
{
@@ -55,7 +56,7 @@
{
echo "TEST1 - Verify that BGP shuts down cleanly"
- CALLXRL=$CALLXRL ${srcdir}/../xrl_shell_funcs.sh shutdown
+ CALLXRL=$CALLXRL $BGP_FUNCS shutdown
sleep 5
}
@@ -71,20 +72,20 @@
PORT=10001;PEER_PORT=20001;PEER_AS=6401
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
enable_peer $IPTUPLE
PORT=10002;PEER_PORT=20002;PEER_AS=6402
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
enable_peer $IPTUPLE
PORT=10003;PEER_PORT=20003;PEER_AS=6403
IPTUPLE="$LOCALHOST $PORT $PEER $PEER_PORT"
- add_peer $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
+ add_peer lo $IPTUPLE $PEER_AS $NEXT_HOP $HOLDTIME
enable_peer $IPTUPLE
- CALLXRL=$CALLXRL ${srcdir}/../xrl_shell_funcs.sh shutdown
+ CALLXRL=$CALLXRL $BGP_FUNCS shutdown
sleep 5
}
@@ -99,10 +100,10 @@
then
CXRL="$CALLXRL -r 10"
runit $QUIET $VERBOSE -c "$0 -s -c $*" <<EOF
- ../../libxipc/xorp_finder
- ../../fea/xorp_fea_dummy = $CXRL finder://fea/common/0.1/get_target_name
- ../../rib/xorp_rib = $CXRL finder://rib/common/0.1/get_target_name
- ../xorp_bgp = $CXRL finder://bgp/common/0.1/get_target_name
+ $XORP_FINDER
+ $XORP_FEA_DUMMY = $CXRL finder://fea/common/0.1/get_target_name
+ $XORP_RIB = $CXRL finder://rib/common/0.1/get_target_name
+ $XORP_BGP = $CXRL finder://bgp/common/0.1/get_target_name
EOF
trap '' 0
exit $?
Modified: trunk/xorp/bgp/harness/xrl_shell_funcs.sh
===================================================================
--- trunk/xorp/bgp/harness/xrl_shell_funcs.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/harness/xrl_shell_funcs.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -4,7 +4,8 @@
# $XORP: xorp/bgp/harness/xrl_shell_funcs.sh,v 1.12 2008/09/29 23:40:35 atanu Exp $
#
-CALLXRL=${CALLXRL:-../../libxipc/call_xrl -w 20}
+. ./setup_paths.sh
+
BASE=${BASE:-test_peer} # Set BASE in callers environment.
#
Modified: trunk/xorp/bgp/path_attribute.cc
===================================================================
--- trunk/xorp/bgp/path_attribute.cc 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/path_attribute.cc 2010-05-12 16:39:45 UTC (rev 11702)
@@ -289,8 +289,10 @@
template <class A>
NextHopAttribute<A>::NextHopAttribute(const A& n)
+ throw(CorruptMessage)
: PathAttribute(Transitive, NEXT_HOP), _next_hop(n)
{
+ verify();
}
template <class A>
@@ -300,7 +302,24 @@
return new NextHopAttribute(_next_hop);
}
+/* Throw exception if there are problems...do nothing
+ * otherwise.
+ */
template <class A>
+void
+NextHopAttribute<A>::verify()
+ throw(CorruptMessage)
+{
+ if (!_next_hop.is_unicast()) {
+ //XLOG_ASSERT(0);
+ xorp_throw(CorruptMessage,
+ c_format("NextHop %s is not a unicast address",
+ _next_hop.str().c_str()),
+ UPDATEMSGERR, INVALNHATTR);
+ }
+}
+
+template <class A>
NextHopAttribute<A>::NextHopAttribute(const uint8_t* d)
throw(CorruptMessage)
: PathAttribute(d)
@@ -318,11 +337,7 @@
_next_hop = A(payload(d));
- if (!_next_hop.is_unicast())
- xorp_throw(CorruptMessage,
- c_format("NextHop %s is not a unicast address",
- _next_hop.str().c_str()),
- UPDATEMSGERR, INVALNHATTR, d, total_tlv_length(d));
+ verify();
}
template<class A>
@@ -2852,6 +2867,8 @@
}
}
}
+
+#ifdef HAVE_IPV6
MPReachNLRIAttribute<IPv6>* mp6_reach_att =
dynamic_cast<MPReachNLRIAttribute<IPv6>*>(_att[MP_REACH_NLRI]);
if (mp6_reach_att) {
@@ -2876,6 +2893,7 @@
}
}
}
+#endif
MPUNReachNLRIAttribute<IPv4>* mp4_unreach_att =
dynamic_cast<MPUNReachNLRIAttribute<IPv4>*>(_att[MP_UNREACH_NLRI]);
if (mp4_unreach_att) {
@@ -3407,13 +3425,18 @@
if (_att[type]) {
s += "\n\t" + _att[type]->str();
} else if(_att_lengths[type]>0) {
- // we're got data for an attribute, but not decoded it yet
- size_t used = _att_lengths[type];
- PathAttribute *pa = PathAttribute::create(_att_bytes[type],
- _att_lengths[type],
- used, NULL, A::ip_version());
- _att[type] = pa;
- s += "\n\t" + _att[type]->str();
+ try {
+ // we've got data for an attribute, but not decoded it yet
+ size_t used = _att_lengths[type];
+ PathAttribute *pa = PathAttribute::create(_att_bytes[type],
+ _att_lengths[type],
+ used, NULL, A::ip_version());
+ _att[type] = pa;
+ s += "\n\t" + _att[type]->str();
+ }
+ catch (const XorpException& e) {
+ s += "\n\tException: " + e.str();
+ }
}
}
return s;
Modified: trunk/xorp/bgp/path_attribute.hh
===================================================================
--- trunk/xorp/bgp/path_attribute.hh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/path_attribute.hh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -35,6 +35,7 @@
#include <boost/noncopyable.hpp>
+
#include <openssl/md5.h>
#include "exceptions.hh" // for CorruptMessage exception
@@ -349,10 +350,15 @@
class NextHopAttribute : public PathAttribute
{
public:
- NextHopAttribute(const A& n);
+ NextHopAttribute(const A& n) throw(CorruptMessage);
NextHopAttribute(const uint8_t* d) throw(CorruptMessage);
PathAttribute *clone() const;
+ /* Throw exception if there are problems...do nothing
+ * otherwise.
+ */
+ void verify() throw(CorruptMessage);
+
string str() const {
return "Next Hop Attribute " + _next_hop.str();
}
Modified: trunk/xorp/bgp/plumbing.cc
===================================================================
--- trunk/xorp/bgp/plumbing.cc 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/plumbing.cc 2010-05-12 16:39:45 UTC (rev 11702)
@@ -1105,7 +1105,14 @@
pretty_string_safi(_master.safi()));
rib_in = iter->second;
- result = rib_in->add_route(net, pa_list, policy_tags);
+ try {
+ result = rib_in->add_route(net, pa_list, policy_tags);
+ }
+ catch(XorpException &e) {
+ XLOG_WARNING("Exception in add_route: %s, assuming failure\n",
+ e.str().c_str());
+ result = ADD_FAILURE;
+ }
if (result == ADD_USED || result == ADD_UNUSED) {
_awaits_push = true;
Modified: trunk/xorp/bgp/route_table_filter.cc
===================================================================
--- trunk/xorp/bgp/route_table_filter.cc 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/route_table_filter.cc 2010-05-12 16:39:45 UTC (rev 11702)
@@ -201,14 +201,18 @@
return true;
}
- //Form a new path attribute list containing the new nexthop
- FPAListRef& palist = rtmsg.attributes();
- palist->replace_nexthop(_local_nexthop);
+ // This check is needed to fix crash in test2-ipv6 of test_routing1.sh
+ // TODO: This needs review. --Ben
+ if (_local_nexthop.is_unicast()) {
+ //Form a new path attribute list containing the new nexthop
+ FPAListRef& palist = rtmsg.attributes();
+ palist->replace_nexthop(_local_nexthop);
- //note that we changed the route
- rtmsg.set_changed();
-
+ //note that we changed the route
+ rtmsg.set_changed();
+ }
+
return true;
}
@@ -235,12 +239,17 @@
return true;
}
- // The nexthop matches the peer's address so rewrite it.
- FPAListRef& palist = rtmsg.attributes();
- palist->replace_nexthop(_local_nexthop);
-
- //note that we changed the route
- rtmsg.set_changed();
+ // Make sure we don't throw an exception due to :: for nexthop.
+ // See similar change in NexthopRewriteFilter::filter.
+ // TODO: This needs review. --Ben
+ if (_local_nexthop.is_unicast()) {
+ // The nexthop matches the peer's address so rewrite it.
+ FPAListRef& palist = rtmsg.attributes();
+ palist->replace_nexthop(_local_nexthop);
+
+ //note that we changed the route
+ rtmsg.set_changed();
+ }
return true;
}
Modified: trunk/xorp/bgp/route_table_ribin.cc
===================================================================
--- trunk/xorp/bgp/route_table_ribin.cc 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/route_table_ribin.cc 2010-05-12 16:39:45 UTC (rev 11702)
@@ -369,14 +369,22 @@
if (chained_rt->is_winner() || dump_iter.peer_to_dump_to() == NULL) {
InternalMessage<A> rt_msg(chained_rt, _peer, _genid);
- log("dump route: " + rt_msg.net().str());
- int res = this->_next_table->route_dump(rt_msg, (BGPRouteTable<A>*)this,
- dump_iter.peer_to_dump_to());
- if(res == ADD_FILTERED)
- chained_rt->set_filtered(true);
- else
- chained_rt->set_filtered(false);
-
+ //XLOG_WARNING("dump route: %s", rt_msg.str().c_str());
+ try {
+ int res = this->_next_table->route_dump(rt_msg, (BGPRouteTable<A>*)this,
+ dump_iter.peer_to_dump_to());
+ if(res == ADD_FILTERED)
+ chained_rt->set_filtered(true);
+ else
+ chained_rt->set_filtered(false);
+ }
+ catch (const XorpException& e) {
+ //TODO: Make sure bad routes never get into the table in the first place
+ // (was an IPv6 zero default route that triggered this bug initially)
+ // See test 28-ipv6 in harness/test_peering1.sh --Ben
+ XLOG_WARNING("Exception in dump_next_route: %s\n", e.str().c_str());
+ XLOG_WARNING(" rt_msg: %s\n", rt_msg.str().c_str());
+ }
break;
}
}
Modified: trunk/xorp/bgp/run_tests
===================================================================
--- trunk/xorp/bgp/run_tests 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/run_tests 2010-05-12 16:39:45 UTC (rev 11702)
@@ -81,7 +81,7 @@
then
./BGPTest $CONFIG_FILE
else
- . ./xrl_shell_funcs.sh
+ . ./bgp_xrl_shell_funcs.sh
# Start a finder in the background.
$FINDER &
# Start a bgp process and then send it the XRL config commands.
Modified: trunk/xorp/bgp/socket.cc
===================================================================
--- trunk/xorp/bgp/socket.cc 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/socket.cc 2010-05-12 16:39:45 UTC (rev 11702)
@@ -230,6 +230,10 @@
XLOG_ASSERT(!get_sock().is_valid());
XLOG_ASSERT(!_connecting);
+ // Clean up any old reader/writers we might have around.
+ // This can happen if you kill network connection between two peers
+ // for 10 seconds and then re-start it.
+ async_remove();
set_sock(s);
async_add(s);
}
@@ -528,6 +532,9 @@
debug_msg("connect suceeded %s\n", sock.str().c_str());
+ // Clean up any old reader/writers we might have around.
+ // Not sure exactly how this one was triggered.
+ async_remove();
async_add(sock);
cb->dispatch(true);
return;
@@ -543,7 +550,6 @@
void
SocketClient::connect_socket_break()
{
- XLOG_ASSERT(_connecting);
_connecting = false;
eventloop().remove_ioevent_cb(get_sock());
Modified: trunk/xorp/bgp/tools/SConscript
===================================================================
--- trunk/xorp/bgp/tools/SConscript 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/tools/SConscript 2010-05-12 16:39:45 UTC (rev 11702)
@@ -31,6 +31,9 @@
'$BUILDDIR/libxorp',
'$BUILDDIR/libcomm',
'$BUILDDIR/libxipc',
+ '$BUILDDIR/libfeaclient',
+ '$BUILDDIR/policy/backend',
+ '$BUILDDIR/policy/common',
'$BUILDDIR/xrl/interfaces',
'$BUILDDIR/xrl/targets',
'$BUILDDIR/bgp',
@@ -40,9 +43,19 @@
env.AppendUnique(LIBS = [
'xorp_bgp', # for ASPath
'xif_bgp',
+ 'xorp_policy_backend',
+ 'xorp_policy_common',
'xorp_ipc',
'xorp_core',
'xorp_comm',
+ 'xif_rib',
+ 'xorp_fea_client',
+ 'xif_fea_ifmgr_mirror',
+ 'xst_fea_ifmgr_mirror',
+ 'xif_fea_ifmgr_replicator',
+ 'xst_bgp',
+ 'xif_profile_client',
+ 'xif_finder_event_notifier',
])
env.Replace(RPATH = [
Deleted: trunk/xorp/bgp/xrl_shell_funcs.sh
===================================================================
--- trunk/xorp/bgp/xrl_shell_funcs.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/bgp/xrl_shell_funcs.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -1,173 +0,0 @@
-#!/bin/sh
-
-#
-# $XORP: xorp/bgp/xrl_shell_funcs.sh,v 1.15 2006/03/06 02:27:52 atanu Exp $
-#
-
-CALLXRL=${CALLXRL:-../libxipc/call_xrl}
-
-local_config()
-{
- echo "local_config" $*
-# $CALLXRL "finder://bgp/bgp/0.1/local_config?localhost:txt=$1&port:i32=$2&as_num:i32=$3&id:ipv4=$4&version:i32=$5&holdtime:i32=$6"
- $CALLXRL "finder://bgp/bgp/0.3/local_config?as:txt=$1&id:ipv4=$2&use_4byte_asnums:bool=$3"
-}
-
-route_reflector()
-{
- echo "route_reflector" $*
- $CALLXRL "finder://bgp/bgp/0.3/set_cluster_id?cluster_id:ipv4=$1&disable:bool=$2"
-}
-
-set_damping()
-{
- echo "route_flap_damping" $*
- $CALLXRL "finder://bgp/bgp/0.3/set_damping?half_life:u32=$1&max_suppress:u32=$2&reuse:u32=$3&suppress:u32=$4&disable:bool=$5"
-}
-
-add_peer()
-{
- echo "add_peer" $*
-# $CALLXRL "finder://bgp/bgp/0.1/add_peer?peer:txt=$1&as:i32=$2&port:i32=$3&next_hop:ipv4=$4"
- $CALLXRL "finder://bgp/bgp/0.3/add_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&as:txt=$5&next_hop:ipv4=$6&holdtime:u32=$7"
-}
-
-delete_peer()
-{
- echo "delete_peer" $*
-# $CALLXRL "finder://bgp/bgp/0.1/delete_peer?peer:txt=$1&as:i32=$2"
- $CALLXRL "finder://bgp/bgp/0.3/delete_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&as:txt=$5"
-}
-
-enable_peer()
-{
- echo "enable_peer" $*
-# $CALLXRL "finder://bgp/bgp/0.1/enable_peer?peer:txt=$1&as:i32=$2"
- $CALLXRL "finder://bgp/bgp/0.3/enable_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4"
-}
-
-set_parameter()
-{
- echo "set_parameter" $*
-# $CALLXRL "finder://bgp/bgp/0.3/set_parameter?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4¶meter:txt=$5"
-
- $CALLXRL "finder://bgp/bgp/0.3/set_parameter?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4¶meter:txt=$5&toggle:bool=$6"
-}
-
-disable_peer()
-{
- echo "disable_peer" $*
-# $CALLXRL "finder://bgp/bgp/0.1/disable_peer?peer:txt=$1&as:i32=$2"
- $CALLXRL "finder://bgp/bgp/0.3/disable_peer?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4"
-}
-
-route_reflector_client()
-{
- echo "route_reflector_client" $*
- $CALLXRL "finder://bgp/bgp/0.3/set_route_reflector_client?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$3&state:bool=$5"
-}
-
-set_peer_md5_password()
-{
- echo "set_peer_md5_password" $*
- $CALLXRL "finder://bgp/bgp/0.3/set_peer_md5_password?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&password:txt=$5"
-}
-
-next_hop_rewrite_filter()
-{
- echo "next_hop_rewrite_filter" $*
- $CALLXRL "finder://bgp/bgp/0.3/next_hop_rewrite_filter?local_ip:txt=$1&local_port:u32=$2&peer_ip:txt=$3&peer_port:u32=$4&next_hop:ipv4=$5"
-}
-
-register_rib()
-{
- echo "register_rib" $*
- $CALLXRL "finder://bgp/bgp/0.3/register_rib?name:txt=$1"
-}
-
-originate_route4()
-{
- echo "originate_route4" $*
- $CALLXRL "finder://bgp/bgp/0.3/originate_route4?nlri:ipv4net=$1&next_hop:ipv4=$2&unicast:bool=$3&multicast:bool=$4"
-}
-
-originate_route6()
-{
- echo "originate_route6" $*
- $CALLXRL "finder://bgp/bgp/0.3/originate_route6?nlri:ipv6net=$1&next_hop:ipv6=$2&unicast:bool=$3&multicast:bool=$4"
-}
-
-withdraw_route4()
-{
- echo "withdraw_route4" $*
- $CALLXRL "finder://bgp/bgp/0.3/withdraw_route4?nlri:ipv4net=$1&unicast:bool&=$2multicast:bool=$3"
-}
-
-withdraw_route6()
-{
- echo "withdraw_route6" $*
- $CALLXRL "finder://bgp/bgp/0.3/withdraw_route6?nlri:ipv6net=$1&unicast:bool&=$2multicast:bool=$3"
-}
-
-shutdown()
-{
- echo "shutdown" $*
- $CALLXRL "finder://bgp/common/0.1/shutdown"
-}
-
-time_wait_seconds()
-{
- # If there are less than 200 PCB's in TIMEWAIT then return 0.
-
- local twc
- twc=`netstat -n | grep TIME_WAIT | grep 19999 | wc -l`
- if [ $twc -lt 200 ]
- then
- echo "0"
- return
- fi
-
- local tw os
-
- os=`uname -s`
- case $os in
- Linux)
- tw=`sysctl -n net.ipv4.tcp_fin_timeout 2>/dev/null`
- if [ $? -eq 0 ] ; then
- echo $tw
- return
- fi
- ;;
-
- FreeBSD)
- local msl
- msl=`sysctl -n net.inet.tcp.msl 2>/dev/null`
- if [ $? -eq 0 ] ; then
- # Timewait is 2 * msl and msl is in milliseconds
- tw=`expr $msl + $msl + 1`
- tw=`expr $tw / 1000`
- echo $tw
- return
- fi
- ;;
-
- *)
- # All other OS: use the default value below
- ;;
- esac
-
- # Defailt to 60 seconds
- echo "60"
-}
-
-# We have arguments.
-if [ $# != 0 ]
-then
- $*
-fi
-
-
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 4
-# End:
Copied: trunk/xorp/fea/fea_xrl_shell_funcs.sh (from rev 11701, trunk/xorp/fea/xrl_shell_funcs.sh)
===================================================================
--- trunk/xorp/fea/fea_xrl_shell_funcs.sh (rev 0)
+++ trunk/xorp/fea/fea_xrl_shell_funcs.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -0,0 +1,496 @@
+#!/bin/sh
+
+# Conditionally set ${srcdir} if it wasn't assigned (e.g., by `gmake check`)
+if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
+
+CALLXRL=${CALLXRL:-../libxipc/call_xrl}
+XRLDIR=${XRLDIR:-${srcdir}/../xrl}
+
+get_configured_interface_names()
+{
+ echo "get_configured_interface_names" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_interface_names"
+}
+
+start_fea_transaction()
+{
+ if [ $# -eq 0 ] ; then
+ tid=`$CALLXRL "finder://fea/ifmgr/0.1/start_transaction" | sed 's/.*=//'`
+ err=$?
+ echo $tid
+ return $err
+ fi
+
+ cat >&2 <<EOF
+usage: start_transaction
+ resulting transaction id is echoed on stdout on success
+EOF
+ return 255
+}
+
+commit_fea_transaction()
+{
+ echo "commit_transaction" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/ifmgr/0.1/commit_transaction?tid:u32=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: commit_transaction <tid>
+ where <tid> is the id of the transaction to be committed.
+EOF
+ return 255
+}
+
+abort_fea_transaction()
+{
+ echo "abort_transaction" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/ifmgr/0.1/abort_transaction?tid:u32=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: abort_transaction <tid>
+ where <tid> is the id of the transaction to be aborted.
+EOF
+ return 255
+}
+
+create_interface()
+{
+ echo "create_interface" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/create_interface?tid:u32=$1&ifname:txt=$2"
+}
+
+delete_interface()
+{
+ echo "delete_interface" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/delete_interface?tid:u32=$1&ifname:txt=$2"
+}
+
+enable_interface()
+{
+ echo "enable_interface" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_interface_enabled?tid:u32=$1&ifname:txt=$2&enabled:bool=true"
+}
+
+disable_interface()
+{
+ echo "disable_interface" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_interface_enabled?tid:u32=$1&ifname:txt=$2&enabled:bool=false"
+}
+
+configure_all_interfaces_from_system()
+{
+ echo "configure_all_interfaces_from_system" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/configure_all_interfaces_from_system?tid:u32=$1&enable:bool=$2"
+}
+
+configure_interface_from_system()
+{
+ echo "configure_interface_from_system" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/configure_interface_from_system?tid:u32=$1&ifname:txt=$2&enable:bool=$3"
+}
+
+set_mac()
+{
+ echo "set_mac" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_mac?tid:u32=$1&ifname:txt=$2&mac:mac=$3"
+}
+
+get_configured_mac()
+{
+ echo "get_configured_mac" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_mac?ifname:txt=$1"
+}
+
+set_mtu()
+{
+ echo "set_mtu" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_mtu?tid:u32=$1&ifname:txt=$2&mtu:u32=$3"
+}
+
+get_configured_mtu()
+{
+ echo "get_configured_mtu" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_mtu?ifname:txt=$1"
+}
+
+get_configured_vif_names()
+{
+ echo "get_configured_vif_names" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_vif_names?ifname:txt=$1"
+}
+
+create_vif()
+{
+ echo "create_vif" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/create_vif?tid:u32=$1&ifname:txt=$2&vif:txt=$3"
+}
+
+delete_vif()
+{
+ echo "delete_vif" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/delete_vif?tid:u32=$1&ifname:txt=$2&vif:txt=$3"
+}
+
+enable_vif()
+{
+ echo "enable_vif" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_vif_enabled?tid:u32=$1&ifname:txt=$2&vif:txt=$3&enabled:bool=true"
+}
+
+disable_vif()
+{
+ echo "disable_vif" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_vif_enabled?tid:u32=$1&ifname:txt=$2&vif:txt=$3&enabled:bool=false"
+}
+
+get_configured_vif_addresses4()
+{
+ echo "get_configured_vif_addresses4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_vif_addresses4?ifname:txt=$1&vif:txt=$2"
+}
+
+create_address4()
+{
+ echo "create_address4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/create_address4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4"
+}
+
+delete_address4()
+{
+ echo "delete_address4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/delete_address4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4"
+}
+
+enable_address4()
+{
+ echo "enable_address4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&enabled:bool=true"
+}
+
+disable_address4()
+{
+ echo "disable_address4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&enabled:bool=false"
+}
+
+set_prefix4()
+{
+ echo "set_prefix4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_prefix4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&prefix_len:u32=$5"
+}
+
+get_configured_prefix4()
+{
+ echo "get_configured_prefix4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_prefix4?ifname:txt=$1&vif:txt=$2&address:ipv4=$3"
+}
+
+set_broadcast4()
+{
+ echo "set_broadcast4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_broadcast4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&broadcast:ipv4=$5"
+}
+
+get_configured_broadcast4()
+{
+ echo "get_configured_broadcast4" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_broadcast4?ifname:txt=$1&vif:txt=$2&address:ipv4=$3"
+}
+
+get_configured_vif_addresses6()
+{
+ echo "get_configured_vif_addresses6" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_vif_addresses6?ifname:txt=$1&vif:txt=$2"
+}
+
+create_address6()
+{
+ echo "create_address6" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/create_address6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4"
+}
+
+delete_address6()
+{
+ echo "delete_address6" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/delete_address6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4"
+}
+
+enable_address6()
+{
+ echo "enable_address6" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4&enabled:bool=true"
+}
+
+disable_address6()
+{
+ echo "disable_address6" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4&enabled:bool=false"
+}
+
+set_prefix6()
+{
+ echo "set_prefix6" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/set_prefix6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4&prefix_len:u32=$5"
+}
+
+get_configured_prefix6()
+{
+ echo "get_configured_prefix6" $*
+ $CALLXRL "finder://fea/ifmgr/0.1/get_configured_prefix6?ifname:txt=$1&vif:txt=$2&address:ipv6=$3"
+}
+
+start_redist_transaction4()
+{
+ if [ $# -eq 0 ] ; then
+ tid=`$CALLXRL "finder://fea/redist_transaction4/0.1/start_transaction" | sed 's/.*=//'`
+ err=$?
+ echo $tid
+ return $err
+ fi
+
+ cat >&2 <<EOF
+usage: start_redist_transaction4
+ resulting transaction id is echoed on stdout on success
+EOF
+ return 255
+}
+
+start_redist_transaction6()
+{
+ if [ $# -eq 0 ] ; then
+ tid=`$CALLXRL "finder://fea/redist_transaction6/0.1/start_transaction" | sed 's/.*=//'`
+ err=$?
+ echo $tid
+ return $err
+ fi
+
+ cat >&2 <<EOF
+usage: start_redist_transaction6
+ resulting transaction id is echoed on stdout on success
+EOF
+ return 255
+}
+
+commit_redist_transaction4()
+{
+ echo "commit_redist_transaction4" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/redist_transaction4/0.1/commit_transaction?tid:u32=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: commit_redist_transaction4 <tid>
+ where <tid> is the id of the transaction to be committed.
+EOF
+ return 255
+}
+
+commit_redist_transaction6()
+{
+ echo "commit_redist_transaction6" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/redist_transaction6/0.1/commit_transaction?tid:u32=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: commit_redist_transaction6 <tid>
+ where <tid> is the id of the transaction to be committed.
+EOF
+ return 255
+}
+
+abort_redist_transaction4()
+{
+ echo "abort_redist_transaction4" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/redist_transaction4/0.1/abort_transaction?tid:u32=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: abort_redist_transaction4 <tid>
+ where <tid> is the id of the transaction to be aborted.
+EOF
+ return 255
+}
+
+abort_redist_transaction6()
+{
+ echo "abort_redist_transaction6" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/redist_transaction6/0.1/abort_transaction?tid:u32=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: abort_redist_transaction6 <tid>
+ where <tid> is the id of the transaction to be aborted.
+EOF
+ return 255
+}
+
+redist_transaction4_add_route()
+{
+ if [ $# -ne 8 ] ; then
+ cat >&2 <<EOF
+usage: redist_transaction4_add_route <tid> <dest net> <nexthop> <ifname> <vifname> <metric> <admin_distance> <cookie> <protocol_origin>
+eg: redist_transaction4_add_route 6987662 187.1.0.0/16 164.27.13.1 ed0 10 20 all BGP
+EOF
+ return 127
+ fi
+
+ $CALLXRL "finder://fea/redist_transaction4/0.1/add_route?tid:u32=$1&dst:ipv4net=$2&nexthop:ipv4=$3&ifname:txt=$4&vifname:txt=$5&metric:u32=$6&admin_distance:u32=$7&protocol_origin:txt=$8"
+}
+
+redist_transaction4_delete_route()
+{
+ if [ $# -ne 2 ] ; then
+ cat >&2 <<EOF
+usage: redist_transaction4_delete_route <tid> <dest net>
+eg: redist_transaction4_delete_route 276567373 187.1.0.0/16
+EOF
+ return 127
+ fi
+
+ $CALLXRL "finder://fea/redist_transaction4/0.1/delete_route?tid:u32=$1&network:ipv4net=$2"
+}
+
+lookup_route_by_dest4()
+{
+ echo -n "lookup_route_by_dest4" $* "-> "
+ $CALLXRL "finder://fea/fti/0.2/lookup_route_by_dest4?dst:ipv4=$1"
+}
+
+lookup_route_by_network4()
+{
+ echo -n "lookup_route_by_network4" $* "-> "
+ $CALLXRL "finder://fea/fti/0.2/lookup_route_by_network4?dst:ipv4net=$1"
+}
+
+have_ipv4()
+{
+ echo -n "have_ipv4" $* "-> "
+ $CALLXRL "finder://fea/fti/0.2/have_ipv4"
+}
+
+have_ipv6()
+{
+ echo -n "have_ipv6" $* "-> "
+ $CALLXRL "finder://fea/fti/0.2/have_ipv6"
+}
+
+get_unicast_forwarding_enabled4()
+{
+ echo -n "get_unicast_forwarding_enabled4" $* "-> "
+ $CALLXRL "finder://fea/fti/0.2/get_unicast_forwarding_enabled4"
+}
+
+get_unicast_forwarding_enabled6()
+{
+ echo -n "get_unicast_forwarding_enabled6" $* "-> "
+ $CALLXRL "finder://fea/fti/0.2/get_unicast_forwarding_enabled6"
+}
+
+set_unicast_forwarding_enabled4()
+{
+ echo "set_unicast_forwarding_enabled4" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/fti/0.2/set_unicast_forwarding_enabled4?enabled:bool=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: set_unicast_fowarding_enabled4 <enabled>
+ where <enabled> is set to true if we want to enable IPv4 unicast forwarding, otherwise is set to false.
+EOF
+ return 255
+}
+
+set_unicast_forwarding_enabled6()
+{
+ echo "set_unicast_forwarding_enabled6" $*
+ if [ $# -eq 1 ] ; then
+ $CALLXRL "finder://fea/fti/0.2/set_unicast_forwarding_enabled6?enabled:bool=$1"
+ return $?
+ fi
+ cat >&2 <<EOF
+usage: set_unicast_fowarding_enabled6 <enabled>
+ where <enabled> is set to true if we want to enable IPv6 unicast forwarding, otherwise is set to false.
+EOF
+ return 255
+}
+
+shutdown()
+{
+ echo "shutdown" $*
+ $CALLXRL "finder://fea/common/0.1/shutdown"
+}
+
+validate_xrls()
+{
+#
+# Check that xrls in this script are valid. Order of arguments is
+# expected to match those in file containing Xrls: this is a laziness
+# requirement and not an xrl requirement. A shell is almost certainly
+# the wrong place for this.
+#
+# STOPLOOKING
+#
+ script_name="${srcdir}/xrl_shell_funcs.sh"
+ script_xrls=`cat ${script_name} | sed -n '1,/STOPLOOKING/p' | sed -n '/finder:\/\// p' | sed 's/[^"]*"\([^"]*\).*/\1/g' | sed 's/=[^-&]*//g' | sed 's/->.*//g'`
+ source_xrl_files="${XRLDIR}/targets/*.xrls"
+
+ match_count=0
+ bad_count=0
+ for i in ${script_xrls} ; do
+ found="no"
+ for file in ${source_xrl_files} ; do
+ source_xrls=`cat ${file} | grep '://' | sed 's/->.*//g'`
+ for j in ${source_xrls} ; do
+ if [ ${i} = ${j} ] ; then
+ found="yes"
+ match_count=`expr ${match_count} + 1`
+ break
+ fi
+ stripped_i=`echo ${i} | sed 's/\?.*//'`
+ stripped_j=`echo ${j} | sed 's/\?.*//'`
+ if [ ${stripped_i} = ${stripped_j} ] ; then
+ found="yes"
+ echo "Warning mismatch in file ${file}:"
+ echo " script has \"${i}\""
+ echo " file has \"${j}\""
+ bad_count=`expr ${bad_count} + 1`
+ break
+ fi
+ done
+ if [ "${found}" = "yes" ] ; then
+ break
+ fi
+ done
+ if [ "${found}" = "no" ] ; then
+ echo "No match for ${i} in ${source_xrl_files}"
+ bad_count=`expr ${bad_count} + 1`
+ fi
+ done
+ status="Summary: ${match_count} xrls okay, ${bad_count} xrls bad."
+ rule=`echo ${status} | sed 's/[A-z0-9,:. ]/-/g'`
+ echo ${rule}
+ echo ${status}
+ echo ${rule}
+ echo $*
+ unset script_xrls
+ unset source_xrls
+
+ return ${bad_count}
+}
+
+# We have arguments.
+if [ $# != 0 ]
+then
+ $*
+fi
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 4
+# End:
Deleted: trunk/xorp/fea/xrl_shell_funcs.sh
===================================================================
--- trunk/xorp/fea/xrl_shell_funcs.sh 2010-05-01 03:51:10 UTC (rev 11701)
+++ trunk/xorp/fea/xrl_shell_funcs.sh 2010-05-12 16:39:45 UTC (rev 11702)
@@ -1,496 +0,0 @@
-#!/bin/sh
-
-# Conditionally set ${srcdir} if it wasn't assigned (e.g., by `gmake check`)
-if [ "X${srcdir}" = "X" ] ; then srcdir=`dirname $0` ; fi
-
-CALLXRL=${CALLXRL:-../libxipc/call_xrl}
-XRLDIR=${XRLDIR:-${srcdir}/../xrl}
-
-get_configured_interface_names()
-{
- echo "get_configured_interface_names" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_interface_names"
-}
-
-start_fea_transaction()
-{
- if [ $# -eq 0 ] ; then
- tid=`$CALLXRL "finder://fea/ifmgr/0.1/start_transaction" | sed 's/.*=//'`
- err=$?
- echo $tid
- return $err
- fi
-
- cat >&2 <<EOF
-usage: start_transaction
- resulting transaction id is echoed on stdout on success
-EOF
- return 255
-}
-
-commit_fea_transaction()
-{
- echo "commit_transaction" $*
- if [ $# -eq 1 ] ; then
- $CALLXRL "finder://fea/ifmgr/0.1/commit_transaction?tid:u32=$1"
- return $?
- fi
- cat >&2 <<EOF
-usage: commit_transaction <tid>
- where <tid> is the id of the transaction to be committed.
-EOF
- return 255
-}
-
-abort_fea_transaction()
-{
- echo "abort_transaction" $*
- if [ $# -eq 1 ] ; then
- $CALLXRL "finder://fea/ifmgr/0.1/abort_transaction?tid:u32=$1"
- return $?
- fi
- cat >&2 <<EOF
-usage: abort_transaction <tid>
- where <tid> is the id of the transaction to be aborted.
-EOF
- return 255
-}
-
-create_interface()
-{
- echo "create_interface" $*
- $CALLXRL "finder://fea/ifmgr/0.1/create_interface?tid:u32=$1&ifname:txt=$2"
-}
-
-delete_interface()
-{
- echo "delete_interface" $*
- $CALLXRL "finder://fea/ifmgr/0.1/delete_interface?tid:u32=$1&ifname:txt=$2"
-}
-
-enable_interface()
-{
- echo "enable_interface" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_interface_enabled?tid:u32=$1&ifname:txt=$2&enabled:bool=true"
-}
-
-disable_interface()
-{
- echo "disable_interface" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_interface_enabled?tid:u32=$1&ifname:txt=$2&enabled:bool=false"
-}
-
-configure_all_interfaces_from_system()
-{
- echo "configure_all_interfaces_from_system" $*
- $CALLXRL "finder://fea/ifmgr/0.1/configure_all_interfaces_from_system?tid:u32=$1&enable:bool=$2"
-}
-
-configure_interface_from_system()
-{
- echo "configure_interface_from_system" $*
- $CALLXRL "finder://fea/ifmgr/0.1/configure_interface_from_system?tid:u32=$1&ifname:txt=$2&enable:bool=$3"
-}
-
-set_mac()
-{
- echo "set_mac" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_mac?tid:u32=$1&ifname:txt=$2&mac:mac=$3"
-}
-
-get_configured_mac()
-{
- echo "get_configured_mac" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_mac?ifname:txt=$1"
-}
-
-set_mtu()
-{
- echo "set_mtu" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_mtu?tid:u32=$1&ifname:txt=$2&mtu:u32=$3"
-}
-
-get_configured_mtu()
-{
- echo "get_configured_mtu" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_mtu?ifname:txt=$1"
-}
-
-get_configured_vif_names()
-{
- echo "get_configured_vif_names" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_vif_names?ifname:txt=$1"
-}
-
-create_vif()
-{
- echo "create_vif" $*
- $CALLXRL "finder://fea/ifmgr/0.1/create_vif?tid:u32=$1&ifname:txt=$2&vif:txt=$3"
-}
-
-delete_vif()
-{
- echo "delete_vif" $*
- $CALLXRL "finder://fea/ifmgr/0.1/delete_vif?tid:u32=$1&ifname:txt=$2&vif:txt=$3"
-}
-
-enable_vif()
-{
- echo "enable_vif" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_vif_enabled?tid:u32=$1&ifname:txt=$2&vif:txt=$3&enabled:bool=true"
-}
-
-disable_vif()
-{
- echo "disable_vif" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_vif_enabled?tid:u32=$1&ifname:txt=$2&vif:txt=$3&enabled:bool=false"
-}
-
-get_configured_vif_addresses4()
-{
- echo "get_configured_vif_addresses4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_vif_addresses4?ifname:txt=$1&vif:txt=$2"
-}
-
-create_address4()
-{
- echo "create_address4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/create_address4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4"
-}
-
-delete_address4()
-{
- echo "delete_address4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/delete_address4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4"
-}
-
-enable_address4()
-{
- echo "enable_address4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&enabled:bool=true"
-}
-
-disable_address4()
-{
- echo "disable_address4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&enabled:bool=false"
-}
-
-set_prefix4()
-{
- echo "set_prefix4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_prefix4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&prefix_len:u32=$5"
-}
-
-get_configured_prefix4()
-{
- echo "get_configured_prefix4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_prefix4?ifname:txt=$1&vif:txt=$2&address:ipv4=$3"
-}
-
-set_broadcast4()
-{
- echo "set_broadcast4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_broadcast4?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv4=$4&broadcast:ipv4=$5"
-}
-
-get_configured_broadcast4()
-{
- echo "get_configured_broadcast4" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_broadcast4?ifname:txt=$1&vif:txt=$2&address:ipv4=$3"
-}
-
-get_configured_vif_addresses6()
-{
- echo "get_configured_vif_addresses6" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_vif_addresses6?ifname:txt=$1&vif:txt=$2"
-}
-
-create_address6()
-{
- echo "create_address6" $*
- $CALLXRL "finder://fea/ifmgr/0.1/create_address6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4"
-}
-
-delete_address6()
-{
- echo "delete_address6" $*
- $CALLXRL "finder://fea/ifmgr/0.1/delete_address6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4"
-}
-
-enable_address6()
-{
- echo "enable_address6" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4&enabled:bool=true"
-}
-
-disable_address6()
-{
- echo "disable_address6" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_address_enabled6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4&enabled:bool=false"
-}
-
-set_prefix6()
-{
- echo "set_prefix6" $*
- $CALLXRL "finder://fea/ifmgr/0.1/set_prefix6?tid:u32=$1&ifname:txt=$2&vif:txt=$3&address:ipv6=$4&prefix_len:u32=$5"
-}
-
-get_configured_prefix6()
-{
- echo "get_configured_prefix6" $*
- $CALLXRL "finder://fea/ifmgr/0.1/get_configured_prefix6?ifname:txt=$1&vif:txt=$2&address:ipv6=$3"
-}
-
-start_redist_transaction4()
-{
- if [ $# -eq 0 ] ; then
- tid=`$CALLXRL "finder://fea/redist_transaction4/0.1/start_transaction" | sed 's/.*=//'`
- err=$?
- echo $tid
- return $err
- fi
-
- cat >&2 <<EOF
-usage: start_redist_transaction4
- resulting transaction id is echoed on stdout on success
-EOF
- return 255
-}
-
-start_redist_transaction6()
-{
- if [ $# -eq 0 ] ; then
- tid=`$CALLXRL "finder://fea/redist_transaction6/0.1/start_transaction" | sed 's/.*=//'`
- err=$?
- echo $tid
- return $err
- fi
-
- cat >&2 <<EOF
-usage: start_redist_transaction6
- resulting transaction id is echoed on stdout on success
-EOF
- return 255
-}
-
-commit_redist_transaction4()
-{
- echo "commit_redist_transaction4" $*
- if [ $# -eq 1 ] ; then
- $CALLXRL "finder://fea/redist_transaction4/0.1/commit_transaction?tid:u32=$1"
- return $?
- fi
- cat >&2 <<EOF
-usage: commit_redist_transaction4 <tid>
- where <tid> is the id of the transaction to be committed.
-EOF
- return 255
-}
-
-commit_redist_transaction6()
-{
- echo "commit_redist_transaction6" $*
- if [ $# -eq 1 ] ; then
- $CALLXRL "finder://fea/redist_transaction6/0.1/commit_transaction?tid:u32=$1"
- return $?
- fi
- cat >&2 <<EOF
-usage: commit_redist_transaction6 <tid>
- where <tid> is the id of the transaction to be committed.
-EOF
- return 255
-}
-
-abort_redist_transaction4()
-{
- echo "abort_redist_transaction4" $*
- if [ $# -eq 1 ] ; then
- $CALLXRL "finder://fea/redist_transaction4/0.1/abort_transaction?tid:u32=$1"
- return $?
- fi
- cat >&2 <<EOF
-usage: abort_redist_transaction4 <tid>
- where <tid> is the id of the transaction to be aborted.
-EOF
- return 255
-}
-
-abort_redist_transaction6()
-{
- echo "abort_redist_transaction6" $*
- if [ $# -eq 1 ] ; then
- $CALLXRL "finder://fea/redist_transaction6/0.1/abort_transaction?tid:u32=$1"
- return $?
- fi
- cat >&2 <<EOF
-usage: abort_redist_transaction6 <tid>
- where <tid> is the id of the transaction to be aborted.
-EOF
- return 255
-}
-
-redist_transaction4_add_route()
-{
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Xorp-cvs
mailing list