Class SCTPOpenCommand

File: src/transport/contract/SCTPCommand.msg

Control info to be used for active or passive SCTP open.

localAddr, remoteAddr, localPort, remotePort should be self-explanatory. localAddr is optional because SCTP can learn it from IP when a packet is received from the peer; localPort is optional because SCTP supports ephemeral ports.

The sendQueueClass, receiveQueueClass and sctpAlgorithmClass fields allow per-connection SCTP configuration. These fields may contain names of classes subclassed from SCTPSendQueue, SCTPReceiveQueue and SCTPAlgorithm, respectively. If not set, module parameters with similar names are used.

The fork parameter is used with passive open, and controls what happens when an incoming connection is received. With fork=true, it emulates the Unix accept(2) syscall semantics: a new connection structure is created for the connection (with a new connId, see in SCTPCommand), and the connection structure with the old connId remains listening. With fork=false, all the above does not happen: the first connection is accepted (with the original connId), and further incoming connections will be refused by SCTP by sending an RST segment.

See also: TcpCommandCode, SCTPMain

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Extends:

SCTPCommand (class)

Control info for SCTP connections. This class is to be set as control info (see cMessage::setControlInfo()) on all messages exchanged between SCTP and application, in both directions. Some commands and indications (SCTP_C_OPEN_xxx, SCTP_I_STATUS) use subclasses.

Fields:

Name Type Description
sid int
messagesToPush uint32
fork bool

used only for passive open

lifetime double
queueClass string

may be left empty

numRequests uint32
numMsgs int
ssn int
gate int
assocId int

identifies the socket within the application

sctpAlgorithmClass string

may be left empty

outboundStreams uint32
remoteAddresses AddressVector
sendUnordered unsigned short
remotePort int

required for active open

localPort int

required for passive open

localAddresses AddressVector

IPvXAddress localAddr; // may be left empty

localAddr IPvXAddress
remoteAddr IPvXAddress

Source code:

//
// Control info to be used for active or passive SCTP open.
//
// localAddr, remoteAddr, localPort, remotePort should be self-explanatory.
// localAddr is optional because SCTP can learn it from IP when a packet
// is received from the peer; localPort is optional because SCTP supports
// ephemeral ports.
//
// The sendQueueClass, receiveQueueClass and sctpAlgorithmClass fields
// allow per-connection SCTP configuration. These fields may contain
// names of classes subclassed from SCTPSendQueue, SCTPReceiveQueue
// and SCTPAlgorithm, respectively. If not set, module parameters with
// similar names are used.
//
// The fork parameter is used with passive open, and controls what happens
// when an incoming connection is received. With fork=true, it emulates
// the Unix accept(2) syscall semantics: a new connection structure
// is created for the connection (with a new connId, see in SCTPCommand),
// and the connection structure with the old connId remains listening.
// With fork=false, all the above does not happen: the first connection
// is accepted (with the original connId), and further incoming connections
// will be refused by SCTP by sending an RST segment.
//
// @see TcpCommandCode, SCTPMain
//
class SCTPOpenCommand extends SCTPCommand
{
    //IPvXAddress localAddr;             // may be left empty
    AddressVector localAddresses;
    IPvXAddress remoteAddr;            // required for active open
    AddressVector remoteAddresses;
    int localPort = -1;              // required for passive open
    int remotePort = -1;             // required for active open
    bool fork = false;               // used only for passive open
    string queueClass = "SCTPQueue"; // may be left empty       
    string sctpAlgorithmClass;       // may be left empty
    uint32 outboundStreams;
    uint32 numRequests;
    uint32 messagesToPush;
}