1 /*
2  * Copyright (C) 2018 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 #pragma once
17 
18 #include <cstdint>
19 #include <string>
20 
21 #include "common/libs/fs/shared_fd.h"
22 
23 namespace cuttlefish {
24 
25 enum RunnerExitCodes : int {
26   kSuccess = 0,
27   kArgumentParsingError = 1,
28   kInvalidHostConfiguration = 2,
29   kCuttlefishConfigurationInitError = 3,
30   kInstanceDirCreationError = 4,
31   kPrioFilesCleanupError = 5,
32   kBootImageUnpackError = 6,
33   kCuttlefishConfigurationSaveError = 7,
34   kDaemonizationError = 8,
35   kVMCreationError = 9,
36   kPipeIOError = 10,
37   kVirtualDeviceBootFailed = 11,
38   kProcessGroupError = 12,
39   kMonitorCreationFailed = 13,
40   kServerError = 14,
41   kUsbV1SocketError = 15,
42   kE2eTestFailed = 16,
43   kKernelDecompressError = 17,
44   kLogcatServerError = 18,
45   kConfigServerError = 19,
46   kTombstoneServerError = 20,
47   kTombstoneDirCreationError = 21,
48   kInitRamFsConcatError = 22,
49   kTapDeviceInUse = 23,
50   kTpmPassthroughError = 24,
51   kModemSimulatorServerError = 25,
52   kSocketProxyServerError = 26,
53 };
54 
55 // Actions supported by the launcher server
56 enum class LauncherAction : char {
57   kExtended = 'A',  ///< expect additional information to follow
58   kFail = 'F',
59   kPowerwash = 'P',
60   kRestart = 'R',
61   kStatus = 'I',
62   kStop = 'X',
63 };
64 
65 // Responses from the launcher server
66 enum class LauncherResponse : char {
67   kSuccess = 'S',
68   kError = 'E',
69   kUnknownAction = 'U',
70 };
71 
72 }  // namespace cuttlefish
73