69edd891cecc2f073df66330336aa6e96fd99300
[framework/connectivity/libnet-client.git] / src / include / network-dbus-request.h
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.tizenopensource.org/license
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #ifndef __NETWORK_DBUS_REQUEST_H_
19 #define __NETWORK_DBUS_REQUEST_H_
20
21 /*****************************************************************************
22  *      Standard headers
23  *****************************************************************************/
24 #include <stdio.h> 
25 #include <errno.h> 
26 #include <stdlib.h> 
27 #include <string.h>
28 #include <glib.h>
29
30 #include <dbus/dbus.h> 
31
32
33 /*****************************************************************************
34  *      Platform headers
35  *****************************************************************************/
36
37
38
39 /*****************************************************************************
40  *      Macros and Typedefs
41  *****************************************************************************/
42         
43 #define CONNMAN_CLIENT_DBUS_TYPE_STRING         "string"
44 #define CONNMAN_CLIENT_DBUS_TYPE_INT16          "int16"
45 #define CONNMAN_CLIENT_DBUS_TYPE_UINT16         "uint16"
46 #define CONNMAN_CLIENT_DBUS_TYPE_INT32          "int32"
47 #define CONNMAN_CLIENT_DBUS_TYPE_UINT32         "uint32"
48 #define CONNMAN_CLIENT_DBUS_TYPE_INT64          "int64"
49 #define CONNMAN_CLIENT_DBUS_TYPE_UINT64         "uint64"
50 #define CONNMAN_CLIENT_DBUS_TYPE_DOUBLE         "double"
51 #define CONNMAN_CLIENT_DBUS_TYPE_BYTE           "byte"
52 #define CONNMAN_CLIENT_DBUS_TYPE_BOOLEAN        "boolean"
53 #define CONNMAN_CLIENT_DBUS_TYPE_OBJECT_PATH    "objpath"
54
55 #define CONNMAN_CLIENT_DBUS_TYPE_VARIANT        "variant"
56 #define CONNMAN_CLIENT_DBUS_TYPE_ARRAY          "array"
57 #define CONNMAN_CLIENT_DBUS_TYPE_DICT_ENTRY     "dict"
58
59
60 /*****************************************************************************
61  *      Global Structures
62  *****************************************************************************/
63
64 typedef struct
65 {
66         char* type;
67         char* mode;
68         char* ssid;
69         char* security;
70         char* passphrase; /** TODO handle EAP */
71 } net_wifi_connect_service_info_t;
72
73
74 /*****************************************************************************
75  *      Global Functions 
76  *****************************************************************************/
77 int _net_dbus_scan_request(void);
78 int _net_dbus_provision_service(gchar * config_str, int len);
79 int _net_dbus_set_bgscan_mode(net_wifi_background_scan_mode_t mode);
80 int _net_dbus_get_state(char* state);
81 int _net_send_dbus_request(const char* destination, char *param_array[], DBusMessage** result);
82 int _net_dbus_open_connection(const char* profile_name);
83 int _net_dbus_close_connection(const char* profile_name);
84 int _net_dbus_get_network_status (net_device_t device_type, net_cm_network_status_t* network_status);
85 int _net_dbus_connect_service(const net_wifi_connect_service_info_t* wifi_connection_info);
86 int _net_dbus_set_profile_ipv4(net_profile_info_t* prof_info, char* profile_name);
87 int _net_dbus_set_profile_dns(net_profile_info_t* prof_info, char* profile_name);
88 int _net_dbus_set_proxy(net_profile_info_t* prof_info, char* profile_name);
89 int _net_dbus_get_technology_state(network_get_tech_state_info_t* tech_state);
90 DBusMessage *_net_invoke_dbus_method(const char* dest, DBusConnection *connection,
91                 const char* path, char* interface_name, char* method, int *dbus_error);
92 int _net_dbus_load_wifi_driver(void);
93 int _net_dbus_remove_wifi_driver(void);
94 int _net_dbus_add_pdp_profile(net_profile_info_t *prof_info);
95 int _net_dbus_modify_pdp_profile(net_profile_info_t *prof_info, const char *profile_name);
96 dbus_bool_t _net_dbus_is_pending_call_used(void);
97 void _net_dbus_set_pending_call_used(dbus_bool_t used);
98 DBusPendingCall *_net_dbus_get_pending_call(void);
99 void _net_dbus_set_pending_call(DBusPendingCall *call);
100
101 #endif /** __NETWORK_SIGNAL_HANDLER_H_ */