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

#define EALGO_FROM_SG1_NET2	ealgo_descbc_012

#define ESP_TO_SG1_NET2		esp_to_sg_pad

ESPAlgorithm ealgo_descbc_012_pad {
        crypt = descbc("01234567");
        pad = sequential();
}

Hdr_ESP esp_to_sg_pad {
        SPI = 0x1000;
        SequenceNumber = any;	// 1;
        algorithm = ealgo_descbc_012_pad;
        PadLength = 7;
}

#define IPSEC_ECHO_DATA echo_data_odd

#include "./RTU_E_common.def"

//======================================================================
//
// Invalid Padding
//

Hdr_ESP esp_from_sg_2 {
        SPI = 0x1000;
        SequenceNumber = 2;
        algorithm = ealgo_descbc_012_pad_2;
        PadLength = 7;
}

ESPAlgorithm ealgo_descbc_012_pad_2 {
        crypt = descbc("01234567");
        //pad = sequential();
        pad = allzero();
        //pad = random();
}

FEM_hdr_ipvX_exth(
	esptun_from_sg1_net2_echo_request_from_host1_net4_to_host1_net1_on_net0_2 ,
	hether_router2nut,
	{
		_SRC(vX(IPSEC_SG1_NET2_ADDR));
		_DST(vX(IPSEC_NUT_NET0_ADDR));
	},
	{
		header = _HDR_IPVX_NAME(esptun_from_sg1_net2_echo_request_from_host1_net4_to_host1_net1_on_net0_2);
		exthdr = esp_from_sg_2;
		upper = _PACKET_IPVX_NAME(echo_request_from_host1_net4_to_host1_net1_on_net0_2);
	}
)

FEM_icmpX_echo_request(
        echo_request_from_host1_net4_to_host1_net1_on_net0_2,
        hether_router2nut,
        {
                _SRC(vX(IPSEC_HOST1_NET4_ADDR));
                _DST(vX(IPSEC_HOST1_NET1_ADDR));
        },
        {
                payload = IPSEC_ECHO_DATA;
        }
)

FEM_icmpX_echo_request(
        echo_request_from_host1_net4_to_host1_net1_on_net1_2,
        hether_nut2host1,
        {
                _SRC(vX(IPSEC_HOST1_NET4_ADDR));
                _DST(vX(IPSEC_HOST1_NET1_ADDR));
        },
        {
                payload = IPSEC_ECHO_DATA;
        }
)

//end

