Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __INET_IROUTINGTABLE_H
00019 #define __INET_IROUTINGTABLE_H
00020
00021 #include <vector>
00022 #include <omnetpp.h>
00023 #include "INETDefs.h"
00024 #include "IPAddress.h"
00025 #include "IPRoute.h"
00026
00027
00029 struct MulticastRoute
00030 {
00031 InterfaceEntry *interf;
00032 IPAddress gateway;
00033 };
00034 typedef std::vector<MulticastRoute> MulticastRoutes;
00035
00036
00045 class INET_API IRoutingTable
00046 {
00047 public:
00048 virtual ~IRoutingTable() {};
00049
00053 virtual void printRoutingTable() const = 0;
00054
00057 virtual void configureInterfaceForIPv4(InterfaceEntry *ie) = 0;
00058
00062 virtual InterfaceEntry *getInterfaceByAddress(const IPAddress& address) const = 0;
00064
00068 virtual bool isIPForwardingEnabled() = 0;
00069
00073 virtual IPAddress getRouterId() = 0;
00074
00078 virtual void setRouterId(IPAddress a) = 0;
00079
00085 virtual bool isLocalAddress(const IPAddress& dest) const = 0;
00086
00090 virtual const IPRoute *findBestMatchingRoute(const IPAddress& dest) const = 0;
00091
00098 virtual InterfaceEntry *getInterfaceForDestAddr(const IPAddress& dest) const = 0;
00099
00107 virtual IPAddress getGatewayForDestAddr(const IPAddress& dest) const = 0;
00109
00112
00117 virtual bool isLocalMulticastAddress(const IPAddress& dest) const = 0;
00118
00122 virtual MulticastRoutes getMulticastRoutesFor(const IPAddress& dest) const = 0;
00124
00127
00132 virtual int getNumRoutes() const = 0;
00133
00139 virtual const IPRoute *getRoute(int k) const = 0;
00140
00144 virtual const IPRoute *findRoute(const IPAddress& target, const IPAddress& netmask,
00145 const IPAddress& gw, int metric = 0, const char *dev = NULL) const = 0;
00146
00150 virtual const IPRoute *getDefaultRoute() const = 0;
00151
00156 virtual void addRoute(const IPRoute *entry) = 0;
00157
00163 virtual bool deleteRoute(const IPRoute *entry) = 0;
00164
00168 virtual std::vector<IPAddress> gatherAddresses() const = 0;
00170
00171 };
00172
00173 #endif
00174