CommandListener.h revision d5573d34c8fac49e16b20cf144486125bf940086
1/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _COMMANDLISTENER_H__
18#define _COMMANDLISTENER_H__
19
20#include <sysutils/FrameworkListener.h>
21
22#include "NetdCommand.h"
23#include "TetherController.h"
24#include "NatController.h"
25#include "PppController.h"
26
27class CommandListener : public FrameworkListener {
28    static TetherController *sTetherCtrl;
29    static NatController *sNatCtrl;
30    static PppController *sPppCtrl;
31
32public:
33    CommandListener();
34    virtual ~CommandListener() {}
35
36private:
37
38    class ListInterfacesCmd : public NetdCommand {
39    public:
40        ListInterfacesCmd();
41        virtual ~ListInterfacesCmd() {}
42        int runCommand(SocketClient *c, int argc, char ** argv);
43    };
44
45    class IpFwdCmd : public NetdCommand {
46    public:
47        IpFwdCmd();
48        virtual ~IpFwdCmd() {}
49        int runCommand(SocketClient *c, int argc, char ** argv);
50    };
51
52    class TetherCmd : public NetdCommand {
53    public:
54        TetherCmd();
55        virtual ~TetherCmd() {}
56        int runCommand(SocketClient *c, int argc, char ** argv);
57    };
58
59    class NatCmd : public NetdCommand {
60    public:
61        NatCmd();
62        virtual ~NatCmd() {}
63        int runCommand(SocketClient *c, int argc, char ** argv);
64    };
65
66    class ListTtysCmd : public NetdCommand {
67    public:
68        ListTtysCmd();
69        virtual ~ListTtysCmd() {}
70        int runCommand(SocketClient *c, int argc, char ** argv);
71    };
72
73    class PppdCmd : public NetdCommand {
74    public:
75        PppdCmd();
76        virtual ~PppdCmd() {}
77        int runCommand(SocketClient *c, int argc, char ** argv);
78    };
79};
80
81#endif
82