#!/usr/bin/perl # # SCTP Conformance Test Suite Implementation # (C) Copyright Fujitsu Ltd. 2008, 2009 # # This file is part of the SCTP Conformance Test Suite implementation. # # The SCTP Conformance Test Suite implementation is free software; # you can redistribute it and/or modify it under the terms of # the GNU General Public License version 2 as published by # the Free Software Foundation. # # The SCTP Conformance Test Suite implementation is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY; without even # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR # PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU CC; see the file COPYING. If not, write to # the Free Software Foundation, 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA. # # Please send any bug reports or fixes you make to the # email address(es): # networktest sctp # # Or submit a bug report through the following website: # http://networktest.sourceforge.net/ # # Written or modified by: # Hiroaki Kago # Wei Yongjun # # Any bugs reported given to us we will try to fix... any fixes shared will # be incorporated into the next SCTP release. # ############################################################################## BEGIN { $V6evalTool::TestVersion = '$Name: REL_1_0_1 $'; } use lib "../common"; use V6evalTool; use SCTP; %pktdesc = ( sctp_chunk_asconf_set_prim => "Send SCTP CHUNK_ASCONF (Set Primary Address Parameter)", sctp_chunk_asconf_ack_ok => "Recv SCTP CHUNK_ASCONF_ACK (Success Indication)", sctp_chunk_heartbeat_link1 => "Send SCTP CHUNK_HEARTBEAT (Link1)", sctp_chunk_heartbeat_ack_link1 => "Recv SCTP CHUNK_HEARTBEAT_ACK (Link1)", sctp_chunk_data_link1 => "Recv SCTP CHUNK_DATA (Link1)", sctp_chunk_sack_link1 => "Send SCTP CHUNK_SACK (Link1)", ); $IF0 = Link0; $IF1 = Link1; vCapture($IF0); vCapture($IF1); sctpCheckEnv($IF0, IF0); sctpStartEchoServer($IF0); vConnect($IF0); %ret = vWarpRecv3($IF1, 10, 0, 0, sctp_chunk_heartbeat_link1); if ($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_heartbeat_link1) { vLogHTML('Cannot receive SCTP CHUNK_HEARTBEAT
'); vSend($IF1, sctp_chunk_abort_snd); vLogHTML('NG'); exit $V6evalTool::exitFail; } $HBINFO = $ret{sctpGetFieldName("CHUNK_HEARTBEAT.HeartbeatInfo.Data")}; vWarpCPP("-DHBINFO=\\\"$HBINFO\\\""); vSend($IF1, sctp_chunk_heartbeat_ack_link1); vLogHTML('================ Main Test ================='); vSend($IF0, sctp_chunk_asconf_set_prim); %ret = vWarpRecv($IF0, 10, 0, 0, sctp_chunk_asconf_ack_ok); if ($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_asconf_ack_ok) { vLogHTML('Cannot receive SCTP CHUNK_ASCONF_ACK
'); vSend($IF0, sctp_chunk_abort_snd); vLogHTML('NG'); exit $V6evalTool::exitFail; } vSendMsg($IF0); vLogHTML('== Check whether Address is marked as the primary address =='); sctpUpdateRecvACK(); %ret = vWarpRecv($IF1, 10, 0, 0, sctp_chunk_data_link1); if ($ret{status} != 0 || $ret{recvFrame} ne sctp_chunk_data_link1) { vLogHTML('Cannot receive SCTP CHUNK_DATA
'); vSend($IF0, sctp_chunk_abort_snd); vLogHTML('NG'); exit $V6evalTool::exitFail; } vSend($IF1, sctp_chunk_sack_link1); vClose($IF0); vLogHTML(OK); exit $V6evalTool::exitPass; ###################################################################### __END__ =head1 NAME AsconfWithSetExists.seq - ASCONF chunk is received with Set Primary Address Parameter which contain a address part of the association =head1 PURPOSE To check that if ASCONF chunk is received with Set Primary Address Parameter which contain a address part of the association then the endpoint should mark the specified address as the primary address to send data to. =head1 SYNOPSIS =begin html
  ./AsconfWithSetExists.seq [-tooloption ...] -pkt ./AsconfWithSetExists.def
    -tooloption : v6eval tool option
  See Also: ../common/STD_PKT_COMMON.def
            ../common/SCTP_COMMON.def
=end html =head1 PRE-TEST CONDITION Association is established between endpoint A and B. Arrange the date in endpoint A such that ASCONF chunk with Set Primary Address Parameter which contain a address part of the association is sent to endpoint B. =head1 TEST PROCEDURE Endpoint A Endpoint B ULP (ESTABLISHED) (ESTABLISHED) ASCONF -----------------> (Set Primary Address) <----------------- ASCONF-ACK (Success Indication) TEST DESCRIPTION: 1. Send ASCONF chunk from endpoint A to B with Set Primary Address Parameter which contain a address part of the association. 2. Check A: ASCONF-ACK with complete success should be received at endpoint A and the endpoint B should mark the specified address as the primary address to send data to. =head1 NOTE None =head1 REFERENCE RFC 5061 4.2.4. Set Primary IP Address 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type =0xC004 | Length = Variable | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | ASCONF-Request Correlation ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Address Parameter | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ASCONF-Request Correlation ID: 32 bits This is an opaque integer assigned by the sender to identify each request parameter. The receiver of the ASCONF Chunk will copy this 32-bit value into the ASCONF Response Correlation ID field of the ASCONF-ACK response parameter. The sender of the ASCONF can use this same value in the ASCONF-ACK to find which request the response is for. Note that the receiver MUST NOT change this 32-bit value. Address Parameter: TLV =begin html
     This field contains an IPv4 or IPv6 address parameter as described in
     Section 3.3.2.1 of [RFC4960].  The complete TLV is wrapped within
     this parameter.  It requests the receiver to mark the specified
     address as the primary address to send data to (see Section 5.1.2 of
     [RFC4960]).  The receiver MAY mark this as its primary address upon
     receiving this request.  If the address 0.0.0.0 or ::0 is provided,
     the receiver MAY mark the source address of the packet as its
     primary.
=end html