TInet6HeaderIP Class Reference

#include <ip6_hdr.h>

class TInet6HeaderIP

Detailed Description

Encapsulates an IPv6 IP header.
 *************************
 Extract from the RFC-2460
 *************************

   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |Version| Traffic Class |           Flow Label                  |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |         Payload Length        |  Next Header  |   Hop Limit   |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   +                                                               +
   |                                                               |
   +                         Source Address                        +
   |                                                               |
   +                                                               +
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
   |                                                               |
   +                                                               +
   |                                                               |
   +                      Destination Address                      +
   |                                                               |
   +                                                               +
   |                                                               |
   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

   Version              4-bit Internet Protocol version number = 6.

   Traffic Class        8-bit traffic class field.  See section 7.

   Flow Label           20-bit flow label.  See section 6.

   Payload Length       16-bit unsigned integer.  Length of the IPv6
                        payload, i.e., the rest of the packet following
                        this IPv6 header, in octets.  (Note that any
                        extension headers [section 4] present are
                        considered part of the payload, i.e., included
                        in the length count.)

   Next Header          8-bit selector.  Identifies the type of header
                        immediately following the IPv6 header.  Uses the
                        same values as the IPv4 Protocol field [RFC-1700
                        et seq.].

   Hop Limit            8-bit unsigned integer.  Decremented by 1 by
                        each node that forwards the packet. The packet
                        is discarded if Hop Limit is decremented to
                        zero.

   Source Address       128-bit address of the originator of the packet.

   Destination Address  128-bit address of the intended recipient of the
                        packet (possibly not the ultimate recipient, if
                        a Routing header is present)
Since
v7.0

Member Attribute Documentation

i

iAlign

TUint32 iAlign

Member Enumeration Documentation

Enum TOffsets

EnumeratorValueDescription
O_PayloadLength4
O_NextHeader6
O_HopLimit7
O_SrcAddr8
O_DstAddr24

Member Function Documentation

DstAddr ( )

TIp6Addr &DstAddr()const [inline]

Gets the destination address from the header.

Returns: Destination address

EcnIsCongestion ( )

TBool EcnIsCongestion()[inline]

Gets ECN congestion status.

see RFC-3168 for details.

Returns: True, if CE bit is set on an ECN capable packet.

EndPtr ( )

TUint8 *EndPtr()[inline]

Gets a pointer to the byte following the header.

Returns: Pointer to the byte following the header

FlowLabel ( )

TInt FlowLabel()const [inline]

Gets the flow label from the header.

Returns: Flow label (host byte order)

HeaderLength ( )

TInt HeaderLength()const [inline]

Gets the header length.

Note that the header length is fixed.

Returns: Header length.

HopLimit ( )

TInt HopLimit()const [inline]

Init ( )

voidInit()[inline]

Initialises the header to basic initial values.

  • Version = 6

  • Traffic Class = 0

  • Flow Label = 0

  • Payload Length = 0

  • Next Header = 0

  • Hop Limit = 0

The Source and Destination address fields are not touched.

MaxHeaderLength ( )

TInt MaxHeaderLength()[static, inline]

Gets the maximum header length.

Note that the header length is fixed.

Returns: Maximum header length

MinHeaderLength ( )

TInt MinHeaderLength()[static, inline]

Gets the minimum header length.

Note that the header length is fixed.

Returns: Minimum header length

NextHeader ( )

TInt NextHeader()const [inline]

Gets the next header selector from the header.

Returns: Next header selector (0..255)

PayloadLength ( )

TInt PayloadLength()const [inline]

Gets the payload length from the header.

Returns: Payload length

SetDstAddr ( const TIp6Addr & )

voidSetDstAddr(const TIp6Addr &anAddr)[inline]

Sets the destination address in the header.

ParameterDescription
anAddrDestination address

SetFlowLabel ( TInt )

voidSetFlowLabel(TIntaFlow)[inline]

Sets the flow label in the header.

ParameterDescription
aFlowFlow label (20 bit integer in host order)

SetHopLimit ( TInt )

voidSetHopLimit(TIntaLimit)[inline]

Sets the hop limit in the header.

ParameterDescription
aLimitHop limit (0..255)

SetNextHeader ( TInt )

voidSetNextHeader(TIntaNextHeader)[inline]

Sets the next header selector from the header.

ParameterDescription
aNextHeaderNext header selector (0..255)

SetPayloadLength ( TInt )

voidSetPayloadLength(TIntaLength)[inline]

Sets the payload length in the header.

ParameterDescription
aLengthPayload length

SetSrcAddr ( const TIp6Addr & )

voidSetSrcAddr(const TIp6Addr &anAddr)[inline]

Sets the source address in the header.

ParameterDescription
anAddrSource address

SetTrafficClass ( TInt )

voidSetTrafficClass(TIntaClass)[inline]

Sets the traffic class in the header.

ParameterDescription
aClassTraffic class (0..255)

SetVersion ( TInt )

voidSetVersion(TIntaVersion)[inline]

Sets the IP version in the header.

ParameterDescription
aVersionIP version (0..15, = 6 for IPv6)

SrcAddr ( )

TIp6Addr &SrcAddr()const [inline]

Gets the source address from the header.

Returns: Source address

TrafficClass ( )

TInt TrafficClass()const [inline]

Gets the traffic class from the header.

Returns: Traffic class

Version ( )

TInt Version()const [inline]

Gets the IP version from the header.

Returns: IP version