Merge "Fix bug in Ip conflict set/get enabled API's" into tizen
[platform/core/connectivity/net-config.git] / include / plugin.h
1 /*
2  * Network Configuration Module
3  *
4  * Copyright (c) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
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 __NETCONFIG_PLUGIN_H__
21 #define __NETCONFIG_PLUGIN_H__
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 #include <glib.h>
28 #include <gio/gio.h>
29 #include <glib-object.h>
30
31 #include "neterror.h"
32
33 #define NETCONFIG_ADD_FOUND_AP_NOTI             "add_found_ap_noti"
34 #define NETCONFIG_DEL_FOUND_AP_NOTI             "del_found_ap_noti"
35 #define NETCONFIG_ADD_PORTAL_NOTI               "add_portal_noti"
36 #define NETCONFIG_DEL_PORTAL_NOTI               "del_portal_noti"
37 #define NETCONFIG_ADD_IP_CONFLICT_NOTI          "add_ip_conflict_noti"
38 #define NETCONFIG_DEL_IP_CONFLICT_NOTI          "del_ip_conflict_noti"
39
40 struct wifi_authentication_data {
41         int auth_result;
42         int resp_length;
43         int authentication_key_length;
44         int cipher_length;
45         int integrity_length;
46         char *resp_data;
47         char *authentication_key;
48         char *cipher_data;
49         char *integrity_data;
50 };
51
52 struct netconfig_headed_plugin_t {
53         void(*pop_device_picker) (void);
54         gboolean(*send_notification_to_net_popup) (const char *, const char *);
55         int(*send_message_to_net_popup) (const char *, const char *, const char *, const char *);
56         int(*send_restriction_to_net_popup) (const char *, const char *, const char *);
57         void(*set_system_event) (int, int, int);
58         void(*pop_wifi_connected_poppup) (const char *);
59 };
60
61 struct netconfig_telephony_plugin_t {
62         void(*get_telephony_network_type) (int *svctype, int *pstype);
63         gboolean(*wifi_get_sim_imsi) (void *wifi, GDBusMethodInvocation *context);
64         netconfig_error_e(*wifi_req_aka_auth) (GArray *rand_data, GArray *autn_data,
65                         GDBusMethodInvocation *context, struct wifi_authentication_data **data);
66         gboolean(*wifi_req_sim_auth) (GArray *rand_data,
67                         GDBusMethodInvocation *context, struct wifi_authentication_data **data);
68         gboolean(*tapi_check_sim_state) (void);
69         gboolean(*wifi_get_aka_authdata) (void *wifi,
70                         GDBusMethodInvocation *context, struct wifi_authentication_data **data);
71         gboolean(*wifi_get_sim_authdata) (void *wifi,
72                         GDBusMethodInvocation *context, struct wifi_authentication_data **data);
73 };
74
75 typedef enum {
76         SYS_EVT_NETWORK_STATUS = 0,
77         SYS_EVT_WIFI_STATE = 1,
78         EKEY_NETWORK_STATUS = 10,
79         EKEY_WIFI_STATE = 11,
80         EVAL_NETWORK_WIFI = 20,
81         EVAL_NETWORK_CELLULAR = 21,
82         EVAL_NETWORK_ETHERNET = 22,
83         EVAL_NETWORK_BT = 23,
84         EVAL_NETWORK_DISCONNECTED = 24,
85         EVAL_WIFI_CONNECTED = 25,
86         EVAL_WIFI_ON = 26,
87         EVAL_WIFI_OFF = 27,
88 } sys_evt_t;
89
90 void netconfig_complete_get_sim_imsi(void *wifi, GDBusMethodInvocation *context, char *imsi);
91 void netconfig_complete_get_aka_auth(void *wifi, GDBusMethodInvocation *context, GArray *array);
92 void netconfig_complete_get_sim_auth(void *wifi, GDBusMethodInvocation *context, GArray *array);
93 void netconfig_wifi_power_on();
94
95 #ifdef __cplusplus
96 }
97 #endif
98
99 #endif /* __NETCONFIG_PLUGIN_H__ */