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 | |
San Mehat | a2677e4 | 2009-12-13 10:40:18 -0800 | [diff] [blame] | 17 | #ifndef _RESPONSECODE_H |
| 18 | #define _RESPONSECODE_H |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 19 | |
San Mehat | a2677e4 | 2009-12-13 10:40:18 -0800 | [diff] [blame] | 20 | class ResponseCode { |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 21 | public: |
| 22 | // 100 series - Requestion action was initiated; expect another reply |
| 23 | // before proceeding with a new command. |
San Mehat | a19b250 | 2010-01-06 10:33:53 -0800 | [diff] [blame] | 24 | static const int ActionInitiated = 100; |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 25 | |
San Mehat | 586536c | 2010-02-16 17:12:00 -0800 | [diff] [blame] | 26 | static const int VolumeListResult = 110; |
| 27 | static const int AsecListResult = 111; |
| 28 | static const int StorageUsersListResult = 112; |
Ken Sumrall | 160b4d6 | 2013-04-22 12:15:39 -0700 | [diff] [blame] | 29 | static const int CryptfsGetfieldResult = 113; |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 30 | |
| 31 | // 200 series - Requested action has been successfully completed |
San Mehat | a19b250 | 2010-01-06 10:33:53 -0800 | [diff] [blame] | 32 | static const int CommandOkay = 200; |
San Mehat | eba65e9 | 2010-01-29 05:15:16 -0800 | [diff] [blame] | 33 | static const int ShareStatusResult = 210; |
San Mehat | a19b250 | 2010-01-06 10:33:53 -0800 | [diff] [blame] | 34 | static const int AsecPathResult = 211; |
San Mehat | eba65e9 | 2010-01-29 05:15:16 -0800 | [diff] [blame] | 35 | static const int ShareEnabledResult = 212; |
Paul Lawrence | f4faa57 | 2014-01-29 13:31:03 -0800 | [diff] [blame] | 36 | static const int PasswordTypeResult = 213; |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 37 | |
| 38 | // 400 series - The command was accepted but the requested action |
| 39 | // did not take place. |
San Mehat | eba65e9 | 2010-01-29 05:15:16 -0800 | [diff] [blame] | 40 | static const int OperationFailed = 400; |
| 41 | static const int OpFailedNoMedia = 401; |
| 42 | static const int OpFailedMediaBlank = 402; |
| 43 | static const int OpFailedMediaCorrupt = 403; |
| 44 | static const int OpFailedVolNotMounted = 404; |
San Mehat | 8f2875b | 2010-02-18 11:40:49 -0800 | [diff] [blame] | 45 | static const int OpFailedStorageBusy = 405; |
San Mehat | 88ac2c0 | 2010-03-23 11:15:58 -0700 | [diff] [blame] | 46 | static const int OpFailedStorageNotFound = 406; |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 47 | |
| 48 | // 500 series - The command was not accepted and the requested |
| 49 | // action did not take place. |
| 50 | static const int CommandSyntaxError = 500; |
| 51 | static const int CommandParameterError = 501; |
Ken Sumrall | 3ad9072 | 2011-10-04 20:38:29 -0700 | [diff] [blame] | 52 | static const int CommandNoPermission = 502; |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 53 | |
| 54 | // 600 series - Unsolicited broadcasts |
San Mehat | a2677e4 | 2009-12-13 10:40:18 -0800 | [diff] [blame] | 55 | static const int UnsolicitedInformational = 600; |
| 56 | static const int VolumeStateChange = 605; |
| 57 | static const int VolumeMountFailedBlank = 610; |
| 58 | static const int VolumeMountFailedDamaged = 611; |
| 59 | static const int VolumeMountFailedNoMedia = 612; |
Jeff Sharkey | 0de365f | 2013-10-16 16:24:19 -0700 | [diff] [blame] | 60 | static const int VolumeUuidChange = 613; |
| 61 | static const int VolumeUserLabelChange = 614; |
San Mehat | a2677e4 | 2009-12-13 10:40:18 -0800 | [diff] [blame] | 62 | |
| 63 | static const int ShareAvailabilityChange = 620; |
| 64 | |
| 65 | static const int VolumeDiskInserted = 630; |
| 66 | static const int VolumeDiskRemoved = 631; |
| 67 | static const int VolumeBadRemoval = 632; |
San Mehat | 8f2875b | 2010-02-18 11:40:49 -0800 | [diff] [blame] | 68 | |
| 69 | static int convertFromErrno(); |
San Mehat | f1b736b | 2009-10-10 17:22:08 -0700 | [diff] [blame] | 70 | }; |
| 71 | #endif |