Commit 2c133c70 authored by peter's avatar peter
Browse files

No commit message

No commit message
parent f3b9483a
Loading
Loading
Loading
Loading
+35 −3
Original line number Diff line number Diff line
@@ -153,7 +153,6 @@
	 * @desc 	This goes through the ExtensionHeaderList and
	 *			checks if a Routing Header type 2 is present.
	 * @param 	p_extHdrList ExtensionHeaderList to be treated
	 * @param 	p_homeAddr Home address
	 * @return 	execution status 
	*/
	function f_isPresentRoutingHeaderType2(	in ExtensionHeaderList p_extHdrList,
@@ -176,6 +175,39 @@
		return v_ret;
	}//end function f_isPresentRoutingHeaderType2

	/*
	 * @desc 	This goes through the ExtensionHeaderList and
	 *			checks if a Binding Authority Data option is present.
	 * @param 	p_extHdrList ExtensionHeaderList to be treated
	 * @return 	execution status 
	*/
	function f_isPresentBindingAuthorityDataOption ( in ExtensionHeaderList p_extHdrList )

	runs on LibIpv6Node
	return FncRetCode {
		var FncRetCode v_ret := e_error;
		var UInt8 i,j;

		//select ext hdrs that need special calculation
		for ( i := 0; i < sizeof ( p_extHdrList ) and ( v_ret != e_success ); i := i + 1 ) {
			if ( ischosen ( p_extHdrList[i].mipHeader )  ) {
				if ( ischosen ( p_extHdrList[i].mipHeader.mipMessage.bindingAck ) ) {
					for ( j := 0; j < sizeof ( p_extHdrList[i].mipHeader.mipMessage.bindingAck.mipOptions ); j := j + 1 ) {
						if ( ischosen ( p_extHdrList[i].mipHeader.mipMessage.bindingAck.mipOptions[j].mipBindingAuthorizationData ) == true ) {
							v_ret := e_success;
						}
					}
				}
			}
		}

		if ( v_ret == e_error ) {
			log ( "**** f_isPresentBindingAuthorityDataOption: ERROR: Binding Authentication Data option is not present in Binding Ack **** " );
		}

		return v_ret;

	}//end function f_isPresentRoutingHeaderType2

} // end module LibIpv6_CommonRfcs_Functions
	
+3 −0
Original line number Diff line number Diff line
@@ -234,6 +234,9 @@ module LibIpv6_CommonRfcs_TypesAndValues {
	
		group rfc3775Options {

			const octetstring		c_preDefAIOption := '0101000000001000'O;
			const octetstring		c_preDefHAIOption := '0801000000000040'O;

			/*
			 * @desc  Extra ICMP option introduced by RFC3775, clause 7.3
			*/
+5 −2
Original line number Diff line number Diff line
@@ -196,12 +196,15 @@ group rfc3775Mipv6_ExtHdrFunctions {
		//}
		//calc mipHeaderLen
		p_mipHeader.headerLen := fx_mipHeaderLength(p_mipHeader);

// modified by PK to easily send packets with wrong checksum
		//set mipChecksum to zero
		p_mipHeader.checksum := c_2ZeroBytes;  
		//p_mipHeader.checksum := c_2ZeroBytes;  
		//calc mipChecksum
		p_mipHeader.checksum := fx_mipHeaderChecksum ( p_srcAddr,
														p_dstAddr,
														p_mipHeader);

		return e_success;
	}
		
+56 −2
Original line number Diff line number Diff line
@@ -669,6 +669,21 @@ group rfc3775Mipv6_ExtHdrTemplates {
			}
		}

// Added by PK
		template MipMessage mw_bindingAck_statusSN (
			template UInt8 p_status,
			UInt16 p_seqNr
		) := {	
			bindingAck := {
				status := p_status,
				kFlag := ?,
				reserved := ?,
				sequenceNumber := p_seqNr,
				lifeTime := ?,		
				mipOptions := ?
			}
		}

		template MipMessage mw_bindingError := {	
			bindingError := {
				status := ?,
@@ -678,6 +693,15 @@ group rfc3775Mipv6_ExtHdrTemplates {
			}	
		}

		template MipMessage mw_bindingError_statusHome ( UInt8 p_status, template Ipv6Address p_homeAddress ) := {
			bindingError := {
				status := p_status,
				reserved := ?,
				homeAddress := p_homeAddress,		
				mipOptions := *
			}	
		}

		template MipMessage m_hot(	UInt16 p_homeNonceIndex,
									Bit64 p_homeInitCookie,
									Bit64 p_homeKeygenToken) := {	
@@ -761,6 +785,21 @@ group rfc3775Mipv6_ExtHdrTemplates {
			p_mipOpt1, p_mipOpt2
		}

		/*
		 *	@param  p_mipOpt1 1st element in the MipOption list
		 *	@param  p_mipOpt2 2nd element in the MipOption list
		 *	@param  p_mipOpt3 3rd element in the MipOption list
		*/
		template MipOptionList m_mipOptList_3Elem (
			template MipOption p_mipOpt1,
			template MipOption p_mipOpt2,
			template MipOption p_mipOpt3
		) := {
			p_mipOpt1,
			p_mipOpt2,
			p_mipOpt3
		}

		/*
		 *	@param  p_mipOpt1 1st element in the MipOption list
		 *	@param  p_mipOpt2 2nd element in the MipOption list
@@ -848,6 +887,21 @@ group rfc3775Mipv6_ExtHdrTemplates {
			}
		}

		template ExtensionHeader m_extHdr_mipHeader_nonZeroChecksum (
			UInt8 p_payloadProtocol,
			UInt8 p_mobilityHeaderType,
			template MipMessage p_mipMessage
		) := {
			mipHeader := {
				payloadProtocol := p_payloadProtocol,
				headerLen := c_uInt8Zero,
				mobilityHeaderType := p_mobilityHeaderType,  
				reserved := c_uInt8Zero,           
				checksum := '1111'O,     
				mipMessage := p_mipMessage
			}
		}

		template ExtensionHeader mw_extHdr_mipHeader ( 	UInt8 p_payloadProtocol,
														UInt8 p_mobilityHeaderType,
														template MipMessage p_mipMessage) := {
+12 −4
Original line number Diff line number Diff line
@@ -696,11 +696,11 @@ group rfc3775Mipv6_ExtHdrTypesAndValues {
		}

		
		group statusCodesValues { 
			/*
			*  @desc This values should be used in BindingAcknowledgement 
			*        messages 
			*/
		group statusCodesValues { 
			const UInt8 c_mipCodeBindingUpdateAccepted := 0;
			const UInt8 c_mipCodeAcceptedButPrefixDiscoveryNecessary := 1;
			const UInt8 c_mipCodeReasonUnspecified := 128;
@@ -715,6 +715,14 @@ group rfc3775Mipv6_ExtHdrTypesAndValues {
			const UInt8 c_mipCodeExpiredCareofNonceIndex := 137;
			const UInt8 c_mipCodeExpiredNonces := 138;
			const UInt8 c_mipCodeRegistrationTypeChangeDisallowed := 139;

			/*
			*  @desc This values should be used in BindingError
			*        messages 
			*/
			const UInt8 c_mipCodeUnknownBindingForHomeAddressDestinationOption := 1;
			const UInt8 c_mipCodeUnrecognizedMHTypeValue := 2;

		}	//end group statusCodesValues
		
	}//end 	group mipConstants