San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [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 | |
Mike Yu | f0e019f | 2019-03-13 14:43:39 +0800 | [diff] [blame] | 17 | #ifndef NETDUTILS_RESPONSECODE_H |
| 18 | #define NETDUTILS_RESPONSECODE_H |
| 19 | |
| 20 | namespace android { |
| 21 | namespace netdutils { |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 22 | |
| 23 | class ResponseCode { |
JP Abgrall | 8a93272 | 2011-07-13 19:17:35 -0700 | [diff] [blame] | 24 | // Keep in sync with |
| 25 | // frameworks/base/services/java/com/android/server/NetworkManagementService.java |
Luke Huang | 711b777 | 2019-05-23 06:14:42 -0700 | [diff] [blame] | 26 | public: |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 27 | // 100 series - Requestion action was initiated; expect another reply |
| 28 | // before proceeding with a new command. |
Luke Huang | 711b777 | 2019-05-23 06:14:42 -0700 | [diff] [blame] | 29 | // 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 Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 37 | |
| 38 | // 200 series - Requested action has been successfully completed |
Luke Huang | 711b777 | 2019-05-23 06:14:42 -0700 | [diff] [blame] | 39 | 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 Innocenti | f89b351 | 2018-08-30 07:34:37 +0900 | [diff] [blame] | 51 | // NOTE: keep synced with bionic/libc/dns/net/gethnamaddr.c |
Luke Huang | 711b777 | 2019-05-23 06:14:42 -0700 | [diff] [blame] | 52 | static constexpr int DnsProxyQueryResult = 222; |
| 53 | static constexpr int ClatdStatusResult = 223; |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 54 | |
| 55 | // 400 series - The command was accepted but the requested action |
| 56 | // did not take place. |
Luke Huang | 711b777 | 2019-05-23 06:14:42 -0700 | [diff] [blame] | 57 | static constexpr int OperationFailed = 400; |
| 58 | static constexpr int DnsProxyOperationFailed = 401; |
| 59 | static constexpr int ServiceStartFailed = 402; |
| 60 | static constexpr int ServiceStopFailed = 403; |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 61 | |
| 62 | // 500 series - The command was not accepted and the requested |
| 63 | // action did not take place. |
Luke Huang | 711b777 | 2019-05-23 06:14:42 -0700 | [diff] [blame] | 64 | static constexpr int CommandSyntaxError = 500; |
| 65 | static constexpr int CommandParameterError = 501; |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 66 | |
| 67 | // 600 series - Unsolicited broadcasts |
Luke Huang | 711b777 | 2019-05-23 06:14:42 -0700 | [diff] [blame] | 68 | 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 Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 87 | }; |
Mike Yu | f0e019f | 2019-03-13 14:43:39 +0800 | [diff] [blame] | 88 | |
| 89 | } // namespace netdutils |
| 90 | } // namespace android |
| 91 | |
| 92 | #endif // NETDUTILS_RESPONSECODE_H |