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

This module handles the mapping between interface IDs and MAC addresses. More...

#include <MacForwardingTable.h>

Inheritance diagram for inet::MacForwardingTable:
inet::OperationalBase inet::IMacForwardingTable inet::StringFormat::IDirectiveResolver inet::OperationalMixin< cSimpleModule > inet::ILifecycle

Classes

struct  AddressEntry
 
struct  MacCompare
 
struct  MulticastAddressEntry
 

Public Member Functions

virtual int getUnicastAddressForwardingInterface (const MacAddress &address, unsigned int vid=0) const override
 
virtual void setUnicastAddressForwardingInterface (int interfaceId, const MacAddress &address, unsigned int vid=0) override
 
virtual void removeUnicastAddressForwardingInterface (int interfaceId, const MacAddress &address, unsigned int vid=0) override
 
virtual void learnUnicastAddressForwardingInterface (int interfaceId, const MacAddress &address, unsigned int vid=0) override
 
virtual std::vector< int > getMulticastAddressForwardingInterfaces (const MacAddress &address, unsigned int vid=0) const override
 
virtual void addMulticastAddressForwardingInterface (int interfaceId, const MacAddress &address, unsigned int vid=0) override
 
virtual void removeMulticastAddressForwardingInterface (int interfaceId, const MacAddress &address, unsigned int vid=0) override
 
virtual void removeForwardingInterface (int interfaceId) override
 
virtual void replaceForwardingInterface (int oldInterfaceId, int newInterfaceId) override
 
- Public Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual ~OperationalMixin ()
 }@ More...
 
- Public Member Functions inherited from inet::ILifecycle
virtual ~ILifecycle ()
 

Protected Types

typedef std::pair< unsigned int, MacAddressForwardingTableKey
 
typedef std::map< ForwardingTableKey, AddressEntryForwardingTable
 
typedef std::map< ForwardingTableKey, MulticastAddressEntryMulticastForwardingTable
 
- Protected Types inherited from inet::OperationalMixin< cSimpleModule >
enum  State
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual void handleParameterChange (const char *name) override
 
virtual void handleMessage (cMessage *msg) override
 
virtual void handleMessageWhenUp (cMessage *msg) override
 
virtual void refreshDisplay () const override
 
virtual void updateDisplayString () const
 
virtual const char * resolveDirective (char directive) const override
 
virtual void parseForwardingTableParameter ()
 
virtual void printState ()
 Prints cached data. More...
 
virtual void removeAgedEntriesFromAllVlans ()
 Remove aged entries from all VLANs. More...
 
virtual void removeAgedEntriesIfNeeded ()
 
virtual void readForwardingTable (const char *fileName)
 Pre-reads in entries for Address Table during initialization. More...
 
virtual void initializeTable ()
 For lifecycle: initialize entries for the vlanForwardingTable by reading them from a file (if specified by a parameter) More...
 
virtual void clearTable ()
 For lifecycle: clears all entries from the vlanForwardingTable. More...
 
virtual void setAgingTime (simtime_t agingTime) 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
 
- Protected Member Functions inherited from inet::OperationalMixin< cSimpleModule >
virtual int numInitStages () const override
 
virtual void refreshDisplay () const 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 ()
 

Protected Attributes

simtime_t agingTime
 
simtime_t lastPurge
 
ForwardingTable forwardingTable
 
MulticastForwardingTable multicastForwardingTable
 
ModuleRefByPar< IInterfaceTableifTable
 
- Protected Attributes inherited from inet::OperationalMixin< cSimpleModule >
State operationalState
 
simtime_t lastChange
 
Operation activeOperation
 
cMessage * activeOperationTimeout
 
cMessage * activeOperationExtraTimer
 

Friends

std::ostream & operator<< (std::ostream &os, const AddressEntry &entry)
 
std::ostream & operator<< (std::ostream &os, const MulticastAddressEntry &entry)
 
std::ostream & operator<< (std::ostream &os, const ForwardingTableKey &key)
 

Detailed Description

This module handles the mapping between interface IDs and MAC addresses.

See the NED definition for details. NOTE that interfaceIds (interfaceId parameters) are actually the corresponding ID of the port interface. i.e. this is an interfaceId and NOT an index of the some kind in a gate vector.

Member Typedef Documentation

◆ ForwardingTable

◆ ForwardingTableKey

typedef std::pair<unsigned int, MacAddress> inet::MacForwardingTable::ForwardingTableKey
protected

◆ MulticastForwardingTable

Member Function Documentation

◆ addMulticastAddressForwardingInterface()

void inet::MacForwardingTable::addMulticastAddressForwardingInterface ( int  interfaceId,
const MacAddress address,
unsigned int  vid = 0 
)
overridevirtual

Implements inet::IMacForwardingTable.

211 {
212  Enter_Method("addMulticastAddressForwardingInterface");
213  ASSERT(address.isMulticast());
214  ForwardingTableKey key(vid, address);
215  auto it = multicastForwardingTable.find(key);
216  if (it == multicastForwardingTable.end())
217  multicastForwardingTable[key] = MulticastAddressEntry(vid, {interfaceId});
218  else {
219  if (contains(it->second.interfaceIds, interfaceId))
220  throw cRuntimeError("Already contains interface");
221  it->second.interfaceIds.push_back(interfaceId);
222  }
223 }

Referenced by parseForwardingTableParameter().

◆ clearTable()

void inet::MacForwardingTable::clearTable ( )
protectedvirtual

For lifecycle: clears all entries from the vlanForwardingTable.

389 {
390  forwardingTable.clear();
391  multicastForwardingTable.clear();
392 }

Referenced by handleParameterChange(), and initializeTable().

◆ getMulticastAddressForwardingInterfaces()

std::vector< int > inet::MacForwardingTable::getMulticastAddressForwardingInterfaces ( const MacAddress address,
unsigned int  vid = 0 
) const
overridevirtual

Implements inet::IMacForwardingTable.

199 {
200  Enter_Method("getMulticastAddressForwardingInterfaces");
201  ASSERT(address.isMulticast());
202  ForwardingTableKey key(vid, address);
203  auto it = multicastForwardingTable.find(key);
204  if (it == multicastForwardingTable.end())
205  return std::vector<int>();
206  else
207  return it->second.interfaceIds;
208 }

◆ getUnicastAddressForwardingInterface()

int inet::MacForwardingTable::getUnicastAddressForwardingInterface ( const MacAddress address,
unsigned int  vid = 0 
) const
overridevirtual

Implements inet::IMacForwardingTable.

137 {
138  Enter_Method("getUnicastAddressForwardingInterface");
139  ASSERT(!address.isMulticast());
140  ForwardingTableKey key(vid, address);
141  auto it = forwardingTable.find(key);
142  if (it == forwardingTable.end())
143  return -1;
144  else if (it->second.insertionTime <= simTime() - agingTime) {
145  EV_TRACE << "Ignoring aged entry: " << it->first << " --> " << it->second << "\n";
146  return -1;
147  }
148  else
149  return it->second.interfaceId;
150 }

◆ handleCrashOperation()

virtual void inet::MacForwardingTable::handleCrashOperation ( LifecycleOperation operation)
inlineoverrideprotectedvirtual

◆ handleMessage()

void inet::MacForwardingTable::handleMessage ( cMessage *  msg)
overrideprotectedvirtual

Reimplemented from inet::OperationalMixin< cSimpleModule >.

99 {
100  throw cRuntimeError("This module doesn't process messages");
101 }

◆ handleMessageWhenUp()

void inet::MacForwardingTable::handleMessageWhenUp ( cMessage *  msg)
overrideprotectedvirtual

Implements inet::OperationalMixin< cSimpleModule >.

104 {
105  throw cRuntimeError("This module doesn't process messages");
106 }

◆ handleParameterChange()

void inet::MacForwardingTable::handleParameterChange ( const char *  name)
overrideprotectedvirtual
64 {
65  if (name != nullptr) {
66  if (!strcmp(name, "forwardingTable")) {
67  clearTable();
69  }
70  }
71 }

◆ handleStartOperation()

virtual void inet::MacForwardingTable::handleStartOperation ( LifecycleOperation operation)
inlineoverrideprotectedvirtual

◆ handleStopOperation()

virtual void inet::MacForwardingTable::handleStopOperation ( LifecycleOperation operation)
inlineoverrideprotectedvirtual

◆ initialize()

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

Reimplemented from inet::OperationalMixin< cSimpleModule >.

52 {
54  if (stage == INITSTAGE_LOCAL) {
55  agingTime = par("agingTime");
56  lastPurge = SIMTIME_ZERO;
57  ifTable.reference(this, "interfaceTableModule", true);
58  WATCH_MAP(forwardingTable);
59  WATCH_MAP(multicastForwardingTable);
60  }
61 }

◆ initializeTable()

void inet::MacForwardingTable::initializeTable ( )
protectedvirtual

For lifecycle: initialize entries for the vlanForwardingTable by reading them from a file (if specified by a parameter)

378 {
379  clearTable();
381 
382  // Option to pre-read in Address Table. To turn it off, set forwardingTableFile to empty string
383  const char *forwardingTableFile = par("forwardingTableFile");
384  if (forwardingTableFile && *forwardingTableFile)
385  readForwardingTable(forwardingTableFile);
386 }

◆ isInitializeStage()

virtual bool inet::MacForwardingTable::isInitializeStage ( int  stage) const
inlineoverrideprotectedvirtual

Implements inet::OperationalMixin< cSimpleModule >.

128 { return stage == INITSTAGE_LINK_LAYER; }

◆ isModuleStartStage()

virtual bool inet::MacForwardingTable::isModuleStartStage ( int  stage) const
inlineoverrideprotectedvirtual

◆ isModuleStopStage()

virtual bool inet::MacForwardingTable::isModuleStopStage ( int  stage) const
inlineoverrideprotectedvirtual

◆ learnUnicastAddressForwardingInterface()

void inet::MacForwardingTable::learnUnicastAddressForwardingInterface ( int  interfaceId,
const MacAddress address,
unsigned int  vid = 0 
)
overridevirtual

Implements inet::IMacForwardingTable.

178 {
179  Enter_Method("learnUnicastAddressForwardingInterface");
180  ASSERT(!address.isMulticast());
182  ForwardingTableKey key(vid, address);
183  auto it = forwardingTable.find(key);
184  if (it == forwardingTable.end()) {
185  EV << "Adding entry" << EV_FIELD(address) << EV_FIELD(interfaceId) << EV_FIELD(vid) << EV_ENDL;
186  forwardingTable[key] = AddressEntry(vid, interfaceId, simTime());
187  }
188  else if (it->second.insertionTime != SimTime::getMaxTime()) {
189  EV << "Updating entry" << EV_FIELD(address) << EV_FIELD(interfaceId) << EV_FIELD(vid) << EV_ENDL;
190  AddressEntry& entry = it->second;
191  entry.interfaceId = interfaceId;
192  entry.insertionTime = simTime();
193  }
194  else
195  EV << "Ignoring manually configured entry" << EV_FIELD(address) << EV_FIELD(interfaceId) << EV_FIELD(vid) << EV_ENDL;
196 }

◆ numInitStages()

virtual int inet::MacForwardingTable::numInitStages ( ) const
inlineoverrideprotectedvirtual
62 { return NUM_INIT_STAGES; }

◆ parseForwardingTableParameter()

void inet::MacForwardingTable::parseForwardingTableParameter ( )
protectedvirtual
356 {
357  auto forwardingTable = check_and_cast<cValueArray *>(par("forwardingTable").objectValue());
358  for (int i = 0; i < forwardingTable->size(); i++) {
359  cValueMap *entry = check_and_cast<cValueMap *>(forwardingTable->get(i).objectValue());
360  auto vlan = entry->containsKey("vlan") ? entry->get("vlan").intValue() : 0;
361  auto macAddressString = entry->get("address").stringValue();
362  L3Address l3Address;
363  if (!L3AddressResolver().tryResolve(macAddressString, l3Address, L3AddressResolver::ADDR_MAC))
364  throw cRuntimeError("Cannot resolve MAC address of '%s'", macAddressString);
365  MacAddress macAddress = l3Address.toMac();
366  auto interfaceName = entry->get("interface").stringValue();
367  auto networkInterface = ifTable->findInterfaceByName(interfaceName);
368  if (networkInterface == nullptr)
369  throw cRuntimeError("Cannot find network interface '%s'", interfaceName);
370  if (macAddress.isMulticast())
371  addMulticastAddressForwardingInterface(networkInterface->getInterfaceId(), macAddress, vlan);
372  else
373  setUnicastAddressForwardingInterface(networkInterface->getInterfaceId(), macAddress, vlan);
374  }
375 }

Referenced by handleParameterChange(), and initializeTable().

◆ printState()

void inet::MacForwardingTable::printState ( )
protectedvirtual

Prints cached data.

250 {
251  EV << endl << "MAC Address Table" << endl;
252  EV << "VLAN ID MAC IfId Inserted" << endl;
253  for (auto& elem : forwardingTable)
254  EV << elem.first.first << " " << elem.first.second << " " << elem.second.interfaceId << " " << elem.second.insertionTime << endl;
255 }

◆ readForwardingTable()

void inet::MacForwardingTable::readForwardingTable ( const char *  fileName)
protectedvirtual

Pre-reads in entries for Address Table during initialization.

291 {
292  FILE *fp = fopen(fileName, "r");
293  if (fp == nullptr)
294  throw cRuntimeError("cannot open address table file `%s'", fileName);
295 
296  // parse address table file:
297  char *line;
298  for (int lineno = 0; (line = fgetline(fp)) != nullptr; delete[] line) {
299  lineno++;
300 
301  // lines beginning with '#' are treated as comments
302  if (line[0] == '#')
303  continue;
304 
305  // scan in VLAN ID
306  char *vlanIdStr = strtok(line, " \t");
307  // scan in MAC address
308  char *macAddressStr = strtok(nullptr, " \t");
309  // scan in interface name
310  char *interfaceName = strtok(nullptr, " \t");
311 
312  char *endptr = nullptr;
313 
314  // empty line or comment?
315  if (!vlanIdStr || *vlanIdStr == '#')
316  continue;
317 
318  // broken line?
319  if (!vlanIdStr || !macAddressStr || !interfaceName)
320  throw cRuntimeError("line %d invalid in address table file `%s'", lineno, fileName);
321 
322  // parse columns:
323 
324  // parse VLAN ID:
325  unsigned int vlanId = strtol(vlanIdStr, &endptr, 10);
326  if (!endptr || *endptr)
327  throw cRuntimeError("error in line %d in address table file `%s': VLAN ID '%s' unresolved", lineno, fileName, vlanIdStr);
328 
329  // parse MAC address:
330  L3Address addr;
331  if (!L3AddressResolver().tryResolve(macAddressStr, addr, L3AddressResolver::ADDR_MAC))
332  throw cRuntimeError("error in line %d in address table file `%s': MAC address '%s' unresolved", lineno, fileName, macAddressStr);
333  MacAddress macAddress = addr.toMac();
334 
335  // parse interface:
336  int interfaceId = -1;
337  auto ie = ifTable->findInterfaceByName(interfaceName);
338  if (ie == nullptr) {
339  long int num = strtol(interfaceName, &endptr, 10);
340  if (endptr && *endptr == '\0')
341  ie = ifTable->findInterfaceById(num);
342  }
343  if (ie == nullptr)
344  throw cRuntimeError("error in line %d in address table file `%s': interface '%s' not found", lineno, fileName, interfaceName);
345  interfaceId = ie->getInterfaceId();
346 
347  // Create an entry with address and interfaceId and insert into table
348  AddressEntry entry(vlanId, interfaceId, 0);
349  ForwardingTableKey key(vlanId, macAddress);
350  forwardingTable[key] = entry;
351  }
352  fclose(fp);
353 }

Referenced by initializeTable().

◆ refreshDisplay()

void inet::MacForwardingTable::refreshDisplay ( ) const
overrideprotectedvirtual
109 {
111 }

◆ removeAgedEntriesFromAllVlans()

void inet::MacForwardingTable::removeAgedEntriesFromAllVlans ( )
protectedvirtual

Remove aged entries from all VLANs.

267 {
268  for (auto cur = forwardingTable.begin(); cur != forwardingTable.end();) {
269  AddressEntry& entry = cur->second;
270  if (entry.insertionTime <= simTime() - agingTime) {
271  EV << "Removing aged entry from Address Table: "
272  << cur->first.first << " " << cur->first.second << " --> interfaceId " << cur->second.interfaceId << "\n";
273  cur = forwardingTable.erase(cur);
274  }
275  else
276  ++cur;
277  }
278 }

Referenced by removeAgedEntriesIfNeeded().

◆ removeAgedEntriesIfNeeded()

void inet::MacForwardingTable::removeAgedEntriesIfNeeded ( )
protectedvirtual
281 {
282  simtime_t now = simTime();
283 
284  if (now >= lastPurge + SimTime(1, SIMTIME_S))
286 
287  lastPurge = simTime();
288 }

Referenced by learnUnicastAddressForwardingInterface().

◆ removeForwardingInterface()

void inet::MacForwardingTable::removeForwardingInterface ( int  interfaceId)
overridevirtual

Implements inet::IMacForwardingTable.

239 {
240  Enter_Method("removeForwardingInterface");
241  for (auto cur = forwardingTable.begin(); cur != forwardingTable.end();) {
242  if (cur->second.interfaceId == interfaceId)
243  cur = forwardingTable.erase(cur);
244  else
245  ++cur;
246  }
247 }

◆ removeMulticastAddressForwardingInterface()

void inet::MacForwardingTable::removeMulticastAddressForwardingInterface ( int  interfaceId,
const MacAddress address,
unsigned int  vid = 0 
)
overridevirtual

Implements inet::IMacForwardingTable.

226 {
227  Enter_Method("removeMulticastAddressForwardingInterface");
228  ASSERT(address.isMulticast());
229  ForwardingTableKey key(vid, address);
230  auto it = multicastForwardingTable.find(key);
231  if (it == multicastForwardingTable.end())
232  throw cRuntimeError("Cannot find entry");
233  if (contains(it->second.interfaceIds, interfaceId))
234  throw cRuntimeError("Cannot find interface");
235  remove(it->second.interfaceIds, interfaceId);
236 }

◆ removeUnicastAddressForwardingInterface()

void inet::MacForwardingTable::removeUnicastAddressForwardingInterface ( int  interfaceId,
const MacAddress address,
unsigned int  vid = 0 
)
overridevirtual

Implements inet::IMacForwardingTable.

167 {
168  Enter_Method("removeUnicastAddressForwardingInterface");
169  ASSERT(!address.isMulticast());
170  ForwardingTableKey key(vid, address);
171  auto it = forwardingTable.find(key);
172  if (it == forwardingTable.end())
173  throw cRuntimeError("Cannot find entry");
174  forwardingTable.erase(it);
175 }

◆ replaceForwardingInterface()

void inet::MacForwardingTable::replaceForwardingInterface ( int  oldInterfaceId,
int  newInterfaceId 
)
overridevirtual

Implements inet::IMacForwardingTable.

258 {
259  Enter_Method("replaceForwardingInterface");
260  for (auto& elem : forwardingTable) {
261  if (elem.second.interfaceId == oldInterfaceId)
262  elem.second.interfaceId = newInterfaceId;
263  }
264 }

◆ resolveDirective()

const char * inet::MacForwardingTable::resolveDirective ( char  directive) const
overrideprotectedvirtual

Implements inet::StringFormat::IDirectiveResolver.

122 {
123  static std::string result;
124  switch (directive) {
125  case 'a':
126  result = std::to_string(forwardingTable.size());
127  break;
128  case 'v':
129  break;
130  default:
131  throw cRuntimeError("Unknown directive: %c", directive);
132  }
133  return result.c_str();
134 }

◆ setAgingTime()

void inet::MacForwardingTable::setAgingTime ( simtime_t  agingTime)
overrideprotectedvirtual

Implements inet::IMacForwardingTable.

395 {
396  this->agingTime = agingTime == -1 ? par("agingTime") : agingTime;
397 }

◆ setUnicastAddressForwardingInterface()

void inet::MacForwardingTable::setUnicastAddressForwardingInterface ( int  interfaceId,
const MacAddress address,
unsigned int  vid = 0 
)
overridevirtual

Implements inet::IMacForwardingTable.

153 {
154  Enter_Method("setUnicastAddressForwardingInterface");
155  ASSERT(!address.isMulticast());
156  ForwardingTableKey key(vid, address);
157  auto it = forwardingTable.find(key);
158  if (it == forwardingTable.end())
159  forwardingTable[key] = AddressEntry(vid, interfaceId, -1);
160  else {
161  it->second.interfaceId = interfaceId;
162  it->second.insertionTime = SimTime::getMaxTime();
163  }
164 }

Referenced by parseForwardingTableParameter().

◆ updateDisplayString()

void inet::MacForwardingTable::updateDisplayString ( ) const
protectedvirtual
114 {
115  if (getEnvir()->isGUI()) {
116  auto text = StringFormat::formatString(par("displayStringTextFormat"), this);
117  getDisplayString().setTagArg("t", 0, text);
118  }
119 }

Referenced by refreshDisplay().

Friends And Related Function Documentation

◆ operator<< [1/3]

std::ostream& operator<< ( std::ostream &  os,
const AddressEntry entry 
)
friend
37 {
38  return os << "{interfaceId=" << entry.interfaceId << ", insertionTime=" << entry.insertionTime << "}";
39 }

◆ operator<< [2/3]

std::ostream& operator<< ( std::ostream &  os,
const ForwardingTableKey key 
)
friend
42 {
43  return os << "{VID=" << key.first << ", addr=" << key.second << "}";
44 }

◆ operator<< [3/3]

std::ostream& operator<< ( std::ostream &  os,
const MulticastAddressEntry entry 
)
friend
47 {
48  return os << "{interfaceIds=" << entry.interfaceIds << "}";
49 }

Member Data Documentation

◆ agingTime

simtime_t inet::MacForwardingTable::agingTime
protected

◆ forwardingTable

◆ ifTable

ModuleRefByPar<IInterfaceTable> inet::MacForwardingTable::ifTable
protected

◆ lastPurge

simtime_t inet::MacForwardingTable::lastPurge
protected

◆ multicastForwardingTable


The documentation for this class was generated from the following files:
inet::MacForwardingTable::multicastForwardingTable
MulticastForwardingTable multicastForwardingTable
Definition: MacForwardingTable.h:58
inet::remove
void remove(std::vector< T > &v, const Tk &a)
Definition: stlutils.h:107
inet::OperationalMixin< cSimpleModule >::initialize
virtual void initialize(int stage) override
Definition: OperationalMixinImpl.h:26
inet::MacForwardingTable::ForwardingTableKey
std::pair< unsigned int, MacAddress > ForwardingTableKey
Definition: MacForwardingTable.h:50
inet::MacForwardingTable::forwardingTable
ForwardingTable forwardingTable
Definition: MacForwardingTable.h:57
inet::MacForwardingTable::initializeTable
virtual void initializeTable()
For lifecycle: initialize entries for the vlanForwardingTable by reading them from a file (if specifi...
Definition: MacForwardingTable.cc:377
inet::L3AddressResolver::ADDR_MAC
@ ADDR_MAC
Definition: L3AddressResolver.h:72
inet::MacForwardingTable::setUnicastAddressForwardingInterface
virtual void setUnicastAddressForwardingInterface(int interfaceId, const MacAddress &address, unsigned int vid=0) override
Definition: MacForwardingTable.cc:152
inet::MacForwardingTable::updateDisplayString
virtual void updateDisplayString() const
Definition: MacForwardingTable.cc:113
inet::MacForwardingTable::agingTime
simtime_t agingTime
Definition: MacForwardingTable.h:55
inet::MacForwardingTable::removeAgedEntriesFromAllVlans
virtual void removeAgedEntriesFromAllVlans()
Remove aged entries from all VLANs.
Definition: MacForwardingTable.cc:266
EV_FIELD
#define EV_FIELD(...)
Definition: INETDefs.h:112
inet::MacForwardingTable::addMulticastAddressForwardingInterface
virtual void addMulticastAddressForwardingInterface(int interfaceId, const MacAddress &address, unsigned int vid=0) override
Definition: MacForwardingTable.cc:210
inet::contains
bool contains(const std::vector< T > &v, const Tk &a)
Definition: stlutils.h:65
inet::MacForwardingTable::lastPurge
simtime_t lastPurge
Definition: MacForwardingTable.h:56
inet::ModuleStopOperation::STAGE_LINK_LAYER
@ STAGE_LINK_LAYER
Definition: ModuleOperations.h:54
inet::INITSTAGE_LOCAL
INET_API InitStage INITSTAGE_LOCAL
Initialization of local state that don't use or affect other modules includes:
NUM_INIT_STAGES
#define NUM_INIT_STAGES
Definition: InitStageRegistry.h:73
inet::MacForwardingTable::clearTable
virtual void clearTable()
For lifecycle: clears all entries from the vlanForwardingTable.
Definition: MacForwardingTable.cc:388
inet::StringFormat::formatString
const char * formatString(IDirectiveResolver *resolver) const
Definition: StringFormat.cc:17
inet::MacForwardingTable::parseForwardingTableParameter
virtual void parseForwardingTableParameter()
Definition: MacForwardingTable.cc:355
Enter_Method
#define Enter_Method(...)
Definition: SelfDoc.h:71
inet::MacForwardingTable::removeAgedEntriesIfNeeded
virtual void removeAgedEntriesIfNeeded()
Definition: MacForwardingTable.cc:280
inet::ModuleStartOperation::STAGE_LINK_LAYER
@ STAGE_LINK_LAYER
Definition: ModuleOperations.h:28
inet::MacForwardingTable::readForwardingTable
virtual void readForwardingTable(const char *fileName)
Pre-reads in entries for Address Table during initialization.
Definition: MacForwardingTable.cc:290
EV_ENDL
#define EV_ENDL
Definition: INETDefs.h:114
inet::INITSTAGE_LINK_LAYER
INET_API InitStage INITSTAGE_LINK_LAYER
Initialization of link-layer protocols.
inet::MacForwardingTable::ifTable
ModuleRefByPar< IInterfaceTable > ifTable
Definition: MacForwardingTable.h:59