CommandListener.h revision 9ff78fb7da7158f5bd7c86d89a842691820259cf
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
26class CommandListener : public FrameworkListener {
27    static TetherController *sTetherCtrl;
28    static NatController *sNatCtrl;
29
30public:
31    CommandListener();
32    virtual ~CommandListener() {}
33
34private:
35
36    class ListInterfacesCmd : public NetdCommand {
37    public:
38        ListInterfacesCmd();
39        virtual ~ListInterfacesCmd() {}
40        int runCommand(SocketClient *c, int argc, char ** argv);
41    };
42
43    class IpFwdCmd : public NetdCommand {
44    public:
45        IpFwdCmd();
46        virtual ~IpFwdCmd() {}
47        int runCommand(SocketClient *c, int argc, char ** argv);
48    };
49
50    class TetherCmd : public NetdCommand {
51    public:
52        TetherCmd();
53        virtual ~TetherCmd() {}
54        int runCommand(SocketClient *c, int argc, char ** argv);
55    };
56
57    class NatCmd : public NetdCommand {
58    public:
59        NatCmd();
60        virtual ~NatCmd() {}
61        int runCommand(SocketClient *c, int argc, char ** argv);
62    };
63};
64
65#endif
66