//
// $Copyright_v6PC$
//
// $Intap$
// $Id: LLA_SAA.def,v 1.1.3.1 2004/10/04 06:44:02 yoshfuji Exp $
//
//  This file has some basic definition and frames for DAD test about
//  any tentative address, and may be included from other *.def files.
//
// DADV6ADDR              : v6 Tentative address for DAD
// NUT_HasNoLLOCAL        : if defined NUT has no link-local address
// DADNA_SRC              : IPv6 src address of DAD NA
// dadns_from_NUT         : DAD NS coming from NUT on DAD
// chkconf_dadns_to_NUT   : DAD NS send to NUT to check if address is configured
// chkconf_dadna_from_NUT : DAD NA coming from NUT if addrss is configured
//
// 

#include "SAA.def"


//
// Ethernet Part
//

_HETHER_define(hether_nut2tentsolnode,
	       nutether(), _ETHER_SOLNODE_MCAST(nutv6()))
_HETHER_define(hether_tn2tentsolnode,
	       tnether(), _ETHER_SOLNODE_MCAST(nutv6()))
_HETHER_define(hether_tn2nutsolnode,
	       tnether(), _ETHER_SOLNODE_MCAST(nutv6()))

//
// IPv6 Part
//

//
// DADNS_from_NUT
//  Description: 
//    DAD NS coming from NUT on DAD
//  Spec:
//    valid DAD NS

FEM_ADDRCONF_dadns(DADNS_from_NUT, hether_nut2tentsolnode,
		   DestinationAddress=_IPV6_SOLNODE_MCAST(nutv6());
		   ,
		   TargetAddress=nutv6(); // Tentative Address
                   )


//
// DADNS_from_TN_SameTgt
//  Description: 
//    DAD NS send to NUT to check if address is configured
//  Spec:
//    valid DAD NS

FEM_ADDRCONF_dadns(DADNS_from_TN_SameTgt, hether_tn2tentsolnode,
		   DestinationAddress=_IPV6_SOLNODE_MCAST(nutv6());
		   ,
		   TargetAddress=nutv6(); // Tentative Address
                   )

//
// DADNS_from_TN_DiffTgt
//  Description: 
//    DAD NS send to NUT to check independency
//  Spec:
//    valid DAD NS

FEM_ADDRCONF_dadns(DADNS_from_TN_DiffTgt, hether_tn2tentsolnode,
		   DestinationAddress=_IPV6_SOLNODE_MCAST(tnv6());
		   ,
		   TargetAddress=tnv6(); // Tentative Address
                   )


//
// DADNA_from_NUT
//  Description: 
//    DAD NA coming from NUT if addrss is configured
//  Spec:
//    valid DAD NA
//    NUT is a host 

FEM_ADDRCONF_dadna(DADNA_from_NUT, _HETHER_nut2allnodes,
		   SourceAddress=nutv6();
		   ,
	           TargetAddress=nutv6();
	           option=_TLLOPT_nut;
		   )

//
// DADNA_from_NUT_woTLL
//  Description: 
//    DAD NA coming from NUT if addrss is configured
//  Spec:
//    valid DAD NA
//    NUT is a host 

FEM_ADDRCONF_dadna(DADNA_from_NUT_woTLL, _HETHER_nut2allnodes,
		   SourceAddress=nutv6();
		   ,
	           TargetAddress=nutv6();
		   )

//
// DADNA_from_TN_SameTgt
//  Description: 
//    DAD NA Transmitted by TN which has Target address same as NUT
//  Spec:
//    valid DAD NA
// 

FEM_ADDRCONF_dadna(DADNA_from_TN_SameTgt, _HETHER_tn2allnodes,
		   SourceAddress=nutv6();
		   ,
	           RFlag=0;
	           TargetAddress=nutv6();
	           option=_TLLOPT_tn;
		   )

//
// DADNA_from_TN_DiffTgt
//  Description: 
//    DAD NA Transmitted by TN which has Target address same as NUT
//  Spec:
//    valid DAD NA
//

FEM_ADDRCONF_dadna(DADNA_from_TN_DiffTgt, _HETHER_tn2allnodes,
		   SourceAddress=tnv6();
		   ,
	           RFlag=0;
	           TargetAddress=tnv6();
	           option=_TLLOPT_tn;
		   )


//
// SOLNS_from_TN_SameTgt
//  Description: 
//    Address resolution NS send to NUT to check if address is configured
//  Spec:
//    valid DAD NS

FEM_icmp6_ns (
        SOLNS_from_TN_SameTgt,
        hether_tn2nutsolnode,
                {
                _SRC(tnv6());
                _DST(_IPV6_SOLNODE_MCAST(nutv6()));
                HopLimit=255;
        },
                {
                TargetAddress=nutv6();
                option=_SLLOPT_tn;
        }
)


//
// na
// NUT's link local address
//           to  
// TN's link local  address
//
// Targetaddress TN's link local address
 
FEM_icmp6_na (
        NA_from_NUT,
        _HETHER_nut2tn,
                {
                _SRC(nutv6());
                _DST(tnv6());
                HopLimit=255;
        },
                {
                RFlag=RFLAG;
                SFlag=1;
                OFlag=1;
                TargetAddress=nutv6();
                option=_TLLOPT_nut;
        }
)

//
// na
// NUT's link local address
//           to  
// TN's link local  address
//
// Targetaddress TN's link local address
 
FEM_icmp6_na (
        NA_from_NUT_woTLL,
        _HETHER_nut2tn,
                {
                _SRC(nutv6());
                _DST(tnv6());
                HopLimit=255;
        },
                {
                RFlag=RFLAG;
                SFlag=1;
                OFlag=1;
                TargetAddress=nutv6();
        }
)

//
// DADNS_from_TN_SameTgt w/ HopLimit=254
//  Description: 
//    DAD NS send to NUT to check if address is configured
//  Spec:
//    invalid DAD NS

FEM_icmp6_ns (
        NS_from_TN_SrcDstUni,
        _HETHER_tn2nut,
                {
                _SRC(tnv6());
                _DST(nutv6());
                HopLimit=255;
        },
                {
                TargetAddress=nutv6();
        }
)

//
// DADNS_from_TN_SameTgt w/ HopLimit=254
//  Description: 
//    DAD NS send to NUT to check if address is configured
//  Spec:
//    invalid DAD NS

FEM_icmp6_ns (
        DADNS_from_TN_HL254,
        hether_tn2tentsolnode,
                {
                _SRC(v6(_UNSPEC_ADDR));
                _DST(_IPV6_SOLNODE_MCAST(nutv6()));
                HopLimit=254;
        },
                {
                TargetAddress=nutv6();
        }
)

//
// DADNS_from_TN_DstAll
//  Description: 
//    DAD NS send to NUT to check if address is configured
//  Spec:
//    invalid DAD NS

FEM_ADDRCONF_dadns(DADNS_from_TN_DstAll, _HETHER_tn2allnodes,
		   DestinationAddress=v6(_ALLNODES_MCAST_ADDR);
		   ,
		   TargetAddress=nutv6(); // Tentative Address
                   )


//
// DADNS_from_TN_DstTent
//  Description: 
//    DAD NS send to NUT to check if address is configured
//  Spec:
//    invalid DAD NS

FEM_ADDRCONF_dadns(DADNS_from_TN_DstTent, _HETHER_tn2nut,
		   DestinationAddress=nutv6();
		   ,
		   TargetAddress=nutv6(); // Tentative Address
                   )


//
// DAD NA w/ HopLimit=254
// TN's link local  address
//           to  
// allnode multicast address
//
// Targetaddress TN's link local address
 
FEM_icmp6_na (
        DADNA_from_TN_HL254,
        _HETHER_tn2allnodes,
                {
                _SRC(tnv6());
                _DST(v6(_ALLNODES_MCAST_ADDR));
                HopLimit=254;
        },
                {
                RFlag=0;
                SFlag=0;
                OFlag=1;
                TargetAddress=nutv6();
                option=_TLLOPT_tn;
        }
)

//
// DAD NA w/ Sflag==1
// TN's link local  address
//           to  
// allnode multicast address
//
// Targetaddress TN's link local address
 
FEM_icmp6_na (
        DADNA_from_TN_SF1,
        _HETHER_tn2allnodes,
                {
                _SRC(tnv6());
                _DST(v6(_ALLNODES_MCAST_ADDR));
                HopLimit=255;
        },
                {
                RFlag=0;
                SFlag=1;
                OFlag=1;
                TargetAddress=nutv6();
                option=_TLLOPT_tn;
        }
)

//
// DAD NS w/ SLL
// unspecified  address
//           to  
// NUT's solicited multicast address
//
// Targetaddress TN's link local address

FEM_icmp6_ns (
        DADNS_from_TN_wSLL,
        hether_tn2tentsolnode,
                {
                _SRC(v6(_UNSPEC_ADDR));
                _DST(_IPV6_SOLNODE_MCAST(nutv6()));
                HopLimit=255;
        },
                {
                TargetAddress=nutv6();
                option=_SLLOPT_tn;   //invalid
        }
)

//
// DAD NA w/ SLL
// TN's link local  address
//           to  
// allnode multicast address
//
// Targetaddress TN's link local address
 
FEM_icmp6_na (
        DADNA_from_TN_wSLL,
        _HETHER_tn2allnodes,
                {
                _SRC(tnv6());
                _DST(v6(_ALLNODES_MCAST_ADDR));
                HopLimit=255;
        },
                {
                RFlag=0;
                SFlag=0;
                OFlag=1;
                TargetAddress=nutv6();
                option=_TLLOPT_tn;
                option=_SLLOPT_tn;
        }
)

//
// DAD NA w/o TLL
// TN's link local  address
//           to  
// allnode multicast address
//
// Targetaddress TN's link local address
 
FEM_icmp6_na (
        DADNA_from_TN_woTLL,
        _HETHER_tn2allnodes,
                {
                _SRC(tnv6());
                _DST(v6(_ALLNODES_MCAST_ADDR));
                HopLimit=255;
        },
                {
                RFlag=0;
                SFlag=0;
                OFlag=1;
                TargetAddress=nutv6();
        }
)

FEM_upp_no_next_header(
        PreparationPkt,
        _HETHER_tn2tn,
        {
                _SRC(nutv6());
                _DST(tnv6());
        },
        {}
)


//end
