blob: c170684cf376b3d956cc9bf3e06d625583ae9e5a [file] [log] [blame]
San Mehatd1830422010-01-15 08:02:39 -08001/*
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
Mike Yuf0e019f2019-03-13 14:43:39 +080017#ifndef NETDUTILS_RESPONSECODE_H
18#define NETDUTILS_RESPONSECODE_H
19
20namespace android {
21namespace netdutils {
San Mehatd1830422010-01-15 08:02:39 -080022
23class ResponseCode {
JP Abgrall8a932722011-07-13 19:17:35 -070024 // Keep in sync with
25 // frameworks/base/services/java/com/android/server/NetworkManagementService.java
Luke Huang711b7772019-05-23 06:14:42 -070026 public:
San Mehatd1830422010-01-15 08:02:39 -080027 // 100 series - Requestion action was initiated; expect another reply
28 // before proceeding with a new command.
Luke Huang711b7772019-05-23 06:14:42 -070029 // clang-format off
30 static constexpr int ActionInitiated = 100;
31 static constexpr int InterfaceListResult = 110;
32 static constexpr int TetherInterfaceListResult = 111;
33 static constexpr int TetherDnsFwdTgtListResult = 112;
34 static constexpr int TtyListResult = 113;
35 static constexpr int TetheringStatsListResult = 114;
36 static constexpr int TetherDnsFwdNetIdResult = 115;
San Mehatd1830422010-01-15 08:02:39 -080037
38 // 200 series - Requested action has been successfully completed
Luke Huang711b7772019-05-23 06:14:42 -070039 static constexpr int CommandOkay = 200;
40 static constexpr int TetherStatusResult = 210;
41 static constexpr int IpFwdStatusResult = 211;
42 static constexpr int InterfaceGetCfgResult = 213;
43 // Formerly: int SoftapStatusResult = 214;
44 static constexpr int UsbRNDISStatusResult = 215;
45 static constexpr int InterfaceRxCounterResult = 216;
46 static constexpr int InterfaceTxCounterResult = 217;
47 static constexpr int InterfaceRxThrottleResult = 218;
48 static constexpr int InterfaceTxThrottleResult = 219;
49 static constexpr int QuotaCounterResult = 220;
50 static constexpr int TetheringStatsResult = 221;
Bernie Innocentif89b3512018-08-30 07:34:37 +090051 // NOTE: keep synced with bionic/libc/dns/net/gethnamaddr.c
Luke Huang711b7772019-05-23 06:14:42 -070052 static constexpr int DnsProxyQueryResult = 222;
53 static constexpr int ClatdStatusResult = 223;
San Mehatd1830422010-01-15 08:02:39 -080054
55 // 400 series - The command was accepted but the requested action
56 // did not take place.
Luke Huang711b7772019-05-23 06:14:42 -070057 static constexpr int OperationFailed = 400;
58 static constexpr int DnsProxyOperationFailed = 401;
59 static constexpr int ServiceStartFailed = 402;
60 static constexpr int ServiceStopFailed = 403;
San Mehatd1830422010-01-15 08:02:39 -080061
62 // 500 series - The command was not accepted and the requested
63 // action did not take place.
Luke Huang711b7772019-05-23 06:14:42 -070064 static constexpr int CommandSyntaxError = 500;
65 static constexpr int CommandParameterError = 501;
San Mehatd1830422010-01-15 08:02:39 -080066
67 // 600 series - Unsolicited broadcasts
Luke Huang711b7772019-05-23 06:14:42 -070068 static constexpr int InterfaceChange = 600;
69 static constexpr int BandwidthControl = 601;
70 static constexpr int ServiceDiscoveryFailed = 602;
71 static constexpr int ServiceDiscoveryServiceAdded = 603;
72 static constexpr int ServiceDiscoveryServiceRemoved = 604;
73 static constexpr int ServiceRegistrationFailed = 605;
74 static constexpr int ServiceRegistrationSucceeded = 606;
75 static constexpr int ServiceResolveFailed = 607;
76 static constexpr int ServiceResolveSuccess = 608;
77 static constexpr int ServiceSetHostnameFailed = 609;
78 static constexpr int ServiceSetHostnameSuccess = 610;
79 static constexpr int ServiceGetAddrInfoFailed = 611;
80 static constexpr int ServiceGetAddrInfoSuccess = 612;
81 static constexpr int InterfaceClassActivity = 613;
82 static constexpr int InterfaceAddressChange = 614;
83 static constexpr int InterfaceDnsInfo = 615;
84 static constexpr int RouteChange = 616;
85 static constexpr int StrictCleartext = 617;
86 // clang-format on
San Mehatd1830422010-01-15 08:02:39 -080087};
Mike Yuf0e019f2019-03-13 14:43:39 +080088
89} // namespace netdutils
90} // namespace android
91
92#endif // NETDUTILS_RESPONSECODE_H