OSDN Git Service

am ad729ac1: bandwidthcontroller: hide iptables errors when they don\'t matter
[android-x86/system-netd.git] / CommandListener.h
index 2f40474..a9da6d7 100644 (file)
 #include "PppController.h"
 #include "PanController.h"
 #include "SoftapController.h"
-#include "UsbController.h"
+#include "BandwidthController.h"
+#include "IdletimerController.h"
+#include "ResolverController.h"
+#include "SecondaryTableController.h"
 
 class CommandListener : public FrameworkListener {
     static TetherController *sTetherCtrl;
@@ -33,7 +36,10 @@ class CommandListener : public FrameworkListener {
     static PppController *sPppCtrl;
     static PanController *sPanCtrl;
     static SoftapController *sSoftapCtrl;
-    static UsbController *sUsbCtrl;
+    static BandwidthController *sBandwidthCtrl;
+    static IdletimerController *sIdletimerCtrl;
+    static ResolverController *sResolverCtrl;
+    static SecondaryTableController *sSecondaryTableCtrl;
 
 public:
     CommandListener();
@@ -41,14 +47,9 @@ public:
 
 private:
 
-    static int readInterfaceCounters(const char *iface, unsigned long *rx, unsigned long *tx);
+    static int writeFile(const char *path, const char *value, int size);
 
-    class UsbCmd : public NetdCommand {
-    public:
-        UsbCmd();
-        virtual ~UsbCmd() {}
-        int runCommand(SocketClient *c, int argc, char ** argv);
-    };
+    static int readInterfaceCounters(const char *iface, unsigned long *rx, unsigned long *tx);
 
     class SoftapCmd : public NetdCommand {
     public:
@@ -105,6 +106,31 @@ 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 IdletimerControlCmd : public NetdCommand {
+    public:
+        IdletimerControlCmd();
+        virtual ~IdletimerControlCmd() {}
+        int runCommand(SocketClient *c, int argc, char ** argv);
+    };
+
+    class ResolverCmd : public NetdCommand {
+    public:
+        ResolverCmd();
+        virtual ~ResolverCmd() {}
+        int runCommand(SocketClient *c, int argc, char ** argv);
+    };
 };
 
 #endif