2 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __STC_DEFAULT_CONNECTION_H__
18 #define __STC_DEFAULT_CONNECTION_H__
21 #include "stc-error.h"
22 #include "stc-manager.h"
23 #include "stc-manager-util.h"
25 #define IMSI_LENGTH 16
26 #define SHA256_DIGEST_LENGTH 32
28 #define TETHERING_USB_IF "usb0"
29 #define TETHERING_WIFI_IF "wlan0"
30 #define TETHERING_BT_IF "bnep0"
31 #define TETHERING_P2P_IF "p2p0"
34 * @brief Tethering interface info
38 stc_iface_type_e type;
42 * @brief default connection information will be fetched from net-config
45 /* to identify each connection uniquely */
49 stc_iface_type_e type;
52 /* cellular profile only else it is always false */
55 /* only present when default profile is cellular */
56 char subscriber_id[SHA256_DIGEST_LENGTH * 2 + 1];
58 /* hardware network protocol type */
59 stc_hw_net_protocol_type_e hw_net_protocol_type;
61 /* tethering status */
62 gboolean tether_state;
64 /* tethering interface */
65 tether_iface_s tether_iface;
66 } default_connection_s;
68 stc_error_e stc_default_connection_monitor_init(stc_s *stc);
69 stc_error_e stc_default_connection_monitor_deinit(stc_s *stc);
71 gchar *stc_default_connection_get_ifname(void);
72 default_connection_s *stc_get_default_connection(void);
74 #endif /* __STC_DEFAULT_CONNECTION_H__ */