#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();
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);
};
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