//
// $Copyright$
//
// $Name:  $
//
// $TAHI: ct/spec/IH_NoNextHeader.def,v 1.3 2001/10/05 06:39:17 masaxmasa Exp $
//

#define TN_GL0_ADDR tn2v6(_GLOBAL0_UCAST_PRFX,_GLOBAL0_UCAST_PRFXLEN,"Link0")
#define TN_GL1_ADDR tn2v6(_GLOBAL1_UCAST_PRFX,_GLOBAL1_UCAST_PRFXLEN,"Link1")
#define NUT_GL0_ADDR nut2v6(_GLOBAL0_UCAST_PRFX,_GLOBAL0_UCAST_PRFXLEN,"Link0")
#define NUT_GL1_ADDR nut2v6(_GLOBAL1_UCAST_PRFX,_GLOBAL1_UCAST_PRFXLEN,"Link1")

//======================================================================
//
// ICMP echo request
//

FEM_hdr_ipv6_exth(
	nonext_to_link0,
	_HETHER_tn2nut,
	{
		_SRC(TN_GL0_ADDR);
		_DST(TN_GL1_ADDR);
		NextHeader = 59;	// No Next Header
	},
	{
		header = _HDR_IPV6_NAME(nonext_to_link0);
		upper = apl;
	}
)

FEM_hdr_ipv6_exth(
	nonext_from_link1,
	_HETHER_nut2tn,
	{
		_SRC(TN_GL0_ADDR);
		_DST(TN_GL1_ADDR);
		NextHeader = 59;	// No Next Header
	},
	{
		header = _HDR_IPV6_NAME(nonext_from_link1);
		upper = apl;
	}
)

//----------------------------------------------------------------------
// Payload Data
//----------------------------------------------------------------------

Upp_NoNext apl {
	data = {128,129,130,131,132,133,134,135};
}

//======================================================================
//
// NS and NA for Link0 (Link Local)
//

FEM_icmp6_ns(
	ns_from_link0_ll,
	_HETHER_nut2tnsolnode,
	{
		_SRC(nutv6());
		_DST(_IPV6_SOLNODE_MCAST(tnv6()));
		HopLimit = 255;
	},
	{
		TargetAddress = TN_GL0_ADDR;
		option = _SLLOPT_nut;
	}
)

FEM_icmp6_na(
	na_to_link0_ll,
	_HETHER_tn2nut,
	{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit = 255;
	},
	{
		SFlag = 1;
		OFlag = 1;
		TargetAddress = TN_GL0_ADDR;
		option = _TLLOPT_tn;
	}
)

//======================================================================
//
// NS and NA for Link0 (Global)
//

FEM_icmp6_ns(
	ns_from_link0,
	_HETHER_nut2tnsolnode,
	{
		_SRC(NUT_GL0_ADDR);
		_DST(_IPV6_SOLNODE_MCAST(tnv6()));
		HopLimit = 255;
	},
	{
		TargetAddress = TN_GL0_ADDR;
		option = _SLLOPT_nut;
	}
)

FEM_icmp6_na(
	na_to_link0,
	_HETHER_tn2nut,
	{
		_SRC(tnv6());
		_DST(NUT_GL0_ADDR);
		HopLimit = 255;
	},
	{
		SFlag = 1;
		OFlag = 1;
		TargetAddress = TN_GL0_ADDR;
		option = _TLLOPT_tn;
	}
)

//======================================================================
//
// NS and NA for Link1 (Link Local)
//

FEM_icmp6_ns(
	ns_from_link1_ll,
	_HETHER_nut2tnsolnode,
	{
		_SRC(nutv6());
		_DST(_IPV6_SOLNODE_MCAST(tnv6()));
		HopLimit = 255;
	},
	{
		TargetAddress = TN_GL1_ADDR;
		option = _SLLOPT_nut;
	}
)

FEM_icmp6_na(
	na_to_link1_ll,
	_HETHER_tn2nut,
	{
		_SRC(tnv6());
		_DST(nutv6());
		HopLimit = 255;
	},
	{
		SFlag = 1;
		OFlag = 1;
		TargetAddress = TN_GL1_ADDR;
		option = _TLLOPT_tn;
	}
)

//======================================================================
//
// NS and NA for Link1 (Global)
//

FEM_icmp6_ns(
	ns_from_link1,
	_HETHER_nut2tnsolnode,
	{
		_SRC(NUT_GL1_ADDR);
		_DST(_IPV6_SOLNODE_MCAST(tnv6()));
		HopLimit = 255;
	},
	{
		TargetAddress = TN_GL1_ADDR;
		option = _SLLOPT_nut;
	}
)

FEM_icmp6_na(
	na_to_link1,
	_HETHER_tn2nut,
	{
		_SRC(tnv6());
		_DST(NUT_GL1_ADDR);
		HopLimit = 255;
	},
	{
		SFlag = 1;
		OFlag = 1;
		TargetAddress = TN_GL1_ADDR;
		option = _TLLOPT_tn;
	}
)
