Loading ttcn/LibCore/LibIpv6_Rfc2463Icmpv6_Functions.ttcn +105 −28 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import from LibIpv6_ExternalFunctions all; import from LibIpv6_Rfc2463Icmpv6_Templates all; import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all; import from LibIpv6_Rfc0768Udp_Functions all; /** * @desc This sends an ICMPv6 echo request from an IPv6 node to Loading Loading @@ -197,7 +198,7 @@ * and waits for a Destination Unreachable message for a fixed amount of time. * @remark Time limit is defined by module parameter PX_TAC (see comp type) * @param p_echoRequest Template of the Echo Request to be sent * @param p_destUnreachable Template of the Packet Too Big message that is expected * @param p_destUnreachable Template of the Destination Unreachable message that is expected * @return execution status */ function f_getDestinationUnreachableAfterEchoReq ( Loading @@ -224,6 +225,37 @@ } // end f_getDestinationUnreachableAfterEchoReq /** * @desc This sends an UDP packet from an IPv6 node to any NUT, * and waits for a Destination Unreachable message for a fixed amount of time. * @remark Time limit is defined by module parameter PX_TAC (see comp type) * @param p_udpPacket Template of the UDP packet to be sent * @param p_destUnreachable Template of the Destination Unreachable message that is expected * @return execution status */ function f_getDestinationUnreachableAfterUdpPacket ( template UdpPacket p_udpPacket, template DestinationUnreachable p_destUnreachable ) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendUdpPacket ( p_udpPacket ); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive ( p_destUnreachable ) { tc_ac.stop; return e_success; } [] tc_ac.timeout{ return e_timeout; } } // end alt } // end f_getDestinationUnreachableAfterEchoReq /** * @desc This sends an ICMPv6 echo request from an IPv6 node to any Loading Loading @@ -436,8 +468,6 @@ }//end f_getParameterProblemAfterEchoReq_ignoreEchoReply /** * @desc This sends an ICMPv6 echo request from an IPv6 node to any * NUT, and waits for a echo reply for a fixed amount of time. Loading Loading @@ -484,6 +514,53 @@ return v_ret; } // End function f_echoProcUp_withHopL255Len1280 /** * @desc This sends an ICMPv6 echo request with data of MTU size(1500)-headers from an IPv6 node to any * NUT, and waits for a echo reply for a fixed amount of time. * This function can be used to verify that the NUT is * up and running. Neighbor detection is handled here, rather than in * a default. Might be useful if NUT must perform neighbor detection. * @remark Time limit is defined by module parameter PX_TAC (see comp type) * @param p_llaAddrTn Local link address of testing node which calls this function * @param p_llaAddrNut Local link address of node under test * @return execution status */ function f_echoProcUp_withHopL255Len1500( in template Ipv6Address p_llaAddrTn, in template Ipv6Address p_llaAddrNut) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret; var octetstring v_icmpData := int2oct(0, 1500-40-8); //1500: default MTU size, 40: IPv6 header length, 8: ICMPv6EchoRequestHeader v_ret := f_sendEchoRequest ( m_echoRequest_noExtHdr_data_hop ( p_llaAddrTn, p_llaAddrNut, c_hopLimit255, c_defId, c_defSeqNo, v_icmpData) ); if ( v_ret == e_success ) { tc_ac.start; alt { [] ipPort.receive ( mw_echoReply_noExtHdr_data_hop ( p_llaAddrNut, p_llaAddrTn, c_hopLimit255, v_icmpData ) ) { tc_ac.stop; return e_success; } [] tc_ac.timeout{ return e_timeout; } } // end alt } // End If return v_ret; } // End function f_echoProcUp_withHopL255Len1500 /** * @desc This sends other ICMPv6 packet from an IPv6 node to * any IUT. Prior it modifies IPv6 packet payload length Loading ttcn/LibUdp/LibIpv6_Rfc0768Udp_Functions.ttcn3 0 → 100644 +33 −0 Original line number Diff line number Diff line /** * @author STF 276 * @version $Id: LibIpv6_Rfc0768Udp_Functions.ttcn3,v 1.1 2010/11/05 14:11:15 dte Exp $ * @desc This module specifies common function definitions * to specify UDP payloads for IPv6 packets */ module LibIpv6_Rfc0768Udp_Functions { //LibCommon import from LibCommon_VerdictControl all; //LibIpv6 import from LibIpv6_Interface_Functions all; import from LibIpv6_Interface_TypesAndValues all; function f_sendUdpPacket (in template UdpPacket p_udpPacket) runs on LibIpv6Node return FncRetCode { var UdpPacket v_ipPkt; v_ipPkt := valueof(p_udpPacket); if(f_setExtensionHeaders( v_ipPkt ) != e_success) { log(" **** f_sendUdp: Error when calculating length of extension headers ****"); return e_error; } //send ipPort.send(v_ipPkt); return e_success; }//end f_sendUdp } // end module LibIpv6_Rfc0768Udp_Functions Loading
ttcn/LibCore/LibIpv6_Rfc2463Icmpv6_Functions.ttcn +105 −28 Original line number Diff line number Diff line Loading @@ -24,6 +24,7 @@ import from LibIpv6_ExternalFunctions all; import from LibIpv6_Rfc2463Icmpv6_Templates all; import from LibIpv6_Rfc2463Icmpv6_TypesAndValues all; import from LibIpv6_Rfc0768Udp_Functions all; /** * @desc This sends an ICMPv6 echo request from an IPv6 node to Loading Loading @@ -197,7 +198,7 @@ * and waits for a Destination Unreachable message for a fixed amount of time. * @remark Time limit is defined by module parameter PX_TAC (see comp type) * @param p_echoRequest Template of the Echo Request to be sent * @param p_destUnreachable Template of the Packet Too Big message that is expected * @param p_destUnreachable Template of the Destination Unreachable message that is expected * @return execution status */ function f_getDestinationUnreachableAfterEchoReq ( Loading @@ -224,6 +225,37 @@ } // end f_getDestinationUnreachableAfterEchoReq /** * @desc This sends an UDP packet from an IPv6 node to any NUT, * and waits for a Destination Unreachable message for a fixed amount of time. * @remark Time limit is defined by module parameter PX_TAC (see comp type) * @param p_udpPacket Template of the UDP packet to be sent * @param p_destUnreachable Template of the Destination Unreachable message that is expected * @return execution status */ function f_getDestinationUnreachableAfterUdpPacket ( template UdpPacket p_udpPacket, template DestinationUnreachable p_destUnreachable ) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret; v_ret := f_sendUdpPacket ( p_udpPacket ); if ( v_ret != e_success ) {return v_ret;} tc_ac.start; alt { [] ipPort.receive ( p_destUnreachable ) { tc_ac.stop; return e_success; } [] tc_ac.timeout{ return e_timeout; } } // end alt } // end f_getDestinationUnreachableAfterEchoReq /** * @desc This sends an ICMPv6 echo request from an IPv6 node to any Loading Loading @@ -436,8 +468,6 @@ }//end f_getParameterProblemAfterEchoReq_ignoreEchoReply /** * @desc This sends an ICMPv6 echo request from an IPv6 node to any * NUT, and waits for a echo reply for a fixed amount of time. Loading Loading @@ -484,6 +514,53 @@ return v_ret; } // End function f_echoProcUp_withHopL255Len1280 /** * @desc This sends an ICMPv6 echo request with data of MTU size(1500)-headers from an IPv6 node to any * NUT, and waits for a echo reply for a fixed amount of time. * This function can be used to verify that the NUT is * up and running. Neighbor detection is handled here, rather than in * a default. Might be useful if NUT must perform neighbor detection. * @remark Time limit is defined by module parameter PX_TAC (see comp type) * @param p_llaAddrTn Local link address of testing node which calls this function * @param p_llaAddrNut Local link address of node under test * @return execution status */ function f_echoProcUp_withHopL255Len1500( in template Ipv6Address p_llaAddrTn, in template Ipv6Address p_llaAddrNut) runs on LibIpv6Node return FncRetCode { var FncRetCode v_ret; var octetstring v_icmpData := int2oct(0, 1500-40-8); //1500: default MTU size, 40: IPv6 header length, 8: ICMPv6EchoRequestHeader v_ret := f_sendEchoRequest ( m_echoRequest_noExtHdr_data_hop ( p_llaAddrTn, p_llaAddrNut, c_hopLimit255, c_defId, c_defSeqNo, v_icmpData) ); if ( v_ret == e_success ) { tc_ac.start; alt { [] ipPort.receive ( mw_echoReply_noExtHdr_data_hop ( p_llaAddrNut, p_llaAddrTn, c_hopLimit255, v_icmpData ) ) { tc_ac.stop; return e_success; } [] tc_ac.timeout{ return e_timeout; } } // end alt } // End If return v_ret; } // End function f_echoProcUp_withHopL255Len1500 /** * @desc This sends other ICMPv6 packet from an IPv6 node to * any IUT. Prior it modifies IPv6 packet payload length Loading
ttcn/LibUdp/LibIpv6_Rfc0768Udp_Functions.ttcn3 0 → 100644 +33 −0 Original line number Diff line number Diff line /** * @author STF 276 * @version $Id: LibIpv6_Rfc0768Udp_Functions.ttcn3,v 1.1 2010/11/05 14:11:15 dte Exp $ * @desc This module specifies common function definitions * to specify UDP payloads for IPv6 packets */ module LibIpv6_Rfc0768Udp_Functions { //LibCommon import from LibCommon_VerdictControl all; //LibIpv6 import from LibIpv6_Interface_Functions all; import from LibIpv6_Interface_TypesAndValues all; function f_sendUdpPacket (in template UdpPacket p_udpPacket) runs on LibIpv6Node return FncRetCode { var UdpPacket v_ipPkt; v_ipPkt := valueof(p_udpPacket); if(f_setExtensionHeaders( v_ipPkt ) != e_success) { log(" **** f_sendUdp: Error when calculating length of extension headers ****"); return e_error; } //send ipPort.send(v_ipPkt); return e_success; }//end f_sendUdp } // end module LibIpv6_Rfc0768Udp_Functions