2 * Network Client Library
4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.1 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.tizenopensource.org/license
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __NETWORK_PM_INTF_H__
21 #define __NETWORK_PM_INTF_H__
23 #include "network-pm-wlan.h"
28 #endif /* __cplusplus */
31 #define DEPRECATED __attribute__((deprecated))
35 * @file network-pm-intf.h
36 * @brief This file defines the interface of Profile Manager with the application/Connection Manager.
40 * \addtogroup profile_managing
44 /*==================================================================================================
46 ==================================================================================================*/
48 /*==================================================================================================
50 ==================================================================================================*/
53 * @enum net_pdp_type_t
54 * This enumeration defines the pdp protocol type.
59 NET_PDP_TYPE_NONE = 0x00,
69 * @enum net_pdn_type_e
70 * This enumeration defines the pdn type.
74 NET_PDN_TYPE_UNKNOWN = 0x00,
75 NET_PDN_TYPE_IPV4 = 0x02,
76 NET_PDN_TYPE_IPV6 = 0x05,
77 NET_PDN_TYPE_IPV4_IPV6 = 0x06,
81 * @enum net_state_type_t
82 * This enumeration defines the service state type.
87 NET_STATE_TYPE_UNKNOWN = 0x00,
91 NET_STATE_TYPE_FAILURE,
92 /** Association state */
93 NET_STATE_TYPE_ASSOCIATION,
94 /** Configuration state */
95 NET_STATE_TYPE_CONFIGURATION,
99 NET_STATE_TYPE_ONLINE,
101 NET_STATE_TYPE_DISCONNECT,
105 * @enum net_state_error_type_t
106 * This enumeration defines the service error state type.
110 NET_STATE_ERROR_NONE = 0x00,
111 NET_STATE_ERROR_OUT_OF_RANGE = 0x01,
112 NET_STATE_ERROR_PIN_MISSING = 0x02,
113 NET_STATE_ERROR_DHCP_FAILED = 0x03,
114 NET_STATE_ERROR_CONNECT_FAILED = 0x04,
115 NET_STATE_ERROR_LOGIN_FAILED = 0x05,
116 NET_STATE_ERROR_AUTH_FAILED = 0x06,
117 NET_STATE_ERROR_INVALID_KEY = 0x07,
118 } net_error_state_type_t;
120 /*==================================================================================================
121 STRUCTURES AND OTHER TYPEDEFS
122 ==================================================================================================*/
126 * Profile data structures: Used between Application and PM Plug-in Interface
130 /** Specifies a protocol type */
131 net_pdp_type_t ProtocolType;
132 /** Specifies a pdn type */
133 net_pdn_type_e PdnType;
134 /** Specifies a roam pdn type */
135 net_pdn_type_e RoamPdnType;
136 /** Specifies a service type(Internet, MMS, WAP, etc...) */
137 net_service_type_t ServiceType;
138 /** Network Access Point Name */
139 char Apn[NET_PDP_APN_LEN_MAX+1];
140 /** Authentication info of the PDP profile */
141 net_auth_info_t AuthInfo;
142 /** Browser Home URL or MMS server URL */
143 char HomeURL[NET_HOME_URL_LEN_MAX+1];
145 char Mcc[NET_SIM_INFO_LEN+1];
147 char Mnc[NET_SIM_INFO_LEN+1];
148 /** Indicates whether the use of static IP or not */
151 /** Indicates Roaming mode */
153 /** This will be deprecated */
156 char Keyword[NET_PDP_APN_LEN_MAX+1];
161 /** Modem object path for PS cellular profile */
162 char PSModemPath[NET_PROFILE_NAME_LEN_MAX + 1];
164 /** network information */
165 net_dev_info_t net_info;
166 } net_pdp_profile_info_t;
169 * Profile data structures: Ethernet Interface
173 /** network information */
174 net_dev_info_t net_info;
175 } net_eth_profile_info_t;
178 * Profile data structures: Bluetooth Interface
182 /** network information */
183 net_dev_info_t net_info;
184 } net_bt_profile_info_t;
187 * Specific profile information related to each technology type
191 /** PDP Profile Information */
192 net_pdp_profile_info_t Pdp;
193 /** Wifi Profile Information */
194 net_wifi_profile_info_t Wlan;
195 /** Ethernet Profile Information */
196 net_eth_profile_info_t Ethernet;
197 /** Bluetooth Profile Information */
198 net_bt_profile_info_t Bluetooth;
199 } net_specific_profile_info_t;
202 * This is the profile structure exposed to applications.
206 /** Device Type of the profile */
207 net_device_t profile_type;
209 char ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
210 /** Specific profile information */
211 net_specific_profile_info_t ProfileInfo;
213 net_state_type_t ProfileState;
214 /** Service error state */
215 net_error_state_type_t ProfileErrorState;
216 /** Favourite flag */
218 } net_profile_info_t;
221 ==================================================================================================
223 ==================================================================================================
226 /*****************************************************************************************/
227 /* net_add_profile API function prototype
228 * int net_add_profile(net_service_type_t network_type, net_profile_info_t *prof_info);
232 * \brief Add new Profile.
234 * \par Sync (or) Async:
235 * This is a Synchronous API.
237 * \par Important Notes:
242 * \param[in] network_type A type of network service.
243 * \param[in] prof_info A pointer of New created Profile Information to be added.
245 * \par Async Response Message:
248 * \return Return Type (int) \n
249 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
250 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
251 * - NET_ERR_UNKNOWN - Any other error\n
252 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
254 * \par Prospective Clients:
255 * Network Connection Setting Applet, WLAN Setting UI Applet.
257 * \par Example of how this function would be called:
259 * net_profile_info_t prof_info;\n
261 * result = net_add_profile(NET_SERVICE_MMS, &prof_info);\n
262 * if(result == NET_ERR_NONE)
264 ******************************************************************************************/
265 int net_add_profile(net_service_type_t network_type, net_profile_info_t *prof_info);
267 /*****************************************************************************************/
269 /* net_reset_profile API function prototype
270 * int net_reset_profile(int type, int sim_id);
274 * \brief Reset to default Profile.
275 * (0 : Return to Default , 1: Delete profile)
277 * \par Sync (or) Async:
278 * This is a Asynchronous API.
280 * \par Important Notes:
285 * \param[in] type Reset style
287 * \par Async Response Message:
290 * \return Return Type (int) \n
291 * - NET_ERR_NONE - indicating that the operation has completed successfully.
292 * - NET_ERR_INVALID_PARAM - Invalid parameter
293 * - NET_ERR_UNKNOWN - Any other error
294 * - NET_ERR_IN_PROGRESS - Already in progress
295 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered
297 * \par Prospective Clients:
298 * Network Connection Setting Applet, WLAN Setting UI Applet.
300 * \par Example of how this function would be called:
304 * result = net_delete_profile(profile_name);
306 * if (result == NET_ERR_NONE)
308 ******************************************************************************************/
309 int net_reset_profile(int type, int sim_id);
311 /*****************************************************************************************/
313 /* net_delete_profile API function prototype
314 * int net_delete_profile(const char* profile_name);
318 * \brief Delete a specific existing Profile.
319 * (cellular : Delete profile, wifi : forgot AP)
321 * \par Sync (or) Async:
322 * This is a Synchronous API.
324 * \par Important Notes:
329 * \param[in] profile_name Profile name to be deleted.
331 * \par Async Response Message:
334 * \return Return Type (int) \n
335 * - NET_ERR_NONE - indicating that the operation has completed successfully.
336 * - NET_ERR_INVALID_PARAM - Invalid parameter
337 * - NET_ERR_UNKNOWN - Any other error
338 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered
340 * \par Prospective Clients:
341 * Network Connection Setting Applet, WLAN Setting UI Applet.
343 * \par Example of how this function would be called:
347 * result = net_delete_profile(profile_name);
349 * if (result == NET_ERR_NONE)
351 ******************************************************************************************/
352 int net_delete_profile(const char *profile_name);
354 /*****************************************************************************************/
355 /* net_get_profile_info API function prototype
356 * int net_get_profile_info(const char *profile_name, net_profile_info_t *prof_info);
360 * \brief Return the profile information referred by Profile Name.
362 * \par Sync (or) Async:
363 * This is a Synchronous API.
365 * \par Important Notes:
366 * On success, profile information shall be copied to prof_info parameter in net_profile_info_t format.
367 * If profile doesn't exist, error shall be returned.
372 * \param[in] profile_name Profile Identifier.
373 * \param[out] prof_info Buffer containing the profile.
375 * \par Async Response Message:
378 * \return Return Type (int) \n
379 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
380 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
381 * - NET_ERR_UNKNOWN - Any other error\n
382 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
384 * \par Prospective Clients:
387 * \par Example of how this function would be called:
389 * net_profile_info_t prof_info;\n
392 * result = net_get_profile_info(profile_name, &prof_info);\n
394 * if (result == NET_ERR_NONE)\n
396 ******************************************************************************************/
397 int net_get_profile_info(const char *profile_name, net_profile_info_t *prof_info);
399 /*****************************************************************************************/
400 /* net_modify_profile API function prototype
401 * int net_modify_profile(const char* profile_name, net_profile_info_t* prof_info);
405 * \brief Edit a specific existing Profile.
407 * \par Sync (or) Async:
408 * This is a Synchronous API.
410 * \par Important Notes:
415 * \param[in] profile_name Profile Identifier.
416 * \param[in] prof_info Changed Profile Information to be updated.
419 * \par Async Response Message:
422 * \return Return Type (int) \n
423 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
424 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
425 * - NET_ERR_UNKNOWN - Any other error\n
426 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
428 * \par Prospective Clients:
429 * Network Connection Setting Applet.
431 * \par Example of how this function would be called:
433 * net_profile_info_t prof_info;\n
436 * result = net_get_profile_info(profile_name, &prof_info);\n
437 * ......(Modifying ProfInfo)\n
439 * result = net_modify_profile(profile_name, &prof_info);\n
441 * if (result == NET_ERR_NONE)\n
443 ******************************************************************************************/
444 int net_modify_profile(const char *profile_name, net_profile_info_t *prof_info);
446 /*****************************************************************************************/
448 * @fn int net_get_profile_list(net_device_t device_type, net_profile_info_t **profile_list, int *count)
450 * This function request service list to ConnMan through dbus.
452 * \par Sync (or) Async:
453 * This is a Synchronous API.
455 * \param[in] device_type Type of device
456 * \param[out] profile_list Profile list. After use this, it should be free()
457 * \param[out] count Number of profile
459 * \return Return Type (int) \n
460 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
461 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
462 * - NET_ERR_UNKNOWN - Any other error\n
463 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
465 * \par Prospective Clients:
468 ******************************************************************************************/
469 int net_get_profile_list(net_device_t device_type, net_profile_info_t **profile_list, int *count);
471 /*****************************************************************************************/
473 * This function sets the default profile which provides the given cellular service.
475 * \par Sync (or) Async:
476 * This is a Synchronous API.
478 * \param[in] profile_name Profile Identifier.
480 * \par Prospective Clients:
483 ******************************************************************************************/
484 int net_set_default_cellular_service_profile(const char *profile_name);
486 /*****************************************************************************************/
488 * This function sets the default profile which provides the given cellular service.
490 * \par Sync (or) Async:
491 * This is a Asynchronous API.
493 * \param[in] profile_name Profile Identifier.
495 * \par Prospective Clients:
498 ******************************************************************************************/
499 int net_set_default_cellular_service_profile_async(const char *profile_name);
501 /*****************************************************************************************/
503 * This function gets the modem object path which provides the given subscriber id.
505 * \par Sync (or) Async:
506 * This is a Synchronous API.
508 * \param[in] sim_id Subscriber identity.
509 * \param[out] modem_path Multi-subscribers' object path. After use this, it should be free()
511 * \par Prospective Clients:
514 ******************************************************************************************/
515 int net_get_cellular_modem_object_path(char **modem_path, int sim_id);
523 #endif /* __cplusplus */