|
INET Framework for OMNeT++/OMNEST
|
Utility class for finding Ipv4 or Ipv6 address of a host or router.
More...
#include <L3AddressResolver.h>
|
| | L3AddressResolver () |
| |
| virtual | ~L3AddressResolver () |
| |
| virtual L3Address | resolve (const char *str, int addrType=DEFAULT_ADDR_TYPE) |
| | Accepts dotted decimal notation ("127.0.0.1"), module name of the host or router ("host[2]"), and empty string (""). More...
|
| |
| virtual std::vector< L3Address > | resolve (std::vector< std::string > strs, int addrType=DEFAULT_ADDR_TYPE) |
| | Utility function: Calls resolve() for each item in the string vector, and returns the result in an address vector. More...
|
| |
| virtual bool | tryResolve (const char *str, L3Address &result, int addrType=DEFAULT_ADDR_TYPE) |
| | Similar to resolve(), but returns false (instead of throwing an error) if the address cannot be resolved because the given host (or interface) doesn't have an address assigned yet. More...
|
| |
|
| bool | tryParse (L3Address &result, const char *addr, int addrType=DEFAULT_ADDR_TYPE) |
| |
| virtual L3Address | addressOf (cModule *host, int addrType=DEFAULT_ADDR_TYPE) |
| | Returns Ipv4 or Ipv6 address of the given host or router. More...
|
| |
| virtual L3Address | addressOf (cModule *host, const char *ifname, int addrType=DEFAULT_ADDR_TYPE) |
| | Similar to addressOf(), but only looks at the given interface. More...
|
| |
| virtual L3Address | addressOf (cModule *host, cModule *destmod, int addrType=DEFAULT_ADDR_TYPE) |
| | Returns Ipv4 or Ipv6 address of the given host or router. More...
|
| |
| virtual L3Address | routerIdOf (cModule *host) |
| | Returns the router Id of the given router. More...
|
| |
| virtual L3Address | getAddressFrom (IInterfaceTable *ift, int addrType=DEFAULT_ADDR_TYPE) |
| | Returns the Ipv4 or Ipv6 address of the given host or router, given its IInterfaceTable module. More...
|
| |
| virtual L3Address | getAddressFrom (NetworkInterface *ie, int addrType=DEFAULT_ADDR_TYPE) |
| | Returns the Ipv4 or Ipv6 address of the given interface (of a host or router). More...
|
| |
| virtual IInterfaceTable * | interfaceTableOf (cModule *host) |
| | The function tries to look up the IInterfaceTable module as submodule "interfaceTable" or "networkLayer.interfaceTable" within the host/router module. More...
|
| |
| virtual IIpv4RoutingTable * | getIpv4RoutingTableOf (cModule *host) |
| | The function tries to look up the IIpv4RoutingTable module as submodule "routingTable" or "networkLayer.routingTable" within the host/router module. More...
|
| |
| virtual Ipv6RoutingTable * | getIpv6RoutingTableOf (cModule *host) |
| | The function tries to look up the Ipv6RoutingTable module as submodule "routingTable6" or "networkLayer.routingTable6" within the host/router module. More...
|
| |
| virtual IInterfaceTable * | findInterfaceTableOf (cModule *host) |
| | Like interfaceTableOf(), but doesn't throw error if not found. More...
|
| |
| virtual IIpv4RoutingTable * | findIpv4RoutingTableOf (cModule *host) |
| | Like routingTableOf(), but doesn't throw error if not found. More...
|
| |
| virtual Ipv6RoutingTable * | findIpv6RoutingTableOf (cModule *host) |
| | Like interfaceTableOf(), but doesn't throw error if not found. More...
|
| |
| virtual NextHopRoutingTable * | findNextHopRoutingTableOf (cModule *host) |
| | Like interfaceTableOf(), but doesn't throw error if not found. More...
|
| |
| virtual std::vector< cModule * > | collectNetworkNodes () |
| | Collect modules that represent network nodes, as denoted by the @networkNode(true) annotation. More...
|
| |
| virtual cModule * | findHostWithAddress (const L3Address &addr) |
| | Find the Host with the specified address. More...
|
| |
| virtual NetworkInterface * | findInterfaceWithMacAddress (const MacAddress &addr) |
| | Find the interface with the specified MAC address. More...
|
| |
| virtual cModule * | findHostWithMacAddress (const MacAddress &addr) |
| | Find the host with the specified MAC address. More...
|
| |
|
| virtual bool | getIpv4AddressFrom (L3Address &retAddr, IInterfaceTable *ift, bool netmask) |
| |
| virtual bool | getIpv6AddressFrom (L3Address &retAddr, IInterfaceTable *ift, bool netmask) |
| |
| virtual bool | getMacAddressFrom (L3Address &retAddr, IInterfaceTable *ift, bool netmask) |
| |
| virtual bool | getModulePathAddressFrom (L3Address &retAddr, IInterfaceTable *ift, bool netmask) |
| |
| virtual bool | getModuleIdAddressFrom (L3Address &retAddr, IInterfaceTable *ift, bool netmask) |
| |
| virtual bool | getInterfaceIpv4Address (L3Address &ret, NetworkInterface *ie, bool mask) |
| |
| virtual bool | getInterfaceIpv6Address (L3Address &ret, NetworkInterface *ie, bool mask) |
| |
| virtual bool | getInterfaceMacAddress (L3Address &ret, NetworkInterface *ie, bool mask) |
| |
| virtual bool | getInterfaceModulePathAddress (L3Address &ret, NetworkInterface *ie, bool mask) |
| |
| virtual bool | getInterfaceModuleIdAddress (L3Address &ret, NetworkInterface *ie, bool mask) |
| |
| virtual void | doCollectNetworkNodes (cModule *parent, std::vector< cModule * > &result) |
| |
Utility class for finding Ipv4 or Ipv6 address of a host or router.
Syntax variations understood:
- literal Ipv4 address: "186.54.66.2"
- literal Ipv6 address: "3011:7cd6:750b:5fd6:aba3:c231:e9f9:6a43"
- module name: "server", "subnet.server[3]"
- interface of a host or router: "server%eth0", "subnet.server[3]%eth0"
- Ipv4 or Ipv6 address of a host or router: "server(ipv4)", "subnet.server[3](ipv6)"
- Ipv4 or Ipv6 address of an interface of a host or router: "server%eth0(ipv4)", "subnet.server[3]%eth0(ipv6)"
- routerId: "router1%routerId", "R1%routerId"
- interface of a host or router toward defined another node: "client1>router"
◆ anonymous enum
| Enumerator |
|---|
| ADDR_IPv4 | |
| ADDR_IPv6 | |
| ADDR_MAC | |
| ADDR_MODULEPATH | |
| ADDR_MODULEID | |
| ADDR_MASK | |
◆ L3AddressResolver()
| inet::L3AddressResolver::L3AddressResolver |
( |
| ) |
|
|
inline |
◆ ~L3AddressResolver()
| virtual inet::L3AddressResolver::~L3AddressResolver |
( |
| ) |
|
|
inlinevirtual |
◆ addressOf() [1/3]
Returns Ipv4 or Ipv6 address of the given host or router.
This function find an interface of host connected to destmod then invokes getAddressFrom() to extract the IP address.
218 for (
int i = 0; i < ift->getNumInterfaces(); i++) {
219 NetworkInterface *ie = ift->getInterface(i);
221 int gateId = ie->getNodeOutputGateId();
223 if (host->gate(gateId)->pathContains(destmod))
228 throw cRuntimeError(
"L3AddressResolver: no interface connected to `%s' module in interface table of `%s'", destmod->getFullPath().c_str(), host->getFullPath().c_str());
◆ addressOf() [2/3]
Similar to addressOf(), but only looks at the given interface.
208 NetworkInterface *ie = ift->findInterfaceByName(ifname);
212 throw cRuntimeError(
"L3AddressResolver: no interface called `%s' in interface table of `%s'", ifname, host->getFullPath().c_str());
◆ addressOf() [3/3]
◆ collectNetworkNodes()
| std::vector< cModule * > inet::L3AddressResolver::collectNetworkNodes |
( |
| ) |
|
|
virtual |
◆ doCollectNetworkNodes()
| void inet::L3AddressResolver::doCollectNetworkNodes |
( |
cModule * |
parent, |
|
|
std::vector< cModule * > & |
result |
|
) |
| |
|
protectedvirtual |
527 for (cModule::SubmoduleIterator it(parent); !it.end(); ++it) {
528 cModule *submodule = *it;
529 if (submodule->getProperties()->getAsBool(
"networkNode"))
530 result.push_back(submodule);
Referenced by collectNetworkNodes().
◆ findHostWithAddress()
| cModule * inet::L3AddressResolver::findHostWithAddress |
( |
const L3Address & |
addr | ) |
|
|
virtual |
◆ findHostWithMacAddress()
| cModule * inet::L3AddressResolver::findHostWithMacAddress |
( |
const MacAddress & |
addr | ) |
|
|
virtual |
Find the host with the specified MAC address.
Returns nullptr if not found.
574 return entry ? entry->getInterfaceTable()->getHostModule() :
nullptr;
◆ findInterfaceTableOf()
| IInterfaceTable * inet::L3AddressResolver::findInterfaceTableOf |
( |
cModule * |
host | ) |
|
|
virtual |
Like interfaceTableOf(), but doesn't throw error if not found.
488 return dynamic_cast<IInterfaceTable *
>(host->getSubmodule(
"interfaceTable"));
Referenced by inet::visualizer::InterfaceTableVisualizerBase::addAllInterfaceVisualizations(), inet::Ipv4FlatNetworkConfigurator::extractTopology(), inet::NetworkConfiguratorBase::extractTopology(), inet::L3NetworkConfiguratorBase::findInterfaceTable(), inet::visualizer::LinkBreakVisualizerBase::findNode(), inet::visualizer::RoutingTableVisualizerBase::getDestinations(), inet::visualizer::InterfaceTableCanvasVisualizer::getNetworkInterface(), inet::ieee80211::Ieee80211MgmtStaSimplified::initialize(), inet::InterfaceOperationBase::initialize(), inet::Ipv6FlatNetworkConfigurator::isIPNode(), inet::visualizer::Ieee80211CanvasVisualizer::refreshDisplay(), and inet::ModulePathAddress::tryParse().
◆ findInterfaceWithMacAddress()
Find the interface with the specified MAC address.
Returns nullptr if not found.
554 if (addr.isUnspecified() || addr.isBroadcast() || addr.isMulticast())
558 for (cModule *
mod : networkNodes) {
560 if (itable !=
nullptr) {
561 for (
int i = 0; i < itable->getNumInterfaces(); i++) {
562 NetworkInterface *entry = itable->getInterface(i);
563 if (entry->getMacAddress() == addr)
Referenced by findHostWithMacAddress().
◆ findIpv4RoutingTableOf()
| IIpv4RoutingTable * inet::L3AddressResolver::findIpv4RoutingTableOf |
( |
cModule * |
host | ) |
|
|
virtual |
◆ findIpv6RoutingTableOf()
| Ipv6RoutingTable * inet::L3AddressResolver::findIpv6RoutingTableOf |
( |
cModule * |
host | ) |
|
|
virtual |
◆ findNextHopRoutingTableOf()
Like interfaceTableOf(), but doesn't throw error if not found.
511 #ifdef INET_WITH_NEXTHOP
512 return dynamic_cast<NextHopRoutingTable *
>(host->findModuleByPath(
".generic.routingTable"));
513 #else // ifdef INET_WITH_NEXTHOP
515 #endif // ifdef INET_WITH_NEXTHOP
◆ getAddressFrom() [1/2]
◆ getAddressFrom() [2/2]
Returns the Ipv4 or Ipv6 address of the given interface (of a host or router).
◆ getInterfaceIpv4Address()
◆ getInterfaceIpv6Address()
370 #ifdef INET_WITH_IPv6
373 if (
auto ipv6Data = ie->findProtocolData<Ipv6InterfaceData>()) {
374 Ipv6Address addr = ipv6Data->getPreferredAddress();
375 if (!addr.isUnspecified()) {
380 #endif // ifdef INET_WITH_IPv6
Referenced by getAddressFrom(), and getIpv6AddressFrom().
◆ getInterfaceMacAddress()
◆ getInterfaceModuleIdAddress()
436 #ifdef INET_WITH_NEXTHOP
437 if (
auto nextHopData = ie->findProtocolData<NextHopInterfaceData>()) {
438 L3Address addr = nextHopData->getAddress();
447 NextHopNetworkConfigurator *configurator =
dynamic_cast<NextHopNetworkConfigurator *
>(getSimulation()->findModuleByPath(
"configurator"));
451 #endif // ifdef INET_WITH_NEXTHOP
452 ret = ie->getModuleIdAddress();
Referenced by getAddressFrom(), and getModuleIdAddressFrom().
◆ getInterfaceModulePathAddress()
414 #ifdef INET_WITH_NEXTHOP
415 if (
auto nextHopData = ie->findProtocolData<NextHopInterfaceData>()) {
416 L3Address addr = nextHopData->getAddress();
425 NextHopNetworkConfigurator *configurator =
dynamic_cast<NextHopNetworkConfigurator *
>(getSimulation()->findModuleByPath(
"configurator"));
429 #endif // ifdef INET_WITH_NEXTHOP
430 ret = ie->getModulePathAddress();
Referenced by getAddressFrom(), and getModulePathAddressFrom().
◆ getIpv4AddressFrom()
267 if (ift->getNumInterfaces() == 0)
268 throw cRuntimeError(
"L3AddressResolver: interface table `%s' has no interface registered "
269 "(yet? try in a later init stage!)", ift->getFullPath().c_str());
271 #ifdef INET_WITH_IPv4
273 for (
int i = 0; i < ift->getNumInterfaces(); i++) {
274 NetworkInterface *ie = ift->getInterface(i);
275 if (ie->isLoopback())
280 #endif // ifdef INET_WITH_IPv4
Referenced by getAddressFrom().
◆ getIpv4RoutingTableOf()
◆ getIpv6AddressFrom()
287 if (ift->getNumInterfaces() == 0)
288 throw cRuntimeError(
"L3AddressResolver: interface table `%s' has no interface registered "
289 "(yet? try in a later init stage!)", ift->getFullPath().c_str());
291 #ifndef INET_WITH_IPv6
293 #else // ifndef INET_WITH_IPv6
301 NetworkInterface *ie = ift->getInterface(i);
304 if (!ieHasIpv6Addr || ie->isLoopback())
307 if (curScope > retScope) {
314 #endif // ifndef INET_WITH_IPv6
Referenced by getAddressFrom().
◆ getIpv6RoutingTableOf()
| Ipv6RoutingTable * inet::L3AddressResolver::getIpv6RoutingTableOf |
( |
cModule * |
host | ) |
|
|
virtual |
The function tries to look up the Ipv6RoutingTable module as submodule "routingTable6" or "networkLayer.routingTable6" within the host/router module.
Throws an error if not found.
481 throw cRuntimeError(
"L3AddressResolver: Ipv6RoutingTable not found as submodule "
482 " `routingTable' in host/router `%s'", host->getFullPath().c_str());
Referenced by inet::xMIPv6::initialize().
◆ getMacAddressFrom()
319 if (ift->getNumInterfaces() == 0)
320 throw cRuntimeError(
"L3AddressResolver: interface table `%s' has no interface registered "
321 "(yet? try in a later init stage!)", ift->getFullPath().c_str());
324 for (
int i = 0; i < ift->getNumInterfaces(); i++) {
325 NetworkInterface *ie = ift->getInterface(i);
326 if (ie->isLoopback())
Referenced by getAddressFrom().
◆ getModuleIdAddressFrom()
353 if (ift->getNumInterfaces() == 0)
354 throw cRuntimeError(
"L3AddressResolver: interface table `%s' has no interface registered "
355 "(yet? try in a later init stage!)", ift->getFullPath().c_str());
358 for (
int i = 0; i < ift->getNumInterfaces(); i++) {
359 NetworkInterface *ie = ift->getInterface(i);
360 if (ie->isLoopback())
Referenced by getAddressFrom().
◆ getModulePathAddressFrom()
336 if (ift->getNumInterfaces() == 0)
337 throw cRuntimeError(
"L3AddressResolver: interface table `%s' has no interface registered "
338 "(yet? try in a later init stage!)", ift->getFullPath().c_str());
341 for (
int i = 0; i < ift->getNumInterfaces(); i++) {
342 NetworkInterface *ie = ift->getInterface(i);
343 if (ie->isLoopback())
Referenced by getAddressFrom().
◆ interfaceTableOf()
| IInterfaceTable * inet::L3AddressResolver::interfaceTableOf |
( |
cModule * |
host | ) |
|
|
virtual |
◆ resolve() [1/2]
Accepts dotted decimal notation ("127.0.0.1"), module name of the host or router ("host[2]"), and empty string ("").
For the latter, it returns the null address. If module name is specified, the module will be looked up using getModuleByPath(), and then addressOf() will be called to determine its IP address.
37 throw cRuntimeError(
"L3AddressResolver: Cannot resolve address `%s'",
s);
Referenced by inet::MultiFieldClassifier::configureFilters(), inet::NetPerfMeter::createAndBindSocket(), inet::Define_Module(), inet::NetPerfMeter::establishConnection(), inet::xmlutils::getParameterIPAddressValue(), inet::PingApp::handleSelfMessage(), inet::DhcpServer::handleStartOperation(), inet::Forwarding::initialize(), inet::ieee80211::Ieee80211MgmtStaSimplified::initialize(), inet::VoipStreamSender::initialize(), inet::SctpNatServer::initialize(), inet::SctpClient::initialize(), inet::SctpServer::initialize(), inet::SctpPeer::initialize(), inet::dymo::Dymo::initialize(), inet::SctpNatPeer::initialize(), inet::ospfv2::ipv4AddressFromAddressString(), inet::ospfv2::ipv4NetmaskFromAddressString(), inet::PingApp::parseDestAddressesPar(), inet::UdpBasicBurst::processStart(), inet::Ipv4NetworkConfigurator::readManualMulticastRouteConfiguration(), inet::Ipv4NetworkConfigurator::readManualRouteConfiguration(), inet::RsvpTe::readTrafficRouteFromXML(), inet::UdpVideoStreamClient::requestStream(), resolve(), inet::EtherAppClient::resolveDestMacAddress(), inet::EtherTrafGen::resolveDestMacAddress(), inet::Ipv4NetworkConfigurator::resolveInterfaceAndGateway(), inet::tcp::TcpSpoof::sendSpoofPacket(), inet::SimpleVoipSender::sendVoIPPacket(), inet::UdpSink::setSocketOptions(), inet::SctpNatPeer::socketClosed(), inet::TunnelApp::socketDataArrived(), and inet::SctpNatPeer::socketPeerClosed().
◆ resolve() [2/2]
Utility function: Calls resolve() for each item in the string vector, and returns the result in an address vector.
The string vector may come e.g. from cStringTokenizer::asVector().
43 std::vector<L3Address> result;
46 for (
int i = 0; i < n; i++)
47 result.push_back(
resolve(strs[i].c_str(), addrType));
◆ routerIdOf()
| L3Address inet::L3AddressResolver::routerIdOf |
( |
cModule * |
host | ) |
|
|
virtual |
Returns the router Id of the given router.
Router Id is obtained from the getRouterId() method of the IIpv4RoutingTable submodule.
191 #ifdef INET_WITH_IPv4
193 return L3Address(rt->getRouterId());
194 #else // ifdef INET_WITH_IPv4
195 throw cRuntimeError(
"INET was compiled without Ipv4 support");
196 #endif // ifdef INET_WITH_IPv4
Referenced by tryResolve().
◆ tryParse()
55 ModuleIdAddress moduleId;
56 ModulePathAddress modulePath;
58 result.set(Ipv4Address(addr));
59 else if (((addrType &
ADDR_IPv6) != 0) && ipv6.tryParse(addr))
61 else if (((addrType &
ADDR_MAC) != 0) && mac.tryParse(addr))
63 else if (((addrType &
ADDR_MODULEID) != 0) && moduleId.tryParse(addr))
65 else if (((addrType &
ADDR_MODULEPATH) != 0) && modulePath.tryParse(addr))
66 result.set(modulePath);
Referenced by tryResolve().
◆ tryResolve()
Similar to resolve(), but returns false (instead of throwing an error) if the address cannot be resolved because the given host (or interface) doesn't have an address assigned yet.
(It still throws an error on any other error condition).
87 std::string modname, ifname,
protocol, destnodename;
90 const char *endp = strchr(p,
'\0');
91 const char *nextsep = strpbrk(p,
"%>(/");
94 modname.assign(p, nextsep - p);
101 nextsep = strpbrk(p,
"(/");
105 ifname.assign(p, nextsep - p);
111 nextsep = strpbrk(p,
"(/");
115 destnodename.assign(p, nextsep - p);
122 nextsep = strpbrk(p,
")");
147 throw cRuntimeError(
"L3AddressResolver: syntax error parsing address spec `%s'",
s);
150 cModule *
mod = getSimulation()->findModuleByPath(modname.c_str());
152 throw cRuntimeError(
"L3AddressResolver: module `%s' not found", modname.c_str());
167 throw cRuntimeError(
"L3AddressResolver: error parsing address spec `%s': address type must be `(ipv4)' or `(ipv6)'",
s);
174 if (!destnodename.empty()) {
175 cModule *destnode = getSimulation()->findModuleByPath(destnodename.c_str());
177 throw cRuntimeError(
"L3AddressResolver: destination module `%s' not found", destnodename.c_str());
180 else if (ifname.empty())
182 else if (ifname ==
"routerId")
186 return !result.isUnspecified();
Referenced by inet::UdpBasicApp::chooseDestAddr(), inet::StreamDecoder::configureMappings(), inet::TcpAppBase::connect(), inet::SctpClient::connect(), inet::SctpPeer::connect(), inet::IpvxTrafGen::handleMessageWhenUp(), inet::EthernetSocketIo::initialize(), inet::Ieee8022LlcSocketIo::initialize(), inet::TcpClientSocketIo::open(), inet::UdpBasicApp::processStart(), and resolve().
The documentation for this class was generated from the following files:
double mod(double dividend, double divisor)
Returns the rest of a whole-numbered division.
Definition: INETMath.h:96
@ UNSPECIFIED
Definition: Ipv6Address.h:43
@ MODULEID
Definition: L3Address.h:40
const value< double, compose< units::m, pow< units::s, -1 > > > c(299792458)
removed DscpReq Ipv4ControlInfo Ipv6ControlInfo up L3AddressInd DispatchProtocolReq L4PortInd Ipv4ControlInfo Ipv6ControlInfo down protocol
Definition: IUdp-gates.txt:25
virtual L3Address resolve(const char *str, int addrType=DEFAULT_ADDR_TYPE)
Accepts dotted decimal notation ("127.0.0.1"), module name of the host or router ("host[2]"),...
Definition: L3AddressResolver.cc:33
virtual bool getInterfaceModulePathAddress(L3Address &ret, NetworkInterface *ie, bool mask)
Definition: L3AddressResolver.cc:412
virtual IIpv4RoutingTable * getIpv4RoutingTableOf(cModule *host)
The function tries to look up the IIpv4RoutingTable module as submodule "routingTable" or "networkLay...
Definition: L3AddressResolver.cc:467
virtual IIpv4RoutingTable * findIpv4RoutingTableOf(cModule *host)
Like routingTableOf(), but doesn't throw error if not found.
Definition: L3AddressResolver.cc:491
virtual L3Address routerIdOf(cModule *host)
Returns the router Id of the given router.
Definition: L3AddressResolver.cc:189
virtual bool getModuleIdAddressFrom(L3Address &retAddr, IInterfaceTable *ift, bool netmask)
Definition: L3AddressResolver.cc:351
@ ADDR_MAC
Definition: L3AddressResolver.h:72
@ MODULEPATH
Definition: L3Address.h:39
@ ADDR_MODULEPATH
Definition: L3AddressResolver.h:73
value< double, units::s > s
Definition: Units.h:1235
virtual bool getIpv6AddressFrom(L3Address &retAddr, IInterfaceTable *ift, bool netmask)
Definition: L3AddressResolver.cc:284
virtual NetworkInterface * findInterfaceWithMacAddress(const MacAddress &addr)
Find the interface with the specified MAC address.
Definition: L3AddressResolver.cc:552
virtual L3Address addressOf(cModule *host, int addrType=DEFAULT_ADDR_TYPE)
Returns Ipv4 or Ipv6 address of the given host or router.
Definition: L3AddressResolver.cc:199
virtual bool getIpv4AddressFrom(L3Address &retAddr, IInterfaceTable *ift, bool netmask)
Definition: L3AddressResolver.cc:265
virtual bool tryResolve(const char *str, L3Address &result, int addrType=DEFAULT_ADDR_TYPE)
Similar to resolve(), but returns false (instead of throwing an error) if the address cannot be resol...
Definition: L3AddressResolver.cc:72
@ ADDR_MODULEID
Definition: L3AddressResolver.h:74
virtual bool getInterfaceModuleIdAddress(L3Address &ret, NetworkInterface *ie, bool mask)
Definition: L3AddressResolver.cc:434
virtual Ipv6RoutingTable * findIpv6RoutingTableOf(cModule *host)
Like interfaceTableOf(), but doesn't throw error if not found.
Definition: L3AddressResolver.cc:500
virtual std::vector< cModule * > collectNetworkNodes()
Collect modules that represent network nodes, as denoted by the @networkNode(true) annotation.
Definition: L3AddressResolver.cc:518
L3AddressResolver()
Definition: L3AddressResolver.h:79
@ ADDR_IPv6
Definition: L3AddressResolver.h:71
virtual IInterfaceTable * interfaceTableOf(cModule *host)
The function tries to look up the IInterfaceTable module as submodule "interfaceTable" or "networkLay...
Definition: L3AddressResolver.cc:456
virtual bool getInterfaceIpv4Address(L3Address &ret, NetworkInterface *ie, bool mask)
Definition: L3AddressResolver.cc:384
virtual bool getInterfaceIpv6Address(L3Address &ret, NetworkInterface *ie, bool mask)
Definition: L3AddressResolver.cc:368
virtual void doCollectNetworkNodes(cModule *parent, std::vector< cModule * > &result)
Definition: L3AddressResolver.cc:525
Scope
Ipv6 address scope (RFC 3513)
Definition: Ipv6Address.h:42
bool tryParse(L3Address &result, const char *addr, int addrType=DEFAULT_ADDR_TYPE)
Definition: L3AddressResolver.cc:51
@ ADDR_MASK
Definition: L3AddressResolver.h:75
virtual bool getInterfaceMacAddress(L3Address &ret, NetworkInterface *ie, bool mask)
Definition: L3AddressResolver.cc:403
virtual bool getModulePathAddressFrom(L3Address &retAddr, IInterfaceTable *ift, bool netmask)
Definition: L3AddressResolver.cc:334
virtual bool getMacAddressFrom(L3Address &retAddr, IInterfaceTable *ift, bool netmask)
Definition: L3AddressResolver.cc:317
virtual L3Address getAddressFrom(IInterfaceTable *ift, int addrType=DEFAULT_ADDR_TYPE)
Returns the Ipv4 or Ipv6 address of the given host or router, given its IInterfaceTable module.
Definition: L3AddressResolver.cc:231
@ GLOBAL
Definition: Ipv6Address.h:48
static bool isWellFormed(const char *text)
Returns true if the format of the string corresponds to an Ipv4 address with the dotted notation ("19...
Definition: Ipv4Address.cc:258
@ ADDR_IPv4
Definition: L3AddressResolver.h:70