IPv6ControlInfo

Namespace inet

IPv6ControlInfo

class

Control information for sending/receiving packets over IPv6.

To send a packet over IPv6, fill in an IPv6ControlInfo object, attach it to the packet with the C++ method setControlInfo(), the send it to the IPv6 module.

When sending, the following fields are required:

Optional fields:

  • srcAddr: it will be set to the address of the outgoing interface
  • timeToLive

When IPv6 delivers a packet to higher layers, it also attaches an IPv6ControlInfo to it. It fills in the following fields:

  • srcAddr, destAddr, protocol, hopLimit: values from the original datagram
  • interfaceId: the interface on which the datagram arrived, or -1 if it was created locally

IPv6 also puts the original datagram object into the control info, because it may be needed by higher layers.

Extends

Name Type Description
cObject (unknown -- not in documented files)

Fields

Name Type Description
protocol short

transport layer protocol

destAddr IPv6Address

destination IPv6 address

srcAddr IPv6Address

source IPv6 address

trafficClass unsigned char

Traffic Class byte (low 6 bits: DSCP; highest 2 bits: ECN)

diffServCodePoint int

maps to bits 0-5 of trafficClass

explicitCongestionNotification int

maps to bits 6-7 of trafficClass

hopLimit short

hop limit

interfaceId int

interface on which the datagram was received, or should be sent (see InterfaceTable)

multicastLoop bool

if true, sent multicast datagrams will be looped back

extensionHeader IPv6ExtensionHeader[]

array of extension headers, subclassed from IPv6ExtensionHeader

Source code

//
// Control information for sending/receiving packets over IPv6.
//
// To send a packet over IPv6, fill in an ~IPv6ControlInfo object,
// attach it to the packet with the C++ method setControlInfo(),
// the send it to the ~IPv6 module.
//
// When sending, the following fields are required:
// - protocol: a value from ~IPProtocolId
// - destAddr
//
// Optional fields:
// - srcAddr: it will be set to the address of the outgoing interface
// - timeToLive
//
// When ~IPv6 delivers a packet to higher layers, it also attaches an
// ~IPv6ControlInfo to it. It fills in the following fields:
//  - srcAddr, destAddr, protocol, hopLimit: values from the original datagram
//  - interfaceId: the interface on which the datagram arrived, or -1 if it was
//    created locally
//
// ~IPv6 also puts the original datagram object into the control info, because
// it may be needed by higher layers.
//
class IPv6ControlInfo extends cObject
{
    @customize(true);
    short protocol @enum(IPProtocolId);  // transport layer protocol
    IPv6Address destAddr; // destination IPv6 address
    IPv6Address srcAddr;  // source IPv6 address
    unsigned char trafficClass;  // Traffic Class byte (low 6 bits: DSCP; highest 2 bits: ECN)
    abstract int diffServCodePoint;  // maps to bits 0-5 of trafficClass
    abstract int explicitCongestionNotification;  // maps to bits 6-7 of trafficClass
    short hopLimit;       // hop limit
    int interfaceId = -1; // interface on which the datagram was received, or
                          // should be sent (see ~InterfaceTable)
    bool multicastLoop;   // if true, sent multicast datagrams will be looped back
    abstract IPv6ExtensionHeader *extensionHeader[]; // array of extension headers, subclassed from ~IPv6ExtensionHeader
}

File: src/inet/networklayer/contract/ipv6/IPv6ControlInfo.msg