OSDN Git Service

am ad729ac1: bandwidthcontroller: hide iptables errors when they don\'t matter
[android-x86/system-netd.git] / CommandListener.h
index d60069e..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;
@@ -34,8 +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();
@@ -43,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:
@@ -108,6 +107,24 @@ private:
         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();