00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00025
00026 #include "config.hh"
00027
00028 #ifdef QOLYESTER_ENABLE_VIRTUAL
00029
00030 # ifndef QOLYESTER_DAEMON_SYS_VIRTUAL_INTERFACEDESC_HH
00031 # define QOLYESTER_DAEMON_SYS_VIRTUAL_INTERFACEDESC_HH 1
00032
00033 # include <set>
00034
00035 # include "net/ipaddress.hh"
00036
00037 namespace olsr {
00038
00039 namespace sys {
00040
00041 namespace internal {
00042
00043
00048 class InterfaceAddress {
00049 typedef InterfaceAddress This;
00050 InterfaceAddress();
00051 public:
00052 InterfaceAddress(unsigned p,
00053 unsigned char s,
00054 const address_t& a,
00055 const address_t& b);
00056
00057 unsigned prefix() const { return _prefix; }
00058 unsigned char scope() const { return _scope; }
00059 const address_t& address() const { return _address; }
00060 const address_t& broadcast() const { return _broadcast; }
00061
00062 bool operator<(const This& rhs) const;
00063
00064 static This make_key(const address_t& a);
00065 private:
00066 unsigned _prefix;
00067 unsigned char _scope;
00068 const address_t _address;
00069 const address_t _broadcast;
00070
00071 static This _dummy_for_find;
00072 };
00073
00074 class InterfaceInfo {
00075 typedef InterfaceInfo This;
00076 typedef InterfaceAddress addr_t;
00077 public:
00078 typedef std::set<addr_t> addrs_t;
00079
00080 InterfaceInfo(const std::string& name);
00081
00082 const std::string& name() const { return _name; }
00083 unsigned index() const { return _index; }
00084 unsigned mtu() const { return _mtu; }
00085 const addrs_t& addrs() const { return _addrs; }
00086
00087 bool operator<(const This& rhs) const;
00088
00089
00090 private:
00091 std::string _name;
00092 unsigned _index;
00093 unsigned _mtu;
00094 addrs_t _addrs;
00095 };
00096
00097 }
00098
00099 }
00100
00101 }
00102
00103 # include "interfacedesc.hxx"
00104
00105 # endif // ! QOLYESTER_DAEMON_SYS_VIRTUAL_INTERFACEDESC_HH
00106
00107 #endif // QOLYESTER_ENABLE_VIRTUAL