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

#include <EthernetCutthroughInterface.h>

Inheritance diagram for inet::EthernetCutthroughInterface:
inet::NetworkInterface inet::queueing::PacketProcessorBase inet::queueing::IPassivePacketSink inet::ILifecycle inet::queueing::IPacketProcessor inet::StringFormat::IDirectiveResolver

Public Member Functions

virtual void pushPacketStart (Packet *packet, cGate *gate, bps datarate) override
 Starts pushing the packet into the packet sink at the given gate. More...
 
virtual void pushPacketEnd (Packet *packet, cGate *gate) override
 Ends pushing the packet into the packet sink at the given gate. More...
 
- Public Member Functions inherited from inet::NetworkInterface
virtual void setInterfaceId (int id)
 
virtual void resetInterface ()
 
 NetworkInterface ()
 
virtual ~NetworkInterface ()
 
virtual std::string str () const override
 
virtual std::string getInterfaceFullPath () const
 
virtual bool supportsPacketSending (cGate *gate) const override
 Returns true if the processor supports sending packets at the given gate. More...
 
virtual bool supportsPacketPushing (cGate *gate) const override
 Returns true if the processor supports pushing packets at the given gate. More...
 
virtual bool supportsPacketPulling (cGate *gate) const override
 Returns true if the processor supports pulling packets at the given gate. More...
 
virtual bool supportsPacketPassing (cGate *gate) const override
 Returns true if the processor supports passing packets as a whole at the given gate. More...
 
virtual bool supportsPacketStreaming (cGate *gate) const override
 Returns true if the processor supports streaming packets at the given gate. More...
 
virtual bool canPushSomePacket (cGate *gate) const override
 Returns false if the packet sink is full at the given gate and no more packets can be pushed into it without raising an error. More...
 
virtual bool canPushPacket (Packet *packet, cGate *gate) const override
 Returns true if the given packet can be pushed at the given gate into the packet sink without raising an error. More...
 
virtual void pushPacket (Packet *packet, cGate *gate) override
 Pushes the packet into the packet sink at the given gate. More...
 
virtual void pushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength=b(0)) override
 Progresses pushing the packet into the packet sink at the given gate. More...
 
IInterfaceTablegetInterfaceTable () const
 Returns the IInterfaceTable this interface is in, or nullptr. More...
 
State getState () const
 Returns the requested state of this interface. More...
 
cChannel * getRxTransmissionChannel ()
 
cChannel * getTxTransmissionChannel ()
 
bool isUp () const
 Returns the combined state of the carrier and the interface requested state. More...
 
bool isDown () const
 
void setHasModuleIdAddress (bool value)
 
void setHasModulePathAddress (bool value)
 
const ModuleIdAddress getModuleIdAddress () const
 
const ModulePathAddress getModulePathAddress () const
 
const L3Address getNetworkAddress () const
 
virtual bool hasNetworkAddress (const L3Address &address) const
 
const ProtocolgetProtocol () const
 
int getInterfaceId () const
 
const char * getInterfaceName () const
 
int getNodeOutputGateId () const
 
int getNodeInputGateId () const
 
int getMtu () const
 
bool hasCarrier () const
 
bool isBroadcast () const
 
bool isMulticast () const
 
bool isPointToPoint () const
 
bool isLoopback () const
 
bool isWired () const
 
bool isWireless () const
 
double getDatarate () const
 
const MacAddressgetMacAddress () const
 
const InterfaceTokengetInterfaceToken () const
 
virtual void setProtocol (const Protocol *protocol)
 
virtual void setInterfaceName (const char *s)
 
virtual void setNodeOutputGateId (int i)
 
virtual void setNodeInputGateId (int i)
 
virtual void setMtu (int m)
 
virtual void setState (State s)
 
virtual void setCarrier (bool b)
 
virtual void setBroadcast (bool b)
 
virtual void setMulticast (bool b)
 
virtual void setPointToPoint (bool b)
 
virtual void setLoopback (bool b)
 
virtual void setDatarate (double d)
 
virtual void setMacAddress (const MacAddress &addr)
 
virtual void setInterfaceToken (const InterfaceToken &t)
 
bool matchesMacAddress (const MacAddress &address) const
 
void addMulticastMacAddress (const MacAddress &address)
 
void removeMulticastMacAddress (const MacAddress &address)
 
bool matchesMulticastMacAddress (const MacAddress &address) const
 
int getNumProtocolData () const
 Returns the number of protocol data structures. More...
 
const InterfaceProtocolDatagetProtocolData (int index) const
 Returns the protocol data at the given index. More...
 
void clearProtocolDataSet ()
 Clears the set of protocol data objects. More...
 
template<typename T >
const TfindProtocolData () const
 Returns the protocol data for the provided type or returns nullptr if no such protocol data is found. More...
 
template<typename T >
TfindProtocolDataForUpdate ()
 Returns the protocol data for the provided type or returns nullptr if no such protocol data is found. More...
 
template<typename T >
const TgetProtocolData () const
 Returns the protocol data for the provided type or throws an exception if no such protocol data is found. More...
 
template<typename T >
TgetProtocolDataForUpdate ()
 Returns the protocol data for the provided type or throws an exception if no such protocol data is found. More...
 
template<typename T >
TaddProtocolData ()
 Returns a newly added protocol data for the provided type, or throws an exception if such a protocol data is already present. More...
 
template<typename T >
TaddProtocolDataIfAbsent ()
 Returns a newly added protocol data for the provided type if absent, or returns the protocol data that is already present. More...
 
template<typename T >
TremoveProtocolData ()
 Removes the protocol data for the provided type, or throws an exception if no such protocol data is found. More...
 
template<typename T >
TremoveProtocolDataIfPresent ()
 Removes the protocol data for the provided type if present, or returns nullptr if no such protocol data is found. More...
 
Ipv4Address getIpv4Address () const
 
Ipv4Address getIpv4Netmask () const
 
virtual void joinMulticastGroup (const L3Address &address)
 
virtual void changeMulticastGroupMembership (const L3Address &multicastAddress, McastSourceFilterMode oldFilterMode, const std::vector< L3Address > &oldSourceList, McastSourceFilterMode newFilterMode, const std::vector< L3Address > &newSourceList)
 
virtual bool setEstimateCostProcess (int, MacEstimateCostProcess *p)
 
virtual MacEstimateCostProcessgetEstimateCostProcess (int)
 
virtual bool handleOperationStage (LifecycleOperation *operation, IDoneCallback *doneCallback) override
 Perform one stage of a lifecycle operation. More...
 
virtual void handleStartOperation (LifecycleOperation *operation)
 
virtual void handleStopOperation (LifecycleOperation *operation)
 
virtual void handleCrashOperation (LifecycleOperation *operation)
 
- Public Member Functions inherited from inet::queueing::IPacketProcessor
virtual ~IPacketProcessor ()
 
- Public Member Functions inherited from inet::queueing::IPassivePacketSink
virtual ~IPassivePacketSink ()
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 

Protected Member Functions

virtual void initialize (int stage) override
 
- Protected Member Functions inherited from inet::NetworkInterface
virtual void configChanged (int fieldId)
 
virtual void stateChanged (int fieldId)
 
virtual void changed (simsignal_t signalID, int fieldId)
 
virtual int numInitStages () const override
 
virtual void handleParameterChange (const char *name) override
 
virtual void refreshDisplay () const override
 
virtual void updateDisplayString () const override
 
virtual const char * resolveDirective (char directive) const override
 
virtual void receiveSignal (cComponent *source, simsignal_t signal, cObject *obj, cObject *details) override
 
virtual cGate * createGateObject (cGate::Type type) override
 
virtual double computeDatarate () const
 
virtual bool computeCarrier () const
 
virtual std::string getFullPath () const override
 
virtual const char * getName () const override
 
virtual void arrived (cMessage *message, cGate *gate, const SendOptions &options, simtime_t time) override
 
- Protected Member Functions inherited from inet::queueing::PacketProcessorBase
virtual void handlePacketProcessed (Packet *packet)
 
virtual void checkPacketOperationSupport (cGate *gate) const
 
virtual void checkPacketOperationSupport (cGate *startGate, cGate *endGate) const
 
virtual void animate (Packet *packet, cGate *gate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacket (Packet *packet, cGate *gate, Action action) const
 
virtual void animatePacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId, Action action) const
 
virtual void animatePacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacketEnd (Packet *packet, cGate *gate, long transmissionId, Action action) const
 
virtual void animatePacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions, Action action) const
 
virtual void animatePacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId, Action action) const
 
virtual void animatePacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions, Action action) const
 
virtual void pushOrSendPacket (Packet *packet, cGate *gate, IPassivePacketSink *consumer)
 
virtual void pushOrSendPacketStart (Packet *packet, cGate *gate, IPassivePacketSink *consumer, bps datarate, int transmissionId)
 
virtual void pushOrSendPacketEnd (Packet *packet, cGate *gate, IPassivePacketSink *consumer, int transmissionId)
 
virtual void pushOrSendPacketProgress (Packet *packet, cGate *gate, IPassivePacketSink *consumer, bps datarate, b position, b extraProcessableLength, int transmissionId)
 
virtual void animatePush (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePushPacket (Packet *packet, cGate *gate) const
 
virtual void animatePushPacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId) const
 
virtual void animatePushPacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions) const
 
virtual void animatePushPacketEnd (Packet *packet, cGate *gate, long transmissionId) const
 
virtual void animatePushPacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId) const
 
virtual void animatePushPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions) const
 
virtual void animatePull (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePullPacket (Packet *packet, cGate *gate) const
 
virtual void animatePullPacketStart (Packet *packet, cGate *gate, bps datarate, long transmissionId) const
 
virtual void animatePullPacketStart (Packet *packet, cGate *gate, bps datarate, const SendOptions &sendOptions) const
 
virtual void animatePullPacketEnd (Packet *packet, cGate *gate, long transmissionId) const
 
virtual void animatePullPacketEnd (Packet *packet, cGate *gate, const SendOptions &sendOptions) const
 
virtual void animatePullPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, long transmissionId) const
 
virtual void animatePullPacketProgress (Packet *packet, cGate *gate, bps datarate, b position, b extraProcessableLength, const SendOptions &sendOptions) const
 
virtual void dropPacket (Packet *packet, PacketDropReason reason, int limit=-1)
 

Protected Attributes

cGate * cutthroughInputGate = nullptr
 
cGate * cutthroughOutputGate = nullptr
 
queueing::IPassivePacketSinkcutthroughInputConsumer = nullptr
 
queueing::IPassivePacketSinkcutthroughOutputConsumer = nullptr
 
- Protected Attributes inherited from inet::NetworkInterface
cGate * upperLayerIn = nullptr
 
cGate * upperLayerOut = nullptr
 
cGate * rxIn = nullptr
 
cGate * txOut = nullptr
 
cChannel * rxTransmissionChannel = nullptr
 
cChannel * txTransmissionChannel = nullptr
 
queueing::IPassivePacketSinkupperLayerInConsumer = nullptr
 
queueing::IPassivePacketSinkupperLayerOutConsumer = nullptr
 
const Protocolprotocol = nullptr
 
ModuleRefByPar< IInterfaceTableinterfaceTable
 IInterfaceTable that contains this interface, or nullptr. More...
 
int interfaceId = -1
 identifies the interface in the IInterfaceTable More...
 
std::string interfaceName
 
int nodeOutputGateId = -1
 id of the output gate of this host/router (or -1 if this is a virtual interface) More...
 
int nodeInputGateId = -1
 id of the input gate of this host/router (or -1 if this is a virtual interface) More...
 
int mtu = 0
 Maximum Transmission Unit (e.g. 1500 on Ethernet); 0 means infinite (i.e. never fragment) More...
 
State state = DOWN
 requested interface state, similar to Linux ifup/ifdown More...
 
bool carrier = false
 presence of the physical or virtual carrier More...
 
bool broadcast = false
 interface supports broadcast More...
 
bool multicast = false
 interface supports multicast More...
 
bool pointToPoint = false
 interface is point-to-point link More...
 
bool loopback = false
 interface is loopback interface More...
 
bool hasModuleIdAddress = false
 
bool hasModulePathAddress = false
 
double datarate = 0
 data rate in bit/s More...
 
MacAddress macAddr
 link-layer address (for now, only IEEE 802 MAC addresses are supported) More...
 
InterfaceToken token
 for Ipv6 stateless autoconfig (RFC 1971), interface identifier (RFC 2462) More...
 
std::vector< MacAddressmulticastAddresses
 
TagSet protocolDataSet
 
std::vector< MacEstimateCostProcess * > estimateCostProcessArray
 
- Protected Attributes inherited from inet::queueing::PacketProcessorBase
const char * displayStringTextFormat = nullptr
 
int numProcessedPackets = -1
 
b processedTotalLength = b(-1)
 

Additional Inherited Members

- Public Types inherited from inet::NetworkInterface
enum  State { UP, DOWN, GOING_UP, GOING_DOWN }
 
enum  {
  F_CARRIER, F_STATE, F_NAME, F_NODE_IN_GATEID,
  F_NODE_OUT_GATEID, F_NETW_GATEIDX, F_LOOPBACK, F_BROADCAST,
  F_MULTICAST, F_POINTTOPOINT, F_DATARATE, F_MTU,
  F_MACADDRESS, F_TOKEN, F_IPV4_DATA, F_IPV6_DATA,
  F_NEXTHOP_DATA, F_ISIS_DATA, F_TRILL_DATA, F_IEEE8021D_DATA,
  F_CLNS_DATA
}
 
- Protected Types inherited from inet::queueing::PacketProcessorBase
enum  Action { PUSH, PULL }
 

Member Function Documentation

◆ initialize()

void inet::EthernetCutthroughInterface::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::NetworkInterface.

19 {
22  cutthroughInputGate = gate("cutthroughIn");
23  cutthroughOutputGate = gate("cutthroughOut");
24  cutthroughInputConsumer = findConnectedModule<IPassivePacketSink>(cutthroughInputGate, 1);
25  cutthroughOutputConsumer = findConnectedModule<IPassivePacketSink>(cutthroughOutputGate, 1);
27  }
28 }

◆ pushPacketEnd()

void inet::EthernetCutthroughInterface::pushPacketEnd ( Packet packet,
cGate *  gate 
)
overridevirtual

Ends pushing the packet into the packet sink at the given gate.

This is a packet streaming operation. The onwership of the packet is transferred to the sink.

Packet streaming can be started with any of the streaming operations, and ends when the streaming position plus the extra processable packet length equals to the total packet length.

This method is called, for example, when a preemption supporting server module ends streaming a packet to the sink.

The sink must not be full at the gate and no other packet streaming can be in progress. The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing and streaming packets.

Reimplemented from inet::NetworkInterface.

45 {
46  Enter_Method("pushPacketEnd");
47  take(packet);
48  if (gate == cutthroughInputGate)
49  cutthroughInputConsumer->pushPacketEnd(packet, cutthroughInputGate->getPathEndGate());
50  else if (gate == cutthroughOutputGate) {
51  packet->addTagIfAbsent<InterfaceInd>()->setInterfaceId(interfaceId);
53  }
54  else
55  NetworkInterface::pushPacketEnd(packet, gate);
56 }

◆ pushPacketStart()

void inet::EthernetCutthroughInterface::pushPacketStart ( Packet packet,
cGate *  gate,
bps  datarate 
)
overridevirtual

Starts pushing the packet into the packet sink at the given gate.

This is a packet streaming operation. The onwership of the packet is transferred to the sink.

Packet streaming can be started with any of the streaming operations, and ends when the streaming position plus the extra processable packet length equals to the total packet length.

This method is called, for example, when a preemption supporting server module starts streaming a packet to the sink.

The sink must not be full at the gate and no other packet streaming can be in progress. The packet must not be nullptr. The gate must be a valid gate of this module and it must support pushing and streaming packets.

Reimplemented from inet::NetworkInterface.

31 {
32  Enter_Method("pushPacketStart");
33  take(packet);
34  if (gate == cutthroughInputGate)
36  else if (gate == cutthroughOutputGate) {
37  packet->addTagIfAbsent<InterfaceInd>()->setInterfaceId(interfaceId);
39  }
40  else
42 }

Member Data Documentation

◆ cutthroughInputConsumer

queueing::IPassivePacketSink* inet::EthernetCutthroughInterface::cutthroughInputConsumer = nullptr
protected

◆ cutthroughInputGate

cGate* inet::EthernetCutthroughInterface::cutthroughInputGate = nullptr
protected

◆ cutthroughOutputConsumer

queueing::IPassivePacketSink* inet::EthernetCutthroughInterface::cutthroughOutputConsumer = nullptr
protected

◆ cutthroughOutputGate

cGate* inet::EthernetCutthroughInterface::cutthroughOutputGate = nullptr
protected

The documentation for this class was generated from the following files:
inet::NetworkInterface::pushPacketStart
virtual void pushPacketStart(Packet *packet, cGate *gate, bps datarate) override
Starts pushing the packet into the packet sink at the given gate.
Definition: NetworkInterface.cc:209
inet::EthernetCutthroughInterface::cutthroughOutputConsumer
queueing::IPassivePacketSink * cutthroughOutputConsumer
Definition: EthernetCutthroughInterface.h:23
inet::EthernetCutthroughInterface::cutthroughOutputGate
cGate * cutthroughOutputGate
Definition: EthernetCutthroughInterface.h:21
inet::EthernetCutthroughInterface::cutthroughInputGate
cGate * cutthroughInputGate
Definition: EthernetCutthroughInterface.h:20
inet::NetworkInterface::interfaceId
int interfaceId
identifies the interface in the IInterfaceTable
Definition: NetworkInterface.h:106
inet::queueing::IPassivePacketSink::pushPacketEnd
virtual void pushPacketEnd(Packet *packet, cGate *gate)=0
Ends pushing the packet into the packet sink at the given gate.
inet::INITSTAGE_NETWORK_INTERFACE_CONFIGURATION
INET_API InitStage INITSTAGE_NETWORK_INTERFACE_CONFIGURATION
Initialization of network interfaces includes:
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::NetworkInterface::datarate
double datarate
data rate in bit/s
Definition: NetworkInterface.h:119
inet::EthernetCutthroughInterface::cutthroughInputConsumer
queueing::IPassivePacketSink * cutthroughInputConsumer
Definition: EthernetCutthroughInterface.h:22
inet::registerInterface
void registerInterface(const NetworkInterface &interface, cGate *in, cGate *out)
Definition: IInterfaceRegistrationListener.cc:12
inet::NetworkInterface::setInterfaceId
virtual void setInterfaceId(int id)
Definition: NetworkInterface.h:175
inet::NetworkInterface::initialize
virtual void initialize(int stage) override
Definition: NetworkInterface.cc:104
inet::queueing::IPassivePacketSink::pushPacketStart
virtual void pushPacketStart(Packet *packet, cGate *gate, bps datarate)=0
Starts pushing the packet into the packet sink at the given gate.
inet::NetworkInterface::pushPacketEnd
virtual void pushPacketEnd(Packet *packet, cGate *gate) override
Ends pushing the packet into the packet sink at the given gate.
Definition: NetworkInterface.cc:234