2 * Network Client Library
4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (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.
21 #ifndef __NETWORK_PM_INTF_H__
22 #define __NETWORK_PM_INTF_H__
28 #endif /* __cplusplus */
31 * @file network-pm-intf.h
32 * @brief This file defines the interface of Profile Manager with the application/Connection Manager.
36 * \addtogroup profile_managing
41 #define DEPRECATED __attribute__((deprecated))
43 /*==================================================================================================
45 ==================================================================================================*/
47 #include "network-pm-wlan.h"
49 /*==================================================================================================
51 ==================================================================================================*/
53 /*==================================================================================================
55 ==================================================================================================*/
58 * @enum net_pdp_type_t
59 * This enumeration defines the pdp protocol type.
64 NET_PDP_TYPE_NONE = 0x00,
74 * @enum net_state_type_t
75 * This enumeration defines the service state type.
80 NET_STATE_TYPE_UNKNOWN = 0x00,
84 NET_STATE_TYPE_FAILURE,
85 /** Association state */
86 NET_STATE_TYPE_ASSOCIATION,
87 /** Configuration state */
88 NET_STATE_TYPE_CONFIGURATION,
92 NET_STATE_TYPE_ONLINE,
94 NET_STATE_TYPE_DISCONNECT,
98 /*==================================================================================================
99 STRUCTURES AND OTHER TYPEDEFS
100 ==================================================================================================*/
104 * Profile data structures: Used between Application and PM Plug-in Interface
108 /** Specifies a protocol type */
109 net_pdp_type_t ProtocolType;
110 /** Specifies a service type(Internet, MMS, WAP, etc...) */
111 net_service_type_t ServiceType;
112 /** Network Access Point Name */
113 char Apn[NET_PDP_APN_LEN_MAX+1];
114 /** Authentication info of the PDP profile */
115 net_auth_info_t AuthInfo;
116 /** Browser Home URL or MMS server URL */
117 char HomeURL[NET_HOME_URL_LEN_MAX+1];
119 char Mcc[NET_SIM_INFO_LEN+1];
121 char Mnc[NET_SIM_INFO_LEN+1];
122 /** Indicates whether the use of static IP or not */
125 /** Indicates Roaming mode */
127 /** This will be deprecated */
130 /** network information */
131 net_dev_info_t net_info;
132 } net_pdp_profile_info_t;
135 * Profile data structures: Ethernet Interface
139 /** network information */
140 net_dev_info_t net_info;
141 } net_eth_profile_info_t;
144 * Specific profile information related to each technology type
148 /** PDP Profile Information */
149 net_pdp_profile_info_t Pdp;
150 /** Wifi Profile Information */
151 net_wifi_profile_info_t Wlan;
152 /** Wifi Profile Information */
153 net_eth_profile_info_t Ethernet;
154 } net_specific_profile_info_t;
157 * This is the profile structure exposed to applications.
161 /** Device Type of the profile */
162 net_device_t profile_type;
164 char ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
165 /** Specific profile information */
166 net_specific_profile_info_t ProfileInfo;
168 net_state_type_t ProfileState;
169 /** Favourite flag */
171 } net_profile_info_t;
174 ==================================================================================================
176 ==================================================================================================
179 /*****************************************************************************************/
180 /* net_add_profile API function prototype
181 * int net_add_profile(net_service_type_t network_type, net_profile_info_t *prof_info);
185 * \brief Add new Profile.
187 * \par Sync (or) Async:
188 * This is a Synchronous API.
190 * \par Important Notes:
195 * \param[in] network_type A type of network service.
196 * \param[in] prof_info A pointer of New created Profile Information to be added.
198 * \par Async Response Message:
201 * \return Return Type (int) \n
202 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
203 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
204 * - NET_ERR_UNKNOWN - Any other error\n
205 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
207 * \par Prospective Clients:
208 * Network Connection Setting Applet, WLAN Setting UI Applet.
210 * \par Example of how this function would be called:
212 * net_profile_info_t prof_info;\n
214 * result = net_add_profile( NET_SERVICE_MMS, &prof_info ); \n
215 * if(result == NET_ERR_NONE)
217 ******************************************************************************************/
218 int net_add_profile(net_service_type_t network_type, net_profile_info_t *prof_info);
220 /*****************************************************************************************/
221 /* net_delete_profile API function prototype
222 * int net_delete_profile(const char* profile_name);
226 * \brief Delete a specific existing Profile.
227 * (cellular : Delete profile, wifi : forgot AP)
229 * \par Sync (or) Async:
230 * This is a Synchronous API.
232 * \par Important Notes:
237 * \param[in] profile_name Profile name to be deleted.
239 * \par Async Response Message:
242 * \return Return Type (int) \n
243 * - NET_ERR_NONE - indicating that the operation has completed successfully.
244 * - NET_ERR_INVALID_PARAM - Invalid parameter
245 * - NET_ERR_UNKNOWN - Any other error
246 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered
248 * \par Prospective Clients:
249 * Network Connection Setting Applet, WLAN Setting UI Applet.
251 * \par Example of how this function would be called:
255 * result = net_delete_profile(profile_name);
257 * if (result == NET_ERR_NONE)
259 ******************************************************************************************/
260 int net_delete_profile(const char *profile_name);
262 /*****************************************************************************************/
263 /* net_get_profile_info API function prototype
264 * int net_get_profile_info(const char *profile_name, net_profile_info_t *prof_info);
268 * \brief Return the profile information referred by Profile Name.
270 * \par Sync (or) Async:
271 * This is a Synchronous API.
273 * \par Important Notes:
274 * On success, profile information shall be copied to prof_info parameter in net_profile_info_t format.
275 * If profile doesn't exist, error shall be returned.
280 * \param[in] profile_name Profile Identifier.
281 * \param[out] prof_info Buffer containing the profile.
283 * \par Async Response Message:
286 * \return Return Type (int) \n
287 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
288 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
289 * - NET_ERR_UNKNOWN - Any other error\n
290 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
292 * \par Prospective Clients:
295 * \par Example of how this function would be called:
297 * net_profile_info_t prof_info;\n
300 * result = net_get_profile_info(profile_name, &prof_info);\n
302 * if (result == NET_ERR_NONE)\n
304 ******************************************************************************************/
305 int net_get_profile_info(const char *profile_name, net_profile_info_t *prof_info);
307 /*****************************************************************************************/
308 /* net_modify_profile API function prototype
309 * int net_modify_profile(const char* profile_name, net_profile_info_t* prof_info);
313 * \brief Edit a specific existing Profile.
315 * \par Sync (or) Async:
316 * This is a Synchronous API.
318 * \par Important Notes:
323 * \param[in] profile_name Profile Identifier.
324 * \param[in] prof_info Changed Profile Information to be updated.
327 * \par Async Response Message:
330 * \return Return Type (int) \n
331 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
332 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
333 * - NET_ERR_UNKNOWN - Any other error\n
334 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
336 * \par Prospective Clients:
337 * Network Connection Setting Applet.
339 * \par Example of how this function would be called:
341 * net_profile_info_t prof_info;\n
344 * result = net_get_profile_info(profile_name, &prof_info);\n
345 * ......(Modifying ProfInfo)\n
347 * result = net_modify_profile(profile_name, &prof_info);\n
349 * if (result == NET_ERR_NONE)\n
351 ******************************************************************************************/
352 int net_modify_profile(const char *profile_name, net_profile_info_t *prof_info);
354 /*****************************************************************************************/
356 * @fn int net_get_profile_list(net_device_t device_type, net_profile_info_t **profile_list, int *count)
358 * This function request service list to ConnMan through dbus.
360 * \par Sync (or) Async:
361 * This is a Synchronous API.
363 * \param[in] device_type Type of device
364 * \param[out] profile_list Profile list. After use this, it should be free()
365 * \param[out] count Number of profile
367 * \return Return Type (int) \n
368 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
369 * - NET_ERR_INVALID_PARAM - Invalid parameter\n
370 * - NET_ERR_UNKNOWN - Any other error\n
371 * - NET_ERR_APP_NOT_REGISTERED - Client is invalid may be unregistered\n
373 * \par Prospective Clients:
376 ******************************************************************************************/
377 int net_get_profile_list(net_device_t device_type, net_profile_info_t **profile_list, int *count);
385 #endif /* __cplusplus */