#!/usr/bin/perl
#
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Yokogawa Electric Corporation,
# IPA (Information-technology Promotion Agency, Japan).
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with
# or without modification, are permitted provided that the following
# conditions and disclaimer are agreed and accepted by the user:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# 3. Neither the names of the copyrighters, the name of the project which
# is related to this software (hereinafter referred to as "project") nor
# the names of the contributors may be used to endorse or promote products
# derived from this software without specific prior written permission.
#
# 4. No merchantable use may be permitted without prior written
# notification to the copyrighters. However, using this software for the
# purpose of testing or evaluating any products including merchantable
# products may be permitted without any notification to the copyrighters.
#
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHTERS, THE PROJECT AND
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING
# BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE, ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHTERS, THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT,STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#
# $TAHI: ct/spec/RH_AtHost.seq,v 1.9 2003/04/07 10:31:25 ozoe Exp $
#
######################################################################
BEGIN {
$V6evalTool::TestVersion = '$Name: REL_2_1_2 $';
}
use V6evalTool;
use SPEC;
if ($V6evalTool::NutDef{Type} ne 'host') {
vLogHTML("This test is for the host only
");
exit $V6evalTool::exitHostOnly;
}
%pktdesc = (
echo_request_rh => 'Send Echo Request with Routing Header',
echo_reply => 'Recv Echo Reply',
usolra => 'Send Router Advertisement',
dadns => 'Recv Neighbor Solicitation',
);
$ret = specReboot();
if ($ret) {
vLogHTML('NG');
exit $V6evalTool::exitFatal;
}
$IF = Link0;
#----- start capturing
vCapture($IF);
#======================================================================
vSend($IF, usolra);
%ret = vRecv($IF, 5, 0, 0, dadns);
if ($ret{status} != 0) {
if ($ret{status} != 1) {
vLogHTML('NG');
exit $V6evalTool::exitFail;
}
}
vSleep(4);
vClear($IF);
vSend($IF, echo_request_rh);
%ret = vRecv($IF, 5, 0, 0, echo_reply);
if ($ret{status} != 0) {
vLogHTML('NG');
exit $V6evalTool::exitFail;
}
if ($ret{recvFrame} ne 'echo_reply') {
vLogHTML('NG');
exit $V6evalTool::exitFail;
}
vLogHTML('OK');
exit $V6evalTool::exitPass;
######################################################################
__END__
=head1 NAME
RH_AtHost - check Routing Header Processing (at Host)
=head1 TARGET
Host
=head1 SYNOPSIS
=begin html
RH_AtHost.seq [-tooloption ...] -pkt RH_AtHost.def
-tooloption : v6eval tool option
=end html
=head1 INITIALIZATION
1. Reboot Target
2. Send Router Advertisement
3. Wait Neighbor Solicitation (DAD)
=head1 TEST PROCEDURE
Tester Target
| |
|-------------------------->|
| ICMP Echo Request |
| |
|<--------------------------|
| ICMP Echo Reply |
| |
v v
1. Send Echo Request
2. Receive Echo Reply
Network topology
(Link0)
Tester Target
Host1 ------ Router1 ------ Router2 ------ Router3 ------ Host2
Global 6 Global 4 Global 2 Global 0
ICMP Echo Request is:
IPv6 Header
Version = 6
Traffic Class = 0
FlowLabel = 0
PayloadLength = 72
NextHeader = 43 (Routing Header)
SourceAddress = Global 6 Address (Host1)
DestinationAddress = Global 0 Address (Host2)
Routing Header
NextHeader = 58 (ICMP)
HeaderExtLength = 6
RoutingType = 0
SegmentsLeft = 0
Address[1] = Global 6 Address (Router1)
Address[2] = Global 4 Address (Router2)
Address[3] = Global 2 Address (Router3)
ICMP Echo Request
Type = 128 (Echo Request)
=head1 JUDGMENT
PASS: ICMP Echo Reply received
ICMP Echo Reply is:
IPv6 Header
Version = 6
Traffic Class = 0
FlowLabel = 0
PayloadLength = 16
NextHeader = 58 (ICMP)
SourceAddress = Global 0 Address (Host2)
DestinationAddress = Global 6 Address (Host1)
ICMP Echo Reply
Type = 129 (Echo Reply)
=head1 SEE ALSO
perldoc V6evalTool
=cut