2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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
8 * http://www.tizenopensource.org/license
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.
18 #ifndef __NETWORK_PM_CONFIG_H__
19 #define __NETWORK_PM_CONFIG_H__
25 #endif /* __cplusplus */
28 * @file network-pm-config.h
29 * @brief This file defines the constants and enumerations used by Profile Manager with the application/Connection Manager.
33 * \addtogroup profile_managing
37 /*==================================================================================================
39 ==================================================================================================*/
41 #include <netinet/in.h>
43 #include "network-cm-error.h"
45 /*==================================================================================================
47 ==================================================================================================*/
49 /** Profile name max length */
50 #define NET_PROFILE_NAME_LEN_MAX 512
52 /** Home URL max length in profile account */
53 #define NET_HOME_URL_LEN_MAX 512
55 /** Maximum length of IPv4 string type e.g., "165.213.173.105". This length does not include NULL in the last byte. */
56 #define NETPM_IPV4_STR_LEN_MAX 15
58 /** Minimum length of IPv4 string type e.g., "0.0.0.0". This length does not include NULL in the last byte. */
59 #define NETPM_IPV4_STR_LEN_MIN 7
61 /** This is for MCC + MNC string */
62 #define NET_SIM_INFO_LEN 10
64 /** Maximum length of username in PDP profile. (used in authentication parameters) [3GPP Defined variable] */
65 #define NET_PDP_AUTH_USERNAME_LEN_MAX 32
67 /** Maximum length of password in PDP profile (used in authentication parameters) [3GPP Defined variable] */
68 #define NET_PDP_AUTH_PASSWORD_LEN_MAX 32
70 /** Maximum length of APN in PDP profile [3GPP Defined variable] */
71 #define NET_PDP_APN_LEN_MAX 100
73 /** Maximum length of proxy string */
74 #define NET_PROXY_LEN_MAX 64
76 /** MAX number of DNS Address */
77 #define NET_DNS_ADDR_MAX 2
79 /** Maximum length of device name */
80 #define NET_MAX_DEVICE_NAME_LEN 32
82 /** Maximum length of MAC address */
83 #define NET_MAX_MAC_ADDR_LEN 32
85 /*==================================================================================================
87 ==================================================================================================*/
96 NET_DEVICE_UNKNOWN = 0x0,
99 NET_DEVICE_DEFAULT = 0x1,
101 /** GPRS & WCDMA device */
102 NET_DEVICE_CELLULAR = 0x2,
105 NET_DEVICE_WIFI = 0x3,
107 /** Serial USB device */
108 NET_DEVICE_USB = 0x4,
110 /** Count of device type */
111 NET_DEVICE_MAX = 0x5,
115 * @enum net_addr_type_t
121 /** IPV4 Address type */
124 /** IPV6 Address type */
129 * @enum net_auth_type_t
130 * PDP Authentication Type
135 /** No authentication */
136 NET_PDP_AUTH_NONE = 0x0,
138 /** PAP authentication */
139 NET_PDP_AUTH_PAP = 0x1,
141 /** CHAP authentication */
142 NET_PDP_AUTH_CHAP = 0x2,
146 * @enum net_proxy_type_t
147 * This enumeration defines the proxy method type.
152 NET_PROXY_TYPE_UNKNOWN = 0x00,
153 /** Direct connection */
154 NET_PROXY_TYPE_DIRECT = 0x01,
155 /** Auto configuration(Use PAC file)
156 * If URL property is not set, DHCP/WPAD auto-discover will be tried */
157 NET_PROXY_TYPE_AUTO = 0x02,
158 /** Manual configuration */
159 NET_PROXY_TYPE_MANUAL= 0x03,
163 * @enum net_service_type_t
164 * This enum indicates network connection type
170 NET_SERVICE_UNKNOWN = 0x00,
172 /** Mobile Internet Type \n
173 Network connection is established in Cellular network for Internet \n
175 NET_SERVICE_INTERNET = 0x01,
177 /** Mobile MMS Type \n
178 Network connection is established in Cellular network for MMS \n
180 NET_SERVICE_MMS = 0x02,
182 /** Mobile WAP Type \n
183 Network connection is established in Cellular network for WAP \n
185 NET_SERVICE_WAP = 0x03,
187 /** Prepaid Mobile Internet Type \n
188 Network connection is established in Cellular network for prepaid internet service.\n
189 This service supports to establish network connection in prepaid sim case\n
191 NET_SERVICE_PREPAID_INTERNET = 0x04,
193 /** Prepaid Mobile MMS Type \n
194 Network Connection is established in Cellular network for prepaid MMS service. \n
195 This profile supports to establish network connection in prepaid sim case\n
197 NET_SERVICE_PREPAID_MMS = 0x05,
198 } net_service_type_t;
202 * @enum net_ip_config_type_t
203 * Net IP configuration Type
207 /** Manual IP configuration */
208 NET_IP_CONFIG_TYPE_STATIC = 0x01,
210 /** Config ip using DHCP client*/
211 NET_IP_CONFIG_TYPE_DYNAMIC,
213 /** Config IP from Auto IP pool (169.254/16)
214 * Later with DHCP client, if available */
215 NET_IP_CONFIG_TYPE_AUTO_IP,
217 /** Indicates an IP address that can not be modified */
218 NET_IP_CONFIG_TYPE_FIXED,
220 /** Don't use any method */
221 NET_IP_CONFIG_TYPE_OFF,
222 } net_ip_config_type_t;
224 /*==================================================================================================
225 STRUCTURES AND OTHER TYPEDEFS
226 ==================================================================================================*/
233 /** IP Version 4 address */
236 /** IP Version 6 address */
237 struct in6_addr Ipv6;
241 * Network Address information
245 /** Address Type: IPv4 or IPv6 */
246 net_addr_type_t Type;
253 * Below structure is used to export proxy info
258 char proxy_addr[NET_PROXY_LEN_MAX+1];
262 * Below structure is used to export profile name
267 char ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
268 } net_profile_name_t;
271 * PDP Authentication Information
275 /** Authentication type */
276 net_auth_type_t AuthType;
278 /** UserName to be used during authentication */
279 char UserName[NET_PDP_AUTH_USERNAME_LEN_MAX+1];
281 /** Password to be used during authentication */
282 char Password[NET_PDP_AUTH_PASSWORD_LEN_MAX+1];
286 * Device Info in Connect response event
290 /** Profile Name of the connection link */
291 char ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
293 /** Device Name of the connection link */
294 char DevName[NET_MAX_DEVICE_NAME_LEN+1];
296 /** Dns Server Address of the connection link */
297 net_addr_t DnsAddr[NET_DNS_ADDR_MAX];
298 /** No of DNS Address for the connection link */
301 /** Net IP configuration Type */
302 net_ip_config_type_t IpConfigType;
304 /** IP Address for the connection link */
306 /** Whether subnet mask present or not. */
309 net_addr_t SubnetMask;
310 /** Whether gateway address present or not */
312 /** Gateway address */
313 net_addr_t GatewayAddr;
315 /** Proxy Method type */
316 net_proxy_type_t ProxyMethod;
318 char ProxyAddr[NET_PROXY_LEN_MAX+1];
321 char MacAddr[NET_MAX_MAC_ADDR_LEN+1];
330 #endif /* __cplusplus */