Commit b9ea1753 authored by tepelmann's avatar tepelmann
Browse files

Added Ipv4 specific implementations and modifications in ttcn3 variants,...

Added Ipv4 specific implementations and modifications in ttcn3 variants, external function implementation, test adaptation, etc.
parent dbc77ae5
Loading
Loading
Loading
Loading
+30 −26
Original line number Diff line number Diff line
@@ -168,96 +168,96 @@ module LibIpv6_Interface_TypesAndValues {
			Ipv6Payload			ipv6Payload optional
		}
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;";
			variant "isPDU;present=bits(4,6);use=com.testingtech.ttcn.tci.codec.helper.*;";
			variant (extHdrList) "fieldPresent=SupportFunctions.isExtensionHeader(valueOf(getTag('nextHeader')));";
		}
	
		type Ipv6Packet DestinationUnreachable
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 1)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 1)";
		}
		
		type Ipv6Packet PacketTooBig
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 2)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 2)";
		}

		type Ipv6Packet TimeExceeded
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 3)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 3)";
		}

		type Ipv6Packet ParameterProblem
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 4)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 4)";
		}
		
		type Ipv6Packet EchoRequest
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 128)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 128)";
		}

		type Ipv6Packet EchoReply
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 129)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 129)";
		}

		//Imported from Rfc 2461
		type Ipv6Packet RouterAdvertisement
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 134)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 134)";
		}

		type Ipv6Packet RouterSolicitation
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 133)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 133)";
		}

		type Ipv6Packet NeighborSolicitation
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 135)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 135)";
		}

		type Ipv6Packet NeighborAdvertisement
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 136)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 136)";
		}

		type Ipv6Packet Redirect
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 137)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 137)";
		}

		//Imported from Rfc 2894
		type Ipv6Packet RouterRenumbering
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 138)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 138)";
		}

		//Imported from Rfc 3775 Mipv6
		type Ipv6Packet HomeAgentAddressDiscoveryRequest
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 144)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 144)";
		}

		type Ipv6Packet HomeAgentAddressDiscoveryReply
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 145)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 145)";
		}

		type Ipv6Packet MobilePrefixSolicitation
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 146)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 146)";
		}

		type Ipv6Packet MobilePrefixAdvertisement
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 147)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 147)";
		}

		type Ipv6Packet MipRouterAdvertisement
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 134)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndType(dec, 58, 134)";
		}

		type Ipv6Packet BindingRefreshRequest
@@ -319,22 +319,22 @@ module LibIpv6_Interface_TypesAndValues {
		//Imported from Rfc 4068
		type Ipv6Packet RouterSolicitationForProxyRtAdv
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 2)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 2)";
		}

		type Ipv6Packet ProxyRouterAdvertisement
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 3)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 3)";
		}

		type Ipv6Packet HandoverInitiate
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 4)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 4)";
		}

		type Ipv6Packet HandoverAcknowledge
		with {
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 5)";
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,6)&&SupportFunctions.checkHeaderAndTypeAndSubtype(dec, 58, 150, 5)";
		}

		//Default value
@@ -1165,17 +1165,18 @@ group ipv4Definitions {
			Ipv4Payload			ipv4Payload optional
		}
		with {
			variant"";//TODO DT MAY 2007
			variant "isPDU;present=bits(4,4)";
			variant (ipv4Payload) "fieldPresent=getIntTag('payloadLength')>0";
		}

		type Ipv4Packet Ipv4EchoRequest
		with {
			variant"";//TODO DT MAY 2007
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,8)";
		}

		type Ipv4Packet Ipv4EchoReply
		with {
			variant"";//TODO DT MAY 2007
			variant "isPDU;use=com.testingtech.ttcn.tci.codec.helper.*;present=bits(4,4)&&SupportFunctions.checkIpv4ICMPAndType(dec,1,0)";
		}

	}//end ipv4Packets
@@ -1207,7 +1208,10 @@ group ipv4Definitions {
			octetstring		ipv4HdrOptions optional
		}
		with {
		 variant"";//TODO DT MAY 2007
		 variant (headerLength) "intTag='Ipv4HeaderLength'";
		 variant (totalLength) "intTag='payloadLength',value-getIntTag('Ipv4HeaderLength')*4";
		 variant (protocol) "intTag='protocol'";
		 variant (ipv4HdrOptions) "fieldPresent=getIntTag('Ipv4HeaderLength')>5;length=(getIntTag('Ipv4HeaderLength')-5)*4";
		}

	} // end ipv4Header
+6 −4
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@

	group constants {
		const UInt8 	c_ipv4IcmpCode0 := 0 ;
		const UInt8 	c_icmpType_ipv4EReq := 0;
		const UInt8 	c_icmpType_ipv4ERep := 8;
		const UInt8 	c_icmpType_ipv4EReq := 8;
		const UInt8 	c_icmpType_ipv4ERep := 0;
	}

 	group icmpMsgs {
@@ -37,7 +37,8 @@
			octetstring	data optional
		}
		with {
			variant"";//TODO DT MAY 2007
			variant "present=getIntTag('protocol')==1";
			variant (data) "fieldPresent=(getIntTag('payloadLength')-8)>0;length=getIntTag('payloadLength')-8"
		}
	
		/*
@@ -52,7 +53,8 @@
			octetstring	data optional
		}
		with {
			variant"";//TODO DT MAY 2007
			variant "present=getIntTag('protocol')==1";
			variant (data) "fieldPresent=(getIntTag('payloadLength')-8)>0;length=getIntTag('payloadLength')-8"
		}

	} // end icmpMsgs