RIOT-OS / applications

Some useful RIOT applications
GNU Lesser General Public License v2.1
41 stars 36 forks source link

ng_sniffer: added ng version of sniffer application #6

Closed haukepetersen closed 9 years ago

haukepetersen commented 9 years ago

This is the adaption of the existing sniffer application to work with the new network stack.

This PR works so far only with at86rf2xx drivers, e.g. with the iot-lab_M3 or the samr21-xpro boards.

OlegHahm commented 9 years ago

After https://github.com/RIOT-OS/RIOT/pull/2891 is merged this can be adapted, right?

haukepetersen commented 9 years ago

I rather wait for the outcome of RIOT-OS/RIOT#2901...

haukepetersen commented 9 years ago

Or not... at least this PR is temporarily adapted.

PeterKietzmann commented 9 years ago

Needs rebase after #2881 was merged. Right?

miri64 commented 9 years ago

Needs adaption:

diff --git a/ng_sniffer/Makefile b/ng_sniffer/Makefile
index 7be6e88..e93353d 100644
--- a/ng_sniffer/Makefile
+++ b/ng_sniffer/Makefile
@@ -9,6 +9,9 @@ RIOTBASE ?= $(CURDIR)/../../RIOT

 # Define modules that are used
 USEMODULE += ng_netif
+USEMODULE += ng_nomac
+USEMODULE += ng_at86rf2xx
+USEMODULE += auto_init_ng_netif
 USEMODULE += uart0
 USEMODULE += shell
 USEMODULE += shell_commands
diff --git a/ng_sniffer/main.c b/ng_sniffer/main.c
index c59eb17..6e82dc3 100644
--- a/ng_sniffer/main.c
+++ b/ng_sniffer/main.c
@@ -21,8 +21,7 @@

 #include <stdio.h>

-#include "board.h"
-#include "kernel.h"
+#include "thread.h"
 #include "hwtimer.h"
 #include "shell.h"
 #include "shell_commands.h"
@@ -38,12 +37,12 @@
 /**
  * @brief   Priority of the RAW dump thread
  */
-#define RAWDUMP_PRIO            (PRIORITY_MAIN - 1)
+#define RAWDUMP_PRIO            (THREAD_PRIORITY_MAIN - 1)

 /**
  * @brief   Stack for the raw dump thread
  */
-static char rawdmp_stack[KERNEL_CONF_STACKSIZE_MAIN];
+static char rawdmp_stack[THREAD_STACKSIZE_MAIN];

 /**
  * @brief   Make a raw dump of the given packet contents
haukepetersen commented 9 years ago

adapted and removed the WIP. Should I squash?

miri64 commented 9 years ago

ACK, please squash

haukepetersen commented 9 years ago

squashed.

haukepetersen commented 9 years ago

and go!