b3326dec0a55955c73317d7c08c63c24ca5f47a6
[platform/core/connectivity/stc-manager.git] / src / monitor / include / stc-default-connection.h
1 /*
2  * Copyright (c) 2016 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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 #ifndef __STC_DEFAULT_CONNECTION_H__
18 #define __STC_DEFAULT_CONNECTION_H__
19
20 #include <glib.h>
21 #include "stc-error.h"
22 #include "stc-manager.h"
23 #include "stc-manager-util.h"
24
25 #define IMSI_LENGTH 16
26
27 /**
28  * @brief default connection information will be fetched from net-config
29  */
30 typedef struct {
31         /* to identify each connection uniquely */
32         gchar *path;
33
34         /* profile info */
35         stc_iface_type_e type;
36         gchar *ifname;
37
38         /* cellular profile only else it is always false */
39         gboolean roaming;
40
41         /* only present when default profile is cellular */
42         char imsi[IMSI_LENGTH];
43
44         /* hardware network protocol type */
45         stc_hw_net_protocol_type_e hw_net_protocol_type;
46 } default_connection_s;
47
48 stc_error_e stc_default_connection_monitor_init(stc_s *stc);
49 stc_error_e stc_default_connection_monitor_deinit(stc_s *stc);
50
51 gchar *stc_default_connection_get_ifname(void);
52 default_connection_s *stc_get_default_connection(void);
53
54 #endif /* __STC_DEFAULT_CONNECTION_H__ */