Commit 0f2f3eeb authored by seb's avatar seb
Browse files

Sniff&Drive MIP TC added

parent ce862558
Loading
Loading
Loading
Loading
+49 −0
Original line number Original line Diff line number Diff line
@@ -335,6 +335,55 @@


	} // end f_replyToEchoRequest
	} // end f_replyToEchoRequest


	function f_replyToEchoRequest_DS(in  template Ipv6Address 	p_llaAddrTn,
								  in  template Ipv6Address 	p_llaAddrNut,
								  in  UInt16 		p_identifier,
								  in  UInt16		p_seqNo )
	runs on LibIpv6Node
	return FncRetCode {

		var FncRetCode v_ret := e_error;

		var EchoRequest echoRequest;
		
		tc_ac.start;
		alt {
			[]	ipPort.receive(mw_echoRequest ( 	p_llaAddrNut,
												p_llaAddrTn )) -> value echoRequest {
					tc_ac.stop;	
					v_ret := e_success;
				}
			[]	tc_ac.timeout{
					return e_timeout;
				}		
		} // end alt

//		v_ret := f_sendEchoReply( m_echoReply_noExtHdr_data( p_llaAddrTn,
//															p_llaAddrNut,
//															p_identifier,
//															p_seqNo,
//															echoRequest.data ));
		
		tc_ac.start;
		alt {
			[]	ipPort.receive(mw_echoReply_noExtHdr_data ( 
									p_llaAddrTn,
									p_llaAddrNut,
									p_identifier,
									p_seqNo,
									echoRequest.data)) {
					tc_ac.stop;	
					v_ret := e_success;
				}
			[]	tc_ac.timeout{
					return e_timeout;
				}		
		} // end alt
		
		return v_ret ;

	} // end f_replyToEchoRequest_DS



	
	
	/*
	/*
+82 −0
Original line number Original line Diff line number Diff line
@@ -346,6 +346,64 @@ module LibIpv6_Rfc3775Mipv6_Functions {


	}//end f_waitForHomeTestInitAndReply
	}//end f_waitForHomeTestInitAndReply


	/*
	 * @desc  Test Node waits for Home Test Init and replies with Home Test
 	 * @param p_glaCn Global Address of CN (test node 2)
	 * @param p_mnHoa Mobile Node Home Address of test node 1
	*/
	function f_waitForHomeTestInitAndReply_DS(	in template Ipv6Address p_glaCn,
											in template Ipv6Address p_mnHoa)
	runs on Ipv6Node
	return FncRetCode {
		var FncRetCode v_ret;

		tc_wait.start;
		alt {
			[]	ipPort.receive(mw_generalIpv6_srcDst(	c_mipHdr,
												p_mnHoa,
												p_glaCn,
												m_extHdrList_1Elem( mw_extHdr_mipHeader (	c_noNextHdr,
																							c_homeTestInit,
																							mw_hoti)))) {
					tc_wait.stop;	
					v_ret := e_success ;
				}
			[]	tc_wait.timeout{
					v_ret :=  e_timeout;
					log("**** f_waitForHomeTestInitAndReply: ERROR: tc_ac.timeout **** ");
					return v_ret;
				}		
		} // end alt

//		v_ret := f_sendGeneralIpv6(m_generalIpv6_srcDst (c_mipHdr,
//											p_glaCn,
//											p_mnHoa,
//											m_extHdrList_1Elem( m_extHdr_mipHeader (	c_noNextHdr,
//																						c_homeTest,
//																						m_hot))));
		tc_wait.start;
		alt {
			[]	ipPort.receive(mw_generalIpv6_srcDst(
									c_mipHdr,
									p_glaCn,
									p_mnHoa,
									m_extHdrList_1Elem( mw_extHdr_mipHeader (	c_noNextHdr,
																				c_homeTest,
																				mw_hot)))) {
					tc_wait.stop;	
					v_ret := e_success ;
				}
			[]	tc_wait.timeout{
					v_ret :=  e_timeout;
					log("**** f_waitForHomeTestInitAndReply: ERROR: tc_ac.timeout **** ");
					return v_ret;
				}		
		} // end alt

		return v_ret;

	}//end f_waitForHomeTestInitAndReply_DS

	/*
	/*
	 * @desc  Test Node sends Home Test Init and waits for Home Test
	 * @desc  Test Node sends Home Test Init and waits for Home Test
	 * @param p_mnCoa Mobile Node Care of Address of test node 1
	 * @param p_mnCoa Mobile Node Care of Address of test node 1
@@ -797,6 +855,30 @@ module LibIpv6_Rfc3775Mipv6_Functions {
		return v_ret;
		return v_ret;
	}//end function f_cn_ha_null2ReverseTunneling
	}//end function f_cn_ha_null2ReverseTunneling


	/*
	 * @desc  Null to Reverse Tunneling (HA = IUT) on HA's interface towards CN
 	 * @param p_glaCnTn Global Address of test node
	 * @param p_mnHoaTn Home Agent Addresses of test node
	 */
	function f_cn_ha_null2ReverseTunneling_DS(	in template Ipv6Address p_glaCnTn,
											in template Ipv6Address p_mnHoaTn)
	runs on Ipv6Node
	return FncRetCode {
		//Variables
		var FncRetCode v_ret := e_success;

		v_ret := f_waitForHomeTestInitAndReply_DS(	p_glaCnTn,
												p_mnHoaTn);
		if(v_ret == e_success) {
			v_ret := f_replyToEchoRequest_DS(	p_glaCnTn,
											p_mnHoaTn,
											c_defId, 
											c_defSeqNo);
		}
		return v_ret;
	}//end function f_cn_ha_null2ReverseTunneling_DS

	
	}//end group statefulMipFns
	}//end group statefulMipFns