OSDN Git Service

When un-natting try to do all we can
[android-x86/system-netd.git] / CommandListener.h
index c005c59..f0a7db7 100644 (file)
 #include "NatController.h"
 #include "PppController.h"
 #include "PanController.h"
+#include "SoftapController.h"
+#include "BandwidthController.h"
+#include "ResolverController.h"
 
 class CommandListener : public FrameworkListener {
     static TetherController *sTetherCtrl;
     static NatController *sNatCtrl;
     static PppController *sPppCtrl;
     static PanController *sPanCtrl;
+    static SoftapController *sSoftapCtrl;
+    static BandwidthController *sBandwidthCtrl;
+    static ResolverController *sResolverCtrl;
 
 public:
     CommandListener();
@@ -37,10 +43,21 @@ public:
 
 private:
 
-    class ListInterfacesCmd : public NetdCommand {
+    static int writeFile(const char *path, const char *value, int size);
+
+    static int readInterfaceCounters(const char *iface, unsigned long *rx, unsigned long *tx);
+
+    class SoftapCmd : public NetdCommand {
     public:
-        ListInterfacesCmd();
-        virtual ~ListInterfacesCmd() {}
+        SoftapCmd();
+        virtual ~SoftapCmd() {}
+        int runCommand(SocketClient *c, int argc, char ** argv);
+    };
+
+    class InterfaceCmd : public NetdCommand {
+    public:
+        InterfaceCmd();
+        virtual ~InterfaceCmd() {}
         int runCommand(SocketClient *c, int argc, char ** argv);
     };
 
@@ -85,6 +102,24 @@ private:
         virtual ~PanCmd() {}
         int runCommand(SocketClient *c, int argc, char ** argv);
     };
+
+    class BandwidthControlCmd : public NetdCommand {
+    public:
+        BandwidthControlCmd();
+        virtual ~BandwidthControlCmd() {}
+        int runCommand(SocketClient *c, int argc, char ** argv);
+    protected:
+        void sendGenericOkFail(SocketClient *cli, int cond);
+        void sendGenericOpFailed(SocketClient *cli, const char *errMsg);
+        void sendGenericSyntaxError(SocketClient *cli, const char *usageMsg);
+    };
+
+    class ResolverCmd : public NetdCommand {
+    public:
+        ResolverCmd();
+        virtual ~ResolverCmd() {}
+        int runCommand(SocketClient *c, int argc, char ** argv);
+    };
 };
 
 #endif