//
// Copyright (C) 2002, 2003 Yokogawa Electric Corporation, 
// INTAP(Interoperability Technology Association for Information 
// Processing, Japan), IPA (Information-technology Promotion Agency, Japan).
// All rights reserved.
// 
// Redistribution and use of this software in source and binary forms, with 
// or without modification, are permitted provided that the following 
// conditions and disclaimer are agreed and accepted by the user:
// 
// 1. Redistributions of source code must retain the above copyright 
// notice, this list of conditions and the following disclaimer.
// 
// 2. Redistributions in binary form must reproduce the above copyright 
// notice, this list of conditions and the following disclaimer in the 
// documentation and/or other materials provided with the distribution.
// 
// 3. Neither the names of the copyrighters, the name of the project which 
// is related to this software (hereinafter referred to as "project") nor 
// the names of the contributors may be used to endorse or promote products 
// derived from this software without specific prior written permission.
// 
// 4. No merchantable use may be permitted without prior written 
// notification to the copyrighters. However, using this software for the 
// purpose of testing or evaluating any products including merchantable 
// products may be permitted without any notification to the copyrighters.
// 
// 
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHTERS, THE PROJECT AND 
// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING 
// BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
// FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.  IN NO EVENT SHALL THE 
// COPYRIGHTERS, THE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
// HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
// CONTRACT,STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
// THE POSSIBILITY OF SUCH DAMAGE.
// $TINY: acceptTooBigMesg.def,v 1.5 2002/03/05 02:59:10 masaxmasa Exp $
// 

#include "PMTU.def"

///////////////////////////////////
//
// Packets for HOST A or related A
//
///////////////////////////////////


// size 1500

FEM_icmp6_echo_request(
         echo_request_1500_from_A,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10a0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_1452;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1500_to_A,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10a0::1"));
        },
        {
                 payload=ping_data_1452;
        }
)

// size 1400

FEM_icmp6_echo_request(
         echo_request_1400_from_A,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10a0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_1352;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1400_to_A,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10a0::1"));
        },
        {
                 payload=ping_data_1352;
        }
)

//////////////////////////
// Too Big Messages

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_1400_for_1500_A,
        _HETHER_tn2nut,
                {
                _SRC(v6("3ffe:501:ffff:10a1::1"));
                _DST(NUT_GLOBAL_ADDRESS);
        },
                {
                MTU     = 1400;
                payload = TooBigData_1500_A;
        }
) 

Payload TooBigData_1500_A {
    data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_A),0,1232);
}

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_1304_for_1400_A,
        _HETHER_tn2nut,
                {
                _SRC(v6("3ffe:501:ffff:10a1::1"));
                _DST(NUT_GLOBAL_ADDRESS);
        },
                {
                MTU     = 1304;
                payload = TooBigData_1400_A;
        }
) 

Payload TooBigData_1400_A {
    data=substr(_PACKET_IPV6_NAME(echo_reply_1400_to_A),0,1232);
}

//////////////////////////
// Fragmented packets

// size = 1280

PMTU_fragment( 
        frag_echo_reply_1400_1st_mtu1280_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1400_to_A),40,1232);
        }
)

PMTU_fragment(
        frag_echo_reply_1400_2nd_mtu1280_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=154;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1400_to_A),1272,128);
        }
)

// size = 1280

PMTU_fragment( 
        frag_echo_reply_1500_1st_mtu1280_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_A),40,1232);
        }
)

PMTU_fragment(
        frag_echo_reply_1500_2nd_mtu1280_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=154;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_A),1272,228);
        }
)

// size = 1304

PMTU_fragment( 
        frag_echo_reply_1400_1st_mtu1304_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1400_to_A),40,1256);
        }
)

PMTU_fragment(
        frag_echo_reply_1400_2nd_mtu1304_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=157;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1400_to_A),1296,104);
        }
)

// size = 1400

PMTU_fragment( 
        frag_echo_reply_1500_1st_mtu1400_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_A),40,1352);
        }
)

PMTU_fragment(
        frag_echo_reply_1500_2nd_mtu1400_A,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10a0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=169;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_A),1392,108);
        }
)



///////////////////////////////////
//
// Packets for HOST B or related B
//
///////////////////////////////////

// size 1500

FEM_icmp6_echo_request(
         echo_request_1500_from_B,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10b0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_1452;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1500_to_B,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10b0::1"));
        },
        {
                 payload=ping_data_1452;
        }
)

// size 1400

FEM_icmp6_echo_request(
         echo_request_1400_from_B,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10b0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_1352;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1400_to_B,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10b0::1"));
        },
        {
                 payload=ping_data_1352;
        }
)

FEM_icmp6_echo_request(
         echo_request_1280_from_B,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10b0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_1232;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1280_to_B,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10b0::1"));
        },
        {
                 payload=ping_data_1232;
        }
)

//////////////////////////
// Too Big Messages

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_1280_for_1500_B,
        _HETHER_tn2nut,
                {
                _SRC(v6("3ffe:501:ffff:10b1::1"));
                _DST(NUT_GLOBAL_ADDRESS);
        },
                {
                MTU     = 1280;
                payload = TooBigData_1280_B;
        }
) 

Payload TooBigData_1280_B {
    data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_B),0,1232);
}

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_1400_for_1280_B,
        _HETHER_tn2nut,
                {
                _SRC(v6("3ffe:501:ffff:10b1::1"));
                _DST(NUT_GLOBAL_ADDRESS);
        },
                {
                MTU     = 1400;
                payload = TooBigData_1400_B;
        }
) 

Payload TooBigData_1400_B {
    data=substr(_PACKET_IPV6_NAME(echo_reply_1280_to_B),0,1232);
}

//////////////////////////
// Fragmented packets

PMTU_fragment( 
        frag_echo_reply_1500_1st_mtu1400_B,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10b0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_B),40,1352);
        }
)

PMTU_fragment(
        frag_echo_reply_1500_2nd_mtu1400_B,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10b0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=169;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_B),1392,108);
        }
)

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

PMTU_fragment( 
        frag_echo_reply_1500_1st_mtu1280_B,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10b0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_B),40,1232);
        }
)

PMTU_fragment(
        frag_echo_reply_1500_2nd_mtu1280_B,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10b0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=154;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_B),1272,228);
        }
)

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

PMTU_fragment( 
        frag_echo_reply_1400_1st_mtu1280_B,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10b0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1400_to_B),40,1232);
        }
)

PMTU_fragment(
        frag_echo_reply_1400_2nd_mtu1280_B,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10b0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=154;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1400_to_B),1272,128);
        }
)

///////////////////////////////////
//
// Packets for HOST C or related C
//
///////////////////////////////////

// size = 1500

FEM_icmp6_echo_request(
         echo_request_1500_from_C,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10c0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_1452;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1500_to_C,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10c0::1"));
        },
        {
                 payload=ping_data_1452;
        }
)

// size = 1492

FEM_icmp6_echo_request(
         echo_request_1492_from_C,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10c0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_1444;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1492_to_C,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10c0::1"));
        },
        {
                 payload=ping_data_1444;
        }
)

// size = 1000

FEM_icmp6_echo_request(
         echo_request_1000_from_C,
         _HETHER_tn2nut,
        {
                 _SRC(v6("3ffe:501:ffff:10c0::1"));
                 _DST(NUT_GLOBAL_ADDRESS);
        },
        {
                 payload=ping_data_952;
        }
)

FEM_icmp6_echo_reply(
         echo_reply_1000_to_C,
         _HETHER_nut2tn,
        {
                 _SRC(NUT_GLOBAL_ADDRESS);
                 _DST(v6("3ffe:501:ffff:10c0::1"));
        },
        {
                 payload=ping_data_952;
        }
)

//////////////////////////
// Too Big Messages

FEM_icmp6_packet_too_big(
        icmp6_TooBigMesg_1272_for_1500_C,
        _HETHER_tn2nut,
                {
                _SRC(v6("3ffe:501:ffff:10c1::1"));
                _DST(NUT_GLOBAL_ADDRESS);
        },
                {
                MTU     = 1272;
                payload = TooBigData_1272_C;
        }
) 

Payload TooBigData_1272_C {
    data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_C),0,1232);
}

//////////////////////////
// Fragmented packets

// size = 1492

PMTU_fragment( 
        frag_echo_reply_1492_1st_mtu1500_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=0;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1492_to_C),40,1444);
        }
)

// size = 1400

PMTU_fragment( 
        frag_echo_reply_1500_1st_mtu1400_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_C),40,1352);
        }
)

PMTU_fragment(
        frag_echo_reply_1500_2nd_mtu1400_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=169;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_C),1392,108);
        }
)

// size = 1280

PMTU_fragment( 
        frag_echo_reply_1492_1st_mtu1280_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1492_to_C),40,1232);
        }
)

PMTU_fragment(
        frag_echo_reply_1492_2nd_mtu1280_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=154;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1492_to_C),1272,220);
        }
)

// size = 1280

PMTU_fragment( 
        frag_echo_reply_1500_1st_mtu1280_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_C),40,1232);
        }
)

PMTU_fragment(
        frag_echo_reply_1500_2nd_mtu1280_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=154;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_C),1272,228);
        }
)



// size = 1272

PMTU_fragment( 
        frag_echo_reply_1492_1st_mtu1272_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1492_to_C),40,1224);
        }
)

PMTU_fragment(
        frag_echo_reply_1492_2nd_mtu1272_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=153;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1492_to_C),1264,228);
        }
)

// size = 1272

PMTU_fragment( 
        frag_echo_reply_1500_1st_mtu1272_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=1;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_C),40,1224);
        }
)

PMTU_fragment(
        frag_echo_reply_1500_2nd_mtu1272_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=153;
             MFlag=0;
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1500_to_C),1264,236);
        }
)


// size = 1000

PMTU_fragment( 
        frag_echo_reply_1000_1st_mtu1280_C,
        _HETHER_nut2tn,
                {
                NextHeader=44;
                _SRC(NUT_GLOBAL_ADDRESS);
                _DST(v6("3ffe:501:ffff:10c0::1"));
        },
                {
             NextHeader=58;
             FragmentOffset=0;
             MFlag=0;  
             Identification=any;
        },
                {
        data=substr(_PACKET_IPV6_NAME(echo_reply_1000_to_C),40,960);
        }
)

