#include <ip6_hdr.h>
| class TInet6HeaderIP |
| Public Attributes | |
|---|---|
| TUint8 | i |
| TUint32 | iAlign |
| Public Member Enumerations | |
|---|---|
| enum | TOffsets { O_PayloadLength, O_NextHeader, O_HopLimit, O_SrcAddr, O_DstAddr } |
| Public Member Functions | |
|---|---|
| TIp6Addr & | DstAddr() |
| TBool | EcnIsCongestion() |
| TUint8 * | EndPtr() |
| TInt | FlowLabel() |
| TInt | HeaderLength() |
| TInt | HopLimit() |
| void | Init() |
| TInt | MaxHeaderLength() |
| TInt | MinHeaderLength() |
| TInt | NextHeader() |
| TInt | PayloadLength() |
| void | SetDstAddr(const TIp6Addr &) |
| void | SetFlowLabel(TInt) |
| void | SetHopLimit(TInt) |
| void | SetNextHeader(TInt) |
| void | SetPayloadLength(TInt) |
| void | SetSrcAddr(const TIp6Addr &) |
| void | SetTrafficClass(TInt) |
| void | SetVersion(TInt) |
| TIp6Addr & | SrcAddr() |
| TInt | TrafficClass() |
| TInt | Version() |
*************************
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)
| TIp6Addr & | DstAddr | ( | ) | const [inline] |
Gets the destination address from the header.
Returns: Destination address
| TBool | EcnIsCongestion | ( | ) | [inline] |
Gets ECN congestion status.
see RFC-3168 for details.
Returns: True, if CE bit is set on an ECN capable packet.
| TUint8 * | EndPtr | ( | ) | [inline] |
Gets a pointer to the byte following the header.
Returns: Pointer to the byte following the header
| TInt | FlowLabel | ( | ) | const [inline] |
Gets the flow label from the header.
Returns: Flow label (host byte order)
| TInt | HeaderLength | ( | ) | const [inline] |
Gets the header length.
Note that the header length is fixed.
Returns: Header length.
| void | Init | ( | ) | [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
| TInt | MaxHeaderLength | ( | ) | [static, inline] |
Gets the maximum header length.
Note that the header length is fixed.
Returns: Maximum header length
| TInt | MinHeaderLength | ( | ) | [static, inline] |
Gets the minimum header length.
Note that the header length is fixed.
Returns: Minimum header length
| TInt | NextHeader | ( | ) | const [inline] |
Gets the next header selector from the header.
Returns: Next header selector (0..255)
| void | SetDstAddr | ( | const TIp6Addr & | anAddr | ) | [inline] |
Sets the destination address in the header.
| Parameter | Description |
|---|---|
| anAddr | Destination address |
| void | SetFlowLabel | ( | TInt | aFlow | ) | [inline] |
Sets the flow label in the header.
| Parameter | Description |
|---|---|
| aFlow | Flow label (20 bit integer in host order) |
| void | SetHopLimit | ( | TInt | aLimit | ) | [inline] |
Sets the hop limit in the header.
| Parameter | Description |
|---|---|
| aLimit | Hop limit (0..255) |
| void | SetNextHeader | ( | TInt | aNextHeader | ) | [inline] |
Sets the next header selector from the header.
| Parameter | Description |
|---|---|
| aNextHeader | Next header selector (0..255) |
| void | SetPayloadLength | ( | TInt | aLength | ) | [inline] |
Sets the payload length in the header.
| Parameter | Description |
|---|---|
| aLength | Payload length |
| void | SetSrcAddr | ( | const TIp6Addr & | anAddr | ) | [inline] |
Sets the source address in the header.
| Parameter | Description |
|---|---|
| anAddr | Source address |
| void | SetTrafficClass | ( | TInt | aClass | ) | [inline] |
Sets the traffic class in the header.
| Parameter | Description |
|---|---|
| aClass | Traffic class (0..255) |
| void | SetVersion | ( | TInt | aVersion | ) | [inline] |
Sets the IP version in the header.
| Parameter | Description |
|---|---|
| aVersion | IP version (0..15, = 6 for IPv6) |