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_CM_INTF_H__
21 #define __NETWORK_CM_INTF_H__
23 #include "network-pm-intf.h"
27 #endif /* __cplusplus */
30 #define DEPRECATED __attribute__((deprecated))
34 * @file network-cm-intf.h
35 * @brief This file defines the interface of Connection Manager with the application.
39 * \addtogroup common_basic
43 /*==================================================================================================
45 ==================================================================================================*/
47 /*==================================================================================================
49 ==================================================================================================*/
58 /** Open Connection Response Event*/
61 /** Close Connection Response Event*/
64 /** Open connection Indication (auto join) */
67 /** Connection Close Indication Event */
70 /** Network service(profile) state changed Indication Event*/
71 NET_EVENT_NET_STATE_IND,
73 /** Network IP change Indication Event\n
74 * This is deprecated Event and maintained only for compatibility */
75 NET_EVENT_IP_CHANGE_IND,
77 /** Profile modify indication Event\n
78 * This is deprecated Event and maintained only for compatibility */
79 NET_EVENT_PROFILE_MODIFY_IND,
81 /** Network configuration changed Event\n
82 * This is deprecated Event and maintained only for compatibility */
83 NET_EVENT_NET_CONFIGURE_RSP,
85 /* Wi-Fi Specific events */
87 /** Wi-Fi interface Scan Response Event */
88 NET_EVENT_WIFI_SCAN_RSP,
90 /** Wi-Fi interface Scan Indication Event(BG scan) */
91 NET_EVENT_WIFI_SCAN_IND,
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,
97 /** Wi-Fi interface Power On/Off Response Event */
98 NET_EVENT_WIFI_POWER_RSP,
100 /** Specific Scan Response Event */
101 NET_EVENT_SPECIFIC_SCAN_RSP,
103 /** Wi-Fi interface Scan Indication Event(Specific scan) */
104 NET_EVENT_SPECIFIC_SCAN_IND,
106 /** Wi-Fi interface Power On/Off Indication Event */
107 NET_EVENT_WIFI_POWER_IND,
109 /** Wi-Fi interface WPS Response Event */
110 NET_EVENT_WIFI_WPS_RSP,
112 /** Set default cellular profile Response Event */
113 NET_EVENT_CELLULAR_SET_DEFAULT_RSP,
115 /** Reset default cellular profile Response Event */
116 NET_EVENT_CELLULAR_RESET_DEFAULT_RSP,
118 /** Wi-Fi interface Scanning Indication Event */
119 NET_EVENT_WIFI_SCANNING_IND,
121 /** Wi-Fi interface Scan Indication Event(WPS scan) */
122 NET_EVENT_WPS_SCAN_IND,
124 /** Ethernet Cable Attached Event */
125 NET_EVENT_ETHERNET_CABLE_ATTACHED,
127 /** Ethernet Cable Detached Event */
128 NET_EVENT_ETHERNET_CABLE_DETACHED,
130 /** Wi-Fi TDLS Peer Connected EVENT */
131 NET_EVENT_TDLS_CONNECTED_IND,
133 /** Wi-Fi TDLS Peer Disconnect EVENT */
134 NET_EVENT_TDLS_DISCONNECTED_IND,
142 * \addtogroup common_info
147 * @enum net_cm_network_status_t
148 * This enum indicates network status
152 /** Service unknown */
154 /** Not connected / Suspended / Idle / Connecting/ Disconnecting/ Killing*/
155 NET_STATUS_UNAVAILABLE,
157 NET_STATUS_AVAILABLE,
158 } net_cm_network_status_t;
161 * @brief Enumerations of statistics type.
165 NET_STATISTICS_TYPE_LAST_RECEIVED_DATA = 0, /**< Last received data */
166 NET_STATISTICS_TYPE_LAST_SENT_DATA = 1, /**< Last sent data */
167 NET_STATISTICS_TYPE_TOTAL_RECEIVED_DATA = 2, /**< Total received data */
168 NET_STATISTICS_TYPE_TOTAL_SENT_DATA = 3, /**< Total sent data */
169 } net_statistics_type_e;
176 * \addtogroup common_basic
180 /*==================================================================================================
181 STRUCTURES AND OTHER TYPEDEFS
182 ==================================================================================================*/
185 * Event Info with Event on callback
190 /** CM Asynchronous event */
192 /** Profile Identifier corresponding to the event */
193 char ProfileName[NET_PROFILE_NAME_LEN_MAX+1];
196 /** Event data length */
198 /** Event data: Depending on the event, Event Data will be
199 type-casted to the appropriate event info data structure */
204 * Technology properties
211 /** connected state */
216 /*****************************************************************************************/
217 /* Callback function prototype
218 * typedef void (*net_event_cb_t)(const net_event_info_t* net_event, void* user_data);
222 * \brief callback function: used to notify client application about Asynchronous events.
223 * This callback function will be called in the Network Client Library(NCL) context.
225 * \par Important Notes:
226 * NCL will allocate the memory for event data.
227 * Once Context will return from callback then NCL will free the memory allocated to event data.
228 * Application is not supposed to free the memory pointed by net_event
230 * \param[out] net_event Pointer to net_event_info_t structure
231 * \param[out] user_data User can transfer the user specific data in callback
233 * \par Description of each event type(net_event->Event) :
235 * - NET_EVENT_OPEN_RSP \n
236 * Response event for (net_open_connection_with_profile(), net_open_connection_with_preference(), net_open_connection_with_wifi_info())
237 * to notify the result of open connection request.
238 * - net_event->ProfileName : Profile Identifier corresponding to the event
239 * - net_event->Error : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
240 * - net_event->Data : Pointer to net_profile_info_t (valid at NET_ERR_NONE, NET_ERR_ACTIVE_CONNECTION_EXISTS)
241 * - If the connection open successfully or already exists for the given profile name,\n
242 * application can get the connected profile information \n
243 * If the connection is failed to establish, net_profile_info_t also contains NULL value
245 * - NET_EVENT_CLOSE_RSP \n
246 * Response event for net_close_connection() to notify the result of close connection request.
247 * - net_event->ProfileName : Profile Identifier corresponding to the event
248 * - net_event->Error : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
249 * - net_event->Data : NULL (not used in this event)
251 * - NET_EVENT_OPEN_IND \n
252 * Indication to notify the activation of a connection by any other application or auto-connection.
253 * - net_event->ProfileName : Profile Identifier corresponding to the event
254 * - net_event->Error : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
255 * - net_event->Data : Pointer to net_profile_info_t
256 * - If NCL can't get profile info from ConnMan, net_profile_info_t contains NULL value
258 * - NET_EVENT_CLOSE_IND \n
259 * Indication to notify the closure of an active connection due to network initiated termination or any other transport connectivity loss.
260 * - net_event->ProfileName : Profile Identifier corresponding to the event
261 * - net_event->Error : Its value will be NET_ERR_NONE always
262 * - net_event->Data : NULL (not used in this event)
264 * - NET_EVENT_NET_STATE_IND \n
265 * Indication to notify that state of each serivce(profile) changed.\n
266 * You can use this event to get more detailed state, but should be used carefully.\n
267 * This event comes from ConnMan daemon via NCL, so you have to understand ConnMan's state.\n
268 * There is no need to handle this event except under special circumstances.
269 * - net_event->ProfileName : Profile Identifier corresponding to the event
270 * - net_event->Error : Its value will be NET_ERR_NONE always
271 * - net_event->Data : Pointer to net_state_type_t
273 * - NET_EVENT_WIFI_SCAN_RSP \n
274 * Response event for net_scan_wifi() to notify the result of scan request.
275 * - net_event->ProfileName : NULL (not used in this event)
276 * - net_event->Error : NET_ERR_NONE on success, negative values for errors
277 * - net_event->Data : NULL (not used in this event)
279 * - NET_EVENT_WIFI_SCAN_IND \n
280 * Indication to notify that BG scan has been completed.
281 * - net_event->ProfileName : NULL (not used in this event)
282 * - net_event->Error : NET_ERR_NONE on success, negative values for errors
283 * - net_event->Data : NULL (not used in this event)
285 * - NET_EVENT_WIFI_POWER_RSP \n
286 * Response event for (net_wifi_power_on(), net_wifi_power_off()) to notify the result of Wi-Fi power on request.
287 * - net_event->ProfileName : NULL (not used in this event)
288 * - net_event->Error : NET_ERR_NONE on success, negative values for errors
289 * - net_event->Data : Pointer to net_wifi_state_t (only WIFI_OFF/WIFI_ON/WIFI_UNKNOWN will be set)
291 * - NET_EVENT_WIFI_POWER_IND \n
292 * Indication to notify that Wi-Fi power state has been changed.
293 * - net_event->ProfileName : NULL (not used in this event)
294 * - net_event->Error : NET_ERR_NONE on success, negative values for errors
295 * - net_event->Data : Pointer to net_wifi_state_t (only WIFI_OFF/WIFI_ON/WIFI_UNKNOWN will be set)
297 * - NET_EVENT_WIFI_WPS_RSP \n
298 * Response event for net_wifi_enroll_wps() to notify the result of enroll wps request.
299 * - net_event->ProfileName : Profile Identifier corresponding to the event
300 * - net_event->Error : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
301 * - net_event->Data : Pointer to net_profile_info_t
302 * - If the connection open successfully, application can get the connected profile information \n
303 * If the connection is failed to establish, net_profile_info_t also contains NULL value
305 * - NET_EVENT_SPECIFIC_SCAN_IND \n
306 * Response event for net_specific_scan_wifi() to notify the BSSs which are found.
307 * - net_event->ProfileName : NULL (not used in this event)
308 * - net_event->Error : Its value will be NET_ERR_NONE in case of success and error cause in case of failure
309 * - net_event->Data : Pointer to GSList of struct ssid_scan_bss_info_t
310 * - net_event->Datalength : The number of BSSs which are found
311 * - Do not delete and modify Data and Datalength and they are destroyed automatically
315 typedef void (*net_event_cb_t)(const net_event_info_t* net_event, void* user_data);
317 /*==================================================================================================
319 ==================================================================================================*/
321 /*****************************************************************************************/
322 /* net_register_client API function prototype
323 * int net_register_client(net_event_cb_t event_cb, void *user_data);
327 * \brief This API shall register the client application with the ConnMan.
329 * \par Sync (or) Async:
330 * This is a Synchronous API.
332 * \par Important Notes:
333 * It is mandatory for the client application to register with ConnMan with this API before using any of its services.\n
334 * The value of event_cb cannot be NULL. Otherwise, error NET_ERR_INVALID_PARAM will be returned by the API.\n
335 * All the Asynchronous Events from ConnMan will be sent to the client App through the callback function (event_cb) registered with this API.
340 * \param[in] event_cb Application Callback function pointer to receive ConnMan events
341 * \param[in] user_data user data
343 * \par Async Response Message:
348 * \return Return Type (int) \n
349 * - NET_ERR_NONE - indicating that the operation has completed successfully.\n
350 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
351 * - NET_ERR_APP_ALREADY_REGISTERED - indicating that client application is already registered,it can't be registered again.\n
352 * - NET_ERR_UNKNOWN - indicating that registration has failed.\n
354 * \par Prospective Clients:
357 * \par Example Program:
361 * result = net_register_client(event_cb , user_data);
363 * if(result == NET_ERR_NONE).........
367 ******************************************************************************************/
368 int net_register_client(net_event_cb_t event_cb, void *user_data);
370 /*****************************************************************************************/
371 /* net_deregister_client API function prototype
372 * int net_deregister_client(void);
376 * \brief This API shall deregister the client application with the ConnMan.
378 * \par Sync (or) Async:
379 * This is a Synchronous API.
381 * \par Important Notes:
382 * After deregistration, Application will be restricted from using other ConnMan APIs/Services.\n
383 * De-register is not allowed when any connection is in active or transition state (activation or deactivation in progress).
389 * \par Async Response Message:
393 * Application must already be registered with the ConnMan.
395 * \return Return Type (int) \n
396 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
397 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
398 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
401 * \par Prospective Clients:
404 * \par Example Program:
408 * result = net_deregister_client();
410 * if(result == NET_ERR_NONE).........
414 ******************************************************************************************/
415 int net_deregister_client(void);
417 /*****************************************************************************************/
418 /* net_open_connection_with_profile API function prototype
419 * int net_open_connection_with_profile(const char *profile_name);
423 * \brief This API will establish a data connection with specific profile name
425 * \par Sync (or) Async:
426 * This is an Asynchronous API.
428 * \par Important Notes:
429 * This API is a Non-Blocking API. Return value only implies whether the request is sent successfully or not. \n
430 * Return value Success does not imply that the connection is established successfully. \n
431 * If application needs to make a connection with specific profile name, it can make a connection with this api. \n
432 * Get the profile name is referred to net_get_profile_list(). \n
433 * If Connection is already existed, this API will share the active connection with the calling application. \n
434 * If Connection is already existed, and same application is trying to open connection, this API will return error.
438 * ConnMan requests transport plug-in interface to open a new connection only if connection is not already established. \n
439 * If there is already a connection , then same connection will be shared.
444 * \param [in] profile_name specific profile name
446 * \par Async Response Message:
447 * NET_EVENT_OPEN_RSP: Connection Establishment response will be sent asynchronously to the App in the callback function registered.\n
448 * refer to net_event_cb_t()
451 * Application must already be registered with the ConnMan.
453 * \return Return Type (int) \n
454 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
455 * - NET_ERR_APP_NOT_REGISTERED -indicating that client is not registered with CM and it cannot use CM services.\n
456 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
457 * - NET_ERR_INVALID_OPERATION - indicating that open connection operation is not allowed in the current state.\n
458 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
461 * \par Prospective Clients:
464 * \par Example Program:
468 * result = net_open_connection_with_profile(profile_name);
470 * if(result == NET_ERR_NONE)......
474 ******************************************************************************************/
475 int net_open_connection_with_profile(const char *profile_name);
477 /*****************************************************************************************/
478 /* net_open_connection_with_preference API function prototype
479 * int net_open_connection_with_preference(net_service_type_t service_type);
483 * \brief This API will establish a data connection with specific service type
485 * \par Sync (or) Async:
486 * This is an Asynchronous API.
488 * \par Important Notes:
489 * This API is a Non-Blocking API. Return value only implies whether the request is sent successfully or not. \n
490 * Return value Success does not imply that the connection is established successfully. \n
491 * If application needs to make a connection with specific service type, it can make a connection with this api. \n
492 * If Connection is already existed, this API will share the active connection with the calling application. \n
493 * If Connection is already exited, and same application is trying to open connection, this API will return error.
497 * ConnMan requests transport plug-in interface to open a new connection only if connection is not already established. \n
498 * If there is already a connection , then same connection will be shared.
503 * \param [in] service_type specific service type
505 * \par Async Response Message:
506 * NET_EVENT_OPEN_RSP: Connection Establishment response will be sent asynchronously to the App in the callback function registered.\n
507 * refer to net_event_cb_t()
510 * Application must already be registered with the ConnMan.
512 * \return Return Type (int) \n
513 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
514 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
515 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
516 * - NET_ERR_INVALID_OPERATION - indicating that open connection operation is not allowed in the current state.\n
517 * - NET_ERR_NO_SERVICE - indicating that service is not found.\n
518 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
521 * \par Prospective Clients:
524 * \par Example Program:
528 * result = net_open_connection_with_preference(service_type);
530 * if(result == NET_ERR_NONE)......
534 ******************************************************************************************/
535 int net_open_connection_with_preference(net_service_type_t service_type);
537 /*****************************************************************************************/
538 /* net_close_connection API function prototype
539 * int net_close_connection(const char *profile_name);
543 * \brief This API will terminate the connection. This API can also be used to abort a connection in progress.
545 * \par Sync (or) Async:
546 * This is an Asynchronous API.
548 * \par Important Notes:
549 * 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
555 * Application must be already registered with the ConnMan. \n
557 * \param [in] profile_name specific profile name
559 * \par Async Response Message:
560 * NET_EVENT_CLOSE_RSP: Connection Close response will be sent asynchronously to the App in the callback function registered\n
561 * refer to net_event_cb_t()
564 * Application must have an active data connection
566 * \return Return Type (int) \n
567 * - NET_ERR_NONE - indicating that the operation has completed successfully. \n
568 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
569 * - NET_ERR_INVALID_OPERATION - indicating that close connection operation is not allowed in the current state.\n
570 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
572 * \par Prospective Clients:
575 * \par Example Program:
579 * result = net_close_connection(profile_name);
581 * if(result == NET_ERR_NONE).........
585 ******************************************************************************************/
586 int net_close_connection(const char *profile_name);
593 * \addtogroup common_info
597 /*****************************************************************************************/
598 /* net_get_active_net_info API function prototype
599 * int net_get_active_net_info(net_profile_info_t *active_profile_info);
603 * \brief This API returns the information of active(default) network profile.
605 * \par Sync (or) Async:
606 * This is a Synchronous API.
608 * \par Important Notes:
609 * On success, profile information shall be copied to active_profile_info parameter in net_profile_info_t format.
617 * \param[out] active_profile_info The information of active(default) network profile.
619 * \par Async Response Message:
623 * Application must already be registered with the CM server.
625 * \return Return Type (int) \n
626 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
627 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
628 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
629 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
630 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
632 * \par Prospective Clients:
635 * \par Example Program:
637 * net_profile_info_t active_profile_info;
639 * int result = net_get_active_net_info(&active_profile_info);
641 * if(result == NET_ERR_NONE)......
645 ******************************************************************************************/
646 int net_get_active_net_info(net_profile_info_t *active_profile_info);
648 /*****************************************************************************************/
650 * \brief This API returns ip address of active(default) network profile.
652 * \par Sync (or) Async:
653 * These is a Synchronous API.
655 * \par Important Notes:
656 * On success, the information shall be copied to the parameter in each format.
658 * \param[out] ip_address ip address of active(default) network profile.
661 * Application must already be registered with the CM server.
663 * \return Return Type (int) \n
664 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
665 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
666 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
667 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
668 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
670 * \par Prospective Clients:
673 * \par Example Program:
675 * net_addr_t ip_address;
677 * int result = net_get_active_ipaddress(&ip_address);
679 * if(result == NET_ERR_NONE)......
681 ******************************************************************************************/
682 int net_get_active_ipaddress(net_addr_t *ip_address);
684 /*****************************************************************************************/
686 * \brief This API returns netmask address of active(default) network profile.
688 * \par Sync (or) Async:
689 * These is a Synchronous API.
691 * \par Important Notes:
692 * On success, the information shall be copied to the parameter in each format.
694 * \param[out] netmask netmask address of active(default) network profile.
697 * Application must already be registered with the CM server.
699 * \return Return Type (int) \n
700 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
701 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
702 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
703 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
704 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
706 * \par Prospective Clients:
709 * \par Example Program:
711 * net_addr_t netmask;
713 * int result = net_get_active_netmask(&netmask);
715 * if(result == NET_ERR_NONE)......
717 ******************************************************************************************/
718 int net_get_active_netmask(net_addr_t *netmask);
720 /*****************************************************************************************/
722 * \brief This API returns ipv6 address of active(default) network profile.
724 * \par Sync (or) Async:
725 * These is a Synchronous API.
727 * \par Important Notes:
728 * On success, the information shall be copied to the parameter in each format.
730 * \param[out] ip_address6 ipv6 address of active(default) network profile.
733 * Application must already be registered with the CM server.
735 * \return Return Type (int) \n
736 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
737 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
738 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
739 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
740 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
742 * \par Prospective Clients:
745 * \par Example Program:
747 * net_addr_t ip_address6;
749 * int result = net_get_active_ipaddress6(&ip_address6);
751 * if(result == NET_ERR_NONE)......
753 ******************************************************************************************/
754 int net_get_active_ipaddress6(net_addr_t *ip_address6);
756 /*****************************************************************************************/
758 * \brief This API returns Prefix Length of IPv6 address of active(default) network profile.
760 * \par Sync (or) Async:
761 * These is a Synchronous API.
763 * \par Important Notes:
764 * On success, the information shall be copied to the parameter in each format.
766 * \param[out] prefixlen6 Prefix Length of IPv6 address of active(default) network profile.
769 * Application must already be registered with the CM server.
771 * \return Return Type (int) \n
772 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
773 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
774 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
775 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
776 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
778 * \par Prospective Clients:
781 * \par Example Program:
785 * int result = net_get_active_prefixlen6(&prefixlen6);
787 * if(result == NET_ERR_NONE)......
789 ******************************************************************************************/
790 int net_get_active_prefixlen6(int *prefixlen6);
792 /*****************************************************************************************/
794 * \brief This API returns gateway address of active(default) network profile.
796 * \par Sync (or) Async:
797 * These is a Synchronous API.
799 * \par Important Notes:
800 * On success, the information shall be copied to the parameter in each format.
802 * \param[out] gateway gateway address of active(default) network profile.
805 * Application must already be registered with the CM server.
807 * \return Return Type (int) \n
808 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
809 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
810 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
811 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
812 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
814 * \par Prospective Clients:
817 * \par Example Program:
819 * net_addr_t gateway;
821 * int result = net_get_active_gateway(&gateway);
823 * if(result == NET_ERR_NONE)......
825 ******************************************************************************************/
826 int net_get_active_gateway(net_addr_t *gateway);
828 /*****************************************************************************************/
830 * \brief This API returns gateway IPv6 address of active(default) network profile.
832 * \par Sync (or) Async:
833 * These is a Synchronous API.
835 * \par Important Notes:
836 * On success, the information shall be copied to the parameter in
839 * \param[out] gateway6 gateway IPv6 address of active(default) network profile.
842 * Application must already be registered with the CM server.
844 * \return Return Type (int) \n
845 * - NET_ERR_NONE - indicating that the status of queried network interface is
847 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with
848 * CM and it cannot use CM services.\n
849 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
850 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
851 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
853 * \par Prospective Clients:
856 * \par Example Program:
858 * net_addr_t gateway6;
860 * int result = net_get_active_gateway6(&gateway6);
862 * if(result == NET_ERR_NONE)......
864 ******************************************************************************************/
865 int net_get_active_gateway6(net_addr_t *gateway6);
867 /*****************************************************************************************/
869 * \brief This API returns DNS address of active(default) network profile.
871 * \par Sync (or) Async:
872 * These is a Synchronous API.
874 * \par Important Notes:
875 * On success, the information shall be copied to the parameter in each format.
877 * \param[out] dns DNS address of active(default) network profile.
880 * Application must already be registered with the CM server.
882 * \return Return Type (int) \n
883 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
884 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
885 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
886 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
887 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
889 * \par Prospective Clients:
892 * \par Example Program:
896 * int result = net_get_active_dns(&dns);
898 * if(result == NET_ERR_NONE)......
900 ******************************************************************************************/
901 int net_get_active_dns(net_addr_t *dns);
903 /*****************************************************************************************/
905 * \brief This API returns ESSID of active(default) network profile.
907 * \par Sync (or) Async:
908 * These is a Synchronous API.
910 * \par Important Notes:
911 * On success, the information shall be copied to the parameter in each format.
913 * \param[out] essid ESSID of active(default) network profile.
916 * Application must already be registered with the CM server and wifi is connected.
918 * \return Return Type (int) \n
919 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
920 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
921 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
922 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
923 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
925 * \par Prospective Clients:
928 * \par Example Program:
932 * int result = net_get_active_essid(&essid);
934 * if(result == NET_ERR_NONE)......
936 ******************************************************************************************/
937 int net_get_active_essid(net_essid_t *essid);
939 /*****************************************************************************************/
941 * \brief This API returns proxy string of active(default) network profile.
943 * \par Sync (or) Async:
944 * These is a Synchronous API.
946 * \par Important Notes:
947 * On success, the information shall be copied to the parameter in each format.
949 * \param[out] proxy proxy string of active(default) network profile.
952 * Application must already be registered with the CM server.
954 * \return Return Type (int) \n
955 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
956 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
957 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
958 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
959 * - NET_ERR_NO_SERVICE - indicating that there is no active network.\n
961 * \par Prospective Clients:
964 * \par Example Program:
968 * int result = net_get_active_proxy(&proxy);
970 * if(result == NET_ERR_NONE)......
972 ******************************************************************************************/
973 int net_get_active_proxy(net_proxy_t *proxy);
975 /*****************************************************************************************/
976 /* net_get_network_status API function prototype
977 * int net_get_network_status(net_device_t device_type, net_cm_network_status_t* network_status);
981 * \brief This API returns The status of a specific network interface passed as a parameter.
983 * \par Sync (or) Async:
984 * This is a Synchronous API.
986 * \par Important Notes:
995 * \param[in] device_type Queried network interface.
996 * \param[out] network_status The status of Queried network interface.
998 * \par Async Response Message:
1001 * \par Precondition:
1002 * Application must already be registered with the CM server.
1004 * \return Return Type (int) \n
1005 * - NET_ERR_NONE - indicating that the status of queried network interface is retrieved. \n
1006 * - NET_ERR_APP_NOT_REGISTERED - indicating that client is not registered with CM and it cannot use CM services.\n
1007 * - NET_ERR_UNKNOWN - indicating that an unknown error has occurred.\n
1008 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
1010 * \par Prospective Clients:
1013 * \par Example Program:
1015 * net_cm_network_status_t status;
1017 * int result = net_get_network_status(NET_MOBILE_TYPE, &status);
1019 * if(result == TRUE)......
1023 ******************************************************************************************/
1024 int net_get_network_status(net_device_t device_type, net_cm_network_status_t* network_status);
1026 /*****************************************************************************************/
1027 /* net_is_connected API function prototype
1028 * int net_is_connected(void);
1032 * \brief This API returns the connection status of process
1034 * \par Sync (or) Async:
1035 * This is a Synchronous API.
1037 * \par Important Notes:
1047 * \par Async Response Message:
1050 * \par Precondition:
1051 * Application must already be registered with the CM server.
1053 * \return Return Type (int) \n
1055 * - 0 - not connected
1057 * \par Prospective Clients:
1060 * \par Example Program:
1062 * int result = net_is_connected();
1064 * if(result == 1)......
1068 ******************************************************************************************/
1069 int net_is_connected(void);
1076 * \addtogroup pdp_specific
1085 * \addtogroup common_extended
1090 * \brief This API is only for Connection/Wi-Fi CAPI. Don't use this.
1092 * \param[in] event_cb Application Callback function pointer to receive ConnMan events
1093 * \param[in] client_type NET_DEVICE_DEFAULT : Connection CAPI, NET_DEVICE_WIFI : Wi-Fi CAPI
1094 * \param[in] user_data user data
1096 ******************************************************************************************/
1097 int net_register_client_ext(net_event_cb_t event_cb, net_device_t client_type, void *user_data);
1100 * \brief This API is only for Connection/Wi-Fi CAPI. Don't use this.
1102 * \param[in] client_type NET_DEVICE_DEFAULT : Connection CAPI, NET_DEVICE_WIFI : Wi-Fi CAPI
1104 ******************************************************************************************/
1105 int net_deregister_client_ext(net_device_t client_type);
1108 * \brief This API is only for Connection/Wi-Fi CAPI. Don't use this.
1110 * \param[in] service_type specific service type
1111 * \param[out] prof_name The name of profile for the service type.
1113 ******************************************************************************************/
1114 int net_open_connection_with_preference_ext(net_service_type_t service_type, net_profile_name_t *prof_name);
1117 * \brief This API is only for Connection CAPI. Don't use this.
1119 * \param[in] ip_addr ip address to route.
1120 * \param[in] interface interface name.
1121 * \param[in] address_family address family of ip address.
1123 ******************************************************************************************/
1124 int net_add_route(const char *ip_addr, const char *interface, int address_family);
1127 * \brief This API is only for Connection CAPI. Don't use this.
1129 * \param[in] ip_addr ip address to route.
1130 * \param[in] interface interface name.
1131 * \param[in] address_family address family of ip address.
1133 ******************************************************************************************/
1134 int net_remove_route(const char *ip_addr, const char *interface, int address_family);
1137 * \brief This API is only for Connection CAPI. Don't use this.
1139 * \param[in] ip_addr ipv6 address to route.
1140 * \param[in] interface interface name.
1141 * \param[in] address_family address family of ip address.
1142 * \param[in] gateway gateway address.
1144 ******************************************************************************************/
1145 int net_add_route_ipv6(const char *ip_addr, const char *interface, int address_family, const char *gateway);
1148 * \brief This API is only for Connection CAPI. Don't use this.
1150 * \param[in] ip_addr ipv6 address to route.
1151 * \param[in] interface interface name.
1152 * \param[in] address_family address family of ip address.
1153 * \param[in] gateway gateway address.
1155 ******************************************************************************************/
1156 int net_remove_route_ipv6(const char *ip_addr, const char *interface, int address_family, const char *gateway);
1158 /*****************************************************************************************/
1159 /* net_get_ethernet_cable_state API function prototype
1160 * int net_get_ethernet_cable_state(int *state);
1164 * \brief This API returns the ethernet cable status, 1 = Attached, 0 = Deatached.
1166 * \param[out] state - Specifies the State of ethernet cable
1168 * \par Sync (or) Async:
1169 * This is a Synchronous API.
1171 * \par Important Notes:
1181 * \par Async Response Message:
1184 * \return Return Type (int) \n
1185 * - NET_ERR_NONE - indicating that the status of ethernet plug in/out retrieved successfully.\n
1186 * - NET_ERR_INVALID_PARAM - indicating that API parameter value is invalid.\n
1187 * - NET_ERR_INVALID_OPERATION - indicating that the API failed to retrieve the status of ethernet plug.\n
1189 * \par Prospective Clients:
1193 ******************************************************************************************/
1194 int net_get_ethernet_cable_state(int *state);
1197 * \brief This API is only for Connection CAPI. Don't use this.
1199 * \param[in] tech_type specific technology type
1200 * \param[out] tech_info technology info.
1202 ******************************************************************************************/
1203 int net_get_technology_properties(net_device_t tech_type, net_tech_info_t *tech_info);
1210 * \addtogroup common_info
1215 * \brief Gets the statistics information.
1217 * \param[in] device_type specific device type(cellular/wifi).
1218 * \param[in] statistics_type specific statistics type.
1219 * \param[out] statistics_type statistics value requested.
1221 ******************************************************************************************/
1222 int net_get_statistics(net_device_t device_type, net_statistics_type_e statistics_type, unsigned long long *size);
1225 * \brief Resets the statistics information.
1227 * \param[in] device_type specific device type(cellular/wifi).
1228 * \param[in] statistics_type specific statistics type.
1230 ******************************************************************************************/
1231 int net_set_statistics(net_device_t device_type, net_statistics_type_e statistics_type);
1239 #endif /* __cplusplus */