1f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat/*
2f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * Copyright (C) 2008 The Android Open Source Project
3f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat *
4f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * Licensed under the Apache License, Version 2.0 (the "License");
5f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * you may not use this file except in compliance with the License.
6f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * You may obtain a copy of the License at
7f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat *
8f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat *      http://www.apache.org/licenses/LICENSE-2.0
9f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat *
10f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * Unless required by applicable law or agreed to in writing, software
11f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * distributed under the License is distributed on an "AS IS" BASIS,
12f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * See the License for the specific language governing permissions and
14f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat * limitations under the License.
15f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat */
16f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat
17f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat#ifndef _COMMANDLISTENER_H__
18f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat#define _COMMANDLISTENER_H__
19f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat
20f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat#include <sysutils/FrameworkListener.h>
21f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat#include "VoldCommand.h"
22f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat
23f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehatclass CommandListener : public FrameworkListener {
24f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehatpublic:
25f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat    CommandListener();
26f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat    virtual ~CommandListener() {}
27f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat
28f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehatprivate:
29d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat    static void dumpArgs(int argc, char **argv, int argObscure);
30d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat
31d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat    class DumpCmd : public VoldCommand {
32d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat    public:
33d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat        DumpCmd();
34d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat        virtual ~DumpCmd() {}
35d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat        int runCommand(SocketClient *c, int argc, char ** argv);
36d9a4e358614a0c5f60cc76c0636ee4bb02004a32San Mehat    };
37f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat
38eba65e9d438a05f1c5dfd0f8d31bc463a5d08eeeSan Mehat    class VolumeCmd : public VoldCommand {
39f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat    public:
40eba65e9d438a05f1c5dfd0f8d31bc463a5d08eeeSan Mehat        VolumeCmd();
41eba65e9d438a05f1c5dfd0f8d31bc463a5d08eeeSan Mehat        virtual ~VolumeCmd() {}
42f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat        int runCommand(SocketClient *c, int argc, char ** argv);
43f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat    };
44f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat
45eba65e9d438a05f1c5dfd0f8d31bc463a5d08eeeSan Mehat    class AsecCmd : public VoldCommand {
46a19b250bd273455933ca3502cf2c2e0a803aff77San Mehat    public:
47eba65e9d438a05f1c5dfd0f8d31bc463a5d08eeeSan Mehat        AsecCmd();
48eba65e9d438a05f1c5dfd0f8d31bc463a5d08eeeSan Mehat        virtual ~AsecCmd() {}
49a19b250bd273455933ca3502cf2c2e0a803aff77San Mehat        int runCommand(SocketClient *c, int argc, char ** argv);
50344ca10856f3d3087a3288ce8f91ad83665d93fbKenny Root    private:
51344ca10856f3d3087a3288ce8f91ad83665d93fbKenny Root        void listAsecsInDirectory(SocketClient *c, const char *directory);
52a19b250bd273455933ca3502cf2c2e0a803aff77San Mehat    };
53a19b250bd273455933ca3502cf2c2e0a803aff77San Mehat
54508c0e1605b795bbb51cb47d955b89f3df26ca94Kenny Root    class ObbCmd : public VoldCommand {
55fb7c4d5a8a1031cf0e493ff182dcf458e5fe8c77Kenny Root    public:
56508c0e1605b795bbb51cb47d955b89f3df26ca94Kenny Root        ObbCmd();
57508c0e1605b795bbb51cb47d955b89f3df26ca94Kenny Root        virtual ~ObbCmd() {}
58fb7c4d5a8a1031cf0e493ff182dcf458e5fe8c77Kenny Root        int runCommand(SocketClient *c, int argc, char ** argv);
59fb7c4d5a8a1031cf0e493ff182dcf458e5fe8c77Kenny Root    };
60fb7c4d5a8a1031cf0e493ff182dcf458e5fe8c77Kenny Root
61586536c60b773e3517531ad8a6cb0de6722c67fcSan Mehat    class StorageCmd : public VoldCommand {
62586536c60b773e3517531ad8a6cb0de6722c67fcSan Mehat    public:
63586536c60b773e3517531ad8a6cb0de6722c67fcSan Mehat        StorageCmd();
64586536c60b773e3517531ad8a6cb0de6722c67fcSan Mehat        virtual ~StorageCmd() {}
65586536c60b773e3517531ad8a6cb0de6722c67fcSan Mehat        int runCommand(SocketClient *c, int argc, char ** argv);
66586536c60b773e3517531ad8a6cb0de6722c67fcSan Mehat    };
672350c44ff39b4cb2940893964a05f778fc80a436San Mehat
682350c44ff39b4cb2940893964a05f778fc80a436San Mehat    class XwarpCmd : public VoldCommand {
692350c44ff39b4cb2940893964a05f778fc80a436San Mehat    public:
702350c44ff39b4cb2940893964a05f778fc80a436San Mehat        XwarpCmd();
712350c44ff39b4cb2940893964a05f778fc80a436San Mehat        virtual ~XwarpCmd() {}
722350c44ff39b4cb2940893964a05f778fc80a436San Mehat        int runCommand(SocketClient *c, int argc, char ** argv);
732350c44ff39b4cb2940893964a05f778fc80a436San Mehat    };
748f869aa1bc685b505c58e97b4e11a9c7491a16f9Ken Sumrall
758f869aa1bc685b505c58e97b4e11a9c7491a16f9Ken Sumrall    class CryptfsCmd : public VoldCommand {
768f869aa1bc685b505c58e97b4e11a9c7491a16f9Ken Sumrall    public:
778f869aa1bc685b505c58e97b4e11a9c7491a16f9Ken Sumrall        CryptfsCmd();
788f869aa1bc685b505c58e97b4e11a9c7491a16f9Ken Sumrall        virtual ~CryptfsCmd() {}
798f869aa1bc685b505c58e97b4e11a9c7491a16f9Ken Sumrall        int runCommand(SocketClient *c, int argc, char ** argv);
808f869aa1bc685b505c58e97b4e11a9c7491a16f9Ken Sumrall    };
81f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat};
82f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat
83f1b736bc5605e92e917ab27f5abf3ba839be2270San Mehat#endif
84