summaryrefslogtreecommitdiffstats
path: root/nexus/InterfaceConfig.h
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-05-22 15:36:13 -0700
committerSan Mehat <san@google.com>2009-05-29 15:26:21 -0700
commit3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5 (patch)
treee73708dde1e774c8e6a0539a91a228acd68000a2 /nexus/InterfaceConfig.h
parent192331d9060763b92f7989124bedbd136689d735 (diff)
downloadsystem_core-3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5.zip
system_core-3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5.tar.gz
system_core-3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5.tar.bz2
nexus: Refactor some of the create/remove network path and add code for
retrieving network lists from supplicant nexus: Rework properties nexus: Implement wifi network enable/disable and add some error checking nexus: Add some TODOs nexus: Whitespace cleanup nexus: Add bindings between controllers and network interfaces nexus: Add properties for InterfaceConfig nexus: Fix a few conversion bugs in InterfaceConfig Signed-off-by: San Mehat <san@google.com>
Diffstat (limited to 'nexus/InterfaceConfig.h')
-rw-r--r--nexus/InterfaceConfig.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/nexus/InterfaceConfig.h b/nexus/InterfaceConfig.h
index 1426e99..d97f20b 100644
--- a/nexus/InterfaceConfig.h
+++ b/nexus/InterfaceConfig.h
@@ -17,12 +17,21 @@
#ifndef _INTERFACE_CONFIG_H
#define _INTERFACE_CONFIG_H
+#include <unistd.h>
+#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-class InterfaceConfig {
+#include "IPropertyProvider.h"
+
+class PropertyManager;
+
+class InterfaceConfig : public IPropertyProvider {
+public:
+ static const char *PropertyNames[];
+
private:
- char *mName;
+ char *mPropPrefix;
bool mUseDhcp;
struct in_addr mIp;
struct in_addr mNetmask;
@@ -32,19 +41,23 @@ private:
struct in_addr mDns3;
public:
- InterfaceConfig(const char *name);
- InterfaceConfig(const char *name, const char *ip, const char *nm,
+ InterfaceConfig(const char *prop_prefix);
+ InterfaceConfig(const char *prop_prefix,
+ const char *ip, const char *nm,
const char *gw, const char *dns1, const char *dns2,
const char *dns3);
- InterfaceConfig(const char *name, const struct in_addr *ip,
+ InterfaceConfig(const char *prop_prefix,
+ const struct in_addr *ip,
const struct in_addr *nm, const struct in_addr *gw,
const struct in_addr *dns1, const struct in_addr *dns2,
const struct in_addr *dns3);
virtual ~InterfaceConfig();
+
+ int set(const char *name, const char *value);
+ const char *get(const char *name, char *buffer, size_t maxsize);
- const char *getName() const { return mName; }
bool getUseDhcp() const { return mUseDhcp; }
const struct in_addr &getIp() const { return mIp; }
const struct in_addr &getNetmask() const { return mNetmask; }
@@ -52,6 +65,10 @@ public:
const struct in_addr &getDns1() const { return mDns1; }
const struct in_addr &getDns2() const { return mDns2; }
const struct in_addr &getDns3() const { return mDns3; }
+
+private:
+ int registerProperties();
+ int unregisterProperties();
};