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 Original line Diff line number Diff line
@@ -168,96 +168,96 @@ module LibIpv6_Interface_TypesAndValues {
			Ipv6Payload			ipv6Payload optional
			Ipv6Payload			ipv6Payload optional
		}
		}
		with {
		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')));";
			variant (extHdrList) "fieldPresent=SupportFunctions.isExtensionHeader(valueOf(getTag('nextHeader')));";
		}
		}
	
	
		type Ipv6Packet DestinationUnreachable
		type Ipv6Packet DestinationUnreachable
		with {
		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
		type Ipv6Packet PacketTooBig
		with {
		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
		type Ipv6Packet TimeExceeded
		with {
		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
		type Ipv6Packet ParameterProblem
		with {
		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
		type Ipv6Packet EchoRequest
		with {
		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
		type Ipv6Packet EchoReply
		with {
		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
		//Imported from Rfc 2461
		type Ipv6Packet RouterAdvertisement
		type Ipv6Packet RouterAdvertisement
		with {
		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
		type Ipv6Packet RouterSolicitation
		with {
		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
		type Ipv6Packet NeighborSolicitation
		with {
		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
		type Ipv6Packet NeighborAdvertisement
		with {
		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
		type Ipv6Packet Redirect
		with {
		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
		//Imported from Rfc 2894
		type Ipv6Packet RouterRenumbering
		type Ipv6Packet RouterRenumbering
		with {
		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
		//Imported from Rfc 3775 Mipv6
		type Ipv6Packet HomeAgentAddressDiscoveryRequest
		type Ipv6Packet HomeAgentAddressDiscoveryRequest
		with {
		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
		type Ipv6Packet HomeAgentAddressDiscoveryReply
		with {
		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
		type Ipv6Packet MobilePrefixSolicitation
		with {
		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
		type Ipv6Packet MobilePrefixAdvertisement
		with {
		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
		type Ipv6Packet MipRouterAdvertisement
		with {
		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
		type Ipv6Packet BindingRefreshRequest
@@ -319,22 +319,22 @@ module LibIpv6_Interface_TypesAndValues {
		//Imported from Rfc 4068
		//Imported from Rfc 4068
		type Ipv6Packet RouterSolicitationForProxyRtAdv
		type Ipv6Packet RouterSolicitationForProxyRtAdv
		with {
		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
		type Ipv6Packet ProxyRouterAdvertisement
		with {
		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
		type Ipv6Packet HandoverInitiate
		with {
		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
		type Ipv6Packet HandoverAcknowledge
		with {
		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
		//Default value
@@ -1165,17 +1165,18 @@ group ipv4Definitions {
			Ipv4Payload			ipv4Payload optional
			Ipv4Payload			ipv4Payload optional
		}
		}
		with {
		with {
			variant"";//TODO DT MAY 2007
			variant "isPDU;present=bits(4,4)";
			variant (ipv4Payload) "fieldPresent=getIntTag('payloadLength')>0";
		}
		}


		type Ipv4Packet Ipv4EchoRequest
		type Ipv4Packet Ipv4EchoRequest
		with {
		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
		type Ipv4Packet Ipv4EchoReply
		with {
		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
	}//end ipv4Packets
@@ -1207,7 +1208,10 @@ group ipv4Definitions {
			octetstring		ipv4HdrOptions optional
			octetstring		ipv4HdrOptions optional
		}
		}
		with {
		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
	} // end ipv4Header
+6 −4
Original line number Original line Diff line number Diff line
@@ -19,8 +19,8 @@


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


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


	} // end icmpMsgs
	} // end icmpMsgs