• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 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 COMMUNICATIONNETMANAGERBASE_CONSTANT_H
17 #define COMMUNICATIONNETMANAGERBASE_CONSTANT_H
18 
19 static constexpr const char *KEY_ADDRESS = "address";
20 static constexpr const char *KEY_FAMILY = "family";
21 static constexpr const char *KEY_PORT = "port";
22 
23 static constexpr const int PARAM_NONE = 0;
24 static constexpr const int PARAM_JUST_OPTIONS = 1;
25 static constexpr const int PARAM_JUST_CALLBACK = 1;
26 static constexpr const int PARAM_OPTIONS_AND_CALLBACK = 2;
27 
28 static constexpr const char *EVENT_NET_AVAILABLE = "netAvailable";
29 static constexpr const char *EVENT_NET_BLOCK_STATUS_CHANGE = "netBlockStatusChange";
30 static constexpr const char *EVENT_NET_CAPABILITIES_CHANGE = "netCapabilitiesChange";
31 static constexpr const char *EVENT_NET_CONNECTION_PROPERTIES_CHANGE = "netConnectionPropertiesChange";
32 static constexpr const char *EVENT_NET_LOST = "netLost";
33 static constexpr const char *EVENT_NET_UNAVAILABLE = "netUnavailable";
34 
35 static constexpr const char *EVENT_IFACE_ADDRESS_UPDATED = "interfaceAddressUpdated";
36 static constexpr const char *EVENT_IFACE_ADDRESS_REMOVED = "interfaceAddressRemoved";
37 static constexpr const char *EVENT_IFACE_ADDED = "interfaceAdded";
38 static constexpr const char *EVENT_IFACE_REMOVED = "interfaceRemoved";
39 static constexpr const char *EVENT_IFACE_CHANGED = "interfaceChanged";
40 static constexpr const char *EVENT_IFACE_LINK_STATE_CHANGED = "interfaceLinkStateChanged";
41 static constexpr const char *EVENT_IFACE_ROUTE_CHANGED = "routeChanged";
42 
43 static constexpr const char *KEY_LINK_UP_BAND_WIDTH_KPS = "linkUpBandwidthKbps";
44 static constexpr const char *KEY_LINK_DOWN_BAND_WIDTH_KPS = "linkDownBandwidthKbps";
45 static constexpr const char *KEY_NET_CAPABILITIES = "netCapabilities";
46 static constexpr const char *KEY_BEARER_PRIVATE_IDENTIFIER = "bearerPrivateIdentifier";
47 static constexpr const char *KEY_NETWORK_CAP = "networkCap";
48 static constexpr const char *KEY_BEARER_TYPE = "bearerTypes";
49 
50 static constexpr const char *KEY_INTERFACE_NAME = "interfaceName";
51 static constexpr const char *KEY_IS_USE_PRIVATE_DNS = "isUsePrivateDns";
52 static constexpr const char *KEY_PRIVATE_DNS_SERVER_NAME = "privateDnsServerName";
53 static constexpr const char *KEY_DOMAINS = "domains";
54 static constexpr const char *KEY_HTTP_PROXY = "httpProxy";
55 static constexpr const char *KEY_LINK_ADDRESSES = "linkAddresses";
56 static constexpr const char *KEY_DNSES = "dnses";
57 static constexpr const char *KEY_ROUTES = "routes";
58 static constexpr const char *KEY_MTU = "mtu";
59 static constexpr const char *KEY_PREFIX_LENGTH = "prefixLength";
60 static constexpr const char *KEY_INTERFACE = "interface";
61 static constexpr const char *KEY_DESTINATION = "destination";
62 static constexpr const char *KEY_GATE_WAY = "gateway";
63 static constexpr const char *KEY_HAS_GET_WAY = "hasGateway";
64 static constexpr const char *KEY_IS_DEFAULT_ROUE = "isDefaultRoute";
65 static constexpr const char *KEY_IS_EXCLUDED_ROUTE = "isExcludedRoute";
66 static constexpr const char *KEY_HOST = "host";
67 static constexpr const char *KEY_PARSED_EXCLUSION_LIST = "parsedExclusionList";
68 static constexpr const char *KEY_NET_HANDLE = "netHandle";
69 static constexpr const char *KEY_BLOCKED = "blocked";
70 static constexpr const char *KEY_NET_CAP = "netCap";
71 static constexpr const char *KEY_CONNECTION_PROPERTIES = "connectionProperties";
72 static constexpr const char *KEY_NET_ID = "netId";
73 
74 static constexpr const char *KEY_SOCKET_FD = "socketFd";
75 static constexpr const char *KEY_FLAGS = "flags";
76 static constexpr const char *KEY_SCOPE = "scope";
77 static constexpr const char *KEY_UP = "up";
78 static constexpr const char *KEY_ROUTE = "route";
79 static constexpr const char *KEY_UPDATED = "updated";
80 
81 enum {
82     ARG_NUM_0,
83     ARG_NUM_1,
84     ARG_NUM_2,
85 };
86 
87 #endif /* COMMUNICATIONNETMANAGERBASE_CONSTANT_H */
88