diff --git a/src/system/configure_network.cpp b/src/system/configure_network.cpp index cb9b75180..f230b8a0a 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -1,5 +1,5 @@ /* - * $Header: /cvsroot/tuxbox/apps/tuxbox/neutrino/src/system/configure_network.cpp,v 1.6 2003/03/26 17:53:12 thegoodguy Exp $ + * $port: configure_network.cpp,v 1.7 2009/11/20 22:44:19 tuxbox-cvs Exp $ * * (C) 2003 by thegoodguy * @@ -38,6 +38,24 @@ CNetworkConfig::CNetworkConfig(void) copy_to_orig(); } +CNetworkConfig* CNetworkConfig::getInstance() +{ + static CNetworkConfig* network_config = NULL; + + if(!network_config) + { + network_config = new CNetworkConfig(); + printf("[network config] Instance created\n"); + } + return network_config; +} + +CNetworkConfig::~CNetworkConfig() +{ + +} + + void CNetworkConfig::init_vars(void) { char mask[16]; @@ -74,7 +92,7 @@ bool CNetworkConfig::modified_from_orig(void) (orig_netmask != netmask ) || (orig_broadcast != broadcast ) || (orig_gateway != gateway ) || - (orig_hostname != hostname ) || + (orig_hostname != hostname ) || (orig_inet_static != inet_static ) ); } diff --git a/src/system/configure_network.h b/src/system/configure_network.h index 3fd94d7d3..61b491720 100644 --- a/src/system/configure_network.h +++ b/src/system/configure_network.h @@ -2,7 +2,7 @@ #define __configure_network_h__ /* - * $Header: /cvsroot/tuxbox/apps/tuxbox/neutrino/src/system/configure_network.h,v 1.3 2003/03/10 21:22:41 thegoodguy Exp $ + * $port: configure_network.h,v 1.4 2009/11/20 22:44:19 tuxbox-cvs Exp $ * * (C) 2003 by thegoodguy * @@ -37,7 +37,6 @@ class CNetworkConfig bool orig_inet_static; void copy_to_orig(void); - bool modified_from_orig(void); void init_vars(void); public: @@ -50,7 +49,11 @@ class CNetworkConfig std::string hostname; bool inet_static; - CNetworkConfig(void); + CNetworkConfig(); + ~CNetworkConfig(); + + static CNetworkConfig* getInstance(); + bool modified_from_orig(void); void commitConfig(void); @@ -58,4 +61,12 @@ class CNetworkConfig void stopNetwork(void); }; +class CNetAdapter +{ + private: + long mac_addr_sys ( u_char *addr); + public: + std::string getMacAddr(void); +}; + #endif /* __configure_network_h__ */