//
// $Copyright$
//
// $Id: packet_too_big.def,v 1.1.1.1 2000/09/28 00:14:46 sekiya Exp $


#define OFFLINK_GLOBAL_ADDRESS v6merge(   OFFLINK_GLOBAL_UCAST_PRFX, \
                GLOBAL_UCAST_PRFXLEN, \
                v6(_GLOBAL9A1N_UCAST_ADDR))

#define OFFLINK_GLOBAL_ADDRESS_2 v6merge(   OFFLINK_GLOBAL_UCAST_PRFX, \
                GLOBAL_UCAST_PRFXLEN, \
                v6(_GLOBAL9A2N_UCAST_ADDR))
//////////////////////////////////////////////////////////////


//
// OFFLINK_GLOBAL_ADDRESS		Off-Link host's Global Address
// TN_GLOBAL_ADDRESS   			TN's Global Address
//

// Prefix
#define OFFLINK_GLOBAL_UCAST_PRFX _GLOBAL9_UCAST_PRFX
#define OFFLINK_LINK1_GLOBAL_UCAST_PRFX _GLOBAL8_UCAST_PRFX
#define TN_GLOBAL_UCAST_PRFX _GLOBAL0_UCAST_PRFX
#define NUT_GLOBAL_UCAST_PRFX _GLOBAL0_UCAST_PRFX
#define TN_LINK1_GLOBAL_UCAST_PRFX _GLOBAL1_UCAST_PRFX
#define NUT_LINK1_GLOBAL_UCAST_PRFX _GLOBAL1_UCAST_PRFX

// Prefix Length
#define GLOBAL_UCAST_PRFXLEN _GLOBAL0_UCAST_PRFXLEN

// Address
#define TN_GLOBAL_ADDRESS v6merge( TN_GLOBAL_UCAST_PRFX, \
        GLOBAL_UCAST_PRFXLEN, \
        v6("::1"))
#define NUT_GLOBAL_ADDRESS v6merge(   NUT_GLOBAL_UCAST_PRFX, \
                GLOBAL_UCAST_PRFXLEN, \
                nutv6("Link0"))
#define TN_LINK1_GLOBAL_ADDRESS v6merge( TN_LINK1_GLOBAL_UCAST_PRFX, \
        GLOBAL_UCAST_PRFXLEN, \
        v6("::1"))
#define NUT_LINK1_GLOBAL_ADDRESS v6merge( NUT_LINK1_GLOBAL_UCAST_PRFX, \
        GLOBAL_UCAST_PRFXLEN, \
        nutv6("Link1"))
#define NUT_LINK1_GLOBAL_UNKNOWN_ADDRESS v6merge( NUT_LINK1_GLOBAL_UCAST_PRFX, \
        GLOBAL_UCAST_PRFXLEN, \
        v6("::1"))
#define OFFLINK_LINK1_GLOBAL_ADDRESS v6merge( OFFLINK_LINK1_GLOBAL_UCAST_PRFX, \
        GLOBAL_UCAST_PRFXLEN, \
        v6("::1"))

#define ROUTING_ADDRESS_0 v6(_GLOBAL6A0N_UCAST_ADDR) 
#define ROUTING_ADDRESS_1 v6(_GLOBAL7A0N_UCAST_ADDR) 


//
// define Packets
//

#define PMTU_echo_request_tn2nut_GLOBALADDR( \
	_pNAME, \
	_EchoRequest_data \
) \
FEM_icmp6_echo_request( \
	 _pNAME, \
	 _HETHER_tn2nut, \
		{ \
		_SRC(OFFLINK_GLOBAL_ADDRESS); \
		_DST(NUT_GLOBAL_ADDRESS); \
	 }, \
		 { \
		 payload=_EchoRequest_data; \
	 } \
)  

#define PMTU_echo_request_tn2nut_GLOBALADDR_ONLINK( \
	_pNAME, \
	_EchoRequest_data \
) \
FEM_icmp6_echo_request( \
	 _pNAME, \
	 _HETHER_tn2nut, \
		{ \
		_SRC(TN_GLOBAL_ADDRESS); \
		_DST(NUT_GLOBAL_ADDRESS); \
	 }, \
		 { \
		 payload=_EchoRequest_data; \
	 } \
)  

#define PMTU_echo_reply_nut2tn_GLOBALADDR( \
	_pNAME,\
	_EchoReply_data \
) \
FEM_icmp6_echo_reply( \
	_pNAME, \
	_HETHER_nut2tn, \
		{ \
		_SRC(NUT_GLOBAL_ADDRESS); \
		_DST(OFFLINK_GLOBAL_ADDRESS); \
	}, \
		{ \
		payload=_EchoReply_data; \
	} \
)

#define PMTU_echo_reply_nut2tn_GLOBALADDR_ONLINK( \
	_pNAME,\
	_EchoReply_data \
) \
FEM_icmp6_echo_reply( \
	_pNAME, \
	_HETHER_nut2tn, \
		{ \
		_SRC(NUT_GLOBAL_ADDRESS); \
		_DST(TN_GLOBAL_ADDRESS); \
	}, \
		{ \
		payload=_EchoReply_data; \
	} \
)

#define _HDR_FRAGMENT_NAME(_pNAME) _FRAGMENT_##_pNAME 
#define _PAYLOAD_NAME(_pNAME) _PAYLOAD_##_pNAME 



#define PMTU_fragment(_pNAME,_pETHER,_oHDR_IPV6, \
					 _oHDR_FRAGMENT,_oPAYLOAD) \
FEM_hdr_ipv6_exth(_pNAME,_pETHER,_oHDR_IPV6, \
		{ \
		header=_HDR_IPV6_NAME(_pNAME); \
                exthdr=_HDR_FRAGMENT_NAME(_pNAME); \
                upper=_PAYLOAD_NAME(_pNAME); \
	} \
) \
Hdr_Fragment _HDR_FRAGMENT_NAME(_pNAME) \
	_oHDR_FRAGMENT \
Payload _PAYLOAD_NAME(_pNAME) \
	_oPAYLOAD



#define PMTU_fragment_tn2nut_GLOBALADDR(_pNAME,_oHDR_FRAGMENT,_oPAYLOAD) \
PMTU_fragment( \
	 _pNAME, \
	 _HETHER_tn2nut, \
		{ \
		NextHeader=44; \
         _SRC(OFFLINK_GLOBAL_ADDRESS); \
		 _DST(NUT_GLOBAL_ADDRESS); \
	 }, \
	 _oHDR_FRAGMENT,\
	 _oPAYLOAD \
)


#define PMTU_fragment_nut2tn_GLOBALADDR(_pNAME,_oHDR_FRAGMENT,_oPAYLOAD) \
PMTU_fragment( \
	_pNAME, \
	_HETHER_nut2tn, \
		{ \
		NextHeader=44; \
        _SRC(NUT_GLOBAL_ADDRESS); \
        _DST(OFFLINK_GLOBAL_ADDRESS); \
	}, \
	_oHDR_FRAGMENT, \
	_oPAYLOAD \
)

//
// Packets for Initialize NUT
//

_HETHER_define(HETHER_nut2onlinksolnode,  nutether(), _ETHER_SOLNODE_MCAST(TN_GLOBAL_ADDRESS))

_HETHER_define(HETHER_nut2tn_oneof,  nutether(), oneof(tnether(),_ETHER_SOLNODE_MCAST(TN_GLOBAL_ADDRESS),_ETHER_SOLNODE_MCAST(tnv6())))

_HETHER_define(HETHER_LINK1_nut2tn_oneof,  nutether(), oneof(tnether(),_ETHER_SOLNODE_MCAST(TN_LINK1_GLOBAL_ADDRESS),_ETHER_SOLNODE_MCAST(tnv6())))

FEM_icmp6_ra (
	ra,
	_HETHER_tn2allnodes,
		{
		_SRC(tnv6());
		_DST(v6(_LLOCAL_ALLNODES_MCAST_ADDR));
		HopLimit=255;
	},
		{
		CurHopLimit=254;
		LifeTime=3600;
		ReachableTime=0;
		RetransTimer=1005;
		option=_SLLOPT_tn;
		option=prefix_ra;
	}
)
	
FEM_icmp6_ra (
	ra_LINK1,
	_HETHER_tn2allnodes,
		{
		_SRC(tnv6());
		_DST(v6(_LLOCAL_ALLNODES_MCAST_ADDR));
		HopLimit=255;
	},
		{
		CurHopLimit=254;
		LifeTime=3600;
		ReachableTime=0;
		RetransTimer=1005;
		option=_SLLOPT_tn;
		option=prefix_ra_LINK1;
	}
)
	
Opt_ICMPv6_Prefix prefix_ra { 
	LFlag=1;
	AFlag=1;
	ValidLifetime=3600005;
	PreferredLifetime=3600005;
	Prefix=v6(NUT_GLOBAL_UCAST_PRFX);
}

Opt_ICMPv6_Prefix prefix_ra_LINK1 { 
	LFlag=1;
	AFlag=1;
	ValidLifetime=3600005;
	PreferredLifetime=3600005;
	Prefix=v6(NUT_LINK1_GLOBAL_UCAST_PRFX);
}

//
// ns
// NUT's link local address 
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns,
	HETHER_nut2tn_oneof,
		{
		_SRC(nutv6());
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_GLOBAL_ADDRESS),tnv6(),TN_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=tnv6();
		option=_SLLOPT_nut;
	}
)

//
// ns Link1
// NUT's link local address 
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns_LINK1,
	HETHER_LINK1_nut2tn_oneof,
		{
		_SRC(nutv6());
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_LINK1_GLOBAL_ADDRESS),tnv6(),TN_LINK1_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=tnv6();
		option=_SLLOPT_nut;
	}
)

//
// ns
// NUT's global address
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns_srcGlobal,
	HETHER_nut2tn_oneof,
		{
		_SRC(NUT_GLOBAL_ADDRESS);
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_GLOBAL_ADDRESS),tnv6(),TN_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=tnv6();
		option=_SLLOPT_nut;
	}
)

//
// ns Link1
// NUT's global address
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns_srcGlobal_LINK1,
	HETHER_LINK1_nut2tn_oneof,
		{
		_SRC(NUT_LINK1_GLOBAL_ADDRESS);
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_LINK1_GLOBAL_ADDRESS),tnv6(),TN_LINK1_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=tnv6();
		option=_SLLOPT_nut;
	}
)

//
// ns
// NUT's link local address 
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns_global,
	HETHER_nut2tn_oneof,
		{
		_SRC(nutv6());
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_GLOBAL_ADDRESS),tnv6(),TN_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=TN_GLOBAL_ADDRESS;
		option=_SLLOPT_nut;
	}
)

//
// ns LINK1
// NUT's link local address 
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns_global_LINK1,
	HETHER_nut2tn_oneof,
		{
		_SRC(NUT_LINK1_GLOBAL_UNKNOWN_ADDRESS);
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_LINK1_GLOBAL_ADDRESS),tnv6(),TN_LINK1_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=TN_LINK1_GLOBAL_ADDRESS;
		option=_SLLOPT_nut;
	}
)

//
// ns
// NUT's global address
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns_srcGlobal_global,
	HETHER_nut2tn_oneof,
		{
		_SRC(NUT_GLOBAL_ADDRESS);
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_GLOBAL_ADDRESS),tnv6(),TN_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=TN_GLOBAL_ADDRESS;
		option=_SLLOPT_nut;
	}
)

//
// ns
// NUT's global address
//           to
// TN's solicited Multicast address or TN's unicast address

FEM_icmp6_ns (
	ns_srcGlobal_global_LINK1,
	HETHER_LINK1_nut2tn_oneof,
		{
		_SRC(NUT_LINK1_GLOBAL_ADDRESS);
		_DST(oneof(_IPV6_SOLNODE_MCAST(tnv6()),_IPV6_SOLNODE_MCAST(TN_LINK1_GLOBAL_ADDRESS),tnv6(),TN_LINK1_GLOBAL_ADDRESS));
		HopLimit=255;
	},
		{
		TargetAddress=TN_LINK1_GLOBAL_ADDRESS;
		option=_SLLOPT_nut;
	}
)

//
// ns
// NUT's link local  address
//           to
// TN's link local address

FEM_icmp6_ns (
	ns_nosol,
	_HETHER_nut2tn,
		{
		_SRC(oneof(nutv6(),NUT_GLOBAL_ADDRESS));
		_DST(tnv6());
		HopLimit=255;
	},
		{
		TargetAddress=tnv6();
		option=_SLLOPT_nut;
	}
)

//
// ns
// NUT's link local  address
//           to
// TN's global address

FEM_icmp6_ns (
	ns2tn_global_nosol,
	HETHER_nut2onlinksolnode,
		{
		_SRC(oneof(nutv6(),NUT_GLOBAL_ADDRESS));
		_DST(TN_GLOBAL_ADDRESS);
		HopLimit=255;
	},
		{
		TargetAddress=TN_GLOBAL_ADDRESS;
		option=_SLLOPT_nut;
	}
)

//
// na
// TN's link local  address
//           to
// NUT's link local address
//
// Targetaddress TN's link local address

FEM_icmp6_na (
	na,
	_HETHER_tn2nut,
		{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit=255;
        },
		{
		SFlag=1;
		OFlag=1;
		TargetAddress=tnv6();
		option=_TLLOPT_tn;
	}
)
//
// na
// TN's global address
//           to
// NUT's global address
//
// Targetaddress TN's link local address

FEM_icmp6_na (
	na_srcGlobal,
	_HETHER_tn2nut,
		{
		_SRC(TN_GLOBAL_ADDRESS);
        _DST(NUT_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		SFlag=1;
		OFlag=1;
		TargetAddress=tnv6();
		option=_TLLOPT_tn;
	}
)

//
// na LINK1
// TN's global address
//           to
// NUT's global address
//
// Targetaddress TN's link local address

FEM_icmp6_na (
	na_srcGlobal_LINK1,
	_HETHER_tn2nut,
		{
		_SRC(TN_LINK1_GLOBAL_ADDRESS);
        _DST(NUT_LINK1_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		SFlag=1;
		OFlag=1;
		TargetAddress=tnv6();
		option=_TLLOPT_tn;
	}
)
//
// na
// TN's global  address
//           to
// NUT's global address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_global,
	_HETHER_tn2nut,
		{
        _SRC(TN_GLOBAL_ADDRESS); 
        _DST(NUT_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)

//
// na LINK1
// TN's global  address
//           to
// NUT's global address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_global_LINK1,
	_HETHER_tn2nut,
		{
        _SRC(TN_LINK1_GLOBAL_ADDRESS); 
        _DST(NUT_LINK1_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_LINK1_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)

//
// na
// TN's link local  address
//           to
// NUT's link local address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_srcLocal_global,
	_HETHER_tn2nut,
		{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit=255;
        },
		{
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)
//
// na LINK1
// TN's link local  address
//           to
// NUT's link local address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_srcLocal_global_LINK1,
	_HETHER_tn2nut,
		{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit=255;
        },
		{
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_LINK1_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)
//
// na
// TN's global  address
//           to
// NUT(router)'s global address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_router_global,
	_HETHER_tn2nut,
		{
        _SRC(TN_GLOBAL_ADDRESS); 
        _DST(NUT_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		RFlag=1; 
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)

//
// na LINK1
// TN's global  address
//           to
// NUT(router)'s global address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_router_global_LINK1,
	_HETHER_tn2nut,
		{
        _SRC(TN_LINK1_GLOBAL_ADDRESS); 
        _DST(NUT_LINK1_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		RFlag=1; 
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_LINK1_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)

//
// na
// TN's link local address
//           to
// NUT(router)'s link local address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_srcLocal_router_global,
	_HETHER_tn2nut,
		{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit=255;
        },
		{
		RFlag=1; 
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)
//
// na LINK1
// TN's link local address
//           to
// NUT(router)'s link local address
//
// Targetaddress TN's global address
FEM_icmp6_na (
	na_srcLocal_router_global_LINK1,
	_HETHER_tn2nut,
		{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit=255;
        },
		{
		RFlag=1; 
		SFlag=1;
		OFlag=1;
		TargetAddress=TN_LINK1_GLOBAL_ADDRESS;
		option=_TLLOPT_tn;
	}
)
//
// na
// TN's link local  address
//           to
// NUT(router)'s link local address
//
// Targetaddress TN's link local address
FEM_icmp6_na (
	na_router,
	_HETHER_tn2nut,
		{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit=255;
        },
		{
		RFlag=1; 
		SFlag=1;
		OFlag=1;
		TargetAddress=tnv6();
		option=_TLLOPT_tn;
	}
)
//
// na
// TN's link local  address
//           to
// NUT(router)'s link local address
//
// Targetaddress TN's link local address
FEM_icmp6_na (
	na_srcGlobal_router,
	_HETHER_tn2nut,
		{
        _SRC(TN_GLOBAL_ADDRESS); 
        _DST(NUT_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		RFlag=1; 
		SFlag=1;
		OFlag=1;
		TargetAddress=tnv6();
		option=_TLLOPT_tn;
	}
)

//
// na LINK1
// TN's link local  address
//           to
// NUT(router)'s link local address
//
// Targetaddress TN's link local address
FEM_icmp6_na (
	na_srcGlobal_router_LINK1,
	_HETHER_tn2nut,
		{
        _SRC(TN_LINK1_GLOBAL_ADDRESS); 
        _DST(NUT_LINK1_GLOBAL_ADDRESS); 
		HopLimit=255;
        },
		{
		RFlag=1; 
		SFlag=1;
		OFlag=1;
		TargetAddress=tnv6();
		option=_TLLOPT_tn;
	}
)

Payload ping_data
	{
	data=repeat(0xff,6);
	}

FEM_icmp6_echo_request (
	EchoRequest,
	_HETHER_tn2nut,
		{
		_SRC(tnv6());
		_DST(nutv6());
       	},
		{
		payload=ping_data;
	}
)



PMTU_echo_request_tn2nut_GLOBALADDR (
	EchoRequest_tn2nut_global,
	ping_data
)

FEM_icmp6_echo_request (
	EchoRequest_tn2nut_global_LINK1,
	_HETHER_tn2nut,
		{
		_SRC(TN_LINK1_GLOBAL_ADDRESS);
		_DST(NUT_LINK1_GLOBAL_ADDRESS);
	},
		{
		payload=ping_data;
	}
)

FEM_icmp6_echo_reply (
	EchoReply,
	_HETHER_nut2tn,
		{
		_SRC(nutv6());
		_DST(tnv6());
	},
		{
		payload=ping_data;
	}
)

PMTU_echo_reply_nut2tn_GLOBALADDR (
	EchoReply_nut2tn_global,
	ping_data
)

FEM_icmp6_echo_reply (
	EchoReply_nut2tn_global_LINK1,
	_HETHER_nut2tn,
		{
		_SRC(NUT_LINK1_GLOBAL_ADDRESS);
		_DST(TN_LINK1_GLOBAL_ADDRESS);
	},
		{
		payload=ping_data;
	}
)

_HETHER_define(icmp_hether_nut2z, nutether(), ether(A9N_MAC_ADDR))


//----------------------------------------------------------------------
// echo-request
//      TN(link-local) ==> NUT(link-local)
//----------------------------------------------------------------------
FEM_icmp6_echo_request(icmp_echo_request, _HETHER_tn2nut,
        {
         _SRC(tnv6());
         _DST(nutv6());},
        {
         payload=icmp_echo_data;
        }
)
//----------------------------------------------------------------------
// echo-request
//      TN(Global) ==> NUT(Global)
//----------------------------------------------------------------------
FEM_icmp6_echo_request(icmp_global_echo_request, _HETHER_tn2nut,
        {
         _SRC(TN_GLOBAL_ADDRESS);
         _DST(NUT_GLOBAL_ADDRESS);},
        {
         payload=icmp_echo_data;
        }
)
//----------------------------------------------------------------------
// echo-reply
//      NUT(link-local) ==> TN(link-local)
//----------------------------------------------------------------------
FEM_icmp6_echo_reply(icmp_echo_reply, _HETHER_nut2tn,
        {
         _SRC(nutv6());
         _DST(tnv6());
        },
        {
         payload=icmp_echo_data;
        }
)
//----------------------------------------------------------------------
// echo-reply
//      NUT(Global) ==> TN(Global)
//----------------------------------------------------------------------
FEM_icmp6_echo_reply(icmp_global_echo_reply, _HETHER_nut2tn,
        {
         _SRC(NUT_GLOBAL_ADDRESS);
         _DST(TN_GLOBAL_ADDRESS);
        },
        {
         payload=icmp_echo_data;
        }
)
//----------------------------------------------------------------------
Payload icmp_echo_data {
        data=repeat(0xff,0x10);
}

//----------------------------------------------------------------------
// multicast NS w/ SLLA
//      NUT(link-local) ==> TN(solnode[link-local])
//      target=TN(link-local)
//      w/ SLLA
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_multicast_ns, _HETHER_nut2tnsolnode,
        {
		_SRC(oneof(nutv6(),nut2v6(NUT_GLOBAL_UCAST_PRFX,GLOBAL_UCAST_PRFXLEN)));
         _DST(_IPV6_SOLNODE_MCAST(tnv6()));
         HopLimit=255;
        },
        {
         TargetAddress=tnv6();
         option=_SLLOPT_nut;
        }
)
//----------------------------------------------------------------------
// multicast NS w/ SLLA
//      NUT(Global) ==> TN(solnode[Global])
//      target=TN(Global)
//      w/ SLLA
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_multicast_global_ns, HETHER_nut2tn_oneof,
        {
         _SRC(oneof(nutv6(),NUT_GLOBAL_ADDRESS));
         _DST(_IPV6_SOLNODE_MCAST(TN_GLOBAL_ADDRESS));
         HopLimit=255;
        },
        {
         TargetAddress=TN_GLOBAL_ADDRESS;
         option=_SLLOPT_nut;
        }
)
//----------------------------------------------------------------------
// unicast NS w/o SLLA
//      NUT(link-local) ==> TN(link-local)
//      target=TN(link-local)
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_ns, _HETHER_nut2tn,
        {
		_SRC(oneof(nutv6(),nut2v6(NUT_GLOBAL_UCAST_PRFX,GLOBAL_UCAST_PRFXLEN)));
         _DST(tnv6());
         HopLimit=255;
        },
        {
         TargetAddress=tnv6();
        }
)
//----------------------------------------------------------------------
// unicast NS w/o SLLA
//      NUT(Global) ==> TN(Global)
//      target=TN(Global)
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_global_ns, _HETHER_nut2tn,
        {
         _SRC(oneof(nutv6(),NUT_GLOBAL_ADDRESS));
         _DST(TN_GLOBAL_ADDRESS);
         HopLimit=255;
        },
        {
         TargetAddress=TN_GLOBAL_ADDRESS;
        }
)
//----------------------------------------------------------------------
// unicast NS w/ SLLA
//      NUT(link-local) ==> TN(link-local)
//      target=TN(link-local)
//      w/ SLLA
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_ns_sll, _HETHER_nut2tn,
        {
		_SRC(oneof(nutv6(),nut2v6(NUT_GLOBAL_UCAST_PRFX,GLOBAL_UCAST_PRFXLEN)));
         _DST(tnv6());
         HopLimit=255;
        },
        {
         TargetAddress=tnv6();
         option=_SLLOPT_nut;
        }
)
//----------------------------------------------------------------------
// unicast NS w/ SLLA
//      NUT(Global) ==> TN(Global)
//      target=TN(Global)
//      w/ SLLA
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_global_ns_sll, _HETHER_nut2tn,
        {
         _SRC(oneof(nutv6(),NUT_GLOBAL_ADDRESS));
         _DST(TN_GLOBAL_ADDRESS);
         HopLimit=255;
        },
        {
         TargetAddress=TN_GLOBAL_ADDRESS;
         option=_SLLOPT_nut;
        }
)

//----------------------------------------------------------------------
// echo-reply
//      NUT(link-local) ==> TN(link-local, but different LLA)
//----------------------------------------------------------------------
FEM_icmp6_echo_reply(icmp_echo_reply_to_z2, icmp_hether_nut2z,
        {
         _SRC(nutv6());
         _DST(tnv6());
        },
        {
         payload=icmp_echo_data;
        }
)
//----------------------------------------------------------------------
// echo-reply
//      NUT(Global) ==> TN(Global, but different LLA)
//----------------------------------------------------------------------
FEM_icmp6_echo_reply(icmp_global_echo_reply_to_z2, icmp_hether_nut2z,
        {
         _SRC(NUT_GLOBAL_ADDRESS);
         _DST(TN_GLOBAL_ADDRESS);
        },
        {
         payload=icmp_echo_data;
        }
)
//----------------------------------------------------------------------
// unicast NS w/o SLLA
//      NUT(link-local) ==> TN(link-local, but different LLA)
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_ns_to_z, icmp_hether_nut2z,
        {
		_SRC(oneof(nutv6(),nut2v6(NUT_GLOBAL_UCAST_PRFX,GLOBAL_UCAST_PRFXLEN)));
         _DST(tnv6());
         HopLimit=255;
        },
        {
         TargetAddress=tnv6();
        }
)
//----------------------------------------------------------------------
// unicast NS w/o SLLA
//      NUT(Global) ==> TN(Global, but different LLA)
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_global_ns_to_z, icmp_hether_nut2z,
        {
         _SRC(oneof(nutv6(),NUT_GLOBAL_ADDRESS));
         _DST(TN_GLOBAL_ADDRESS);
         HopLimit=255;
        },
        {
         TargetAddress=TN_GLOBAL_ADDRESS;
        }
)
//----------------------------------------------------------------------
// unicast NS w/ SLLA
//      NUT(link-local) ==> TN(link-local, but different LLA)
//      target=TN(link-local)
//      w/ SLLA
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_ns_sll_to_z, icmp_hether_nut2z,
        {
		_SRC(oneof(nutv6(),nut2v6(NUT_GLOBAL_UCAST_PRFX,GLOBAL_UCAST_PRFXLEN)));
         _DST(tnv6());
         HopLimit=255;
        },
        {
         TargetAddress=tnv6();
         option=_SLLOPT_nut;
        }
)
//----------------------------------------------------------------------
// unicast NS w/ SLLA
//      NUT(Global) ==> TN(Global, but different LLA)
//      target=TN(Global)
//      w/ SLLA
//----------------------------------------------------------------------
FEM_icmp6_ns(icmp_unicast_global_ns_sll_to_z, icmp_hether_nut2z,
        {
         _SRC(oneof(nutv6(),NUT_GLOBAL_ADDRESS));
         _DST(TN_GLOBAL_ADDRESS);
         HopLimit=255;
        },
        {
         TargetAddress=TN_GLOBAL_ADDRESS;
         option=_SLLOPT_nut;
        }
)

//////////////////////////////////////////////////////////////

//#include "PMTU.def"

Payload data_1500 {
	 data=repeat(0xff,1452);
}
Payload data_1412_1500 {
	 data=repeat(0xff,1412);
}

FEM_icmp6_echo_request(
	EchoRequest_LINK0_tn2nut_forwarding,
	_HETHER_tn2nut, 
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS); 
		_DST(OFFLINK_LINK1_GLOBAL_ADDRESS);
	},
		{
	payload=data_1500;
	}
)

FEM_icmp6_echo_request(
	EchoRequest_LINK0_tn2nut_forwarding_1,
	_HETHER_tn2nut, 
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS); 
		_DST(OFFLINK_LINK1_GLOBAL_ADDRESS);
		HopLimit=63;
	},
		{
	payload=data_1500;
	}
)

FEM_icmp6_echo_request(
	EchoRequest_LINK1_nut2tn_forwarding,
	_HETHER_nut2tn, 
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS); 
		_DST(OFFLINK_LINK1_GLOBAL_ADDRESS);
	},
		{
	payload=data_1500;
	}
)


FEM_icmp6_echo_request_exth(
	packet_LINK0_tn2nut_routingheader,
	_HETHER_tn2nut,
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS);
		_DST(NUT_GLOBAL_ADDRESS);
	},
		{
		header = _HDR_IPV6_NAME(packet_LINK0_tn2nut_routingheader);
		exthdr = RoutingHeader_LINK0_tn2nut;
		upper = _ICMPV6_NAME(packet_LINK0_tn2nut_routingheader);
	},
		{
	payload=data_1412_1500;
	}
)

FEM_icmp6_echo_request_exth(
	packet_LINK0_tn2nut_routingheader_1,
	_HETHER_tn2nut,
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS);
		_DST(NUT_GLOBAL_ADDRESS);
		HopLimit=63;
	},
		{
		header = _HDR_IPV6_NAME(packet_LINK0_tn2nut_routingheader);
		exthdr = RoutingHeader_LINK0_tn2nut;
		upper = _ICMPV6_NAME(packet_LINK0_tn2nut_routingheader);
	},
		{
	payload=data_1412_1500;
	}
)

FEM_icmp6_echo_request_exth(
	packet_LINK0_tn2nut_routingheader_after_processing,
	_HETHER_tn2nut,
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS);
		_DST(OFFLINK_LINK1_GLOBAL_ADDRESS);
	},
		{
		header = _HDR_IPV6_NAME(packet_LINK0_tn2nut_routingheader_segmentleft0);
		exthdr = RoutingHeader_LINK0_tn2nut_after_processing;
		upper = _ICMPV6_NAME(packet_LINK0_tn2nut_routingheader_segmentleft0);
	},
		{
	payload=data_1412_1500;
	}
)

FEM_icmp6_echo_request_exth(
	packet_LINK0_tn2nut_routingheader_after_processing_1,
	_HETHER_tn2nut,
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS);
		_DST(OFFLINK_LINK1_GLOBAL_ADDRESS);
		HopLimit=63;
	},
		{
		header = _HDR_IPV6_NAME(packet_LINK0_tn2nut_routingheader_segmentleft0_1);
		exthdr = RoutingHeader_LINK0_tn2nut_after_processing;
		upper = _ICMPV6_NAME(packet_LINK0_tn2nut_routingheader_segmentleft0_1);
	},
		{
	payload=data_1412_1500;
	}
)

Hdr_Routing RoutingHeader_LINK0_tn2nut {
        SegmentsLeft = 2;
        Address = OFFLINK_LINK1_GLOBAL_ADDRESS;
        Address = ROUTING_ADDRESS_1;
}

Hdr_Routing RoutingHeader_LINK0_tn2nut_after_processing {
        SegmentsLeft = 0;
        Address = NUT_GLOBAL_ADDRESS;
        Address = ROUTING_ADDRESS_1;
}

FEM_icmp6_echo_request_exth(
	packet_LINK1_nut2tn_routingheader,
	_HETHER_nut2tn,
		{
		_SRC(OFFLINK_GLOBAL_ADDRESS);
		_DST(OFFLINK_LINK1_GLOBAL_ADDRESS);
		HopLimit=63;
	},
		{
		header = _HDR_IPV6_NAME(packet_LINK1_nut2tn_routingheader);
		exthdr = RoutingHeader_LINK1_nut2tn;
		upper = _ICMPV6_NAME(packet_LINK1_nut2tn_routingheader);
	},
		{
	payload=data_1412_1500;
	}
)

Hdr_Routing RoutingHeader_LINK1_nut2tn {
        SegmentsLeft = 1;
        Address = NUT_GLOBAL_ADDRESS;
        Address = ROUTING_ADDRESS_1;
}


FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_1300,
        _HETHER_nut2tn,
                {
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(OFFLINK_GLOBAL_ADDRESS);
        },
                {
                MTU=1300;
                payload=invoking_packet;
        }
)
 
Payload invoking_packet {
        data=substr(_PACKET_IPV6_NAME(EchoRequest_LINK0_tn2nut_forwarding),0,1232);
}

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_1300_1,
        _HETHER_nut2tn,
                {
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(OFFLINK_GLOBAL_ADDRESS);
        },
                {
                MTU=1300;
                payload=invoking_packet_1;
        }
)
 
Payload invoking_packet_1 {
        data=substr(_PACKET_IPV6_NAME(EchoRequest_LINK0_tn2nut_forwarding_1),0,1232);
}

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_routingheader_1300,
        _HETHER_nut2tn,
                {
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(OFFLINK_GLOBAL_ADDRESS);
        },
                {
                MTU=1300;
                #payload=invoking_packet_routingheader;
                payload=any;
        }
)
 
Payload invoking_packet_routingheader {
        data=substr(_PACKET_IPV6_NAME(packet_LINK0_tn2nut_routingheader),0,1232);
}

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_routingheader_1300_1,
        _HETHER_nut2tn,
                {
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(OFFLINK_GLOBAL_ADDRESS);
        },
                {
                MTU=1300;
                #payload=invoking_packet_routingheader_1;
                payload=any;
        }
)
 
Payload invoking_packet_routingheader_1 {
        data=substr(_PACKET_IPV6_NAME(packet_LINK0_tn2nut_routingheader_1),0,1232);
}

