commit 641e71a02f98751e8e77a25895ff26c0a6abd0c7
parent 839053c95253181e918a50787881509ae778ee61
Author: Denis Kenzior <denkenz@gmail.com>
Date: Fri, 31 Aug 2018 13:24:26 -0500
station: Add skeleton
Diffstat:
5 files changed, 116 insertions(+), 0 deletions(-)
diff --git a/Makefile.am b/Makefile.am
@@ -76,6 +76,7 @@ src_iwd_SOURCES = src/main.c linux/nl80211.h \
src/netdev.h src/netdev.c \
src/wiphy.h src/wiphy.c \
src/device.h src/device.c \
+ src/station.h src/station.c \
src/ie.h src/ie.c \
src/dbus.h src/dbus.c \
src/crypto.h src/crypto.c \
diff --git a/src/iwd.h b/src/iwd.h
@@ -24,6 +24,7 @@
struct l_genl_family;
struct device;
+struct station;
typedef void (*iwd_device_foreach_func)(struct device *, void *data);
@@ -52,3 +53,6 @@ void known_networks_exit(void);
bool device_init(void);
void device_exit(void);
+
+bool station_init(void);
+void station_exit(void);
diff --git a/src/main.c b/src/main.c
@@ -434,6 +434,7 @@ int main(int argc, char *argv[])
goto fail_device;
adhoc_init();
+ station_init();
wsc_init();
network_init();
known_networks_init();
@@ -448,6 +449,7 @@ int main(int argc, char *argv[])
known_networks_exit();
network_exit();
wsc_exit();
+ station_exit();
adhoc_exit();
device_exit();
fail_device:
diff --git a/src/station.c b/src/station.c
@@ -0,0 +1,75 @@
+/*
+ *
+ * Wireless daemon for Linux
+ *
+ * Copyright (C) 2018 Intel Corporation. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <errno.h>
+
+#include <ell/ell.h>
+
+#include "src/util.h"
+#include "src/iwd.h"
+#include "src/common.h"
+#include "src/scan.h"
+#include "src/netdev.h"
+#include "src/network.h"
+#include "src/station.h"
+
+static struct l_queue *station_list;
+
+struct station *station_create(struct wiphy *wiphy, struct netdev *netdev)
+{
+ struct station *station;
+
+ station = l_new(struct station, 1);
+
+ station->wiphy = wiphy;
+ station->netdev = netdev;
+
+ l_queue_push_head(station_list, station);
+
+ return station;
+}
+
+void station_free(struct station *station)
+{
+ l_debug("");
+
+ if (!l_queue_remove(station_list, station))
+ return;
+
+ l_free(station);
+}
+
+bool station_init(void)
+{
+ station_list = l_queue_new();
+ return true;
+}
+
+void station_exit(void)
+{
+ l_queue_destroy(station_list, NULL);
+ station_list = NULL;
+}
diff --git a/src/station.h b/src/station.h
@@ -0,0 +1,34 @@
+/*
+ *
+ * Wireless daemon for Linux
+ *
+ * Copyright (C) 2018 Intel Corporation. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#include <stdbool.h>
+
+struct wiphy;
+struct netdev;
+
+struct station {
+ struct wiphy *wiphy;
+ struct netdev *netdev;
+};
+
+struct station *station_create(struct wiphy *wiphy, struct netdev *netdev);
+void station_free(struct station *station);