|
INET Framework for OMNeT++/OMNEST
|
#include <TunnelApp.h>
|
| virtual int | numInitStages () const override |
| |
| virtual void | initialize (int stage) override |
| |
| virtual void | handleMessageWhenUp (cMessage *msg) override |
| |
| virtual void | socketDataArrived (UdpSocket *socket, Packet *packet) override |
| | Notifies about data arrival, packet ownership is transferred to the callee. More...
|
| |
| virtual void | socketErrorArrived (UdpSocket *socket, Indication *indication) override |
| | Notifies about error indication arrival, indication ownership is transferred to the callee. More...
|
| |
| virtual void | socketClosed (UdpSocket *socket) override |
| | Notifies about socket closed, indication ownership is transferred to the callee. More...
|
| |
| virtual void | socketDataArrived (Ipv4Socket *socket, Packet *packet) override |
| |
| virtual void | socketClosed (Ipv4Socket *socket) override |
| |
| virtual void | socketDataArrived (TunSocket *socket, Packet *packet) override |
| |
| virtual void | socketClosed (TunSocket *socket) override |
| |
| virtual void | handleStartOperation (LifecycleOperation *operation) override |
| |
| virtual void | handleStopOperation (LifecycleOperation *operation) override |
| |
| virtual void | handleCrashOperation (LifecycleOperation *operation) override |
| |
| virtual bool | isInitializeStage (int stage) const override |
| |
| virtual bool | isModuleStartStage (int stage) const override |
| |
| virtual bool | isModuleStopStage (int stage) const override |
| |
| virtual int | numInitStages () const override |
| |
| virtual void | refreshDisplay () const override |
| |
| virtual void | handleMessage (cMessage *msg) override |
| |
| virtual void | handleMessageWhenDown (cMessage *msg) |
| |
| virtual bool | handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override |
| | Perform one stage of a lifecycle operation. More...
|
| |
| virtual State | getInitialOperationalState () const |
| | Returns initial operational state: OPERATING or NOT_OPERATING. More...
|
| |
| virtual void | handleActiveOperationTimeout (cMessage *message) |
| |
| virtual bool | isUp () const |
| | utility functions More...
|
| |
| virtual bool | isDown () const |
| |
| virtual void | setOperationalState (State newState) |
| |
| virtual void | scheduleOperationTimeout (simtime_t timeout) |
| |
| virtual void | setupActiveOperation (LifecycleOperation *operation, IDoneCallback *doneCallback, State) |
| |
| virtual void | delayActiveOperationFinish (simtime_t timeout) |
| |
| virtual void | startActiveOperationExtraTime (simtime_t delay=SIMTIME_ZERO) |
| |
| virtual void | startActiveOperationExtraTimeOrFinish (simtime_t extraTime) |
| |
| virtual void | finishActiveOperation () |
| |
◆ TunnelApp()
| inet::TunnelApp::TunnelApp |
( |
| ) |
|
◆ ~TunnelApp()
| inet::TunnelApp::~TunnelApp |
( |
| ) |
|
|
virtual |
◆ handleCrashOperation()
◆ handleMessageWhenUp()
| void inet::TunnelApp::handleMessageWhenUp |
( |
cMessage * |
msg | ) |
|
|
overrideprotectedvirtual |
Implements inet::OperationalMixin< cSimpleModule >.
76 if (message->arrivedOn(
"socketIn")) {
77 ASSERT(message->getControlInfo() ==
nullptr);
80 socket->processMessage(message);
83 throw cRuntimeError(
"Unknown message: %s", message->getName());
86 throw cRuntimeError(
"Message arrived on unknown gate %s", message->getArrivalGate()->getFullName());
92 if (
s.second->isOpen())
◆ handleStartOperation()
|
|
inlineoverrideprotectedvirtual |
◆ handleStopOperation()
◆ initialize()
| void inet::TunnelApp::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::OperationalMixin< cSimpleModule >.
36 const char *protocolName = par(
"protocol");
63 IInterfaceTable *interfaceTable = getModuleFromPar<IInterfaceTable>(par(
"interfaceTableModule"),
this);
64 NetworkInterface *networkInterface = interfaceTable->findInterfaceByName(
interface);
65 if (networkInterface ==
nullptr)
66 throw cRuntimeError(
"TUN interface not found: %s",
interface);
◆ numInitStages()
| virtual int inet::TunnelApp::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ socketClosed() [1/3]
| void inet::TunnelApp::socketClosed |
( |
Ipv4Socket * |
socket | ) |
|
|
overrideprotectedvirtual |
◆ socketClosed() [2/3]
| virtual void inet::TunnelApp::socketClosed |
( |
TunSocket * |
socket | ) |
|
|
inlineoverrideprotectedvirtual |
◆ socketClosed() [3/3]
| void inet::TunnelApp::socketClosed |
( |
UdpSocket * |
socket | ) |
|
|
overrideprotectedvirtual |
◆ socketDataArrived() [1/3]
| void inet::TunnelApp::socketDataArrived |
( |
Ipv4Socket * |
socket, |
|
|
Packet * |
packet |
|
) |
| |
|
overrideprotectedvirtual |
Implements inet::Ipv4Socket::ICallback.
123 auto packetProtocol = packet->getTag<NetworkProtocolInd>()->getProtocol();
129 throw cRuntimeError(
"Unknown protocol: %s", packetProtocol->getName());
◆ socketDataArrived() [2/3]
| void inet::TunnelApp::socketDataArrived |
( |
TunSocket * |
socket, |
|
|
Packet * |
packet |
|
) |
| |
|
overrideprotectedvirtual |
◆ socketDataArrived() [3/3]
| void inet::TunnelApp::socketDataArrived |
( |
UdpSocket * |
socket, |
|
|
Packet * |
packet |
|
) |
| |
|
overrideprotectedvirtual |
Notifies about data arrival, packet ownership is transferred to the callee.
Implements inet::UdpSocket::ICallback.
107 throw cRuntimeError(
"Unknown protocol: %s", packetProtocol->getName());
◆ socketErrorArrived()
Notifies about error indication arrival, indication ownership is transferred to the callee.
Implements inet::UdpSocket::ICallback.
◆ clientSocket
◆ destinationAddress
| const char* inet::TunnelApp::destinationAddress = nullptr |
|
protected |
◆ destinationPort
| int inet::TunnelApp::destinationPort = -1 |
|
protected |
◆ interface
| const char* inet::TunnelApp::interface = nullptr |
|
protected |
◆ ipv4Socket
◆ localPort
| int inet::TunnelApp::localPort = -1 |
|
protected |
◆ protocol
| const Protocol* inet::TunnelApp::protocol = nullptr |
|
protected |
◆ serverSocket
◆ socketMap
◆ tunSocket
The documentation for this class was generated from the following files:
void setOutputGate(cGate *toUdp)
Sets the gate on which to send to UDP.
Definition: UdpSocket.h:117
int localPort
Definition: TunnelApp.h:26
State operationalState
Definition: OperationalMixin.h:23
void bind(int localPort)
Bind the socket to a local port number.
Definition: UdpSocket.cc:34
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd TransportProtocolInd
Definition: IUdp-gates.txt:20
const Protocol * protocol
Definition: TunnelApp.h:22
static const Protocol ipv4
Definition: Protocol.h:93
void open(int interfaceId)
Definition: TunSocket.cc:56
virtual void close() override
Closes this socket releasing all resources.
Definition: Ipv4Socket.cc:96
static const Protocol * getProtocol(int id)
Definition: Protocol.cc:50
virtual void initialize(int stage) override
Definition: OperationalMixinImpl.h:26
virtual void destroy() override
Notify the protocol that the owner of ISocket has destroyed the socket.
Definition: UdpSocket.cc:98
void deleteSockets()
Deletes the socket objects.
Definition: SocketMap.cc:44
void setCallback(ICallback *cb)
Sets a callback object, to be used with processMessage().
Definition: UdpSocket.cc:338
ISocket * findSocketFor(cMessage *msg)
Finds the socket for the given message.
Definition: SocketMap.cc:19
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
virtual void send(Packet *msg) override
Sends a data packet to the address and port specified previously in a connect() call.
Definition: UdpSocket.cc:80
Ipv4Socket ipv4Socket
Definition: TunnelApp.h:28
void addSocket(ISocket *socket)
Adds the given socket.
Definition: SocketMap.cc:28
void connect(L3Address remoteAddr, int remotePort)
Connects to a remote UDP socket.
Definition: UdpSocket.cc:53
value< double, units::s > s
Definition: Units.h:1235
static const Protocol udp
Definition: Protocol.h:117
std::map< int, ISocket * > & getMap()
Returns the socket map.
Definition: SocketMap.h:57
virtual void send(Packet *packet) override
Definition: Ipv4Socket.cc:84
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
virtual void close() override
Unbinds the socket.
Definition: UdpSocket.cc:87
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
void setCallback(ICallback *cb)
Sets a callback object, to be used with processMessage().
Definition: TunSocket.cc:22
TunSocket tunSocket
Definition: TunnelApp.h:31
UdpSocket clientSocket
Definition: TunnelApp.h:30
virtual bool isOpen() const override
Definition: UdpSocket.h:293
void setOutputGate(cGate *outputGate)
Sets the gate on which to send raw packets.
Definition: TunSocket.h:45
INET_API InitStage INITSTAGE_APPLICATION_LAYER
Initialization of applications.
const char * getName() const
Definition: Protocol.h:38
virtual void delayActiveOperationFinish(simtime_t timeout)
Definition: OperationalMixinImpl.h:161
const char * interface
Definition: TunnelApp.h:23
virtual void startActiveOperationExtraTimeOrFinish(simtime_t extraTime)
Definition: OperationalMixinImpl.h:179
static const Ipv4Address UNSPECIFIED_ADDRESS
0.0.0.0
Definition: Ipv4Address.h:91
virtual void setCallback(INetworkSocket::ICallback *callback) override
Sets a callback object, to be used with processMessage().
Definition: Ipv4Socket.cc:25
const char * destinationAddress
Definition: TunnelApp.h:24
void setOutputGate(cGate *outputGate)
Sets the gate on which to send raw packets.
Definition: Ipv4Socket.h:55
virtual void bind(const Protocol *protocol, Ipv4Address localAddress)
Definition: Ipv4Socket.cc:61
virtual void send(Packet *packet) override
Definition: TunSocket.cc:66
int destinationPort
Definition: TunnelApp.h:25
SocketMap socketMap
Definition: TunnelApp.h:32
virtual bool isOpen() const override
Definition: Ipv4Socket.h:73
UdpSocket serverSocket
Definition: TunnelApp.h:29
virtual void destroy() override
Notify the protocol that the owner of ISocket has destroyed the socket.
Definition: Ipv4Socket.cc:105