Add an API to access vconf via DBus
[platform/core/connectivity/libnet-client.git] / include / common / network-cm-intf.h
1 /*
2  * Network Client Library
3  *
4  * Copyright 2012 Samsung Electronics Co., Ltd
5  *
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
9  *
10  * http://www.tizenopensource.org/license
11  *
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.
17  *
18  */
19
20 #ifndef __NETWORK_CM_INTF_H__
21 #define __NETWORK_CM_INTF_H__
22
23 #include <stdbool.h>
24 #include "network-pm-intf.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 #ifndef DEPRECATED
31 #define DEPRECATED __attribute__((deprecated))
32 #endif
33
34 /**
35  * @file network-cm-intf.h
36  * @brief This file defines the interface of Connection Manager with the application.
37 */
38
39 /**
40  * \addtogroup  common_basic
41  * \{
42 */
43
44 /*==================================================================================================
45                                         CONSTANTS
46 ==================================================================================================*/
47
48 /*==================================================================================================
49                                         ENUMS
50 ==================================================================================================*/
51
52 /**
53  * @enum net_event_t
54  * Callback Event
55  */
56
57 typedef enum {
58         /** Open Connection Response Event*/
59         NET_EVENT_OPEN_RSP,
60
61         /** Close Connection Response Event*/
62         NET_EVENT_CLOSE_RSP,
63
64         /** Open connection Indication (auto join) */
65         NET_EVENT_OPEN_IND,
66
67         /** Connection Close Indication Event */
68         NET_EVENT_CLOSE_IND,
69
70         /** Network service(profile) state changed Indication Event*/
71         NET_EVENT_NET_STATE_IND,
72
73         /** Network IP change Indication Event\n
74          *  This is deprecated Event and maintained only for compatibility */
75         NET_EVENT_IP_CHANGE_IND,
76
77         /** Profile modify indication Event\n
78          *  This is deprecated Event and maintained only for compatibility */
79         NET_EVENT_PROFILE_MODIFY_IND,
80
81         /** Network configuration changed Event\n
82          *  This is deprecated Event and maintained only for compatibility */
83         NET_EVENT_NET_CONFIGURE_RSP,
84
85         /* Wi-Fi Specific events */
86
87         /** Wi-Fi interface Scan Response Event */
88         NET_EVENT_WIFI_SCAN_RSP,
89
90         /** Wi-Fi interface Scan Indication Event(BG scan) */
91         NET_EVENT_WIFI_SCAN_IND,
92
93         /** Wi-Fi interface MAC changed Event\n
94          *  This is deprecated Event and maintained only for compatibility */
95         NET_EVENT_WIFI_MAC_ID_IND,
96
97         /** Wi-Fi interface Power On/Off Response Event */
98         NET_EVENT_WIFI_POWER_RSP,
99
100         /** Specific Scan Response Event */
101         NET_EVENT_SPECIFIC_SCAN_RSP,
102
103         /** Wi-Fi interface Scan Indication Event(Specific scan) */
104         NET_EVENT_SPECIFIC_SCAN_IND,
105
106         /** Wi-Fi interface Power On/Off Indication Event */
107         NET_EVENT_WIFI_POWER_IND,
108
109         /** Wi-Fi interface WPS Response Event */
110         NET_EVENT_WIFI_WPS_RSP,
111
112         /** Set default cellular profile Response Event */
113         NET_EVENT_CELLULAR_SET_DEFAULT_RSP,
114
115         /** Reset default cellular profile Response Event */
116         NET_EVENT_CELLULAR_RESET_DEFAULT_RSP,
117
118         /** Wi-Fi interface Scanning Indication Event */
119         NET_EVENT_WIFI_SCANNING_IND,
120
121         /** Ethernet Cable Attached Event */
122         NET_EVENT_ETHERNET_CABLE_ATTACHED,
123
124         /** Ethernet Cable Detached Event */
125         NET_EVENT_ETHERNET_CABLE_DETACHED,
126
127         /** Network Type Changed Event */
128         NET_EVENT_NETWORK_TYPE_CHANGED,
129
130         /** IPv4 Address Changed Event */
131         NET_EVENT_IPV4_ADDRESS_CHANGED,
132
133         /** IPv6 Address Changed Event */
134         NET_EVENT_IPV6_ADDRESS_CHANGED,
135
136         /** Proxy Address Changed Event */
137         NET_EVENT_PROXY_ADDRESS_CHANGED,
138
139         /** Internet State Changed Event(Online) */
140         NET_EVENT_INTERNET_ONLINE_IND,
141
142         /** Internet State Changed Event(Offline) */
143         NET_EVENT_INTERNET_OFFLINE_IND,
144 } net_event_t;
145
146 /**
147  * \}
148  */
149
150 /**
151  * \addtogroup  common_info
152  * \{
153 */
154
155 /**
156 * @enum net_cm_network_status_t
157 * This enum indicates network status
158 */
159 typedef enum {
160         /** Service unknown */
161         NET_STATUS_UNKNOWN,
162         /** Not connected / Suspended / Idle / Connecting/ Disconnecting/ Killing*/
163         NET_STATUS_UNAVAILABLE,
164         /** Active */
165         NET_STATUS_AVAILABLE,
166 } net_cm_network_status_t;
167
168 /**
169  * @brief Enumerations of statistics type.
170  */
171 typedef enum {
172         NET_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0,             /**< Last received data */
173         NET_STATISTICS_TYPE_LAST_SENT_DATA = 1,                 /**< Last sent data */
174         NET_STATISTICS_TYPE_TOTAL_RECEIVED_DATA = 2,    /**< Total received data */
175         NET_STATISTICS_TYPE_TOTAL_SENT_DATA = 3,                /**< Total sent data */
176 } net_statistics_type_e;
177
178 /**
179  * \}
180  */
181
182 /**
183  * \addtogroup  common_basic
184  * \{
185 */
186
187 /*==================================================================================================
188                         STRUCTURES AND OTHER TYPEDEFS
189 ==================================================================================================*/
190
191 /**
192  * Event Info with Event on callback
193  */
194
195 typedef struct {
196         /** CM Asynchronous event */
197         net_event_t     event;
198         /** Profile Identifier corresponding to the event */
199         char            profile_name[NET_PROFILE_NAME_LEN_MAX+1];
200         /** Event Status */
201         net_err_t       Error;
202         /** Event data length */
203         int             datalength;
204         /** Event data: Depending on the event, Event Data will be
205         type-casted to the appropriate event info data structure */
206         void *          data;
207 } net_event_info_t;
208
209 /**
210  * Technology properties
211  */
212
213 typedef struct {
214         /** powered state */
215         char            powered;
216         /** connected state */
217         char            connected;
218 } net_tech_info_t;
219
220
221 /*****************************************************************************************/
222 /* Callback function prototype
223  * typedef void (*net_event_cb_t)(const net_event_info_t* net_event, void* user_data);
224  */
225
226 /**
227  * \brief callback function: used to notify client application about Asynchronous events.
228  * This callback function will be called in the Network Client Library(NCL) context.
229  *
230  * \par Important Notes:
231  * NCL will allocate the memory for event data.
232  * Once Context will return from callback then NCL will free the memory allocated to event data.
233  * Application is not supposed to free the memory pointed by net_event
234  *
235  * \param[out] net_event    Pointer to net_event_info_t structure
236  * \param[out] user_data    User can transfer the user specific data in callback
237  *
238  * \par Description of each event type(net_event->Event) :
239  *
240  * - NET_EVENT_OPEN_RSP \n
241  *     Response event for (net_open_connection_with_profile(), net_open_connection_with_preference(), net_open_connection_with_wifi_info())
242  *     to notify the result of open connection request.
243  *   - net_event->profile_name : Profile Identifier corresponding to the event
244  *   - net_event->Error       : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
245  *   - net_event->Data        : Pointer to net_profile_info_t (valid at NET_ERR_NONE, NET_ERR_ACTIVE_CONNECTION_EXISTS)
246  *     - If the connection open successfully or already exists for the given profile name,\n
247  *       application can get the connected profile information \n
248  *       If the connection is failed to establish, net_profile_info_t also contains NULL value
249  *
250  * - NET_EVENT_CLOSE_RSP \n
251  *     Response event for net_close_connection() to notify the result of close connection request.
252  *   - net_event->profile_name : Profile Identifier corresponding to the event
253  *   - net_event->Error       : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
254  *   - net_event->Data        : NULL (not used in this event)
255  *
256  * - NET_EVENT_OPEN_IND \n
257  *     Indication to notify the activation of a connection by any other application or auto-connection.
258  *   - net_event->profile_name : Profile Identifier corresponding to the event
259  *   - net_event->Error       : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
260  *   - net_event->Data        : Pointer to net_profile_info_t
261  *     - If NCL can't get profile info from ConnMan, net_profile_info_t contains NULL value
262  *
263  * - NET_EVENT_CLOSE_IND \n
264  *     Indication to notify the closure of an active connection due to network initiated termination or any other transport connectivity loss.
265  *   - net_event->profile_name : Profile Identifier corresponding to the event
266  *   - net_event->Error       : Its value will be NET_ERR_NONE always
267  *   - net_event->Data        : NULL (not used in this event)
268  *
269  * - NET_EVENT_NET_STATE_IND \n
270  *     Indication to notify that state of each serivce(profile) changed.\n
271  *     You can use this event to get more detailed state, but should be used carefully.\n
272  *     This event comes from ConnMan daemon via NCL, so you have to understand ConnMan's state.\n
273  *     There is no need to handle this event except under special circumstances.
274  *   - net_event->profile_name : Profile Identifier corresponding to the event
275  *   - net_event->Error       : Its value will be NET_ERR_NONE always
276  *   - net_event->Data        : Pointer to net_state_type_t
277  *
278  * - NET_EVENT_WIFI_SCAN_RSP \n
279  *     Response event for net_scan_wifi() to notify the result of scan request.
280  *   - net_event->profile_name : NULL (not used in this event)
281  *   - net_event->Error       : NET_ERR_NONE on success, negative values for errors
282  *   - net_event->Data        : NULL (not used in this event)
283  *
284  * - NET_EVENT_WIFI_SCAN_IND \n
285  *     Indication to notify that BG scan has been completed.
286  *   - net_event->profile_name : NULL (not used in this event)
287  *   - net_event->Error       : NET_ERR_NONE on success, negative values for errors
288  *   - net_event->Data        : NULL (not used in this event)
289  *
290  * - NET_EVENT_WIFI_POWER_RSP \n
291  *     Response event for (net_wifi_power_on(), net_wifi_power_off()) to notify the result of Wi-Fi power on request.
292  *   - net_event->profile_name : NULL (not used in this event)
293  *   - net_event->Error       : NET_ERR_NONE on success, negative values for errors
294  *   - net_event->Data        : Pointer to net_wifi_state_t (only WIFI_OFF/WIFI_ON/WIFI_UNKNOWN will be set)
295  *
296  * - NET_EVENT_WIFI_POWER_IND \n
297  *     Indication to notify that Wi-Fi power state has been changed.
298  *   - net_event->profile_name : NULL (not used in this event)
299  *   - net_event->Error       : NET_ERR_NONE on success, negative values for errors
300  *   - net_event->Data        : Pointer to net_wifi_state_t (only WIFI_OFF/WIFI_ON/WIFI_UNKNOWN will be set)
301  *
302  * - NET_EVENT_WIFI_WPS_RSP \n
303  *     Response event for net_wifi_enroll_wps() to notify the result of enroll wps request.
304  *   - net_event->profile_name : Profile Identifier corresponding to the event
305  *   - net_event->Error       : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
306  *   - net_event->Data        : Pointer to net_profile_info_t
307  *     - If the connection open successfully, application can get the connected profile information \n
308  *       If the connection is failed to establish, net_profile_info_t also contains NULL value
309  *
310  * - NET_EVENT_SPECIFIC_SCAN_IND \n
311  *     Response event for net_specific_scan_wifi() to notify the BSSs which are found.
312  *   - net_event->profile_name : NULL (not used in this event)
313  *   - net_event->Error       : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
314  *   - net_event->Data        : Pointer to GSList of struct ssid_scan_bss_info_t
315  *   - net_event->Datalength  : The number of BSSs which are found
316  *     - Do not delete and modify Data and Datalength and they are destroyed automatically
317  *
318  */
319
320 typedef void (*net_event_cb_t)(const net_event_info_t* net_event, void* user_data);
321
322 /*==================================================================================================
323                                 FUNCTION PROTOTYPES
324 ==================================================================================================*/
325
326 /*****************************************************************************************/
327 /* net_open_connection_with_profile API function prototype
328  * int net_open_connection_with_profile(const char *profile_name);
329  */
330
331 /**
332  * \brief  This API will establish a data connection with specific profile name
333  *
334  * \par Sync (or) Async:
335  * This is an Asynchronous API.
336  *
337  * \par Important Notes:
338  *        This API is a Non-Blocking API. Return value only implies whether the request is sent successfully or not. \n
339  *            Return value Success does not imply that the connection is established successfully. \n
340  *            If application needs to make a connection with specific profile name, it can make a connection with this api. \n
341  *            Get the profile name is referred to net_get_profile_list(). \n
342  *            If Connection is already existed, this API will share the active connection with the calling application. \n
343  *            If Connection is already existed, and same application is trying to open connection, this API will return error.
344  *
345  * \par Notes :
346  *
347  *      ConnMan requests transport plug-in interface to open a new connection only if connection is not already established. \n
348  *      If there is already a connection , then same connection will be shared.
349  *
350  * \warning
351  *  None
352  *
353  * \param [in]  profile_name     specific profile name
354  *
355  * \par Async Response Message:
356  *        NET_EVENT_OPEN_RSP: Connection Establishment response will be sent asynchronously to the App in the callback function registered.\n
357  *        refer to net_event_cb_t()
358  *
359  * \par Precondition:
360  *        Application must already be registered with the ConnMan.
361  *
362  * \return Return Type (int) \n
363  * - NET_ERR_NONE  - indicating that the operation has completed successfully. \n
364  * - NET_ERR_APP_NOT_REGISTERED -indicating that client is not registered with CM and it cannot use CM services.\n
365  * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
366  * - NET_ERR_INVALID_OPERATION  - indicating that open connection operation is not allowed in the current state.\n
367  * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
368  *
369  *
370  * \par Prospective Clients:
371  * External Apps.
372  *
373  * \par Example Program:
374  *
375  * int result;
376  *
377  * result = net_open_connection_with_profile(profile_name);
378  *
379  * if(result == NET_ERR_NONE)......
380  *
381  *
382  *
383 ******************************************************************************************/
384 int net_open_connection_with_profile(void *handle, const char *profile_name);
385
386 /*****************************************************************************************/
387 /* net_open_mesh_connection_with_profile API function prototype
388  * int net_open_mesh_connection_with_profile(const char *profile_name);
389  */
390
391 /**
392  * \brief  This API will establish a data connection with specific profile name
393  *
394  * \par Sync (or) Async:
395  * This is an Asynchronous API.
396  *
397  * \par Important Notes:
398  *        This API is a Non-Blocking API. Return value only implies whether the request is sent successfully or not. \n
399  *            Return value Success does not imply that the connection is established successfully. \n
400  *            If application needs to make a connection with specific profile name, it can make a connection with this api. \n
401  *            Get the profile name is referred to net_get_profile_list(). \n
402  *            If Connection is already existed, this API will share the active connection with the calling application. \n
403  *            If Connection is already existed, and same application is trying to open connection, this API will return error.
404  *
405  * \par Notes :
406  *
407  *      ConnMan requests transport plug-in interface to open a new connection only if connection is not already established. \n
408  *      If there is already a connection , then same connection will be shared.
409  *
410  * \warning
411  *  None
412  *
413  * \param [in]  profile_name     specific profile name
414  *
415  * \par Async Response Message:
416  *        NET_EVENT_OPEN_RSP: Connection Establishment response will be sent asynchronously to the App in the callback function registered.\n
417  *        refer to net_event_cb_t()
418  *
419  * \par Precondition:
420  *        Application must already be registered with the ConnMan.
421  *
422  * \return Return Type (int) \n
423  * - NET_ERR_NONE  - indicating that the operation has completed successfully. \n
424  * - NET_ERR_APP_NOT_REGISTERED -indicating that client is not registered with CM and it cannot use CM services.\n
425  * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
426  * - NET_ERR_INVALID_OPERATION  - indicating that open connection operation is not allowed in the current state.\n
427  * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
428  *
429  *
430  * \par Prospective Clients:
431  * External Apps.
432  *
433  * \par Example Program:
434  *
435  * int result;
436  *
437  * result = net_open_mesh_connection_with_profile(profile_name);
438  *
439  * if(result == NET_ERR_NONE)......
440  *
441  *
442  *
443 ******************************************************************************************/
444 int net_open_mesh_connection_with_profile(void *handle, const char *profile_name);
445
446 /*****************************************************************************************/
447 /* net_close_connection API function prototype
448  * int net_close_connection(const char *profile_name);
449  */
450
451 /**
452  * \brief       This API will terminate the connection. This API can also be used to abort a connection in progress.
453  *
454  * \par Sync (or) Async:
455  * This is an Asynchronous API.
456  *
457  * \par Important Notes:
458  *        This API is an Asynchronous API. Return value only implies whether the request is sent successfully or not. Return value Success doesn't imply that the connection is disconnected successfully.\n
459  *
460  * \warning
461  *  None
462  *
463  * \par Notes :
464  *              Application must be already registered with the ConnMan. \n
465  *
466  * \param [in]  profile_name     specific profile name
467  *
468  * \par Async Response Message:
469  *        NET_EVENT_CLOSE_RSP: Connection Close response will be sent asynchronously to the App in the callback function registered\n
470  *        refer to net_event_cb_t()
471  *
472  * \par Precondition:
473  *        Application must have an active data connection
474  *
475  * \return Return Type (int) \n
476  * - NET_ERR_NONE  - indicating that the operation has completed successfully. \n
477  * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
478  * - NET_ERR_INVALID_OPERATION  - indicating that close connection operation is not allowed in the current state.\n
479  * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
480  *
481  * \par Prospective Clients:
482  * External Apps.
483  *
484  * \par Example Program:
485  *
486  * int result;
487  *
488  * result = net_close_connection(profile_name);
489  *
490  * if(result == NET_ERR_NONE).........
491  *
492  *
493  *
494 ******************************************************************************************/
495 int net_close_connection(void *handle, const char *profile_name);
496
497 /*****************************************************************************************/
498 /* net_close_mesh_connection API function prototype
499  * int net_close_mesh_connection(const char *profile_name);
500  */
501
502 /**
503  * \brief       This API will terminate the connection. This API can also be used to abort a connection in progress.
504  *
505  * \par Sync (or) Async:
506  * This is an Asynchronous API.
507  *
508  * \par Important Notes:
509  *        This API is an Asynchronous API. Return value only implies whether the request is sent successfully or not. Return value Success doesn't imply that the connection is disconnected successfully.\n
510  *
511  * \warning
512  *  None
513  *
514  * \par Notes :
515  *              Application must be already registered with the ConnMan. \n
516  *
517  * \param [in]  profile_name     specific profile name
518  *
519  * \par Async Response Message:
520  *        NET_EVENT_CLOSE_RSP: Connection Close response will be sent asynchronously to the App in the callback function registered\n
521  *        refer to net_event_cb_t()
522  *
523  * \par Precondition:
524  *        Application must have an active data connection
525  *
526  * \return Return Type (int) \n
527  * - NET_ERR_NONE  - indicating that the operation has completed successfully. \n
528  * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
529  * - NET_ERR_INVALID_OPERATION  - indicating that close connection operation is not allowed in the current state.\n
530  * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
531  *
532  * \par Prospective Clients:
533  * External Apps.
534  *
535  * \par Example Program:
536  *
537  * int result;
538  *
539  * result = net_close_mesh_connection(profile_name);
540  *
541  * if(result == NET_ERR_NONE).........
542  *
543  *
544  *
545 ******************************************************************************************/
546 int net_close_mesh_connection(void *handle, const char *profile_name);
547
548 /**
549  * \}
550  */
551
552 /**
553  * \addtogroup  common_info
554  * \{
555 */
556
557 /*****************************************************************************************/
558 /* net_get_active_net_info API function prototype
559  * int net_get_active_net_info(net_profile_info_t *active_profile_info);
560  */
561
562 /**
563  * \brief  This API returns the information of active(default) network profile.
564  *
565  * \par Sync (or) Async:
566  * This is a Synchronous API.
567  *
568  * \par Important Notes:
569  *              On success, profile information shall be copied to active_profile_info parameter in net_profile_info_t format.
570  *
571  * \par Notes :
572  *  None
573  *
574  * \warning
575  *  None
576  *
577  * \param[out] active_profile_info      The information of active(default) network profile.
578  *
579  * \par Async Response Message:
580  *  None
581  *
582  * \par Precondition:
583  *        Application must already be registered with the CM server.
584  *
585  * \return Return Type (int) \n
586  * - NET_ERR_NONE  - indicating that the status of queried network interface is retrieved. \n
587  * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
588  * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
589  * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
590  * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
591  *
592  * \par Prospective Clients:
593  * External Apps.
594  *
595  * \par Example Program:
596  *
597  * net_profile_info_t active_profile_info;
598  *
599  * int result = net_get_active_net_info(&active_profile_info);
600  *
601  * if(result == NET_ERR_NONE)......
602  *
603  *
604  *
605 ******************************************************************************************/
606 int net_get_active_net_info(void *handle, net_profile_info_t *active_profile_info);
607
608 /*****************************************************************************************/
609 /* net_get_network_status API function prototype
610  * int net_get_network_status(net_device_t device_type, net_cm_network_status_t* network_status);
611  */
612
613 /**
614  * \brief  This API returns The status of a specific network interface passed as a parameter.
615  *
616  * \par Sync (or) Async:
617  * This is a Synchronous API.
618  *
619  * \par Important Notes:
620  *  None
621  *
622  * \par Notes :
623  *  None
624  *
625  * \warning
626  *  None
627  *
628  * \param[in] device_type Queried       network interface.
629  * \param[out] network_status   The status of Queried network interface.
630  *
631  * \par Async Response Message:
632  *  None
633  *
634  * \par Precondition:
635  *        Application must already be registered with the CM server.
636  *
637  * \return Return Type (int) \n
638  * - NET_ERR_NONE  - indicating that the status of queried network interface is retrieved. \n
639  * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
640  * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
641  * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
642  *
643  * \par Prospective Clients:
644  * External Apps.
645  *
646  * \par Example Program:
647  *
648  * net_cm_network_status_t status;
649  *
650  * int result = net_get_network_status(NET_MOBILE_TYPE, &status);
651  *
652  * if(result == TRUE)......
653  *
654  *
655  *
656 ******************************************************************************************/
657 int net_get_network_status(void *handle, net_device_t device_type, net_cm_network_status_t* network_status);
658
659 /**
660  * \}
661  */
662
663 /**
664  * \addtogroup  pdp_specific
665  * \{
666 */
667
668 /**
669  * \}
670  */
671
672 /**
673  * \addtogroup  common_extended
674  * \{
675 */
676
677 /**
678  * \brief       This API is only for Connection/Wi-Fi CAPI. Don't use this.
679  *
680  * \param[in] event_cb     Application Callback function pointer to receive ConnMan events
681  * \param[in] client_type  NET_DEVICE_DEFAULT : Connection CAPI, NET_DEVICE_WIFI : Wi-Fi CAPI
682  * \param[in] user_data    user data
683  *
684  ******************************************************************************************/
685 int net_register_client(void **handle, net_event_cb_t event_cb, void *user_data);
686
687 /**
688  * \brief       This API is only for Connection/Wi-Fi CAPI. Don't use this.
689  *
690  * \param[in] client_type  NET_DEVICE_DEFAULT : Connection CAPI, NET_DEVICE_WIFI : Wi-Fi CAPI
691  *
692  ******************************************************************************************/
693 void net_deregister_client(void *handle);
694
695 /**
696  * \brief       This API is only for Connection CAPI. Don't use this.
697  *
698  * \param[in]  ip_addr     ip address to route.
699  * \param[in]  interface   interface name.
700  * \param[in]  address_family address family of ip address.
701  *
702  ******************************************************************************************/
703 int net_add_route(void *handle, const char *ip_addr, const char *interface, int address_family);
704
705 /**
706  * \brief       This API is only for Connection CAPI. Don't use this.
707  *
708  * \param[in]  ip_addr     ip address to route.
709  * \param[in]  interface   interface name.
710  * \param[in]  address_family address family of ip address.
711  *
712  ******************************************************************************************/
713 int net_remove_route(void *handle, const char *ip_addr, const char *interface, int address_family);
714
715 /**
716  * \brief       This API is only for Connection CAPI. Don't use this.
717  *
718  * \param[in]  ip_addr     ip address to route.
719  * \param[in]  interface   interface name.
720  * \param[in]  address_family address family of ip address.
721  * \param[in]  gateway     The gateway address.
722  *
723  ******************************************************************************************/
724 int net_add_route_entry(void *handle, const char *ip_addr,
725                 const char *interface, int address_family, const char *gateway);
726
727 /**
728  * \brief       This API is only for Connection CAPI. Don't use this.
729  *
730  * \param[in]  ip_addr     ip address to route.
731  * \param[in]  interface   interface name.
732  * \param[in]  address_family address family of ip address.
733  * \param[in]  gateway     The gateway address.
734  *
735  ******************************************************************************************/
736 int net_remove_route_entry(void *handle, const char *ip_addr,
737                 const char *interface, int address_family, const char *gateway);
738
739 /**
740  * \brief       This API is only for Connection CAPI. Don't use this.
741  *
742  * \param[in]  ip_addr     ipv6 address to route.
743  * \param[in]  interface   interface name.
744  * \param[in]  address_family address family of ip address.
745  * \param[in]  gateway  gateway address.
746  *
747  ******************************************************************************************/
748 int net_add_route_ipv6(void *handle, const char *ip_addr,
749                 const char *interface, int address_family, const char *gateway);
750
751 /**
752  * \brief       This API is only for Connection CAPI. Don't use this.
753  *
754  * \param[in]  ip_addr     ipv6 address to route.
755  * \param[in]  interface   interface name.
756  * \param[in]  address_family address family of ip address.
757  * \param[in]  gateway  gateway address.
758  *
759  ******************************************************************************************/
760 int net_remove_route_ipv6(void *handle, const char *ip_addr,
761                 const char *interface, int address_family, const char *gateway);
762
763 /**
764  * \brief       This API is only for Connection CAPI. Don't use this.
765  *
766  * \param[in]  tid     TID in C#.
767  *
768  ******************************************************************************************/
769 void net_set_cs_tid(int tid, void *handle);
770
771 /**
772  * \brief       This API is only for Connection CAPI. Don't use this.
773  *
774  * \param[in]  tid     TID in C#.
775  *
776  ******************************************************************************************/
777 void net_unset_cs_tid(int tid, void *handle);
778
779 /*****************************************************************************************/
780 /* net_get_ethernet_cable_state API function prototype
781  * int net_get_ethernet_cable_state(int *state);
782  */
783
784 /**
785  * \brief       This API returns the ethernet cable status, 1 = Attached, 0 = Deatached.
786  *
787  * \param[out] state - Specifies the State of ethernet cable
788  *
789  * \par Sync (or) Async:
790  * This is a Synchronous API.
791  *
792  * \par Important Notes:
793  *  None
794  *
795  * \par Notes :
796  *  None
797  *
798  * \warning
799  *  None
800  *
801  *
802  * \par Async Response Message:
803  *  None
804  *
805  * \return Return Type (int) \n
806  * - NET_ERR_NONE - indicating that the status of ethernet plug in/out retrieved successfully.\n
807  * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
808  * - NET_ERR_INVALID_OPERATION - indicating that the API failed to retrieve the status of ethernet plug.\n
809  *
810  * \par Prospective Clients:
811  * External Apps.
812  *
813  *
814 ******************************************************************************************/
815 int net_get_ethernet_cable_state(void *handle, int *state);
816
817 /**
818  * \brief       This API is only for Connection CAPI. Don't use this.
819  *
820  * \param[out]  state   Indicating whether the default connection is metered.
821  *
822  ******************************************************************************************/
823 int net_get_metered_state(void *handle, int *state);
824
825 /**
826  * \brief       This API is only for Connection CAPI. Don't use this.
827  *
828  * \param[in]   handle    The network info handle.
829  * \param[out]  state     Indicating whether time is updated by NTP or not.
830  *
831  ******************************************************************************************/
832 int net_get_clock_update_info(void *handle, bool *state);
833
834 /**
835  * \brief       This API is only for Connection CAPI. Don't use this.
836  *
837  * \param[in] enable            Enable EAP over Ethernet network.
838  * \param[in] pofilename        Profile name of ethernet.
839  *
840  ******************************************************************************************/
841 int net_ethernet_eap_enable(gboolean enable, const char *profilename);
842
843 /**
844  * \brief       This API is only for Connection CAPI. Don't use this.
845  *
846  * \param[in] pofilename        Profile name of ethernet.
847  * \param[out] enabled          Indicating whether the EAP over Ethernet is enabled.
848  *
849  ******************************************************************************************/
850 int net_ethernet_eap_enabled(const char *profilename, gboolean *enabled);
851
852 /**
853  * \brief       This API is only for Connection CAPI. Don't use this.
854  *
855  * \param[in] net_info  Ethernet device information.
856  *
857  ******************************************************************************************/
858 int net_save_ethernet_eap_config(void *handle, net_dev_info_t *net_info);
859
860 /**
861  * \}
862  */
863
864 /**
865  * \addtogroup  common_info
866  * \{
867 */
868
869 /**
870  * \brief       Gets the statistics information.
871  *
872  * \param[in]  device_type     specific device type(cellular/wifi).
873  * \param[in]  statistics_type specific statistics type.
874  * \param[out] size            statistics value requested.
875  *
876  ******************************************************************************************/
877 int net_get_statistics(void *handle, net_device_t device_type,
878                 net_statistics_type_e statistics_type, unsigned long long *size);
879
880 /**
881  * \brief       Resets the statistics information.
882  *
883  * \param[in]  device_type     specific device type(cellular/wifi).
884  * \param[in]  statistics_type specific statistics type.
885  *
886  ******************************************************************************************/
887 int net_set_statistics(void *handle, net_device_t device_type,
888                 net_statistics_type_e statistics_type);
889
890 /**
891  * \brief Start TCP dump.
892  *
893  *
894  ******************************************************************************************/
895 int net_start_tcpdump(void *handle);
896
897 /**
898  * \brief Stop TCP dump.
899  *
900  *
901  ******************************************************************************************/
902 int net_stop_tcpdump(void *handle);
903
904 /**
905  * \brief Get TCP dump running status.
906  *
907  * \param[out]  is_tcpdump_running       True or false boolean, tcpdump is in progress or not running
908  *
909  ******************************************************************************************/
910 gboolean net_get_tcpdump_state(void *handle, gboolean *is_tcpdump_running);
911
912 /**
913  * \brief Get vconf value via dbus.
914  *
915  * \param[in]  handle     libnet-client handle.
916  * \param[in]  key        Vconf key.
917  * \param[in]  type       Vconf data type(string, int, bool).
918  * \param[out] ret        Return value.
919  * \param[out] int_value  Vconf value for int or bool type.
920  * \param[out] str_value  Vconf value for string type.
921  *
922  ******************************************************************************************/
923 int net_get_vconf_value(void *handle, const char *key, const char *type,
924                 int *ret, int *int_value, char **str_value);
925
926 /**
927  * \}
928  */
929
930 #ifdef __cplusplus
931 }
932 #endif /* __cplusplus */
933
934 #endif