• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 NETMANAGER_EXT_CONSTANTS_H
17 #define NETMANAGER_EXT_CONSTANTS_H
18 
19 #include <errors.h>
20 
21 namespace OHOS {
22 namespace NetManagerStandard {
23 constexpr int NETMANAGER_EXT_ERROR = -1;
24 
25 enum {
26     NETMANAGER_EXT_COMMON = 0x00,
27     EXTERNALVPN_MANAGER = 0x01,
28     NETMANAGER_ETHERNET_MANAGER = 0x02,
29     NETMANAGER_MDNS_MANAGER = 0x03,
30 };
31 
32 // Error code for common
33 constexpr ErrCode COMMON_EXT_ERR_OFFSET = ErrCodeOffset(SUBSYS_COMMUNICATION, NETMANAGER_EXT_COMMON);
34 // Error code for netmanager ethernet
35 constexpr ErrCode ETHERNET_ERR_OFFSET = ErrCodeOffset(SUBSYS_COMMUNICATION, NETMANAGER_ETHERNET_MANAGER);
36 // Error code for netmanager external vpn
37 constexpr ErrCode EXTERNALVPN_ERR_OFFSET = ErrCodeOffset(SUBSYS_COMMUNICATION, EXTERNALVPN_MANAGER);
38 
39 // Error code for netmanager mdns
40 constexpr ErrCode MDNS_ERR_OFFSET = ErrCodeOffset(SUBSYS_COMMUNICATION, NETMANAGER_MDNS_MANAGER);
41 
42 // for network sharing
43 enum class SharingIfaceType {
44     SHARING_WIFI = 0,
45     SHARING_USB,
46     SHARING_BLUETOOTH,
47 };
48 enum class SharingIfaceState {
49     SHARING_NIC_SERVING = 1,
50     SHARING_NIC_CAN_SERVER,
51     SHARING_NIC_ERROR,
52 };
53 } // namespace NetManagerStandard
54 } // namespace OHOS
55 #endif // NETMANAGER_EXT_CONSTANTS_H
56