Skip to content
Snippets Groups Projects
Commit 839711bd authored by schmitting's avatar schmitting
Browse files

RFC3056 finished

parent 5e22c935
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,15 @@ module LibIpv6_CommonRfcs_TypesAndValues {
}//end group rfc4291AddressingArchitecture
group ipv4Address {
//Prefix
const Ipv4Address c_broadcastAddress := 'FFFFFFFF'O; // 255.255.255.255
const Ipv4Address c_multicastAddress := 'E0000001'O; // 224.0.0.1
const Ipv4Address c_loopbackAddress := '7F000001'O; // 127.0.0.1
const Ipv4Address c_privateInternetAddress := 'C0A80101'O; // 192.168.1.1
}//end group ipv4Address
group ipv6Address {
//Prefix
const Oct2 c_llaMcaPrefix := 'FF02'O ;
......
......@@ -158,8 +158,7 @@
/*
* @desc
* This function can be used to verify that the NUT is
* up and running.
* This function sends encapsulated EReq and waits for encapsulated reply.
* @remark Time limit is defined by module parameter PX_TAC (see comp type)
* @param p_relRtAnycastAddr IPv4 address of relay router
* @param p_ipv4TnAddr IPv4 address of testing node which calls this function
......@@ -168,11 +167,66 @@
* @param p_ipv6NutAddr IPv6 address of Ping end
* @return execution status
*/
function f_receive6to4RtAdv(
in template Ipv6Address p_addrIut,
out RouterAdvertisement p_rtAdv
function f_relayRouterSendsEReq_4(
in template Ipv4Address p_relRtAnycastAddr,
in template Ipv4Address p_ipv4NutAddr,
in template Ipv6Address p_ipv6RelRt01Addr,
in template Ipv6Address p_ipv6Hs02Addr
)
runs on LibIpv6Node
return FncRetCode {
var FncRetCode v_ret := e_error;
v_ret := f_sendIpv4Packet (
m_ipv4Packet_tunneledIpv6 (
p_relRtAnycastAddr,
p_ipv4NutAddr,
m_echoRequest_noExtHdr_noData (
p_ipv6RelRt01Addr,
p_ipv6Hs02Addr,
c_defId,
c_defSeqNo
)
)
);
if(v_ret != e_success) {
log("**** f_relayRouterSendsEReq_4: Error: Problem in f_sendIpv4Packet. ****");
} tc_ac.start;
alt{
[] ipv4Port.receive(mw_ipv4Packet_tunneledIpv6 (
p_ipv4NutAddr,
p_relRtAnycastAddr,
mw_echoReply_noExtHdr_noData (
p_ipv6Hs02Addr,
p_ipv6RelRt01Addr,
c_defId,
c_defSeqNo
)
)) {
tc_ac.stop;
}
[] tc_ac.timeout {
log("**** f_relayRouterSendsEReq_4: Timeout tc_ac: Expected message not received. ****");
return e_timeout;
}
}//end alt
return v_ret;
}//end f_relayRouterSendsEReq_4
/*
* @desc
* This function can be used to wait for router advertisement.
* @remark Time limit is defined by module parameter PX_TAC (see comp type)
* @param p_addrIut Address of IUT
* @return execution status
*/
function f_receive6to4RtAdv(
in template Ipv6Address p_addrIut
)
runs on LibIpv6Node
return FncRetCode {
var FncRetCode v_ret;
var float v_raDelay;
......@@ -181,7 +235,8 @@
alt {
[] ipPort.receive ( mw_rtAdv_noExtHdr (
p_addrIut,
c_allNodesMca ) ) -> value p_rtAdv {
c_allNodesMca ) )
{
tc_ac.stop;
return e_success;
}
......@@ -192,4 +247,137 @@
}//end f_receive6to4RtAdv
/*
* @desc
* This function is used to verify that the NUT does
* NOT encapsulate and send an IPv6 packet.
* @remark Time limit is defined by module parameter PX_TAC (see comp type)
* @param p_relRtAnycastAddr IPv4 address of relay router
* @param p_ipv4NutAddr IPv4 address of node under test
* @return execution status
*/
function f_receiveNoEncapsulatedIPv6Packet(
in template Ipv4Address p_relRtAnycastAddr,
in template Ipv4Address p_ipv4NutAddr
)
runs on LibIpv6Node
return FncRetCode {
var FncRetCode v_ret := e_error;
tc_ac.start;
alt{
[] ipv4Port.receive(mw_ipv4Packet_tunneledIpv6 (
p_ipv4NutAddr,
p_relRtAnycastAddr,
?
)) {
tc_ac.stop;
log("**** f_receiveNoEncapsulatedIPv6Packet: Unexpected message received. ****");
return v_ret;
}
[] tc_ac.timeout {
return e_success;
}
}//end alt
}//end f_receiveNoEncapsulatedIPv6Packet
/*
* @desc This checks that no decapsulated Echo Request is received.
* @remark Time limit is defined by module parameter PX_TAC (see comp type)
* @param p_llaAddrTn Local link address of testing node which calls this function
* @param p_llaAddrNut Local link address of node under test
* @param p_identifier Idenitifier to be used in ICMPv6 echo request
* @param p_seqNo Sequence number to be used in ICMPv6 echo request
* @return execution status
*/
function f_receiveNoDecapsulatedIPv6Packet(
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;
tc_ac.start;
alt {
[] ipPort.receive(mw_echoRequest ( p_llaAddrNut,
p_llaAddrTn )) {
tc_ac.stop;
log("**** f_receiveNoDecapsulatedIPv6Packet: Unexpected message received. ****");
return v_ret;
}
[] tc_ac.timeout{
return e_success;
}
} // end alt
} // end f_receiveNoDecapsulatedIPv6Packet
/*
* @desc This function sends encapsulated EReq with wrong IPv4 portion of encapsulated
* IPv6 address and checks that there is no encapsulated reply.
* @remark Time limit is defined by module parameter PX_TAC (see comp type)
* @param p_relRtAnycastAddr IPv4 address of relay router
* @param p_ipv4TnAddr IPv4 address of testing node which calls this function
* @param p_ipv4NutAddr IPv4 address of node under test
* @param p_ipv6TnAddr IPv6 address of Ping start
* @param p_ipv6NutAddr IPv6 address of Ping end
* @return execution status
*/
function f_receiveNoEncapsulatedAnswer_4(
in template Ipv4Address p_relRtAnycastAddr,
in template Ipv4Address p_ipv4NutAddr,
in template Ipv6Address p_ipv6RelRt01Addr,
in template Ipv6Address p_ipv6Hs02Addr
)
runs on LibIpv6Node
return FncRetCode {
var FncRetCode v_ret := e_error;
v_ret := f_sendIpv4Packet (
m_ipv4Packet_tunneledIpv6 (
p_relRtAnycastAddr,
p_ipv4NutAddr,
m_echoRequest_noExtHdr_noData (
p_ipv6RelRt01Addr,
p_ipv6Hs02Addr,
c_defId,
c_defSeqNo
)
)
);
if(v_ret != e_success) {
log("**** f_receiveNoEncapsulatedAnswer_4: Error: Problem in f_sendIpv4Packet. ****");
}
tc_ac.start;
alt{
[] ipv4Port.receive(mw_ipv4Packet_tunneledIpv6 (
p_ipv4NutAddr,
p_relRtAnycastAddr,
mw_echoReply_noExtHdr_noData (
p_ipv6Hs02Addr,
p_ipv6RelRt01Addr,
c_defId,
c_defSeqNo
)
)) {
tc_ac.stop;
log("**** f_receiveNoEncapsulatedAnswer_4: Unexpected message received. ****");
return v_ret;
}
[] tc_ac.timeout {
return e_success;
}
}//end alt
return v_ret;
}//end f_receiveNoEncapsulatedAnswer_4
} // end module LibIpv6_CommonTrans_Functions
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment