diff options
author | San Mehat <san@google.com> | 2009-05-22 15:36:13 -0700 |
---|---|---|
committer | San Mehat <san@google.com> | 2009-05-29 15:26:21 -0700 |
commit | 3c5a6f0bc8aefc4dacab8e95ba9017a7ac7d91f5 (patch) | |
tree | e73708dde1e774c8e6a0539a91a228acd68000a2 /nexus/Controller.h | |
parent | 192331d9060763b92f7989124bedbd136689d735 (diff) | |
download | system_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/Controller.h')
-rw-r--r-- | nexus/Controller.h | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/nexus/Controller.h b/nexus/Controller.h index ae37426..9137f9a 100644 --- a/nexus/Controller.h +++ b/nexus/Controller.h @@ -13,51 +13,59 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + #ifndef _CONTROLLER_H #define _CONTROLLER_H #include <unistd.h> #include <sys/types.h> -#include "../../../frameworks/base/include/utils/List.h" +#include <utils/List.h> + +class PropertyManager; -#include "PropertyCollection.h" +#include "PropertyManager.h" +#include "IPropertyProvider.h" -class Controller { +class Controller : public IPropertyProvider { private: - const char *mName; - const char *mPropertyPrefix; - PropertyCollection *mProperties; - bool mEnabled; + /* + * Name of this controller - WIFI/VPN/USBNET/BTNET/BTDUN/LOOP/etc + */ + char *mName; + + /* + * Name of the system ethernet interface which this controller is + * bound to. + */ + char *mBoundInterface; + +protected: + PropertyManager *mPropMngr; public: - Controller(const char *name, const char *prefix); - virtual ~Controller() {} + Controller(const char *name, PropertyManager *propMngr); + virtual ~Controller(); virtual int start(); virtual int stop(); - virtual const PropertyCollection &getProperties(); - virtual int setProperty(const char *name, char *value); - virtual const char *getProperty(const char *name, char *buffer, size_t maxsize); - const char *getName() { return mName; } - const char *getPropertyPrefix() { return mPropertyPrefix; } + const char *getBoundInterface() { return mBoundInterface; } + + /* IPropertyProvider methods */ + virtual int set(const char *name, const char *value); + virtual const char *get(const char *name, char *buffer, size_t maxsize); protected: int loadKernelModule(char *modpath, const char *args); bool isKernelModuleLoaded(const char *modtag); int unloadKernelModule(const char *modtag); - - int registerProperty(const char *name); - int unregisterProperty(const char *name); + int bindInterface(const char *ifname); + int unbindInterface(const char *ifname); private: void *loadFile(char *filename, unsigned int *_size); - - virtual int enable() = 0; - virtual int disable() = 0; - }; typedef android::List<Controller *> ControllerCollection; |