summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNishant Chaprana <n.chaprana@samsung.com>2018-08-10 16:41:37 +0530
committerNishant Chaprana <n.chaprana@samsung.com>2018-08-24 10:20:11 +0530
commitd04bfa0350781ebfb8cbb2e64fabdfb2f36cd302 (patch)
tree750ce9bb53579e1ee54d91aa3a6c976e55f1a8db /include
parent037a4a5e75f3fc0845a924bb94addc2549550e63 (diff)
downloadconnman-d04bfa0350781ebfb8cbb2e64fabdfb2f36cd302.tar.gz
connman-d04bfa0350781ebfb8cbb2e64fabdfb2f36cd302.tar.bz2
connman-d04bfa0350781ebfb8cbb2e64fabdfb2f36cd302.zip
[connman] Added Tizen Wi-Fi Meshsubmit/tizen/20180824.072908
Change-Id: Iec2ec99fb7d4fc6d9c0539e5a9e7c903e1969580 Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
Diffstat (limited to 'include')
-rw-r--r--[-rwxr-xr-x]include/dbus.h3
-rw-r--r--[-rwxr-xr-x]include/device.h7
-rw-r--r--[-rwxr-xr-x]include/inet.h5
-rw-r--r--include/mesh-netlink.h58
-rw-r--r--include/mesh.h155
-rw-r--r--[-rwxr-xr-x]include/service.h7
6 files changed, 235 insertions, 0 deletions
diff --git a/include/dbus.h b/include/dbus.h
index 3087fe40..19e49380 100755..100644
--- a/include/dbus.h
+++ b/include/dbus.h
@@ -47,6 +47,9 @@ extern "C" {
#define CONNMAN_SESSION_INTERFACE CONNMAN_SERVICE ".Session"
#define CONNMAN_NOTIFICATION_INTERFACE CONNMAN_SERVICE ".Notification"
#define CONNMAN_PEER_INTERFACE CONNMAN_SERVICE ".Peer"
+#if defined TIZEN_EXT_WIFI_MESH
+#define CONNMAN_MESH_INTERFACE CONNMAN_SERVICE ".Mesh"
+#endif
#define CONNMAN_PRIVILEGE_MODIFY 1
#define CONNMAN_PRIVILEGE_SECRET 2
diff --git a/include/device.h b/include/device.h
index 36b2f550..852207d4 100755..100644
--- a/include/device.h
+++ b/include/device.h
@@ -131,6 +131,13 @@ struct connman_device_driver {
struct connman_device *device, int scan_type,
GSList *specific_scan_list, void *user_data);
#endif
+#if defined TIZEN_EXT_WIFI_MESH
+ int (*abort_scan) (enum connman_service_type type,
+ struct connman_device *device);
+ int (*mesh_specific_scan) (enum connman_service_type type,
+ struct connman_device *device, const char *ssid, unsigned int freq,
+ void *user_data);
+#endif
};
int connman_device_driver_register(struct connman_device_driver *driver);
diff --git a/include/inet.h b/include/inet.h
index 07427300..ef61af93 100755..100644
--- a/include/inet.h
+++ b/include/inet.h
@@ -81,6 +81,11 @@ int connman_inet_check_ipaddress(const char *host);
bool connman_inet_check_hostname(const char *ptr, size_t len);
bool connman_inet_is_ipv6_supported();
+#if defined TIZEN_EXT_WIFI_MESH
+char *connman_inet_ifaddr(const char *name);
+char *connman_inet_ifname2addr(const char *name);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/include/mesh-netlink.h b/include/mesh-netlink.h
new file mode 100644
index 00000000..78b3e36e
--- /dev/null
+++ b/include/mesh-netlink.h
@@ -0,0 +1,58 @@
+/*
+ *
+ * Connection Manager
+ *
+ *
+ * Copyright (C) 2017 Samsung Electronics Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef __CONNMAN_MESH_NETLINK_H
+#define __CONNMAN_MESH_NETLINK_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+ int id;
+ struct nl_sock *nl_socket;
+ struct nl_cb *cb;
+} mesh_nl80211_global;
+
+#define MESH_HWMP_ROOTMODE_NO_ROOT 0
+#define MESH_HWMP_ROOTMODE_PROACTIVE_PREQ_NO_PREP 2
+#define MESH_HWMP_ROOTMODE_PROACTIVE_PREQ_WITH_PREP 3
+#define MESH_HWMP_ROOTMODE_RANN 4
+
+#define NL80211_ATTR_IFINDEX 3
+#define NL80211_CMD_SET_MESH_CONFIG 29
+#define NL80211_ATTR_MESH_CONFIG 35
+
+#define NL80211_MESHCONF_HWMP_ROOTMODE 14
+#define NL80211_MESHCONF_GATE_ANNOUNCEMENTS 17
+
+int __connman_mesh_netlink_set_gate_announce(mesh_nl80211_global *global,
+ int mesh_if_index, bool gate_announce, int hwmp_rootmode);
+
+mesh_nl80211_global *__connman_mesh_nl80211_global_init(void);
+void __connman_mesh_nl80211_global_deinit(mesh_nl80211_global *global);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CONNMAN_MESH_NETLINK_H */
diff --git a/include/mesh.h b/include/mesh.h
new file mode 100644
index 00000000..547c237e
--- /dev/null
+++ b/include/mesh.h
@@ -0,0 +1,155 @@
+/*
+ *
+ * Connection Manager
+ *
+ *
+ * Copyright (C) 2017 Samsung Electronics Co., Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef __CONNMAN_MESH_H
+#define __CONNMAN_MESH_H
+
+#include <gdbus.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct connman_mesh;
+
+enum connman_mesh_security {
+ CONNMAN_MESH_SECURITY_UNKNOWN = 0,
+ CONNMAN_MESH_SECURITY_NONE = 1,
+ CONNMAN_MESH_SECURITY_SAE = 2,
+};
+
+enum connman_mesh_state {
+ CONNMAN_MESH_STATE_UNKNOWN = 0,
+ CONNMAN_MESH_STATE_IDLE = 1,
+ CONNMAN_MESH_STATE_ASSOCIATION = 2,
+ CONNMAN_MESH_STATE_CONFIGURATION = 3,
+ CONNMAN_MESH_STATE_READY = 4,
+ CONNMAN_MESH_STATE_DISCONNECT = 5,
+ CONNMAN_MESH_STATE_FAILURE = 6,
+};
+
+enum connman_mesh_peer_type {
+ CONNMAN_MESH_PEER_TYPE_CREATED = 0,
+ CONNMAN_MESH_PEER_TYPE_DISCOVERED = 1,
+};
+
+enum connman_mesh_peer_disconnect_reason {
+ CONNMAN_MESH_REASON_UNKNOWN = 0,
+ CONNMAN_MESH_DEAUTH_LEAVING = 1,
+ CONNMAN_MESH_PEERING_CANCELLED = 2,
+ CONNMAN_MESH_MAX_PEERS = 3,
+ CONNMAN_MESH_CONFIG_POLICY_VIOLATION = 4,
+ CONNMAN_MESH_CLOSE_RCVD = 5,
+ CONNMAN_MESH_MAX_RETRIES = 6,
+ CONNMAN_MESH_CONFIRM_TIMEOUT = 7,
+ CONNMAN_MESH_INVALID_GTK = 8,
+ CONNMAN_MESH_INCONSISTENT_PARAMS = 9,
+ CONNMAN_MESH_INVALID_SECURITY_CAP = 10,
+};
+
+enum connman_mesh_peer_status {
+ CONNMAN_MESH_PEER_ADD = 0,
+ CONNMAN_MESH_PEER_REMOVE = 1,
+};
+
+struct connman_mesh *connman_mesh_create(const char *interface_addr,
+ const char *identifier);
+
+void connman_mesh_set_name(struct connman_mesh *mesh, const char *name);
+const char *connman_mesh_get_name(struct connman_mesh *mesh);
+void connman_mesh_set_passphrase(struct connman_mesh *mesh,
+ const char *passphrase);
+const char *connman_mesh_get_passphrase(struct connman_mesh *mesh);
+void connman_mesh_set_address(struct connman_mesh *mesh, const char *address);
+void connman_mesh_set_security(struct connman_mesh *mesh, const char *security);
+const char *connman_mesh_get_security(struct connman_mesh *mesh);
+void connman_mesh_set_frequency(struct connman_mesh *mesh, uint16_t frequency);
+uint16_t connman_mesh_get_frequency(struct connman_mesh *mesh);
+void connman_mesh_set_ieee80211w(struct connman_mesh *mesh, uint16_t ieee80211w);
+uint16_t connman_mesh_get_ieee80211w(struct connman_mesh *mesh);
+int connman_mesh_peer_set_state(struct connman_mesh *mesh,
+ enum connman_mesh_state new_state);
+void connman_mesh_set_peer_type(struct connman_mesh *mesh,
+ enum connman_mesh_peer_type type);
+bool connman_mesh_peer_is_connected_state(struct connman_mesh *mesh);
+struct connman_mesh *connman_get_connected_mesh_from_name(char *name);
+struct connman_mesh *connman_get_connecting_mesh_from_name(char *name);
+void connman_mesh_set_index(struct connman_mesh *mesh, int index);
+void connman_mesh_set_strength(struct connman_mesh *mesh, uint8_t strength);
+void connman_mesh_peer_set_disconnect_reason(struct connman_mesh *mesh,
+ int disconnect_reason);
+void __connman_mesh_add_ethernet_to_bridge(void);
+void __connman_mesh_remove_ethernet_from_bridge(void);
+int __connman_mesh_change_peer_status(DBusMessage *msg,
+ const char *peer_address,
+ enum connman_mesh_peer_status status);
+
+int connman_mesh_register(struct connman_mesh *mesh);
+void connman_mesh_unregister(struct connman_mesh *mesh);
+
+int __connman_mesh_add_virtual_interface(const char *ifname,
+ const char *parent_ifname, const char *bridge_ifname);
+
+int __connman_mesh_remove_virtual_interface(const char *ifname);
+int __connman_mesh_set_stp_gate_announce(bool gate_announce, int hwmp_rootmode,
+ int stp);
+
+const char *connman_mesh_get_interface_name(void);
+bool connman_mesh_is_interface_created(void);
+
+struct connman_mesh *connman_mesh_get(const char *interface_addr,
+ const char *identifier);
+
+int connman_mesh_notify_interface_create(bool success);
+int connman_mesh_notify_interface_remove(bool success);
+
+int connman_mesh_add_connected_peer(const char *peer_address);
+int connman_mesh_remove_connected_peer(const char *peer_address, int reason);
+
+typedef void (*mesh_change_peer_status_cb_t) (int result, void *user_data);
+
+struct connman_mesh_driver {
+ int (*add_interface) (const char *ifname, const char *parent_ifname);
+ int (*remove_interface) (const char *ifname);
+ int (*connect) (struct connman_mesh *mesh);
+ int (*disconnect) (struct connman_mesh *mesh);
+ int (*change_peer_status) (const char *peer_address,
+ enum connman_mesh_peer_status status,
+ mesh_change_peer_status_cb_t callback, void *user_data);
+};
+
+int connman_mesh_driver_register(struct connman_mesh_driver *driver);
+void connman_mesh_driver_unregister(struct connman_mesh_driver *driver);
+
+struct connman_mesh_eth_driver {
+ int (*add_to_bridge) (const char *bridge);
+ int (*remove_from_bridge) (const char *bridge);
+};
+
+int connman_mesh_eth_driver_register(struct connman_mesh_eth_driver *driver);
+void connman_mesh_eth_driver_unregister(struct connman_mesh_eth_driver *driver);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __CONNMAN_MESH_H */
diff --git a/include/service.h b/include/service.h
index 30550233..961b5942 100755..100644
--- a/include/service.h
+++ b/include/service.h
@@ -49,8 +49,15 @@ enum connman_service_type {
CONNMAN_SERVICE_TYPE_VPN = 7,
CONNMAN_SERVICE_TYPE_GADGET = 8,
CONNMAN_SERVICE_TYPE_P2P = 9,
+#if defined TIZEN_EXT_WIFI_MESH
+ CONNMAN_SERVICE_TYPE_MESH = 10,
+#endif
};
+#if defined TIZEN_EXT_WIFI_MESH
+#define MAX_CONNMAN_SERVICE_TYPES 11
+#else
#define MAX_CONNMAN_SERVICE_TYPES 10
+#endif
enum connman_service_security {