INET Framework for OMNeT++/OMNEST
inet::IPSocket Class Reference

TODO. More...

#include <IPSocket.h>

Public Member Functions

 IPSocket (cGate *gateToIP=nullptr)
 
virtual ~IPSocket ()
 
void setOutputGate (cGate *gateToIP)
 Sets the gate on which to send to IP. More...
 
void registerProtocol (int protocol)
 Registers the given IP protocol to the connected gate. More...
 

Protected Member Functions

void sendToIP (cMessage *message)
 

Private Attributes

cGate * gateToIP
 

Detailed Description

TODO.

Constructor & Destructor Documentation

inet::IPSocket::IPSocket ( cGate *  gateToIP = nullptr)
inline
38 { this->gateToIP = gateToIP; }
cGate * gateToIP
Definition: IPSocket.h:32
virtual inet::IPSocket::~IPSocket ( )
inlinevirtual
39 {}

Member Function Documentation

void inet::IPSocket::registerProtocol ( int  protocol)

Registers the given IP protocol to the connected gate.

Referenced by inet::PIMBase::handleNodeStart(), inet::IPvXTrafSink::initialize(), inet::EchoProtocol::initialize(), inet::PIMSplitter::initialize(), inet::tcp::TCP_lwIP::initialize(), inet::LinkStateRouting::initialize(), inet::tcp::TCP_NSC::initialize(), inet::IPvXTrafGen::initialize(), inet::ICMP::initialize(), inet::ICMPv6::initialize(), inet::GPSR::initialize(), inet::dymo::DYMO::initialize(), inet::AODVRouting::initialize(), inet::tcp::TCP::initialize(), inet::IGMPv2::initialize(), inet::UDP::initialize(), inet::IGMPv3::initialize(), inet::sctp::SCTP::initialize(), and inet::RSVP::initialize().

25 {
26  if (gateToIP && gateToIP->isConnected()) {
27  RegisterTransportProtocolCommand *message = new RegisterTransportProtocolCommand();
28  message->setProtocol(protocol);
29  sendToIP(message);
30  }
31 }
uint8_t protocol
Definition: TCP_NSC.cc:88
cGate * gateToIP
Definition: IPSocket.h:32
void sendToIP(cMessage *message)
Definition: IPSocket.cc:33
void inet::IPSocket::sendToIP ( cMessage *  message)
protected

Referenced by registerProtocol().

34 {
35  if (!gateToIP)
36  throw cRuntimeError("IPSocket: setOutputGate() must be invoked before socket can be used");
37 
38  check_and_cast<cSimpleModule *>(gateToIP->getOwnerModule())->send(message, gateToIP);
39 }
cGate * gateToIP
Definition: IPSocket.h:32
void inet::IPSocket::setOutputGate ( cGate *  gateToIP)
inline

Sets the gate on which to send to IP.

Must be invoked before socket can be used. Example: socket.setOutputGate(gate("ipOut"));

45 { this->gateToIP = gateToIP; }
cGate * gateToIP
Definition: IPSocket.h:32

Member Data Documentation

cGate* inet::IPSocket::gateToIP
private

Referenced by registerProtocol(), and sendToIP().


The documentation for this class was generated from the following files: