/* * @author STF 276 * @version $Id$ * @desc This module defines the ICMPv6 message types and * their information elements using types from the * Common and Ipv6 library. Also it provides some useful * constant definitions. * All types have been defined on the basis of RFC 2463 * @url http://www.ietf.org/rfc/rfc2463.txt * */ module LibIpv6_Rfc2463Icmpv6_TypesAndValues { //LibCommon import from LibCommon_BasicTypesAndValues all; import from LibCommon_DataStrings all; //LibIpv6 import from LibIpv6_CommonRfcs_TypesAndValues all ; group IcmpCodes { const UInt8 c_icmpCode0 := 0 ; const UInt8 c_icmpCode1 := 1 ; const UInt8 c_icmpCode2 := 2 ; const UInt8 c_icmpCode3 := 3 ; const UInt8 c_icmpCode4 := 4 ; const UInt8 c_icmpCode5 := 5 ; const UInt8 c_icmpCode255 := 255 ; } group rfc2463MessageIds { const UInt8 c_destinationUnreachableMsg := 1; const UInt8 c_packetTooBigMsg := 2; const UInt8 c_timeExceededMsg := 3; const UInt8 c_parameterProblemMsg := 4; const UInt8 c_unknownInformational := 127; const UInt8 c_echoRequestMsg := 128; const UInt8 c_echoReplyMsg := 129; const UInt8 c_unknownError := 255; } // end group rfc2463MessageIds group rfc2710MessageIds { const UInt8 c_multicastListenerQuery := 130; const UInt8 c_multicastListenerReport := 131; const UInt8 c_multicastListenerDone := 132; } // end group rfc2710MessageIds group IcmpPointers { const UInt32 c_icmpPointer4 := 4; const UInt32 c_icmpPointer6 := 6; const UInt32 c_icmpPointer24 := 24; const UInt32 c_icmpPointer40 := 40; const UInt32 c_icmpPointer41 := 41; const UInt32 c_icmpPointer42 := 42; const UInt32 c_icmpPointer43 := 43; const UInt32 c_icmpPointer46 := 46; const UInt32 c_icmpPointer64 := 64; } group icmpRfc2463MessageTypes { /* * @desc PDU type derived from RFC2463 clause 3.1 */ type record DestinationUnreachableMsg { UInt8 icmpType(c_destinationUnreachableMsg), UInt8 icmpCode, Oct2 checksum, Oct4 unused, octetstring data optional } with { variant "present=bytes(1,1)&&(valueOf(getTag('nextHeader'))==58)"; variant (data) "length=getIntTag('IPv6Header_payloadLength')-8"; } /* * @desc PDU type derived from RFC2463 clause 3.2 */ type record PacketTooBigMsg { UInt8 icmpType(c_packetTooBigMsg), UInt8 icmpCode, Oct2 checksum, UInt32 mtu, octetstring data optional } with { variant "present=bytes(1,2)&&(valueOf(getTag('nextHeader'))==58)"; variant (data) "length=getIntTag('IPv6Header_payloadLength')-8"; } /* * @desc PDU type derived from RFC2463 clause 3.3 */ type record TimeExceededMsg { UInt8 icmpType(c_timeExceededMsg), UInt8 icmpCode, Oct2 checksum, UInt32 unused(0), //always zero octetstring data optional } with { variant "present=bytes(1,3)&&(valueOf(getTag('nextHeader'))==58)"; variant (data) "length=getIntTag('IPv6Header_payloadLength')-8"; } /* * @desc PDU type derived from RFC2463 clause 3.4 */ type record ParameterProblemMsg { UInt8 icmpType(c_parameterProblemMsg), UInt8 icmpCode, Oct2 checksum, UInt32 pointer, octetstring data optional } with { variant "present=bytes(1,4)&&(valueOf(getTag('nextHeader'))==58)"; variant (data) "length=getIntTag('IPv6Header_payloadLength')-8"; } /* * @desc PDU type derived from RFC2463 clause 4.1 */ type record EchoRequestMsg { UInt8 icmpType(c_echoRequestMsg), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 sequenceNumber, octetstring data optional } with { variant "present=bytes(1,128)&&(valueOf(getTag('nextHeader'))==58)"; variant (data) "length=getIntTag('IPv6Header_payloadLength')-8"; } /* * @desc PDU type derived from RFC2463 clause 4.2 */ type record EchoReplyMsg { UInt8 icmpType(c_echoReplyMsg), UInt8 icmpCode, Oct2 checksum, UInt16 identifier, UInt16 sequenceNumber, octetstring data optional } with { variant "present=bytes(1,129)&&(valueOf(getTag('nextHeader'))==58)"; variant (data) "length=getIntTag('IPv6Header_payloadLength')-8"; } /* * @desc Generic Icmpv6 header */ type record OtherIcmpv6Msg { UInt8 icmpType, UInt8 icmpCode, Oct2 checksum, octetstring data optional } with { variant "present=valueOf(getTag('nextHeader'))==58"; variant (data) "length=getIntTag('IPv6Header_payloadLength')-4"; } } // end icmpRfc2463Packets } // end module LibIpv6_Rfc2463Icmpv6_TypesAndValues //with { // encode "LibIpv6_Rfc2463Icmpv6_TypesAndValues"; //}