LibIpv6_Interface.ttcn 3.8 KB
Newer Older
alex's avatar
alex committed
/*
 *	@author 	STF 276
 *  @version 	$Id$
 *	@desc		This module defines the interface for any function
 *              part of the IPv6 library.
 *				Further on, this module defines a meta type over all IPv6
 *              packets supported by the IPv6 library as well as
 *              templates for it. Also it includes the raw Ipv6
 *              message type which can be used for sending encoded
 *              Ipv6 packets.
 *
 */
module LibIpv6_Interface {

	//LibCommon
	import from LibCommon_Time all ;
	//LibIpv6
	import from LibIpv6_Rfc2460Root_TypesAndValues {type all};
	import from LibIpv6_Rfc2463Icmpv6_TypesAndValues {type all};
	import from LibIpv6_Rfc2461NeighborDiscovery_TypesAndValues {type all};
	import from LibIpv6_Rfc2894RouterRenumbering_TypesAndValues {type all};
seb's avatar
seb committed
	import from LibIpv6_Rfc3775Mipv6_TypesAndValues {type all};
seb's avatar
seb committed
	import from LibIpv6_Rfc0768Udp_TypesAndValues all ;
	import from LibIpv6_Rfc4303Esp_TypesAndValues all;
alex's avatar
alex committed

	/*
	 * @desc	This type is used to define behavior within the IPv6 library
	 *			which can be executed on  both, host as well as router,
	 *			components. It may also be used to specify behavior outside of
	 *			the IPv6 library. In order to call IPv6 library functions
	 *			defined based on this type the caller function must
	 *			be defined based on a type compatible component type.
alex's avatar
alex committed
	*/
	type component LibIpv6Node {
		port Ipv6Port ipPort;
		timer tc_ac:= PX_TAC;
		timer tc_noAc:= PX_TNOAC;
		timer tc_wait:= PX_TWAIT;
	}

	type port Ipv6Port message {
		inout
validator's avatar
""  
validator committed

alex's avatar
alex committed
		//Imported from Rfc 2463
		DestinationUnreachable,
		PacketTooBig,
		TimeExceeded,
		ParameterProblem,
		EchoRequest,
		EchoReply,
		//Imported from Rfc 2461
		RouterAdvertisement,
		RouterSolicitation,
		NeighborSolicitation,
		NeighborAdvertisement,
		Redirect,
		//Imported from Rfc 2894
		RouterRenumbering,
		//Imported from Rfc XXXX Mipv6
		HomeAgentAddressDiscoveryRequest,
		HomeAgentAddressDiscoveryReply,
		MobilePrefixSolicitation,
		MobilePrefixAdvertisement,
		MipRouterAdvertisement,
		OtherIcmpv6Hdr,
		//hand encoded IPv6 packets
		RawIpv6Packet,
		//UDP
		UdpPacket,
		//MetaPdu
validator's avatar
""  
validator committed
		Ipv6Packet,
		//General IPv6 packet
seb's avatar
seb committed
		GeneralIpv6,
		//EspPackets
		EspTunnelModePacket,
		EspTransportModePacket
alex's avatar
alex committed
	}

	/*
	 * @desc This meta packet type contains any Ipv6 packets.
	 *		 This type is used mainly for checksum calculation
alex's avatar
alex committed
	*/
seb's avatar
seb committed
    type union Ipv6Packet  {
alex's avatar
alex committed
		//Imported from Rfc 2463
		DestinationUnreachable 				destinationUnreachable,
		PacketTooBig						packetTooBig,
		TimeExceeded						timeExceeded,
		ParameterProblem					parameterProblem,
		EchoRequest							echoRequest,
		EchoReply							echoReply,
		//Imported from Rfc 2461
		RouterAdvertisement					routerAdvert,
		RouterSolicitation      			routerSolicitation,
		NeighborSolicitation				nbrSolicitation,
		NeighborAdvertisement				nbrAdvert,
		Redirect							redirect,
		//Imported from Rfc 2894
		RouterRenumbering					routerRenumbering,
		//Imported from Rfc XXXX Mipv6
		HomeAgentAddressDiscoveryRequest	homeAgentAddressDiscoveryRequest,
		HomeAgentAddressDiscoveryReply		homeAgentAddressDiscoveryReply,
		MobilePrefixSolicitation			mobilePrefixSolicitation,
		MobilePrefixAdvertisement			mobilePrefixAdvertisement,
		MipRouterAdvertisement				mipRouterAdvertisement,
		//Default value
		OtherIcmpv6Hdr						otherHeader,
		//Udp
validator's avatar
""  
validator committed
		UdpPacket							udpPacket,
	  	//General IPv6 packet
seb's avatar
seb committed
	  	GeneralIpv6                         generalIpv6
alex's avatar
alex committed
	}
	with {
		encode "isPDU=LibIpv6_Interface;"
	}

	template Ipv6Packet mw_ipPkt := ? ;

seb's avatar
seb committed
	template Ipv6Packet m_ipPkt_echoRequest (in template EchoRequest p_echoRequest) := {
alex's avatar
alex committed
		echoRequest := p_echoRequest
	}

	/*
	*  @desc This type is intended to be used to send "hand encoded"
	*        IPv6 packets. It can also be used to create incorrect
	*        IPv6 messages.
    */
	type octetstring RawIpv6Packet;

} // end module LibIpv6_Interface