1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef NET_CONN_TYPES_H
17 #define NET_CONN_TYPES_H
18 
19 namespace OHOS {
20 namespace NetManagerStandard {
21 constexpr int32_t MAX_IPV4_ADDRESS_LEN = 32;
22 
23 enum NetMonitorResponseCode {
24     OK = 200,
25     CREATED = 201,
26     NO_CONTENT = 204,
27     URL_REDIRECT_MAX = 399,
28     BAD_REQUEST = 400,
29     CLIENT_ERROR_MAX = 499
30 };
31 
32 enum NetDetectionStatus {
33     UNKNOWN_STATE,
34     INVALID_DETECTION_STATE,
35     VERIFICATION_STATE,
36     CAPTIVE_PORTAL_STATE,
37     QUALITY_POOR_STATE,
38     QUALITY_NORMAL_STATE,
39     QUALITY_GOOD_STATE,
40     ACCEPT_UNVALIDATED
41 };
42 using NetDetectionStateHandler = std::function<void(NetDetectionStatus netDetectionState,
43     const std::string &urlRedirect)>;
44 } // namespace NetManagerStandard
45 } // namespace OHOS
46 #endif // NET_CONN_TYPES_H
47