RMBufRecvInfo Class Reference

class RMBufRecvInfo : public RMBufPktInfo

Information for incoming packets.

This extends the packet information class to record progress of processing the received IPv4 or IPv6 packet.

The RMBufChain contains a full IPv6 (or IPv4) packet starting from the beginning. The position of the current (upper layer or extension header) is indicated by the iOffset field.

  • iProtocol is always the internet protocol number corresponding to the header incidated by iOffset.

  • iLength is the length of the FULL packet, starting from the IP header. The upper layer length (that includes the uppler layer header) is always: (iLength - iOffset) >= 0. Note that this can be ZERO!

  • iIcmp =! 0, for ICMP error report

The source and destination address are loaded from the ip header associated with the indicated upper layer header. In case of ICMP error report, the addresses are loaded from the packet *inside* the ICMP report.

The addresses are always in IPv6 format. If the packet was IPv4 packet, the addresses are presented in IPv4 mapped format.

CAUTION:

The fact that address is IPv4 mapped DOES NOT mean that the packet is IPv4. It could as well be an IPv6 packet with mapped addresses!

RMBufRecvInfo is assuming that it fits into the single RMBuf block.

Since
v7.0

Inherits from

Member Functions Documentation

CheckL(TInt)

TInt CheckL ( TInt aLength ) const [inline]

Tests that the specified length field does not exceed the remaining space in the buffer.

Verify that there is enough data after in the packet after the iOffset octets. This simply tests whether (aLength > iLength - iOffset ), and leaves with KErrInet6ShortPacket , if true.

leave
KErrInet6ShortPacket Insufficient space.

Parameters

TInt aLength Length to test.

Member Data Documentation

TUint8 iCode

TUint8 iCode

ICMP Code (0..255).

This applies to both ICMPv4 and ICMPv6.

(only defined if the field iIcmp != 0)

TUint8 iIcmp

TUint8 iIcmp

ICMP packet flag.

This determines the interpretation of the information fields: iType, iCode, and iParameter.

  • iIcmp == 0, The buffer contains normal upper layer packet, the header starting from the indicated iOffset. The values of the iType, iCode and iParameter are undefined..

  • iIcmp != 0, The buffer contains an ICMP error report for the upper layer protocol, the returned upper layer header starting from the indicated iOffset. The iOffsetIp indicates the start of the problem packet.

Valid values are: 0, KProtocolInetIcmp , or KProtocolInet6Icmp .

TUint32 iInterfaceIndex

TUint32 iInterfaceIndex

Index of the logical source network interface.

TInt iOffset

TInt iOffset

An offset that indicates the beginning of the current header being processed.

Inbound hooks must update this if they consume a header within the packet.

It initially points to the first header after the IP header. Offset to the header being processed.

TUint16 iOffsetIp

TUint16 iOffsetIp

Offset to the related IP header.

This is usually zero, but is non-zero for ICMP error reports, and could be non-zero for tunneled packets.

TUint32 iOriginalIndex

TUint32 iOriginalIndex

Index of the physical original network interface.

TUint32 iParameter

TUint32 iParameter

The last 32 bits from the ICMP header.

(only defined if the field iIcmp != 0)

TUint16 iPrevNextHdr

TUint16 iPrevNextHdr

Offset of the previous Next Header field.

If a hook consumes an extension header and advances iOffset to the next header, it must also set this to point to the Next Header field of the former header.

This is initialized to refer the next header field of the IP header.

This can be used by header handlers which remove the header from the packet. For example, IPSEC does this for AH and ESP headers. IPSEC must be able to correct the protocol/next header field of the previous header.

TUint8 iType

TUint8 iType

ICMP Type (0..255).

This applies to both ICMPv4 and ICMPv6.

(only defined if the field iIcmp != 0)

TUint8 iVersion

TUint8 iVersion

IP Version (4 or 6) of the related IP header.