ResponseCode.h 2.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

17 18
#ifndef _RESPONSECODE_H
#define _RESPONSECODE_H
19

20
class ResponseCode {
21 22 23
public:
    // 100 series - Requestion action was initiated; expect another reply
    // before proceeding with a new command.
24
    static const int ActionInitiated  = 100;
25

26 27 28
    static const int VolumeListResult         = 110;
    static const int AsecListResult           = 111;
    static const int StorageUsersListResult   = 112;
29
    static const int CryptfsGetfieldResult    = 113;
30 31

    // 200 series - Requested action has been successfully completed
32
    static const int CommandOkay              = 200;
San Mehat's avatar
San Mehat committed
33
    static const int ShareStatusResult        = 210;
34
    static const int AsecPathResult           = 211;
San Mehat's avatar
San Mehat committed
35
    static const int ShareEnabledResult       = 212;
36
    static const int PasswordTypeResult       = 213;
37 38 39

    // 400 series - The command was accepted but the requested action
    // did not take place.
San Mehat's avatar
San Mehat committed
40 41 42 43 44
    static const int OperationFailed          = 400;
    static const int OpFailedNoMedia          = 401;
    static const int OpFailedMediaBlank       = 402;
    static const int OpFailedMediaCorrupt     = 403;
    static const int OpFailedVolNotMounted    = 404;
45
    static const int OpFailedStorageBusy      = 405;
46
    static const int OpFailedStorageNotFound  = 406;
47 48 49 50 51

    // 500 series - The command was not accepted and the requested
    // action did not take place.
    static const int CommandSyntaxError = 500;
    static const int CommandParameterError = 501;
52
    static const int CommandNoPermission = 502;
53 54

    // 600 series - Unsolicited broadcasts
55 56 57 58 59
    static const int UnsolicitedInformational       = 600;
    static const int VolumeStateChange              = 605;
    static const int VolumeMountFailedBlank         = 610;
    static const int VolumeMountFailedDamaged       = 611;
    static const int VolumeMountFailedNoMedia       = 612;
60 61
    static const int VolumeUuidChange               = 613;
    static const int VolumeUserLabelChange          = 614;
62 63 64 65 66 67

    static const int ShareAvailabilityChange        = 620;

    static const int VolumeDiskInserted            = 630;
    static const int VolumeDiskRemoved             = 631;
    static const int VolumeBadRemoval              = 632;
68 69

    static int convertFromErrno();
70 71
};
#endif