//
// $Copyright$
//
// $Name:  $
//
// $Id: HTR_A_common.def,v 1.1.1.1 2000/10/31 22:38:51 sekiya Exp $
//

#include "./HTR_common.def"
//======================================================================
//
// Algorithm predefinition
//

AHAlgorithm aalgo_hmacmd5_012 {
	auth = hmacmd5("0123456789ABCDEF");
}

AHAlgorithm aalgo_hmacmd5_foo {
	auth = hmacmd5("foo0foo1foo2foo3");
}

AHAlgorithm aalgo_hmacsha1_012 {
	auth = hmacsha1("0123456789ABCDEF0123");
}


//======================================================================
//
// AH/ESP definition (default use)
//

#ifndef AALGO_FROM_HOST1
#define AALGO_FROM_HOST1 aalgo_hmacmd5_012
#endif

#ifndef AALGO_TO_HOST1
#define AALGO_TO_HOST1 aalgo_hmacmd5_012
#endif


Hdr_AH ah_from_host {
	SPI = 0x1000;
	SequenceNumber = 1;
	algorithm = AALGO_FROM_HOST1;
}

Hdr_AH ah_to_host {
	SPI = 0x1000;
	SequenceNumber = any; #1;
	algorithm = AALGO_TO_HOST1;
}

Hdr_AH ah_from_host_sn2 {
	SPI = 0x1000;
	SequenceNumber = 2;
	algorithm = AALGO_FROM_HOST1;
}

Hdr_AH ah_from_host_sn3 {
	SPI = 0x1000;
	SequenceNumber = 3;
	algorithm = AALGO_FROM_HOST1;
}

Hdr_AH ah_from_host_sn4 {
	SPI = 0x1000;
	SequenceNumber = 4;
	algorithm = AALGO_FROM_HOST1;
}


//======================================================================
//
// Echo Request from Host1 IPsec AH
//

#ifndef AH_FROM_HOST1
#define AH_FROM_HOST1 ah_from_host
#endif

FEM_icmpX_echo_request_exth(
	echo_request_from_host1_ah,
	hether_router2nut,
	{
		_SRC(vX(IPSEC_HOST1_NET5_ADDR));
		_DST(vX(IPSEC_NUT_NET3_ADDR));
	},
	{
		header = _HDR_IPVX_NAME(echo_request_from_host1_ah);
		exthdr = AH_FROM_HOST1;
		upper = _ICMPVX_NAME(echo_request_from_host1_ah);
	},
	{
		payload = IPSEC_ECHO_DATA;
	}
)

//======================================================================
//
// Echo Reply to Host1 IPsec AH
//

#ifndef AH_TO_HOST1
#define AH_TO_HOST1 ah_to_host
#endif

FEM_icmpX_echo_reply_exth(
	echo_reply_to_host1_ah,
	hether_nut2router,
	{
		_SRC(vX(IPSEC_NUT_NET3_ADDR));
		_DST(vX(IPSEC_HOST1_NET5_ADDR));
	},
	{
		header = _HDR_IPVX_NAME(echo_reply_to_host1_ah);
		exthdr = AH_TO_HOST1;
		upper = _ICMPVX_NAME(echo_reply_to_host1_ah);
	},
	{
		payload = IPSEC_ECHO_DATA;
	}
)

//end


