//
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Yokogawa Electric Corporation,
// 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.
//
// $TAHI: ct/natpt/rfc2765_3.3_icmpv4query.def,v 1.3 2001/10/11 01:41:47 akisada Exp $
//

#include "natpt.def"

#define FEM_icmpv4query(_pNAME, _pTYPE, _pDATA) \
_FEM_icmp4(EchoRequest, \
	_pNAME, \
	_HETHER_tn2nut, \
	{ \
		_SRC(TN_LINK1_V4_ADDRESS); \
		_DST(TN_LINK0_V4_ADDRESS); \
		DF=1; \
	}, \
        { \
		Type = _pTYPE; \
		Code = 0; \
		payload = _PAYLOAD_NAME(_pNAME); \
	} \
) \
Payload _PAYLOAD_NAME(_pNAME) \
	{ \
		data = _pDATA; \
	}

// Send Information Request (Type 15) on Link1
FEM_icmpv4query(icmpv4_information_request, 15, {})

// Send Information Reply (Type 16) on Link1
FEM_icmpv4query(icmpv4_information_reply, 16, {})

// Send Timestamp Request (Type 13) on Link1
FEM_icmpv4query(icmpv4_timestamp_request, 13, repeat(0x0, 12))

// Send Timestamp Reply (Type 14) on Link1
FEM_icmpv4query(icmpv4_timestamp_reply, 14, repeat(0xff, 12))

// Send Address Mask Request (Type 17) on Link1
FEM_icmpv4query(icmpv4_address_mask_request, 17, repeat(0x0, 4))

// Send Address Mask Reply (Type 18) on Link1
FEM_icmpv4query(icmpv4_address_mask_reply, 18, repeat(0xff, 4))

// Send ICMP Router Advertisement (Type 9) on Link1
FEM_icmpv4query(icmpv4_router_advertisement, 9, {})

// Send ICMP Router Solicitation (Type 10) on Link1
FEM_icmpv4query(icmpv4_router_solicitation, 10, {})

// Send Unknown ICMPv4 (Type 255) on Link1
FEM_icmpv4query(icmpv4_unknown, 255, repeat(0xff,64))
