Tom Marshall | bead261 | 2019-01-04 14:37:31 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * Copyright (C) 2019 The LineageOS Project |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | #ifndef _RESPONSECODE_H |
| 19 | #define _RESPONSECODE_H |
| 20 | |
| 21 | class ResponseCode { |
| 22 | public: |
| 23 | // 100 series - Requestion action was initiated; expect another reply |
| 24 | // before proceeding with a new command. |
| 25 | static const int ActionInitiated = 100; |
| 26 | |
| 27 | static const int VolumeListResult = 110; |
| 28 | static const int AsecListResult = 111; |
| 29 | static const int StorageUsersListResult = 112; |
| 30 | static const int CryptfsGetfieldResult = 113; |
| 31 | |
| 32 | // 200 series - Requested action has been successfully completed |
| 33 | static const int CommandOkay = 200; |
| 34 | static const int ShareStatusResult = 210; |
| 35 | static const int AsecPathResult = 211; |
| 36 | static const int ShareEnabledResult = 212; |
| 37 | static const int PasswordTypeResult = 213; |
| 38 | |
| 39 | // 400 series - The command was accepted but the requested action |
| 40 | // did not take place. |
| 41 | static const int OperationFailed = 400; |
| 42 | static const int OpFailedNoMedia = 401; |
| 43 | static const int OpFailedMediaBlank = 402; |
| 44 | static const int OpFailedMediaCorrupt = 403; |
| 45 | static const int OpFailedVolNotMounted = 404; |
| 46 | static const int OpFailedStorageBusy = 405; |
| 47 | static const int OpFailedStorageNotFound = 406; |
| 48 | |
| 49 | // 500 series - The command was not accepted and the requested |
| 50 | // action did not take place. |
| 51 | static const int CommandSyntaxError = 500; |
| 52 | static const int CommandParameterError = 501; |
| 53 | static const int CommandNoPermission = 502; |
| 54 | |
| 55 | // 600 series - Unsolicited broadcasts |
| 56 | static const int UnsolicitedInformational = 600; |
| 57 | static const int VolumeStateChange = 605; |
| 58 | static const int VolumeMountFailedBlank = 610; |
| 59 | static const int VolumeMountFailedDamaged = 611; |
| 60 | static const int VolumeMountFailedNoMedia = 612; |
| 61 | static const int VolumeUuidChange = 613; |
| 62 | static const int VolumeUserLabelChange = 614; |
| 63 | |
| 64 | static const int ShareAvailabilityChange = 620; |
| 65 | |
| 66 | static const int VolumeDiskInserted = 630; |
| 67 | static const int VolumeDiskRemoved = 631; |
| 68 | static const int VolumeBadRemoval = 632; |
| 69 | |
| 70 | static const int DiskCreated = 640; |
| 71 | static const int DiskSizeChanged = 641; |
| 72 | static const int DiskLabelChanged = 642; |
| 73 | static const int DiskScanned = 643; |
| 74 | static const int DiskSysPathChanged = 644; |
| 75 | static const int DiskDestroyed = 649; |
| 76 | |
| 77 | static const int VolumeCreated = 650; |
| 78 | static const int VolumeStateChanged = 651; |
| 79 | static const int VolumeFsTypeChanged = 652; |
| 80 | static const int VolumeFsUuidChanged = 653; |
| 81 | static const int VolumeFsLabelChanged = 654; |
| 82 | static const int VolumePathChanged = 655; |
| 83 | static const int VolumeDestroyed = 659; |
| 84 | |
| 85 | static const int MoveStatus = 660; |
| 86 | static const int BenchmarkResult = 661; |
| 87 | static const int TrimResult = 662; |
| 88 | |
| 89 | static int convertFromErrno(); |
| 90 | }; |
| 91 | #endif |