|
INET Framework for OMNeT++/OMNEST
|
#include <EthernetSocketIo.h>
◆ finish()
| void inet::EthernetSocketIo::finish |
( |
| ) |
|
|
overrideprotectedvirtual |
75 recordScalar(
"packets sent",
numSent);
77 ApplicationBase::finish();
◆ handleCrashOperation()
◆ handleMessageWhenUp()
| void inet::EthernetSocketIo::handleMessageWhenUp |
( |
cMessage * |
message | ) |
|
|
overrideprotectedvirtual |
◆ handleStartOperation()
◆ handleStopOperation()
◆ initialize()
| void inet::EthernetSocketIo::initialize |
( |
int |
stage | ) |
|
|
overrideprotectedvirtual |
Reimplemented from inet::OperationalMixin< cSimpleModule >.
32 const char *localAddressString = par(
"localAddress");
33 if (*localAddressString !=
'\0') {
35 L3AddressResolver addressResolver;
42 const char *remoteAddressString = par(
"remoteAddress");
43 if (*remoteAddressString !=
'\0') {
45 L3AddressResolver addressResolver;
◆ numInitStages()
| virtual int inet::EthernetSocketIo::numInitStages |
( |
| ) |
const |
|
inlineoverrideprotectedvirtual |
◆ refreshDisplay()
| void inet::EthernetSocketIo::refreshDisplay |
( |
| ) |
const |
|
overrideprotectedvirtual |
85 getDisplayString().setTagArg(
"t", 0, buf);
◆ setSocketOptions()
| void inet::EthernetSocketIo::setSocketOptions |
( |
| ) |
|
|
protectedvirtual |
91 const char *
interface = par("interface");
92 if (interface[0] !=
'\0') {
93 auto interfaceTable = getModuleFromPar<IInterfaceTable>(par(
"interfaceTableModule"),
this);
94 auto networkInterface = interfaceTable->findInterfaceByName(interface);
95 if (networkInterface ==
nullptr)
96 throw cRuntimeError(
"Cannot find network interface");
Referenced by handleStartOperation().
◆ socketClosed()
◆ socketDataArrived()
Notifies about data arrival, packet ownership is transferred to the callee.
Implements inet::EthernetSocket::ICallback.
104 EV_INFO <<
"Received packet: " << packet << endl;
106 packet->removeTag<SocketInd>();
107 send(packet,
"trafficOut");
◆ socketErrorArrived()
Notifies about error indication arrival, indication ownership is transferred to the callee.
Implements inet::EthernetSocket::ICallback.
112 EV_WARN <<
"Ignoring Ethernet error report " << indication->getName() << endl;
◆ localAddress
◆ numReceived
| int inet::EthernetSocketIo::numReceived = 0 |
|
protected |
◆ numSent
| int inet::EthernetSocketIo::numSent = 0 |
|
protected |
◆ remoteAddress
◆ socket
The documentation for this class was generated from the following files:
State operationalState
Definition: OperationalMixin.h:23
void setOutputGate(cGate *gate)
Sets the gate on which to send messages.
Definition: SocketBase.h:36
virtual void processMessage(cMessage *msg) override
Examines the message, takes ownership, and updates socket state.
Definition: EthernetSocket.cc:40
int numReceived
Definition: EthernetSocketIo.h:23
virtual void initialize(int stage) override
Definition: OperationalMixinImpl.h:26
EthernetSocket socket
Definition: EthernetSocketIo.h:21
simsignal_t packetSentSignal
Definition: Simsignals.cc:96
virtual void setSocketOptions()
Definition: EthernetSocketIo.cc:88
@ ADDR_MAC
Definition: L3AddressResolver.h:72
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
INET_API InitStage INITSTAGE_NETWORK_INTERFACE_CONFIGURATION
Initialization of network interfaces includes:
simsignal_t packetReceivedSignal
Definition: Simsignals.cc:97
MacAddress remoteAddress
Definition: EthernetSocketIo.h:19
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
MacAddress localAddress
Definition: EthernetSocketIo.h:20
virtual void close() override
Unbinds the socket.
Definition: SocketBase.cc:43
virtual void send(Packet *packet) override
Sends a data packet to the address and port specified previously in a connect() call.
Definition: SocketBase.cc:36
virtual void delayActiveOperationFinish(simtime_t timeout)
Definition: OperationalMixinImpl.h:161
virtual void startActiveOperationExtraTimeOrFinish(simtime_t extraTime)
Definition: OperationalMixinImpl.h:179
void setNetworkInterface(NetworkInterface *networkInterface)
Definition: EthernetSocket.h:67
@ MAC
Definition: L3Address.h:38
void setCallback(ICallback *callback)
Sets a callback object, to be used with processMessage().
Definition: EthernetSocket.h:65
virtual void refreshDisplay() const override
Definition: OperationalMixinImpl.h:200
virtual bool belongsToSocket(cMessage *msg) const override
Returns true if the message belongs to this socket instance.
Definition: SocketBase.cc:61
virtual void destroy() override
Notify the protocol that the owner of ISocket has destroyed the socket.
Definition: SocketBase.cc:52
int numSent
Definition: EthernetSocketIo.h:22
static const Protocol unknown
Definition: Protocol.h:133