Commit 6d220adb authored by seb's avatar seb
Browse files

LibSec added

parent 9301258c
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -403,7 +403,7 @@
		template ExtensionHeader m_extHdr_tunneledHeader(	UInt8 p_nextHdr,
		template ExtensionHeader m_extHdr_tunneledHeader(	UInt8 p_nextHdr,
										template Ipv6Address p_src,
										template Ipv6Address p_src,
										template Ipv6Address p_dst) := {
										template Ipv6Address p_dst) := {
			tunnelIpv6 := {
			tunneledIpv6 := {
				version 		:= c_ipv6Version ,
				version 		:= c_ipv6Version ,
				trafficClass 	:= c_trafficClassZero ,
				trafficClass 	:= c_trafficClassZero ,
				flowLabel 		:= c_flowLabelZero ,
				flowLabel 		:= c_flowLabelZero ,
@@ -425,7 +425,7 @@
		template ExtensionHeader mw_extHdr_tunneledHeader(	UInt8 p_nextHdr,
		template ExtensionHeader mw_extHdr_tunneledHeader(	UInt8 p_nextHdr,
										template Ipv6Address p_src,
										template Ipv6Address p_src,
										template Ipv6Address p_dst) := {
										template Ipv6Address p_dst) := {
			tunnelIpv6 := {
			tunneledIpv6 := {
				version 		:= c_ipv6Version ,
				version 		:= c_ipv6Version ,
				trafficClass 	:= ? ,
				trafficClass 	:= ? ,
				flowLabel 		:= ? ,
				flowLabel 		:= ? ,
+15 −29
Original line number Original line Diff line number Diff line
@@ -14,6 +14,7 @@
	//LibIpv6
	//LibIpv6
	import from LibIpv6_MultiRfcs_TypesAndValues all ;
	import from LibIpv6_MultiRfcs_TypesAndValues all ;



	group commonIpv6Values {
	group commonIpv6Values {
		const UInt4			c_ipv6Version := 6;
		const UInt4			c_ipv6Version := 6;
		//Unspecified address
		//Unspecified address
@@ -98,14 +99,11 @@
			RoutingHeader		routingHeader,
			RoutingHeader		routingHeader,
			FragmentHeader		fragmentHeader,
			FragmentHeader		fragmentHeader,
			DestOptionHeader 	destinationOptionHeader,
			DestOptionHeader 	destinationOptionHeader,
			//tunneledIpv6
			TunneledIpv6Header	tunneledIpv6,
//			Ipv6Header			tunnelIpv6,
			TunneledIpv6Header	tunnelIpv6,
			MipHeader			mipHeader,//defined in LibIpv6_MultiRfcs_TypesAndValues
			MipHeader			mipHeader,//defined in LibIpv6_MultiRfcs_TypesAndValues
			AuthHeader			authHeader, //defined in LibIpv6_MultiRfcs_TypesAndValues
			AuthHeader			authHeader, //defined in LibIpv6_MultiRfcs_TypesAndValues
			EspHeader			espHeader/*, //defined in LibIpv6_MultiRfcs_TypesAndValues
			EspHeader			espHeader //defined in LibIpv6_MultiRfcs_TypesAndValues
			OtherIpv6ExtHdr		otherHeader
		//	OtherIpv6ExtHdr		otherHeader
*/
		} 
		} 
		with {
		with {
			encode "present=isEOF()== false && ((valueOf(dec.getTag('nextHeader'))==0) || (valueOf(dec.getTag('nextHeader'))==43) || (valueOf(dec.getTag('nextHeader'))==44) || (valueOf(dec.getTag('nextHeader'))==60) || (valueOf(dec.getTag('nextHeader'))==51) || (valueOf(dec.getTag('nextHeader'))==50) || (valueOf(dec.getTag('nextHeader'))==41) || (valueOf(dec.getTag('nextHeader'))==135))";
			encode "present=isEOF()== false && ((valueOf(dec.getTag('nextHeader'))==0) || (valueOf(dec.getTag('nextHeader'))==43) || (valueOf(dec.getTag('nextHeader'))==44) || (valueOf(dec.getTag('nextHeader'))==60) || (valueOf(dec.getTag('nextHeader'))==51) || (valueOf(dec.getTag('nextHeader'))==50) || (valueOf(dec.getTag('nextHeader'))==41) || (valueOf(dec.getTag('nextHeader'))==135))";
@@ -188,29 +186,6 @@
			encode (hdrExtLen) "tag='hdrExtLen';intTag='hdrExtIntLen',value*8+8-2;intTag='IPv6Header_payloadLength',getIntTag('IPv6Header_payloadLength')-value*8-8";
			encode (hdrExtLen) "tag='hdrExtLen';intTag='hdrExtIntLen',value*8+8-2;intTag='IPv6Header_payloadLength',getIntTag('IPv6Header_payloadLength')-value*8-8";
		} 
		} 
		
		


		/*
	 * @desc Derived from RFC4303 clause 2. 
	*/
	group espHeader {
		type record EspHeader {
			// Header
			UInt32				securityParametersIndex,
			UInt32				sequenceNumber,		
			// Payload
			octetstring			initializationVector optional,
			ExtensionHeaderList extHdrList optional,
			octetstring			data optional,
			octetstring			trafficFlowConfidentialityPadding optional,
			// Trailer
			octetstring			padding optional,
			UInt8				padLength,
			UInt8				nextHdr,
			octetstring			integrityCheckValue
		}
	}//end group espHeader 		

	} // end extensionHeaders 
	} // end extensionHeaders 
	
	
	group generalIpv6MessageType {
	group generalIpv6MessageType {
@@ -228,6 +203,17 @@
        	encode (data) "length=getIntTag('IPv6Header_payloadLength');";
        	encode (data) "length=getIntTag('IPv6Header_payloadLength');";
        }
        }


		/*
		 * @desc PDU type derived from RFC2460
		*/
		type record GeneralIpv6Payload {
			ExtensionHeaderList extHdrList optional,
			octetstring	data optional
        }
        with {
	        encode "TODO";
        }
        
    } //end group generalIpv6MessageType
    } //end group generalIpv6MessageType


} // end module LibIpv6_Rfc2460Root_TypesAndValues
} // end module LibIpv6_Rfc2460Root_TypesAndValues
+86 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,21 @@
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 144)";
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 144)";
		}
		}


		/*
		 * @desc Used in EspTransportModePacket
		*/
		type record HomeAgentAddressDiscoveryRequestPayload {
			ExtensionHeaderList extHdrList		optional,
			UInt8 			icmpType(c_mipIcmpHomeAgentAddressDiscoveryRequest),
			UInt8 			icmpCode,
			Oct2 			checksum,
			UInt16			identifier,
			UInt16			reserved
		}
		with {
	        encode "TODO";
        }
		
		/*
		/*
		 * @desc Derived from RFC3775, clause 6.6
		 * @desc Derived from RFC3775, clause 6.6
		*/
		*/
@@ -69,6 +84,22 @@
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 145)";
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 145)";
		}
		}


		/*
		 * @desc Used in EspTransportModePacket
		*/
		type record HomeAgentAddressDiscoveryReplyPayload {
			ExtensionHeaderList extHdrList		optional,
			UInt8 			icmpType(c_mipIcmpHomeAgentAddressDiscoveryReply),
			UInt8 			icmpCode,
			Oct2 			checksum,
			UInt16			identifier,
			UInt16			reserved,
			Ipv6AddressList	homeAgentAddresses optional
		}
		with {
	        encode "TODO";
        }

		/*
		/*
		 * @desc Derived from RFC3775, clause 6.7
		 * @desc Derived from RFC3775, clause 6.7
		*/
		*/
@@ -85,6 +116,21 @@
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 146)";
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 146)";
		}
		}


		/*
		 * @desc Used in EspTransportModePacket
		*/
		type record MobilePrefixSolicitationPayload {
			ExtensionHeaderList extHdrList		optional,
			UInt8 			icmpType(c_mipIcmpMobilePrefixSolicitation),
			UInt8 			icmpCode,
			Oct2 			checksum,
			UInt16			identifier,
			UInt16			reserved
		}
		with {
	        encode "TODO";
        }
		
		/*
		/*
		 * @desc   Derived from  RFC3775, clause 6.8
		 * @desc   Derived from  RFC3775, clause 6.8
		 * @remark MipPrefixInfoList type is a modification 
		 * @remark MipPrefixInfoList type is a modification 
@@ -106,6 +152,24 @@
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 147)";
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 147)";
		}
		}


		/*
		 * @desc Used in EspTransportModePacket
		*/
		type record MobilePrefixAdvertisementPayload {
			ExtensionHeaderList extHdrList		optional,
			UInt8 			icmpType(c_mipIcmpMobilePrefixAdvertisement),
			UInt8 			icmpCode,
			Oct2 			checksum,
			UInt16			identifier,
			UInt1			mFlag,
			UInt1			oFlag,
			UInt14			reserved,
			MipPrefixInfoList	mipPrefixInfoList
		}
		with {
	        encode "TODO";
        }
		
		/*
		/*
		 * @desc   Derived from  RFC3775, clause 7.1
		 * @desc   Derived from  RFC3775, clause 7.1
		 * @remark MipRouterAdvertisement type is a modification 
		 * @remark MipRouterAdvertisement type is a modification 
@@ -131,6 +195,28 @@
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 134)";
			encode "isPDU=LibIpv6_Rfc3775MIPv6_TypesAndValues;use=com.testingtech.ttcn.tci.codec.helper.*;present=SupportFunctions.checkHeaderAndType(dec, 58, 134)";
		}
		}


		/*
		 * @desc Used in EspTransportModePacket
		*/
		type record MipRouterAdvertisementPayload {
			ExtensionHeaderList extHdrList		optional,
			UInt8 			icmpType(c_mipRtAdv),
			UInt8 			icmpCode,
			Oct2 			checksum,
			UInt8			curHopLimit,
			UInt1			mFlag,
			UInt1			oFlag,
			UInt1			hFlag,
			UInt5			reserved,
			UInt16			routerLifetime,
			UInt32			reachableTime,
			UInt32			retransTimer,
			MipRtAdvOptions	mipRtAdvOptions optional
		}
		with {
	        encode "TODO";
        }
		


		/*
		/*
		 * @remark At least one of these options shall be present
		 * @remark At least one of these options shall be present
+7 −3
Original line number Original line Diff line number Diff line
@@ -21,6 +21,7 @@ module LibIpv6_Interface {
	import from LibIpv6_Rfc2894RouterRenumbering_TypesAndValues {type all};
	import from LibIpv6_Rfc2894RouterRenumbering_TypesAndValues {type all};
	import from LibIpv6_Rfc3775Mipv6_TypesAndValues {type all};
	import from LibIpv6_Rfc3775Mipv6_TypesAndValues {type all};
	import from LibIpv6_Rfc0768Udp_TypesAndValues all ;
	import from LibIpv6_Rfc0768Udp_TypesAndValues all ;
	import from LibIpv6_Rfc4303Esp_TypesAndValues all;


	/*
	/*
	 * @desc	This type is used to define behavior within the IPv6 library
	 * @desc	This type is used to define behavior within the IPv6 library
@@ -69,7 +70,10 @@ module LibIpv6_Interface {
		//MetaPdu
		//MetaPdu
		Ipv6Packet,
		Ipv6Packet,
		//General IPv6 packet
		//General IPv6 packet
		GeneralIpv6
		GeneralIpv6,
		//EspPackets
		EspTunnelModePacket,
		EspTransportModePacket
	}
	}


	/*
	/*
+2 −2
Original line number Original line Diff line number Diff line
@@ -58,9 +58,9 @@ group extHdrFns {
									p_extHdrList[i].mipHeader);
									p_extHdrList[i].mipHeader);
				}
				}
			}
			}
			else if (ischosen(p_extHdrList[i].tunnelIpv6)) {
			else if (ischosen(p_extHdrList[i].tunneledIpv6)) {
				v_nrOfTunnelHdr := v_nrOfTunnelHdr + 1;
				v_nrOfTunnelHdr := v_nrOfTunnelHdr + 1;
				p_extHdrList[i].tunnelIpv6.payloadLength := fx_tunnelledPayloadLength(p_ipv6Packet, v_nrOfTunnelHdr);
				p_extHdrList[i].tunneledIpv6.payloadLength := fx_tunnelledPayloadLength(p_ipv6Packet, v_nrOfTunnelHdr);
			}
			}
		/*	else if (ischosen(p_extHdrList[i].)) {
		/*	else if (ischosen(p_extHdrList[i].)) {
				f_setSecurityHdr();
				f_setSecurityHdr();
Loading