00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _pnetwork_h_
00021 #define _pnetwork_h_
00022
00023 #include <pclasses/pexport.h>
00024 #include <pclasses/pinetaddr.h>
00025
00026 #include <string>
00027 #include <list>
00028
00029 namespace P {
00030
00032
00039 class PNET_EXPORT NetDeviceInfo {
00040 public:
00041 NetDeviceInfo(const NetDeviceInfo& ndi);
00042 ~NetDeviceInfo();
00043
00045 inline const InetAddress& addr() const
00046 { return m_addr; }
00047
00049 inline const InetAddress& netmask() const
00050 { return m_netmask; }
00051
00053 inline const InetAddress& broadcast() const
00054 { return m_broadcast; }
00055
00057
00062 inline int mtu() const
00063 { return m_mtu; }
00064
00065 NetDeviceInfo& operator=(const NetDeviceInfo& ndi);
00066
00068 static void enumDevices(std::list<NetDeviceInfo>& devlist);
00069
00070 private:
00071 NetDeviceInfo(const std::string& devName, const InetAddress& addr, const InetAddress& netmask,
00072 const InetAddress& brdcast, int mtu);
00073
00074 std::string m_devName;
00075 InetAddress m_addr;
00076 InetAddress m_netmask;
00077 InetAddress m_broadcast;
00078 int m_mtu;
00079 };
00080
00081 }
00082
00083 #endif