// 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. // #include "../common/STD_PKT_COMMON.def" #ifndef SNDTSN #define SNDTSN INITTSN #endif #ifndef SACK #define SACK 0 #endif #if ENABLE_IPV6 #define DATA_SIZE 476 #else #define DATA_SIZE 484 #endif #define DATA_FRAGMENT_SEND(_pNAME, _pINDEX, _pGAP, _pBFLAG, _pEFLAG) \ PKG_SCTP_SHORT_SEND( \ sctp_chunk_data_##_pNAME, \ { \ chunk = chunk_data_##_pNAME; \ } \ ) \ CHUNK_DATA chunk_data_##_pNAME { \ UFlag = 1; \ BFlag = _pBFLAG; \ EFlag = _pEFLAG; \ TSN = SNDTSN + _pINDEX; \ Identifier = 0; \ SequenceNumber = 0; \ Protocol = 0; \ payload = data##_pNAME; \ } \ Payload data##_pNAME { \ data = repeat(_pINDEX, DATA_SIZE); \ } \ PKG_SCTP_SHORT_RECV( \ sctp_chunk_sack_##_pNAME, \ { \ chunk = chunk_sack_##_pNAME; \ } \ ) \ \ CHUNK_SACK chunk_sack_##_pNAME { \ ACK = SNDTSN; \ AdvRecvWindow = any; \ NumOfGapAck = _pGAP; \ NumOfDupTSN = stop; \ } // _pNAME, _pINDEX, _pGAP, _pBFLAG, _pEFLAG // a1 -> a2 -> a3 DATA_FRAGMENT_SEND(a1, 1, 0, 1, 0) DATA_FRAGMENT_SEND(a2, 2, 1, 0, 0) DATA_FRAGMENT_SEND(a3, 3, 1, 0, 1) PKG_SCTP_SHORT_RECV( sctp_chunk_data_all, { chunk = chunk_data_all; } ) CHUNK_DATA chunk_data_all { UFlag = any; BFlag = 1; EFlag = 1; TSN = SACK; Identifier = any; SequenceNumber = any; Protocol = any; payload = dataall; } Payload dataall { data = repeat(1, DATA_SIZE); data = repeat(2, DATA_SIZE); data = repeat(3, DATA_SIZE); } PKG_SCTP_SHORT_SEND( sctp_chunk_sack_all, { chunk = chunk_sack_all; } ) CHUNK_SACK chunk_sack_all { ACK = SACK; AdvRecvWindow = ARWND; NumOfGapAck = 0; NumOfDupTSN = 0; }