San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 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> |
Jeff Sharkey | 36801cc | 2015-03-13 16:09:20 -0700 | [diff] [blame] | 21 | #include <utils/Errors.h> |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 22 | #include "VoldCommand.h" |
| 23 | |
| 24 | class CommandListener : public FrameworkListener { |
| 25 | public: |
| 26 | CommandListener(); |
| 27 | virtual ~CommandListener() {} |
| 28 | |
| 29 | private: |
San Mehat | d9a4e35 | 2010-03-12 13:32:47 -0800 | [diff] [blame] | 30 | static void dumpArgs(int argc, char **argv, int argObscure); |
Jeff Sharkey | 36801cc | 2015-03-13 16:09:20 -0700 | [diff] [blame] | 31 | static int sendGenericOkFail(SocketClient *cli, int cond); |
San Mehat | d9a4e35 | 2010-03-12 13:32:47 -0800 | [diff] [blame] | 32 | |
| 33 | class DumpCmd : public VoldCommand { |
| 34 | public: |
| 35 | DumpCmd(); |
| 36 | virtual ~DumpCmd() {} |
| 37 | int runCommand(SocketClient *c, int argc, char ** argv); |
| 38 | }; |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 39 | |
San Mehat | eba65e9 | 2010-01-29 05:15:16 -0800 | [diff] [blame] | 40 | class VolumeCmd : public VoldCommand { |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 41 | public: |
San Mehat | eba65e9 | 2010-01-29 05:15:16 -0800 | [diff] [blame] | 42 | VolumeCmd(); |
| 43 | virtual ~VolumeCmd() {} |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 44 | int runCommand(SocketClient *c, int argc, char ** argv); |
| 45 | }; |
| 46 | |
San Mehat | eba65e9 | 2010-01-29 05:15:16 -0800 | [diff] [blame] | 47 | class AsecCmd : public VoldCommand { |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 48 | public: |
San Mehat | eba65e9 | 2010-01-29 05:15:16 -0800 | [diff] [blame] | 49 | AsecCmd(); |
| 50 | virtual ~AsecCmd() {} |
San Mehat | a19b250 | 2010-01-06 10:33:53 -0800 | [diff] [blame] | 51 | int runCommand(SocketClient *c, int argc, char ** argv); |
Kenny Root | 344ca10 | 2012-04-03 17:23:01 -0700 | [diff] [blame] | 52 | private: |
| 53 | void listAsecsInDirectory(SocketClient *c, const char *directory); |
San Mehat | a19b250 | 2010-01-06 10:33:53 -0800 | [diff] [blame] | 54 | }; |
| 55 | |
Kenny Root | 508c0e1 | 2010-07-12 09:59:49 -0700 | [diff] [blame] | 56 | class ObbCmd : public VoldCommand { |
Kenny Root | fb7c4d5 | 2010-06-30 18:48:41 -0700 | [diff] [blame] | 57 | public: |
Kenny Root | 508c0e1 | 2010-07-12 09:59:49 -0700 | [diff] [blame] | 58 | ObbCmd(); |
| 59 | virtual ~ObbCmd() {} |
Kenny Root | fb7c4d5 | 2010-06-30 18:48:41 -0700 | [diff] [blame] | 60 | int runCommand(SocketClient *c, int argc, char ** argv); |
| 61 | }; |
| 62 | |
San Mehat | 586536c | 2010-02-16 17:12:00 -0800 | [diff] [blame] | 63 | class StorageCmd : public VoldCommand { |
| 64 | public: |
| 65 | StorageCmd(); |
| 66 | virtual ~StorageCmd() {} |
| 67 | int runCommand(SocketClient *c, int argc, char ** argv); |
| 68 | }; |
San Mehat | 2350c44 | 2010-03-02 13:16:50 -0800 | [diff] [blame] | 69 | |
Ken Sumrall | b87937c | 2013-03-19 21:46:39 -0700 | [diff] [blame] | 70 | class FstrimCmd : public VoldCommand { |
| 71 | public: |
| 72 | FstrimCmd(); |
| 73 | virtual ~FstrimCmd() {} |
| 74 | int runCommand(SocketClient *c, int argc, char ** argv); |
| 75 | }; |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 76 | }; |
| 77 | |
| 78 | #endif |