Commit 4432db42 authored by berge's avatar berge
Browse files

Removed useless commented code and some pieces of code that were redundant...

Removed useless commented code and some pieces of code that were redundant with f_setExtensionHdrs().
parent 406d3605
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -415,21 +415,6 @@ group ipSecFns {
		
		var FncRetCode v_ret := e_success;

		//IKE

		//smu 2007 to do once alogs are aligned 
//		if( f_checkEncryptionKeyLen(PX_IKE_ENCALGO,lengthof(PX_IKE_ENC_KEY)) != true) {
//			log("**** f_init_ipSecParams: ERROR: Incorrect key length for the selected encryption algorithm ****");
//			return e_error;
//		}

//		if( f_checkIntegrityKeyLen(PX_INTEGRITY_ALGO, lengthof(PX_INTEGRITY_KEY)) != true) {
//			log("**** f_init_ipSecParams: ERROR: Incorrect key length for the selected integrity algorithm ****");
//			return e_error;
//		}

		//smu 2007 add check for prf

		if (PX_IPSEC_CONTROL == e_manualSecParamsSetup ) {	
	
			//ESP - AH
+5 −5
Original line number Diff line number Diff line
@@ -1084,11 +1084,11 @@ group rfc3775Mipv6_ExtHdrFunctions {

group rfc4303Esp_ExtHdrFunctions {
	
	//smu 2007 what is this fns doing. log is not updated
	/*
	 * @desc 	
	 *			This function is used when sending messages.
	 * @param 	p_msg ExtensionHeaderList to be treated	
	 * @desc 	Rebuild original packet from an ESP packet (removes ESP encapsulation)
	 * @param 	p_ipv6Packet complete packet containing ESP Header to be processed
	 * @param   p_espHeader ESP Header to be processed
	 * @param   p_originalIpv6Packet retrieved original packet 
	 * @return 	execution status 
	*/
	function f_getOriginalIpv6Packet(	in Ipv6Packet p_ipv6Packet,
@@ -1101,7 +1101,7 @@ group rfc4303Esp_ExtHdrFunctions {

		if (not(ispresent(p_espHeader.espPayload.espIpDatagram.extHdrList))
			and not(ispresent(p_espHeader.espPayload.espIpDatagram.ipv6Payload))) {
				log("**** f_setEspHeader: EspHeader.espPayload.espIpDatagram received that does neither contain extHdrList not ipv6Payload => EspHeader is not constructed correctly ****")	;			
				log("**** f_getOriginalIpv6Packet: EspHeader.espPayload.espIpDatagram received that does neither contain extHdrList not ipv6Payload => EspHeader is not constructed correctly ****")	;			
				return e_error;
		}

+1 −60
Original line number Diff line number Diff line
@@ -904,27 +904,6 @@ group sendRequests {
		var IkeSaInitRequest v_ipPkt := valueof(p_ikeSaInitRequest);
		var FncRetCode v_ret := e_error;

		if (ispresent(v_ipPkt.ipv6Payload)) {
			if (ischosen(v_ipPkt.ipv6Payload.ikeMsg)) {

				//smu 2007: to be moved to setExtensionHdrs?

				//Done in templates
				//Length of SA in octets
				//Length in octets of this proposal, including all transforms and attributes that follow.
				//Length in octets of the Transform including Header and Attributes
				//v_ret := f_getSAandCalcLen(v_ipPkt.ipv6Payload.ikeMsg.payloadList);
			
				//Length in octets of IKEv2 header + payloads in octets
				//v_ipPkt.ipv6Payload.ikeMsg.ikev2Header.messageLength := 
				//lengthof(fx_ikev2HeaderToOct(v_ipPkt.ipv6Payload.ikeMsg.ikev2Header))
				//+ lengthof(fx_ikePayloadListToOct(v_ipPkt.ipv6Payload.ikeMsg.payloadList));

				//Length in octets of this UDP packet, done in setExtensionHdr
				//Checksum of UDPpacket, done in setExtensionHdr
			}
		}

		if(f_setExtensionHeaders(	v_ipPkt,
									v_ipPkt.ipv6Hdr.sourceAddress,
									v_ipPkt.ipv6Hdr.destinationAddress) != e_success) {
@@ -953,28 +932,6 @@ group sendRequests {
		//encryptedPL is to be filled out by test adapter
		fx_setIkeSecurityParameters(vc_ikeSad[0]);

		if (ispresent(v_ipPkt.ipv6Payload)) {
			if (ischosen(v_ipPkt.ipv6Payload.ikeMsg)) {

				//smu 2007: to be moved to setExtensionHdrs?

				//Length of SA in octets
				//Length in octets of this proposal, including all transforms and attributes that follow.
				//Length in octets of the Transform including Header and Attributes
				//v_ret := f_getSAandCalcLen(v_ipPkt.ipv6Payload.ikeMsg.payloadList);

				//use fx_ikeEncPayloadLength
			
				//Length in octets of IKEv2 header + payloads in octets
				v_ipPkt.ipv6Payload.ikeMsg.ikev2Header.messageLength := 
				lengthof(fx_ikev2HeaderToOct(v_ipPkt.ipv6Payload.ikeMsg.ikev2Header));
				//+ lengthof(fx_ikePayloadListToOct(v_ipPkt.ipv6Payload.ikeMsg.payloadList));

				//Length in octets of this UDP packet, done in setExtensionHdr
				//Checksum of UDPpacket, done in setExtensionHdr
			}
		}

		if(f_setExtensionHeaders(	v_ipPkt,
									v_ipPkt.ipv6Hdr.sourceAddress,
									v_ipPkt.ipv6Hdr.destinationAddress) != e_success) {
@@ -1002,23 +959,7 @@ group sendRequests {
	return FncRetCode {
		var IkeSaInitResponse v_ipPkt;
		v_ipPkt := valueof(p_IkeSaInitres);
		//set Extension Header
		//smu 2007 update it
/*		if (ispresent(v_ipPkt.extHdrList)) {
			if(f_setExtensionHeaders(	v_ipPkt.extHdrList,
										v_ipPkt.ipv6Hdr.sourceAddress,
										v_ipPkt.ipv6Hdr.destinationAddress,
										v_ipPkt) != e_success) {
				log(" **** f_sendHaAddrDreq: Error when calculating length of extension headers ****");
				return e_error;
			}
		}*/
		//calc payloadLen
	//	v_ipPkt.ipv6Hdr.payloadLength := fx_payloadLength (v_ipPkt);
		//set checksum to zero
	//	v_ipPkt.ipv6Payload.homeAgentAddrDiscRequestMsg.checksum := c_2ZeroBytes;
		//calc checksum
	//	v_ipPkt.ipv6Payload.homeAgentAddrDiscRequestMsg.checksum := fx_calcPayloadChecksum(v_ipPkt.ipv6Hdr.sourceAddress, v_ipPkt.ipv6Hdr.destinationAddress, v_ipPkt.ipv6Payload);

		//send
		ipPort.send(v_ipPkt);