Search Linux Wireless

[PATCH 6/6] mac80211: Path Selection Protocol dummy module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can be inserted and 'used' for Path Selection
by insmodding and issuing:
iw dev <mesh-dev> set mesh_param mesh_path_selection_protocol_id 000F0F0F

Signed-off-by: Florian Sesser <flomaillist@xxxxxxxxxxxxx>
---
 net/mac80211/Makefile      |    2 +
 net/mac80211/mesh_pptest.c |   71 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+), 0 deletions(-)
 create mode 100644 net/mac80211/mesh_pptest.c

diff --git a/net/mac80211/Makefile b/net/mac80211/Makefile
index 796e7a6..add8ffc 100644
--- a/net/mac80211/Makefile
+++ b/net/mac80211/Makefile
@@ -42,6 +42,8 @@ ifdef CONFIG_MAC80211_MESH
 obj-m += mesh_hwmp.o
 endif
 
+obj-m += mesh_pptest.o
+
 mac80211-$(CONFIG_PM) += pm.o
 
 # objects for PID algorithm
diff --git a/net/mac80211/mesh_pptest.c b/net/mac80211/mesh_pptest.c
new file mode 100644
index 0000000..9841d2d
--- /dev/null
+++ b/net/mac80211/mesh_pptest.c
@@ -0,0 +1,71 @@
+#include <linux/init.h>
+#include <linux/module.h>
+#include "mesh.h"
+MODULE_LICENSE("GPL");
+
+static struct mesh_path_sel_algo pptest;
+
+static void pptest_path_start_discovery_fn (struct ieee80211_sub_if_data *sdata) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+}
+static int pptest_nexthop_lookup_fn (struct sk_buff *skb, struct ieee80211_sub_if_data *sdata) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+	return 0;
+}
+static void pptest_queue_preq_fn (struct mesh_path *mpath, u8 flags) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+}
+static int pptest_path_error_tx_fn (u8 *dst, __le32 dst_dsn, u8 *ra,
+				struct ieee80211_sub_if_data *sdata) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+	return 0;
+}
+static void pptest_path_timer_fn (unsigned long data) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+}
+static void pptest_rx_path_sel_frame_fn (struct ieee80211_sub_if_data *sdata,
+				struct ieee80211_mgmt *mgmt, size_t len) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+}
+static void pptest_path_sel_start_fn (struct ieee80211_if_mesh *sta) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+}
+static void pptest_path_sel_stop_fn (struct ieee80211_if_mesh *sta) {
+	printk(KERN_INFO "pptest: %s has been called.\n", __func__);
+}
+
+static struct mesh_path_sel_ops pptest_ops = {
+	.path_start_discovery_fn = &pptest_path_start_discovery_fn,
+	.nexthop_lookup_fn = &pptest_nexthop_lookup_fn,
+	.queue_preq_fn = &pptest_queue_preq_fn,
+	.path_error_tx_fn = &pptest_path_error_tx_fn,
+	.path_timer_fn = &pptest_path_timer_fn,
+	.rx_path_sel_frame_fn = &pptest_rx_path_sel_frame_fn,
+	.path_sel_start_fn = &pptest_path_sel_start_fn,
+	.path_sel_stop_fn = &pptest_path_sel_stop_fn,
+};
+
+static struct mesh_path_sel_algo pptest = {
+	.name = "mesh_pptest",
+	.id = 0x000F0F0F,
+	.ops = &pptest_ops,
+	.owner = THIS_MODULE,
+};
+
+static int __init init_mesh_pptest(void)
+{
+	/* init code here */
+	printk(KERN_ALERT "Hello, this is mesh_pptest speaking (__init)\n");
+	mesh_path_sel_algo_register(&pptest);
+	return 0;
+}
+
+static void __exit cleanup_mesh_pptest(void)
+{
+	/* cleanup code here */
+	printk(KERN_ALERT "Goodbye, this is mesh_pptest dying\n");
+	mesh_path_sel_algo_unregister(&pptest);
+}
+
+module_init(init_mesh_pptest);
+module_exit(cleanup_mesh_pptest);
-- 
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux