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

Base class for Ethernet MAC implementations. More...

#include <EthernetMacBase.h>

Inheritance diagram for inet::EthernetMacBase:
inet::MacProtocolBase inet::queueing::IActivePacketSink inet::LayeredProtocolBase inet::OperationalBase inet::OperationalMixin< cSimpleModule > inet::ILifecycle inet::EthernetCsmaMac inet::EthernetMac

Classes

struct  EtherDescr
 

Public Types

enum  MacTransmitState {
  TX_IDLE_STATE = 1, WAIT_IFG_STATE, SEND_IFG_STATE, TRANSMITTING_STATE,
  JAMMING_STATE, BACKOFF_STATE, PAUSE_STATE
}
 
enum  MacReceiveState { RX_IDLE_STATE = 1, RECEIVING_STATE, RX_COLLISION_STATE, RX_RECONNECT_STATE }
 

Public Member Functions

 EthernetMacBase ()
 
virtual ~EthernetMacBase ()
 
virtual MacAddress getMacAddress ()
 
double getTxRate ()
 
bool isActive ()
 
MacTransmitState getTransmitState ()
 
MacReceiveState getReceiveState ()
 
virtual void handleStartOperation (LifecycleOperation *operation) override
 
virtual void handleStopOperation (LifecycleOperation *operation) override
 
virtual void handleCrashOperation (LifecycleOperation *operation) override
 
virtual void processAtHandleMessageFinished ()
 
void addPaddingAndSetFcs (Packet *packet, B requiredMinByteLength=MIN_ETHERNET_FRAME_BYTES) const
 Inserts padding in front of FCS and calculate FCS. More...
 
virtual queueing::IPassivePacketSourcegetProvider (cGate *gate) override
 Returns the passive packet source from where packets are pulled or nullptr if the connected module doesn't implement the interface. More...
 
virtual void handlePullPacketProcessed (Packet *packet, cGate *gate, bool successful) override
 Notifies about the completion of the packet processing for a packet that was pulled earlier independently whether the packet is passed or streamed. More...
 
- Public Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual ~OperationalMixin ()
 }@ More...
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 
- Public Member Functions inherited from inet::queueing::IActivePacketSink
virtual ~IActivePacketSink ()
 
virtual void handleCanPullPacketChanged (cGate *gate)=0
 Notifies about a change in the possibility of pulling some packet from the passive packet source at the given gate. More...
 

Static Public Attributes

static const double SPEED_OF_LIGHT_IN_CABLE = 200000000.0
 

Protected Types

enum  SelfMsgKindValues {
  ENDIFG = 100, ENDRECEPTION, ENDBACKOFF, ENDTRANSMISSION,
  ENDJAMMING, ENDPAUSE
}
 
enum  { NUM_OF_ETHERDESCRS = 11 }
 
- Protected Types inherited from inet::OperationalMixin< cSimpleModule >
enum  State
 

Protected Member Functions

virtual void initialize (int stage) override
 
virtual int numInitStages () const override
 
virtual void initializeFlags ()
 
virtual void initializeStatistics ()
 
virtual void finish () override
 
virtual bool dropFrameNotForUs (Packet *packet, const Ptr< const EthernetMacHeader > &frame)
 Checks destination address and drops the frame when frame is not for us; returns true if frame is dropped. More...
 
virtual void readChannelParameters (bool errorWhenAsymmetric)
 Calculates datarates, etc. More...
 
virtual void printParameters ()
 
virtual void processConnectDisconnect ()
 
virtual void encapsulate (Packet *packet)
 
virtual void decapsulate (Packet *packet)
 
bool verifyCrcAndLength (Packet *packet)
 Verify ethernet packet: check FCS and payload length. More...
 
virtual void configureNetworkInterface () override
 
virtual void refreshDisplay () const override
 
virtual void receiveSignal (cComponent *src, simsignal_t signalId, cObject *obj, cObject *details) override
 
virtual void refreshConnection ()
 
void changeTransmissionState (MacTransmitState newState)
 
void changeReceptionState (MacReceiveState newState)
 
virtual void cutEthernetSignalEnd (EthernetSignalBase *signal, simtime_t duration)
 
virtual void txFinished ()
 
- Protected Member Functions inherited from inet::MacProtocolBase
 MacProtocolBase ()
 
virtual ~MacProtocolBase ()
 
virtual void registerInterface ()
 
virtual MacAddress parseMacAddressParameter (const char *addrstr)
 
virtual void deleteCurrentTxFrame ()
 
virtual void dropCurrentTxFrame (PacketDropDetails &details)
 
virtual void handleMessageWhenDown (cMessage *msg) override
 
virtual void sendUp (cMessage *message)
 
virtual void sendDown (cMessage *message)
 
virtual bool isUpperMessage (cMessage *message) const override
 
virtual bool isLowerMessage (cMessage *message) const override
 
virtual bool isInitializeStage (int stage) const override
 
virtual bool isModuleStartStage (int stage) const override
 
virtual bool isModuleStopStage (int stage) const override
 
virtual void flushQueue (PacketDropDetails &details)
 should clear queue and emit signal "packetDropped" with entire packets More...
 
virtual void clearQueue ()
 should clear queue silently More...
 
queueing::IPacketQueuegetQueue (cGate *gate) const
 
virtual bool canDequeuePacket () const
 
virtual PacketdequeuePacket ()
 
- Protected Member Functions inherited from inet::LayeredProtocolBase
virtual void handleMessageWhenUp (cMessage *message) override
 
virtual void handleSelfMessage (cMessage *message)
 
virtual void handleUpperMessage (cMessage *message)
 
virtual void handleLowerMessage (cMessage *message)
 
virtual void handleUpperCommand (cMessage *message)
 
virtual void handleLowerCommand (cMessage *message)
 
virtual void handleUpperPacket (Packet *packet)
 
virtual void handleLowerPacket (Packet *packet)
 
- Protected Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual int numInitStages () const override
 
virtual void refreshDisplay () const override
 
virtual void handleMessage (cMessage *msg) override
 
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 ()
 

Protected Attributes

const char * displayStringTextFormat = nullptr
 
bool sendRawBytes = false
 
FcsMode fcsMode = FCS_MODE_UNDEFINED
 
const EtherDescrcurEtherDescr = nullptr
 
bool connected = false
 
bool promiscuous = false
 
bool duplexMode = false
 
bool frameBursting = false
 
cChannel * transmissionChannel = nullptr
 
cGate * physInGate = nullptr
 
cGate * physOutGate = nullptr
 
bool channelsDiffer = false
 
MacTransmitState transmitState = static_cast<MacTransmitState>(-1)
 
MacReceiveState receiveState = static_cast<MacReceiveState>(-1)
 
simtime_t lastTxFinishTime
 
int pauseUnitsRequested = 0
 
cMessage * endTxTimer = nullptr
 
cMessage * endIfgTimer = nullptr
 
cMessage * endPauseTimer = nullptr
 
EthernetSignalBasecurTxSignal = nullptr
 
unsigned long numFramesSent = 0
 
unsigned long numFramesReceivedOK = 0
 
unsigned long numBytesSent = 0
 
unsigned long numBytesReceivedOK = 0
 
unsigned long numFramesFromHL = 0
 
unsigned long numDroppedPkFromHLIfaceDown = 0
 
unsigned long numDroppedIfaceDown = 0
 
unsigned long numDroppedBitError = 0
 
unsigned long numDroppedNotForUs = 0
 
unsigned long numFramesPassedToHL = 0
 
unsigned long numPauseFramesRcvd = 0
 
unsigned long numPauseFramesSent = 0
 
- Protected Attributes inherited from inet::MacProtocolBase
int upperLayerInGateId = -1
 Gate ids. More...
 
int upperLayerOutGateId = -1
 
int lowerLayerInGateId = -1
 
int lowerLayerOutGateId = -1
 
opp_component_ptr< NetworkInterfacenetworkInterface
 
opp_component_ptr< cModule > hostModule
 
PacketcurrentTxFrame = nullptr
 Currently transmitted frame if any. More...
 
opp_component_ptr< queueing::IPacketQueuetxQueue
 Messages received from upper layer and to be transmitted later. More...
 
- Protected Attributes inherited from inet::OperationalMixin< cSimpleModule >
State operationalState
 
simtime_t lastChange
 
Operation activeOperation
 
cMessage * activeOperationTimeout
 
cMessage * activeOperationExtraTimer
 

Static Protected Attributes

static const EtherDescr etherDescrs [NUM_OF_ETHERDESCRS]
 
static const EtherDescr nullEtherDescr
 
static simsignal_t rxPkOkSignal = registerSignal("rxPkOk")
 
static simsignal_t txPausePkUnitsSignal = registerSignal("txPausePkUnits")
 
static simsignal_t rxPausePkUnitsSignal = registerSignal("rxPausePkUnits")
 
static simsignal_t transmissionStateChangedSignal = registerSignal("transmissionStateChanged")
 
static simsignal_t receptionStateChangedSignal = registerSignal("receptionStateChanged")
 

Detailed Description

Base class for Ethernet MAC implementations.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
NUM_OF_ETHERDESCRS 
64  {
66  };

◆ MacReceiveState

Enumerator
RX_IDLE_STATE 
RECEIVING_STATE 
RX_COLLISION_STATE 
RX_RECONNECT_STATE 
45  {
46  RX_IDLE_STATE = 1,
50  // FIXME add RX_OFF_STATE
51  };

◆ MacTransmitState

Enumerator
TX_IDLE_STATE 
WAIT_IFG_STATE 
SEND_IFG_STATE 
TRANSMITTING_STATE 
JAMMING_STATE 
BACKOFF_STATE 
PAUSE_STATE 
34  {
35  TX_IDLE_STATE = 1,
42  // FIXME add TX_OFF_STATE
43  };

◆ SelfMsgKindValues

Enumerator
ENDIFG 
ENDRECEPTION 
ENDBACKOFF 
ENDTRANSMISSION 
ENDJAMMING 
ENDPAUSE 
55  {
56  ENDIFG = 100,
58  ENDBACKOFF,
60  ENDJAMMING,
61  ENDPAUSE
62  };

Constructor & Destructor Documentation

◆ EthernetMacBase()

inet::EthernetMacBase::EthernetMacBase ( )
175 {
176  lastTxFinishTime = -1.0; // never equals to current simtime
178 }

◆ ~EthernetMacBase()

inet::EthernetMacBase::~EthernetMacBase ( )
virtual
181 {
182  delete curTxSignal;
183  cancelAndDelete(endTxTimer);
184  cancelAndDelete(endIfgTimer);
185  cancelAndDelete(endPauseTimer);
186 }

Member Function Documentation

◆ addPaddingAndSetFcs()

void inet::EthernetMacBase::addPaddingAndSetFcs ( Packet packet,
B  requiredMinByteLength = MIN_ETHERNET_FRAME_BYTES 
) const

Inserts padding in front of FCS and calculate FCS.

662 {
663  auto ethFcs = packet->removeAtBack<EthernetFcs>(ETHER_FCS_BYTES);
664  ethFcs->setFcsMode(fcsMode);
665 
666  B paddingLength = requiredMinBytes - ETHER_FCS_BYTES - B(packet->getByteLength());
667  if (paddingLength > B(0)) {
668  const auto& ethPadding = makeShared<EthernetPadding>();
669  ethPadding->setChunkLength(paddingLength);
670  packet->insertAtBack(ethPadding);
671  }
672 
673  switch (ethFcs->getFcsMode()) {
675  ethFcs->setFcs(0xC00DC00DL);
676  break;
678  ethFcs->setFcs(0xBAADBAADL);
679  break;
680  case FCS_COMPUTED: { // calculate FCS
681  auto ethBytes = packet->peekDataAsBytes();
682  auto bufferLength = B(ethBytes->getChunkLength()).get();
683  auto buffer = new uint8_t[bufferLength];
684  // 1. fill in the data
685  ethBytes->copyToBuffer(buffer, bufferLength);
686  // 2. compute the FCS
687  auto computedFcs = ethernetCRC(buffer, bufferLength);
688  delete[] buffer;
689  ethFcs->setFcs(computedFcs);
690  break;
691  }
692  default:
693  throw cRuntimeError("Unknown FCS mode: %d", (int)(ethFcs->getFcsMode()));
694  }
695 
696  packet->insertAtBack(ethFcs);
697 }

Referenced by inet::EthernetMac::handleUpperPacket(), and inet::EthernetCsmaMac::handleUpperPacket().

◆ changeReceptionState()

◆ changeTransmissionState()

◆ configureNetworkInterface()

void inet::EthernetMacBase::configureNetworkInterface ( )
overrideprotectedvirtual

Implements inet::MacProtocolBase.

269 {
270 
271  // MTU: typical values are 576 (Internet de facto), 1500 (Ethernet-friendly),
272  // 4000 (on some point-to-point links), 4470 (Cisco routers default, FDDI compatible)
273  networkInterface->setMtu(par("mtu"));
274 
275  // capabilities
276  networkInterface->setMulticast(true);
277  networkInterface->setBroadcast(true);
278 }

◆ cutEthernetSignalEnd()

void inet::EthernetMacBase::cutEthernetSignalEnd ( EthernetSignalBase signal,
simtime_t  duration 
)
protectedvirtual
700 {
701  ASSERT(duration <= signal->getDuration());
702  if (duration == signal->getDuration())
703  return;
704  int64_t newBitLength = duration.dbl() * signal->getBitrate();
705  if (auto packet = check_and_cast_nullable<Packet *>(signal->decapsulate())) {
706  // TODO removed length calculation based on the PHY layer (parallel bits, bit order, etc.)
707  if (newBitLength < packet->getBitLength()) {
708  packet->trimFront();
709  packet->setBackOffset(B(newBitLength / 8)); //TODO rounded down to byte align instead of b(newBitLength)
710  packet->trimBack();
711  packet->setBitError(true);
712  }
713  signal->encapsulate(packet);
714  }
715  signal->setBitError(true);
716  signal->setBitLength(newBitLength);
717  signal->setDuration(duration);
718 }

Referenced by inet::EthernetCsmaMac::sendJamSignal().

◆ decapsulate()

void inet::EthernetMacBase::decapsulate ( Packet packet)
protectedvirtual
388 {
389  auto phyHeader = packet->popAtFront<EthernetPhyHeader>();
390  ASSERT(packet->getDataLength() >= MIN_ETHERNET_FRAME_BYTES);
391  packet->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&Protocol::ethernetMac);
392 }

Referenced by inet::EthernetCsmaMac::frameReceptionComplete(), inet::EthernetCsmaMac::handleSignalFromNetwork(), and inet::EthernetMac::processMsgFromNetwork().

◆ dropFrameNotForUs()

bool inet::EthernetMacBase::dropFrameNotForUs ( Packet packet,
const Ptr< const EthernetMacHeader > &  frame 
)
protectedvirtual

Checks destination address and drops the frame when frame is not for us; returns true if frame is dropped.

447 {
448  // Current ethernet mac implementation does not support the configuration of multicast
449  // ethernet address groups. We rather accept all multicast frames (just like they were
450  // broadcasts) and pass it up to the higher layer where they will be dropped
451  // if not needed.
452  //
453  // PAUSE frames must be handled a bit differently because they are processed at
454  // this level. Multicast PAUSE frames should not be processed unless they have a
455  // destination of MULTICAST_PAUSE_ADDRESS. We drop all PAUSE frames that have a
456  // different muticast destination. (Note: Would the multicast ethernet addressing
457  // implemented, we could also process the PAUSE frames destined to any of our
458  // multicast adresses)
459  // All NON-PAUSE frames must be passed to the upper layer if the interface is
460  // in promiscuous mode.
461 
462  if (frame->getDest().equals(getMacAddress()))
463  return false;
464 
465  if (frame->getDest().isBroadcast())
466  return false;
467 
468  bool isPause = (frame->getTypeOrLength() == ETHERTYPE_FLOW_CONTROL);
469 
470  if (!isPause && (promiscuous || frame->getDest().isMulticast()))
471  return false;
472 
473  if (isPause && frame->getDest().equals(MacAddress::MULTICAST_PAUSE_ADDRESS))
474  return false;
475 
476  EV_WARN << "Frame `" << packet->getName() << "' not destined to us, discarding\n";
478  PacketDropDetails details;
479  details.setReason(NOT_ADDRESSED_TO_US);
480  emit(packetDroppedSignal, packet, &details);
481  delete packet;
482  return true;
483 }

Referenced by inet::EthernetCsmaMac::frameReceptionComplete(), and inet::EthernetMac::processMsgFromNetwork().

◆ encapsulate()

void inet::EthernetMacBase::encapsulate ( Packet packet)
protectedvirtual
381 {
382  auto phyHeader = makeShared<EthernetPhyHeader>();
383  frame->insertAtFront(phyHeader);
384  frame->addTagIfAbsent<PacketProtocolTag>()->setProtocol(&Protocol::ethernetPhy);
385 }

Referenced by inet::EthernetMac::startFrameTransmission(), and inet::EthernetCsmaMac::startFrameTransmission().

◆ finish()

void inet::EthernetMacBase::finish ( )
overrideprotectedvirtual

Reimplemented in inet::EthernetCsmaMac, and inet::EthernetMac.

567 {
568  {
569  simtime_t t = simTime();
570  recordScalar("simulated time", t);
571  recordScalar("full-duplex", duplexMode);
572 
573  if (t > 0) {
574  recordScalar("frames/sec sent", numFramesSent / t);
575  recordScalar("frames/sec rcvd", numFramesReceivedOK / t);
576  recordScalar("bits/sec sent", (8.0 * numBytesSent) / t);
577  recordScalar("bits/sec rcvd", (8.0 * numBytesReceivedOK) / t);
578  }
579  }
580 }

Referenced by inet::EthernetCsmaMac::finish(), and inet::EthernetMac::finish().

◆ getMacAddress()

virtual MacAddress inet::EthernetMacBase::getMacAddress ( )
inlinevirtual

◆ getProvider()

queueing::IPassivePacketSource * inet::EthernetMacBase::getProvider ( cGate *  gate)
overridevirtual

Returns the passive packet source from where packets are pulled or nullptr if the connected module doesn't implement the interface.

The gate parameter must be a valid gate of this module.

Implements inet::queueing::IActivePacketSink.

728 {
729  return (gate->getId() == upperLayerInGateId) ? txQueue.get() : nullptr;
730 }

◆ getReceiveState()

MacReceiveState inet::EthernetMacBase::getReceiveState ( )
inline
148 { return receiveState; }

◆ getTransmitState()

MacTransmitState inet::EthernetMacBase::getTransmitState ( )
inline
147 { return transmitState; }

◆ getTxRate()

double inet::EthernetMacBase::getTxRate ( )
inline
144 { return curEtherDescr->txrate; }

◆ handleCrashOperation()

void inet::EthernetMacBase::handleCrashOperation ( LifecycleOperation operation)
overridevirtual

Reimplemented from inet::MacProtocolBase.

301 {
302 // clearQueue();
303  connected = false;
304  networkInterface->setCarrier(false);
306  networkInterface->setState(NetworkInterface::State::DOWN);
307 }

◆ handlePullPacketProcessed()

void inet::EthernetMacBase::handlePullPacketProcessed ( Packet packet,
cGate *  gate,
bool  successful 
)
overridevirtual

Notifies about the completion of the packet processing for a packet that was pulled earlier independently whether the packet is passed or streamed.

This method is called, for example, when a previously pulled packet is failed to be processed successfully. It allows the sink to retry the operation.

The gate parameter must be a valid gate of this module. The packet must not be nullptr.

Implements inet::queueing::IActivePacketSink.

733 {
734  Enter_Method("handlePullPacketProcessed");
735  throw cRuntimeError("Not supported callback");
736 }

◆ handleStartOperation()

void inet::EthernetMacBase::handleStartOperation ( LifecycleOperation operation)
overridevirtual

Reimplemented from inet::MacProtocolBase.

281 {
282  networkInterface->setState(NetworkInterface::State::UP);
283  initializeFlags();
284  readChannelParameters(true);
285 }

◆ handleStopOperation()

void inet::EthernetMacBase::handleStopOperation ( LifecycleOperation operation)
overridevirtual

Reimplemented from inet::MacProtocolBase.

288 {
289  if (currentTxFrame != nullptr || !txQueue->isEmpty()) {
290  networkInterface->setState(NetworkInterface::State::GOING_DOWN);
291  delayActiveOperationFinish(par("stopOperationTimeout"));
292  }
293  else {
294  networkInterface->setCarrier(false);
295  networkInterface->setState(NetworkInterface::State::DOWN);
296  startActiveOperationExtraTimeOrFinish(par("stopOperationExtraTime"));
297  }
298 }

◆ initialize()

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

Reimplemented from inet::MacProtocolBase.

Reimplemented in inet::EthernetCsmaMac, and inet::EthernetMac.

189 {
191  if (stage == INITSTAGE_LOCAL) {
192  fcsMode = parseFcsMode(par("fcsMode"));
193  physInGate = gate("phys$i");
194  physOutGate = gate("phys$o");
195  lowerLayerInGateId = physInGate->getId();
196  lowerLayerOutGateId = physOutGate->getId();
197  transmissionChannel = nullptr;
199 
200  initializeFlags();
201 
203 
204  lastTxFinishTime = -1.0; // not equals with current simtime.
205 
206  // initialize self messages
207  endTxTimer = new cMessage("EndTransmission", ENDTRANSMISSION);
208  endIfgTimer = new cMessage("EndIFG", ENDIFG);
209  endPauseTimer = new cMessage("EndPause", ENDPAUSE);
210 
211  // initialize states
214 
215  // initialize pause
217 
218  subscribe(POST_MODEL_CHANGE, this);
219 
220  WATCH(transmitState);
221  WATCH(receiveState);
222  WATCH(connected);
223  WATCH(frameBursting);
224  WATCH(promiscuous);
225  WATCH(pauseUnitsRequested);
226  }
227 }

Referenced by inet::EthernetMac::initialize(), and inet::EthernetCsmaMac::initialize().

◆ initializeFlags()

void inet::EthernetMacBase::initializeFlags ( )
protectedvirtual

Reimplemented in inet::EthernetCsmaMac, and inet::EthernetMac.

230 {
231  displayStringTextFormat = par("displayStringTextFormat");
232  sendRawBytes = par("sendRawBytes");
233  duplexMode = true;
234 
235  // initialize connected flag
236  connected = physOutGate->getPathEndGate()->isConnected() && physInGate->getPathStartGate()->isConnected();
237 
238  if (!connected)
239  EV_WARN << "MAC not connected to a network.\n";
240 
241  // initialize promiscuous flag
242  promiscuous = par("promiscuous");
243 
244  frameBursting = false;
245 }

Referenced by handleStartOperation(), initialize(), inet::EthernetMac::initializeFlags(), and inet::EthernetCsmaMac::initializeFlags().

◆ initializeStatistics()

void inet::EthernetMacBase::initializeStatistics ( )
protectedvirtual

◆ isActive()

bool inet::EthernetMacBase::isActive ( )
inline
145 { return connected; }

◆ numInitStages()

virtual int inet::EthernetMacBase::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented in inet::EthernetCsmaMac, and inet::EthernetMac.

167 { return NUM_INIT_STAGES; }

◆ printParameters()

void inet::EthernetMacBase::printParameters ( )
protectedvirtual
554 {
555  // Dump parameters
556  EV_DETAIL << "MAC address: " << getMacAddress() << (promiscuous ? ", promiscuous mode" : "") << endl
557  << "txrate: " << curEtherDescr->txrate << " bps, "
558  << (duplexMode ? "full-duplex" : "half-duplex") << endl
559  << "bitTime: " << 1e9 / curEtherDescr->txrate << " ns" << endl
560  << "frameBursting: " << (frameBursting ? "on" : "off") << endl
561  << "slotTime: " << curEtherDescr->slotTime << endl
562  << "interFrameGap: " << INTERFRAME_GAP_BITS / curEtherDescr->txrate << endl
563  << endl;
564 }

◆ processAtHandleMessageFinished()

void inet::EthernetMacBase::processAtHandleMessageFinished ( )
virtual
311 {
312  if (operationalState == State::STOPPING_OPERATION) {
313  if (currentTxFrame == nullptr && txQueue->isEmpty()) {
314  EV << "Ethernet Queue is empty, MAC stopped\n";
315  connected = false;
316  networkInterface->setCarrier(false);
318  networkInterface->setState(NetworkInterface::State::DOWN);
319  startActiveOperationExtraTimeOrFinish(par("stopOperationExtraTime"));
320  }
321  }
322 }

Referenced by inet::EthernetMac::handleMessageWhenUp(), and inet::EthernetCsmaMac::handleMessageWhenUp().

◆ processConnectDisconnect()

void inet::EthernetMacBase::processConnectDisconnect ( )
protectedvirtual

Reimplemented in inet::EthernetCsmaMac.

348 {
349  if (!connected) {
350  cancelEvent(endTxTimer);
351  cancelEvent(endIfgTimer);
352  cancelEvent(endPauseTimer);
353 
354  if (currentTxFrame) {
355  EV_DETAIL << "Interface is not connected, dropping packet " << currentTxFrame << endl;
357  PacketDropDetails details;
358  details.setReason(INTERFACE_DOWN);
359  dropCurrentTxFrame(details);
360  lastTxFinishTime = -1.0; // so that it never equals to the current simtime, used for Burst mode detection.
361  }
362 
363  // Clear queue
364  while (canDequeuePacket()) {
365  Packet *msg = dequeuePacket();
366  EV_DETAIL << "Interface is not connected, dropping packet " << msg << endl;
368  PacketDropDetails details;
369  details.setReason(INTERFACE_DOWN);
370  emit(packetDroppedSignal, msg, &details);
371  delete msg;
372  }
373 
374  changeTransmissionState(TX_IDLE_STATE); // FIXME replace status to OFF
376  }
377  // FIXME when connect, set statuses to RECONNECT or IDLE
378 }

Referenced by handleCrashOperation(), processAtHandleMessageFinished(), inet::EthernetCsmaMac::processConnectDisconnect(), and refreshConnection().

◆ readChannelParameters()

void inet::EthernetMacBase::readChannelParameters ( bool  errorWhenAsymmetric)
protectedvirtual

Calculates datarates, etc.

Verifies the datarates on the incoming/outgoing channels, and throws error when they differ and the parameter errorWhenAsymmetric is true.

Reimplemented in inet::EthernetCsmaMac.

486 {
487  // When the connected channels change at runtime, we'll receive
488  // two separate notifications (one for the rx channel and one for the tx one),
489  // so we cannot immediately raise an error when they differ. Rather, we'll need
490  // to verify at the next opportunity (event) that the two channels have eventually
491  // been set to the same value.
492 
493  cDatarateChannel *outTrChannel = check_and_cast_nullable<cDatarateChannel *>(physOutGate->findTransmissionChannel());
494  cDatarateChannel *inTrChannel = check_and_cast_nullable<cDatarateChannel *>(physInGate->findIncomingTransmissionChannel());
495 
496  connected = physOutGate->getPathEndGate()->isConnected() && physInGate->getPathStartGate()->isConnected();
497 
498  if (connected && ((!outTrChannel) || (!inTrChannel)))
499  throw cRuntimeError("Ethernet phys gate must be connected using a transmission channel");
500 
501  double txRate = outTrChannel ? outTrChannel->getNominalDatarate() : 0.0;
502  double rxRate = inTrChannel ? inTrChannel->getNominalDatarate() : 0.0;
503 
504  bool rxDisabled = !inTrChannel || inTrChannel->isDisabled();
505  bool txDisabled = !outTrChannel || outTrChannel->isDisabled();
506 
507  if (errorWhenAsymmetric && (rxDisabled != txDisabled))
508  throw cRuntimeError("The enablements of the input/output channels differ (rx=%s vs tx=%s)", rxDisabled ? "off" : "on", txDisabled ? "off" : "on");
509 
510  if (txDisabled)
511  connected = false;
512 
513  bool dataratesDiffer;
514  if (!connected) {
516  dataratesDiffer = false;
517  if (!outTrChannel)
518  transmissionChannel = nullptr;
519  if (networkInterface) {
520  networkInterface->setCarrier(false);
521  networkInterface->setDatarate(0);
522  }
523  }
524  else {
525  if (outTrChannel && !transmissionChannel)
526  outTrChannel->subscribe(POST_MODEL_CHANGE, this);
527  transmissionChannel = outTrChannel;
528  dataratesDiffer = (txRate != rxRate);
529  }
530 
531  channelsDiffer = dataratesDiffer || (rxDisabled != txDisabled);
532 
533  if (errorWhenAsymmetric && dataratesDiffer)
534  throw cRuntimeError("The input/output datarates differ (rx=%g bps vs tx=%g bps)", rxRate, txRate);
535 
536  if (connected) {
537  // Check valid speeds
538  for (auto& etherDescr : etherDescrs) {
539  if (txRate == etherDescr.txrate) {
540  curEtherDescr = &(etherDescr);
541  if (networkInterface) {
542  networkInterface->setCarrier(true);
543  networkInterface->setDatarate(txRate);
544  }
545  return;
546  }
547  }
548  throw cRuntimeError("Invalid transmission rate %g bps on channel %s at module %s",
549  txRate, transmissionChannel->getFullPath().c_str(), getFullPath().c_str());
550  }
551 }

Referenced by inet::EthernetMac::handleMessageWhenUp(), handleStartOperation(), inet::EthernetCsmaMac::readChannelParameters(), and refreshConnection().

◆ receiveSignal()

void inet::EthernetMacBase::receiveSignal ( cComponent *  src,
simsignal_t  signalId,
cObject *  obj,
cObject *  details 
)
overrideprotectedvirtual

Reimplemented from inet::MacProtocolBase.

325 {
326  Enter_Method("%s", cComponent::getSignalName(signalID));
327 
328  MacProtocolBase::receiveSignal(source, signalID, obj, details);
329 
330  if (signalID == POST_MODEL_CHANGE) {
331  if (auto gcobj = dynamic_cast<cPostPathCreateNotification *>(obj)) {
332  if ((physOutGate == gcobj->pathStartGate) || (physInGate == gcobj->pathEndGate))
334  }
335  else if (auto gcobj = dynamic_cast<cPostPathCutNotification *>(obj)) {
336  if ((physOutGate == gcobj->pathStartGate) || (physInGate == gcobj->pathEndGate))
338  }
339  else if (transmissionChannel && dynamic_cast<cPostParameterChangeNotification *>(obj)) { // note: we are subscribed to the channel object too
340  cPostParameterChangeNotification *gcobj = static_cast<cPostParameterChangeNotification *>(obj);
341  if (transmissionChannel == gcobj->par->getOwner())
343  }
344  }
345 }

◆ refreshConnection()

void inet::EthernetMacBase::refreshConnection ( )
protectedvirtual
436 {
437  Enter_Method("refreshConnection");
438 
439  bool oldConn = connected;
440  readChannelParameters(false);
441 
442  if (oldConn != connected)
444 }

Referenced by receiveSignal().

◆ refreshDisplay()

void inet::EthernetMacBase::refreshDisplay ( ) const
overrideprotectedvirtual
583 {
585 
586  // icon coloring
587  const char *color;
588 
590  color = "red";
591  else if (transmitState == TRANSMITTING_STATE)
592  color = "yellow";
593  else if (transmitState == JAMMING_STATE)
594  color = "red";
595  else if (receiveState == RECEIVING_STATE)
596  color = "#4040ff";
597  else if (transmitState == BACKOFF_STATE)
598  color = "white";
599  else if (transmitState == PAUSE_STATE)
600  color = "gray";
601  else
602  color = "";
603 
604  getDisplayString().setTagArg("i", 1, color);
605 
606  if (!strcmp(getParentModule()->getNedTypeName(), "inet.linklayer.ethernet.EthernetInterface"))
607  getParentModule()->getDisplayString().setTagArg("i", 1, color);
608 
609  auto text = StringFormat::formatString(displayStringTextFormat, [&] (char directive) {
610  static std::string result;
611  switch (directive) {
612  case 's':
613  result = std::to_string(numFramesSent);
614  break;
615  case 'r':
616  result = std::to_string(numFramesReceivedOK);
617  break;
618  case 'd':
620  break;
621  case 'q':
622  result = txQueue != nullptr ? std::to_string(txQueue->getNumPackets()) : "";
623  break;
624  case 'b':
625  if (transmissionChannel == nullptr)
626  result = "not connected";
627  else {
628  char datarateText[40];
629  double datarate = transmissionChannel->getNominalDatarate();
630  if (datarate >= 1e9)
631  sprintf(datarateText, "%gGbps", datarate / 1e9);
632  else if (datarate >= 1e6)
633  sprintf(datarateText, "%gMbps", datarate / 1e6);
634  else if (datarate >= 1e3)
635  sprintf(datarateText, "%gkbps", datarate / 1e3);
636  else
637  sprintf(datarateText, "%gbps", datarate);
638  result = datarateText;
639  }
640  break;
641  default:
642  throw cRuntimeError("Unknown directive: %c", directive);
643  }
644  return result.c_str();
645  });
646  getDisplayString().setTagArg("t", 0, text);
647 }

◆ txFinished()

void inet::EthernetMacBase::txFinished ( )
protectedvirtual

◆ verifyCrcAndLength()

bool inet::EthernetMacBase::verifyCrcAndLength ( Packet packet)
protected

Verify ethernet packet: check FCS and payload length.

396 {
397  EV_STATICCONTEXT;
398 
399  auto ethHeader = packet->peekAtFront<EthernetMacHeader>(); // FIXME can I use any flags?
400  const auto& ethTrailer = packet->peekAtBack<EthernetFcs>(ETHER_FCS_BYTES); // FIXME can I use any flags?
401 
402  switch (ethTrailer->getFcsMode()) {
404  break;
406  EV_ERROR << "incorrect FCS in ethernet frame\n";
407  return false;
408  case FCS_COMPUTED: {
409  bool isFcsBad = false;
410  // check the FCS
411  auto ethBytes = packet->peekDataAt<BytesChunk>(B(0), packet->getDataLength() - ethTrailer->getChunkLength());
412  auto bufferLength = B(ethBytes->getChunkLength()).get();
413  auto buffer = new uint8_t[bufferLength];
414  // 1. fill in the data
415  ethBytes->copyToBuffer(buffer, bufferLength);
416  // 2. compute the FCS
417  auto computedFcs = ethernetCRC(buffer, bufferLength);
418  delete[] buffer;
419  isFcsBad = (computedFcs != ethTrailer->getFcs()); // FIXME how to check fcs?
420  if (isFcsBad)
421  return false;
422  break;
423  }
424  default:
425  throw cRuntimeError("invalid FCS mode in ethernet frame");
426  }
427  if (isIeee8023Header(*ethHeader)) {
428  b payloadLength = B(ethHeader->getTypeOrLength());
429 
430  return payloadLength <= packet->getDataLength() - (ethHeader->getChunkLength() + ethTrailer->getChunkLength());
431  }
432  return true;
433 }

Referenced by inet::EthernetCsmaMac::frameReceptionComplete(), and inet::EthernetMac::processMsgFromNetwork().

Member Data Documentation

◆ channelsDiffer

bool inet::EthernetMacBase::channelsDiffer = false
protected

◆ connected

◆ curEtherDescr

◆ curTxSignal

◆ displayStringTextFormat

const char* inet::EthernetMacBase::displayStringTextFormat = nullptr
protected

Referenced by initializeFlags(), and refreshDisplay().

◆ duplexMode

◆ endIfgTimer

◆ endPauseTimer

◆ endTxTimer

◆ etherDescrs

const EthernetMacBase::EtherDescr inet::EthernetMacBase::etherDescrs
staticprotected

Referenced by readChannelParameters().

◆ fcsMode

FcsMode inet::EthernetMacBase::fcsMode = FCS_MODE_UNDEFINED
protected

Referenced by addPaddingAndSetFcs(), and initialize().

◆ frameBursting

◆ lastTxFinishTime

◆ nullEtherDescr

const EthernetMacBase::EtherDescr inet::EthernetMacBase::nullEtherDescr
staticprotected
Initial value:
= {
0.0,
0.0,
0,
B(0),
B(0),
B(0),
0.0,
0.0
}

Referenced by EthernetMacBase(), and readChannelParameters().

◆ numBytesReceivedOK

unsigned long inet::EthernetMacBase::numBytesReceivedOK = 0
protected

◆ numBytesSent

unsigned long inet::EthernetMacBase::numBytesSent = 0
protected

◆ numDroppedBitError

unsigned long inet::EthernetMacBase::numDroppedBitError = 0
protected

◆ numDroppedIfaceDown

unsigned long inet::EthernetMacBase::numDroppedIfaceDown = 0
protected

◆ numDroppedNotForUs

unsigned long inet::EthernetMacBase::numDroppedNotForUs = 0
protected

◆ numDroppedPkFromHLIfaceDown

unsigned long inet::EthernetMacBase::numDroppedPkFromHLIfaceDown = 0
protected

◆ numFramesFromHL

unsigned long inet::EthernetMacBase::numFramesFromHL = 0
protected

◆ numFramesPassedToHL

unsigned long inet::EthernetMacBase::numFramesPassedToHL = 0
protected

◆ numFramesReceivedOK

unsigned long inet::EthernetMacBase::numFramesReceivedOK = 0
protected

◆ numFramesSent

unsigned long inet::EthernetMacBase::numFramesSent = 0
protected

◆ numPauseFramesRcvd

unsigned long inet::EthernetMacBase::numPauseFramesRcvd = 0
protected

◆ numPauseFramesSent

unsigned long inet::EthernetMacBase::numPauseFramesSent = 0
protected

◆ pauseUnitsRequested

◆ physInGate

◆ physOutGate

◆ promiscuous

bool inet::EthernetMacBase::promiscuous = false
protected

◆ receiveState

◆ receptionStateChangedSignal

simsignal_t inet::EthernetMacBase::receptionStateChangedSignal = registerSignal("receptionStateChanged")
staticprotected

Referenced by changeReceptionState().

◆ rxPausePkUnitsSignal

simsignal_t inet::EthernetMacBase::rxPausePkUnitsSignal = registerSignal("rxPausePkUnits")
staticprotected

◆ rxPkOkSignal

simsignal_t inet::EthernetMacBase::rxPkOkSignal = registerSignal("rxPkOk")
staticprotected

◆ sendRawBytes

bool inet::EthernetMacBase::sendRawBytes = false
protected

◆ SPEED_OF_LIGHT_IN_CABLE

const double inet::EthernetMacBase::SPEED_OF_LIGHT_IN_CABLE = 200000000.0
static

◆ transmissionChannel

cChannel* inet::EthernetMacBase::transmissionChannel = nullptr
protected

◆ transmissionStateChangedSignal

simsignal_t inet::EthernetMacBase::transmissionStateChangedSignal = registerSignal("transmissionStateChanged")
staticprotected

Referenced by changeTransmissionState().

◆ transmitState

◆ txPausePkUnitsSignal

simsignal_t inet::EthernetMacBase::txPausePkUnitsSignal = registerSignal("txPausePkUnits")
staticprotected

The documentation for this class was generated from the following files:
inet::MacProtocolBase::networkInterface
opp_component_ptr< NetworkInterface > networkInterface
Definition: MacProtocolBase.h:30
inet::EthernetMacBase::ENDIFG
@ ENDIFG
Definition: EthernetMacBase.h:56
inet::EthernetMacBase::nullEtherDescr
static const EtherDescr nullEtherDescr
Definition: EthernetMacBase.h:82
inet::EthernetMacBase::numFramesSent
unsigned long numFramesSent
Definition: EthernetMacBase.h:115
inet::MacAddress::MULTICAST_PAUSE_ADDRESS
static const MacAddress MULTICAST_PAUSE_ADDRESS
The special multicast PAUSE MAC address, 01:80:C2:00:00:01.
Definition: MacAddress.h:37
inet::OperationalMixin< cSimpleModule >::operationalState
State operationalState
Definition: OperationalMixin.h:23
inet::EthernetMacBase::numDroppedPkFromHLIfaceDown
unsigned long numDroppedPkFromHLIfaceDown
Definition: EthernetMacBase.h:120
inet::EthernetMacBase::ENDTRANSMISSION
@ ENDTRANSMISSION
Definition: EthernetMacBase.h:59
inet::MIN_ETHERNET_FRAME_BYTES
const B MIN_ETHERNET_FRAME_BYTES
Definition: Ethernet.h:22
inet::EthernetMacBase::numBytesSent
unsigned long numBytesSent
Definition: EthernetMacBase.h:117
inet::EthernetMacBase::numDroppedIfaceDown
unsigned long numDroppedIfaceDown
Definition: EthernetMacBase.h:121
inet::EthernetMacBase::transmissionChannel
cChannel * transmissionChannel
Definition: EthernetMacBase.h:95
inet::ETHER_FCS_BYTES
const B ETHER_FCS_BYTES
Definition: Ethernet.h:59
inet::isIeee8023Header
bool isIeee8023Header(const EthernetMacHeader &hdr)
Definition: EthernetMacHeader_m.h:229
inet::INTERFRAME_GAP_BITS
const b INTERFRAME_GAP_BITS
Definition: Ethernet.h:24
inet::EthernetMacBase::changeReceptionState
void changeReceptionState(MacReceiveState newState)
Definition: EthernetMacBase.cc:655
inet::MacProtocolBase::dropCurrentTxFrame
virtual void dropCurrentTxFrame(PacketDropDetails &details)
Definition: MacProtocolBase.cc:99
inet::EthernetMacBase::ENDJAMMING
@ ENDJAMMING
Definition: EthernetMacBase.h:60
inet::FCS_COMPUTED
@ FCS_COMPUTED
Definition: FcsMode_m.h:59
inet::EthernetMacBase::numFramesFromHL
unsigned long numFramesFromHL
Definition: EthernetMacBase.h:119
inet::EthernetMacBase::physOutGate
cGate * physOutGate
Definition: EthernetMacBase.h:97
inet::ETHERTYPE_FLOW_CONTROL
@ ETHERTYPE_FLOW_CONTROL
Definition: EtherType_m.h:92
inet::EthernetMacBase::WAIT_IFG_STATE
@ WAIT_IFG_STATE
Definition: EthernetMacBase.h:36
inet::FCS_DECLARED_CORRECT
@ FCS_DECLARED_CORRECT
Definition: FcsMode_m.h:57
inet::packetDroppedSignal
simsignal_t packetDroppedSignal
Definition: Simsignals.cc:85
inet::EthernetMacBase::numBytesReceivedOK
unsigned long numBytesReceivedOK
Definition: EthernetMacBase.h:118
inet::EthernetMacBase::promiscuous
bool promiscuous
Definition: EthernetMacBase.h:90
inet::EthernetMacBase::EtherDescr::slotTime
double slotTime
Definition: EthernetMacBase.h:76
inet::EthernetMacBase::ENDRECEPTION
@ ENDRECEPTION
Definition: EthernetMacBase.h:57
inet::EthernetMacBase::numPauseFramesSent
unsigned long numPauseFramesSent
Definition: EthernetMacBase.h:126
inet::EthernetMacBase::EtherDescr::txrate
double txrate
Definition: EthernetMacBase.h:69
PacketProtocolTag
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down PacketProtocolTag
Definition: IUdp-gates.txt:25
inet::MacProtocolBase::lowerLayerInGateId
int lowerLayerInGateId
Definition: MacProtocolBase.h:26
inet::EthernetMacBase::RECEIVING_STATE
@ RECEIVING_STATE
Definition: EthernetMacBase.h:47
inet::EthernetMacBase::lastTxFinishTime
simtime_t lastTxFinishTime
Definition: EthernetMacBase.h:103
inet::EthernetMacBase::PAUSE_STATE
@ PAUSE_STATE
Definition: EthernetMacBase.h:41
inet::EthernetMacBase::BACKOFF_STATE
@ BACKOFF_STATE
Definition: EthernetMacBase.h:40
inet::units::units::B
intscale< b, 1, 8 > B
Definition: Units.h:1168
inet::EthernetMacBase::refreshConnection
virtual void refreshConnection()
Definition: EthernetMacBase.cc:435
inet::ethernetCRC
uint32_t ethernetCRC(const unsigned char *buf, unsigned int bufsize, uint32_t crc)
Definition: EthernetCRC.cc:58
inet::EthernetMacBase::transmissionStateChangedSignal
static simsignal_t transmissionStateChangedSignal
Definition: EthernetMacBase.h:132
inet::EthernetMacBase::getMacAddress
virtual MacAddress getMacAddress()
Definition: EthernetMacBase.h:142
inet::MacProtocolBase::currentTxFrame
Packet * currentTxFrame
Currently transmitted frame if any.
Definition: MacProtocolBase.h:35
inet::EthernetMacBase::readChannelParameters
virtual void readChannelParameters(bool errorWhenAsymmetric)
Calculates datarates, etc.
Definition: EthernetMacBase.cc:485
inet::EthernetMacBase::endPauseTimer
cMessage * endPauseTimer
Definition: EthernetMacBase.h:109
inet::Protocol::ethernetMac
static const Protocol ethernetMac
Definition: Protocol.h:65
inet::EthernetMacBase::sendRawBytes
bool sendRawBytes
Definition: EthernetMacBase.h:86
inet::EthernetMacBase::ENDBACKOFF
@ ENDBACKOFF
Definition: EthernetMacBase.h:58
inet::MacProtocolBase::upperLayerInGateId
int upperLayerInGateId
Gate ids.
Definition: MacProtocolBase.h:24
inet::EthernetMacBase::numDroppedNotForUs
unsigned long numDroppedNotForUs
Definition: EthernetMacBase.h:123
inet::EthernetMacBase::endTxTimer
cMessage * endTxTimer
Definition: EthernetMacBase.h:107
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
inet::EthernetMacBase::processConnectDisconnect
virtual void processConnectDisconnect()
Definition: EthernetMacBase.cc:347
inet::EthernetMacBase::connected
bool connected
Definition: EthernetMacBase.h:89
inet::MacProtocolBase::receiveSignal
virtual void receiveSignal(cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
Definition: MacProtocolBase.cc:151
inet::units::values::b
value< int64_t, units::b > b
Definition: Units.h:1241
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::EthernetMacBase::physInGate
cGate * physInGate
Definition: EthernetMacBase.h:96
inet::FCS_DECLARED_INCORRECT
@ FCS_DECLARED_INCORRECT
Definition: FcsMode_m.h:58
inet::EthernetMacBase::numDroppedBitError
unsigned long numDroppedBitError
Definition: EthernetMacBase.h:122
inet::MacProtocolBase::initialize
virtual void initialize(int stage) override
Definition: MacProtocolBase.cc:37
inet::EthernetMacBase::JAMMING_STATE
@ JAMMING_STATE
Definition: EthernetMacBase.h:39
inet::EthernetMacBase::endIfgTimer
cMessage * endIfgTimer
Definition: EthernetMacBase.h:108
inet::EthernetMacBase::RX_COLLISION_STATE
@ RX_COLLISION_STATE
Definition: EthernetMacBase.h:48
inet::Protocol::ethernetPhy
static const Protocol ethernetPhy
Definition: Protocol.h:66
inet::OperationalMixin< cSimpleModule >::delayActiveOperationFinish
virtual void delayActiveOperationFinish(simtime_t timeout)
Definition: OperationalMixinImpl.h:161
inet::EthernetMacBase::duplexMode
bool duplexMode
Definition: EthernetMacBase.h:91
inet::StringFormat::formatString
const char * formatString(IDirectiveResolver *resolver) const
Definition: StringFormat.cc:17
inet::INTERFACE_DOWN
@ INTERFACE_DOWN
Definition: Simsignals_m.h:72
inet::EthernetMacBase::initializeStatistics
virtual void initializeStatistics()
Definition: EthernetMacBase.cc:247
inet::MacProtocolBase::getQueue
queueing::IPacketQueue * getQueue(cGate *gate) const
Definition: MacProtocolBase.cc:157
inet::OperationalMixin< cSimpleModule >::startActiveOperationExtraTimeOrFinish
virtual void startActiveOperationExtraTimeOrFinish(simtime_t extraTime)
Definition: OperationalMixinImpl.h:179
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::EthernetMacBase::channelsDiffer
bool channelsDiffer
Definition: EthernetMacBase.h:100
inet::EthernetMacBase::RX_IDLE_STATE
@ RX_IDLE_STATE
Definition: EthernetMacBase.h:46
inet::EthernetMacBase::etherDescrs
static const EtherDescr etherDescrs[NUM_OF_ETHERDESCRS]
Definition: EthernetMacBase.h:81
inet::EthernetMacBase::displayStringTextFormat
const char * displayStringTextFormat
Definition: EthernetMacBase.h:85
inet::EthernetMacBase::SEND_IFG_STATE
@ SEND_IFG_STATE
Definition: EthernetMacBase.h:37
inet::MacProtocolBase::lowerLayerOutGateId
int lowerLayerOutGateId
Definition: MacProtocolBase.h:27
inet::EthernetMacBase::receptionStateChangedSignal
static simsignal_t receptionStateChangedSignal
Definition: EthernetMacBase.h:133
inet::MacProtocolBase::dequeuePacket
virtual Packet * dequeuePacket()
Definition: MacProtocolBase.cc:175
inet::EthernetMacBase::curTxSignal
EthernetSignalBase * curTxSignal
Definition: EthernetMacBase.h:112
inet::parseFcsMode
FcsMode parseFcsMode(const char *fcsModeString)
Definition: FcsMode.cc:14
inet::MacAddress::UNSPECIFIED_ADDRESS
static const MacAddress UNSPECIFIED_ADDRESS
The unspecified MAC address, 00:00:00:00:00:00.
Definition: MacAddress.h:31
inet::MacProtocolBase::txQueue
opp_component_ptr< queueing::IPacketQueue > txQueue
Messages received from upper layer and to be transmitted later.
Definition: MacProtocolBase.h:38
inet::EthernetMacBase::frameBursting
bool frameBursting
Definition: EthernetMacBase.h:92
inet::EthernetMacBase::numPauseFramesRcvd
unsigned long numPauseFramesRcvd
Definition: EthernetMacBase.h:125
inet::EthernetMacBase::receiveState
MacReceiveState receiveState
Definition: EthernetMacBase.h:102
inet::OperationalMixin< cSimpleModule >::refreshDisplay
virtual void refreshDisplay() const override
Definition: OperationalMixinImpl.h:200
inet::EthernetMacBase::ENDPAUSE
@ ENDPAUSE
Definition: EthernetMacBase.h:61
inet::EthernetMacBase::pauseUnitsRequested
int pauseUnitsRequested
Definition: EthernetMacBase.h:104
inet::MacProtocolBase::canDequeuePacket
virtual bool canDequeuePacket() const
Definition: MacProtocolBase.cc:170
inet::EthernetMacBase::transmitState
MacTransmitState transmitState
Definition: EthernetMacBase.h:101
inet::NOT_ADDRESSED_TO_US
@ NOT_ADDRESSED_TO_US
Definition: Simsignals_m.h:76
inet::EthernetMacBase::TRANSMITTING_STATE
@ TRANSMITTING_STATE
Definition: EthernetMacBase.h:38
inet::EthernetMacBase::numFramesReceivedOK
unsigned long numFramesReceivedOK
Definition: EthernetMacBase.h:116
inet::EthernetMacBase::numFramesPassedToHL
unsigned long numFramesPassedToHL
Definition: EthernetMacBase.h:124
inet::EthernetMacBase::TX_IDLE_STATE
@ TX_IDLE_STATE
Definition: EthernetMacBase.h:35
inet::EthernetMacBase::RX_RECONNECT_STATE
@ RX_RECONNECT_STATE
Definition: EthernetMacBase.h:49
inet::EthernetMacBase::initializeFlags
virtual void initializeFlags()
Definition: EthernetMacBase.cc:229
inet::EthernetMacBase::fcsMode
FcsMode fcsMode
Definition: EthernetMacBase.h:87
inet::EthernetMacBase::curEtherDescr
const EtherDescr * curEtherDescr
Definition: EthernetMacBase.h:88
inet::EthernetMacBase::NUM_OF_ETHERDESCRS
@ NUM_OF_ETHERDESCRS
Definition: EthernetMacBase.h:65
inet::EthernetMacBase::changeTransmissionState
void changeTransmissionState(MacTransmitState newState)
Definition: EthernetMacBase.cc:649