Add a macro for tv profile
[platform/core/connectivity/stc-manager.git] / src / monitor / include / stc-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_CONNECTION_H__
18 #define __STC_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 #define SHA256_DIGEST_LENGTH 32
27
28 #define TETHERING_USB_IF   "usb0"
29 #define TETHERING_WIFI_IF  "wlan0"
30 #define TETHERING_BT_IF    "bnep0"
31 #define TETHERING_P2P_IF   "p2p0"
32
33 /**
34  * @brief Tethering interface info
35  */
36 typedef struct {
37         gchar *ifname;
38         stc_iface_type_e type;
39 } tether_iface_s;
40
41 /**
42  * @brief connection information will be fetched from connman
43  */
44 typedef struct {
45         /* to identify each connection uniquely */
46         gchar *path;
47
48         /* profile info */
49         stc_iface_type_e type;
50         gchar *ifname;
51
52         /* cellular profile only else it is always false */
53         gboolean roaming;
54
55         /* only present when default profile is cellular */
56         char subscriber_id[SHA256_DIGEST_LENGTH * 2 + 1];
57
58         /* hardware network protocol type */
59         stc_hw_net_protocol_type_e hw_net_protocol_type;
60
61         /* tethering status */
62         gboolean tether_state;
63
64         /* tethering interface */
65         tether_iface_s tether_iface;
66 } stc_connection_s;
67
68 stc_error_e stc_connection_monitor_init(stc_s *stc);
69 stc_error_e stc_connection_monitor_deinit(stc_s *stc);
70
71 GSList *stc_get_connection_list(void);
72
73 #endif /* __STC_CONNECTION_H__ */