Commit 9912300d authored by schmitting's avatar schmitting
Browse files

After 1st IKE session

parent 69c550a5
Loading
Loading
Loading
Loading
+44 −21
Original line number Diff line number Diff line
@@ -77,33 +77,46 @@
		 * @desc TODO
		*/
		type record IkeMsg {
			Oct2		        sourcePort, // TODO: UDP Header
			Oct2		        destPort,
			UInt16		        sourcePort,
			UInt16		        destPort,
			UInt16		        msgLength,																																								
			Oct2		        checksum,
			// IKEv2 Header
			UInt16		        checksum,
			Oct4				padding optional,
			// IKEv2 Header
			Oct8				initiatorSpi,
			Oct8				responderSpi,
			UInt8				nextPayload,
			UInt4				majorVersion,
			UInt4				minorVersion,
			UInt8				exchangeType,
			//UInt8				flags,
			UInt2				twoXFlags,
			UInt1				rFlag,
			UInt1				vFlag,
			UInt1				iFlag,
			UInt3				threeXFlags,
			Oct4				messageID,
			Oct4				messageLength,
			// IKE Payloads
			UInt32				messageID,
			UInt32				messageLength,
			// IKEv2 Payloads
			IkePayloadList		payloadList
		}
		with {
			encode "TODO";
		}

		group IkeRfc4306udpPortTypes {
			const UInt16	c_udpPort500 	:= 500;
			const UInt16	c_udpPort4500 	:= 4500;
		} // end group IkeRfc4306VersionTypes

		group IkeRfc4306SpiTypes {
			const Oct8	c_zeroResponderSpi 	:= '0000000000000000'O;
		} // end group IkeRfc4306SpiTypes

		group IkeRfc4306VersionTypes {
			const UInt4	c_ikeMajorVersion2 	:= 2;
			const UInt4	c_ikeMinorVersion0 	:= 0;
		} // end group IkeRfc4306VersionTypes

		group IkeRfc4306ExchangeTypes {
			const UInt8	c_ikeSaInit 	:= 34;
			const UInt8	c_ikeAuth	 	:= 35;
@@ -111,6 +124,14 @@
			const UInt8	c_informational := 37;
		} // end group IkeRfc4306ExchangeTypes

		group IkeRfc4306FlagsTypes {
			const UInt1	c_rFlagRequest 		:= 0;
			const UInt1	c_rFlagResponse		:= 1;
			const UInt1	c_vFlag		 		:= 0;
			const UInt1	c_iFlagResponder	:= 0;
			const UInt1	c_iFlagInitiator 	:= 1;
		} // end group IkeRfc4306FlagsTypes

 	} //end group ikePackets

	group ikeRfc4306Payloads {
@@ -159,12 +180,12 @@
			encode "TODO";
		}

		const UInt8 c_maxIkePaylods  := 10; //FIXME
		const UInt8 c_maxIkePayloads  := 10; //FIXME

		/*
		 * @desc TODO
		*/
		type set length(1 .. c_maxIkePaylods) of IkePayload IkePayloadList
		type set length(1 .. c_maxIkePayloads) of IkePayload IkePayloadList
		with {
			encode "TODO";
		}
@@ -198,7 +219,7 @@
					UInt8			protocolId,
					UInt8			spiSize,
					UInt8			numberOfTransforms,
					octetstring		spi,
					octetstring		spi optional,
					SaTransformList	saTransformList
				} 
				with {
@@ -260,7 +281,7 @@
					group IkeRfc4306SaTransformAttributes {

						group IkeRfc4306TransformAttributeTypes {
							const UInt15 c_saTransformAttributeKeyLength		:= 14;
							const UInt8	c_saTransformAttributeKeyLength		:= 14;
						} // end group IkeRfc4306TransformAttributeTypes

						/*
@@ -288,9 +309,7 @@
						*/
						type record SaTransformAttributeKeyLength {
							UInt1	attributeFormat(c_attributeFormatTv),
							// TODO (AVF): This is casting of UInt8 to UInt15. It has to be fixed
							// UInt15	attributeType(c_saTransformAttributeKeyLength),
							UInt15	attributeType(14),
							UInt15	attributeType(c_saTransformAttributeKeyLength),
							UInt16	attributeValue		
						} 
						with {
@@ -435,12 +454,15 @@
			/*
			 * @desc Derived from  RFC 4306 Section 3.9
			*/

			type octetstring NonceData length (16 .. 256);

			type record NoncePayload {
				UInt8	  nextPayload,
				UInt1	  criticalFlag,
				UInt7	  reserved,
				UInt16	  payloadLength,
				octetstring		data
				NonceData data
			} 
			with {
				encode "TODO";
@@ -774,4 +796,5 @@

 	} //end group ikeRfc4306Payloads


} // end module LibIpv6_Rfc4306Ikev2_TypesAndValues
 No newline at end of file