* [PATCH wpan-tools 0/3] wpan-ping fixes
@ 2015-06-05 13:32 Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 1/3] wpan-ping: Take 6LoWPAN dispatch byte into account Stefan Schmidt
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Stefan Schmidt @ 2015-06-05 13:32 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt
Hello.
Some smaller fixes. wpan-ping no plays nicely in 6LoWPAN networks by settign
the dispatch byte to not a 6LoWPAN frame. The other two are just some
missing gitignore entries I spotted.
Stefan Schmidt (3):
wpan-ping: Take 6LoWPAN dispatch byte into account
gitignore: add generated iwpan-info
wpan-ping: Add .gitignore to ignore generated files
src/.gitignore | 1 +
wpan-ping/.gitignore | 2 ++
wpan-ping/wpan-ping.c | 17 ++++++++++-------
3 files changed, 13 insertions(+), 7 deletions(-)
create mode 100644 wpan-ping/.gitignore
regards
Stefan Schmidt
--
2.1.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH wpan-tools 1/3] wpan-ping: Take 6LoWPAN dispatch byte into account
2015-06-05 13:32 [PATCH wpan-tools 0/3] wpan-ping fixes Stefan Schmidt
@ 2015-06-05 13:32 ` Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info Stefan Schmidt
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2015-06-05 13:32 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt
In rfc4944 section 5.1 a dispatch byte is defined as the first transmitted
byte in the payload. All protocols that want to work in 6LoWPAN networks
without interfering with them should set it to something like 00xxxxxx.
We want to operate in such networks without disturbing them so putting a safe
0x00 here. We might use some of the other bits for flags at some point but do
not need them right now.
And yes, the maximum payload is still increasing by one instead of
decreasing. Earlier versions of this tool had a longer internal header which
resulted in a smaller payload length. That has changed now so we can increase
the payload length by 2 and subtract the dispatch byte to still gain one byte.
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
wpan-ping/wpan-ping.c | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/wpan-ping/wpan-ping.c b/wpan-ping/wpan-ping.c
index dbcc780..0d9da44 100644
--- a/wpan-ping/wpan-ping.c
+++ b/wpan-ping/wpan-ping.c
@@ -43,8 +43,10 @@
#include "../src/nl802154.h"
#define MIN_PAYLOAD_LEN 5
-#define MAX_PAYLOAD_LEN 115
+#define MAX_PAYLOAD_LEN 116
#define IEEE802154_ADDR_LEN 8
+/* Set the dispatch header to not 6lowpan for compat */
+#define NOT_A_6LOWPAN_FRAME 0x00
enum {
IEEE802154_ADDR_NONE = 0x0,
@@ -194,10 +196,11 @@ static void dump_packet(unsigned char *buf, int len) {
static int generate_packet(unsigned char *buf, struct config *conf, unsigned int seq_num) {
int i;
- buf[0] = conf->packet_len;
- buf[1] = seq_num >> 8; /* Upper byte */
- buf[2] = seq_num & 0xFF; /* Lower byte */
- for (i = 3; i < conf->packet_len; i++) {
+ buf[0] = NOT_A_6LOWPAN_FRAME;
+ buf[1] = conf->packet_len;
+ buf[2] = seq_num >> 8; /* Upper byte */
+ buf[3] = seq_num & 0xFF; /* Lower byte */
+ for (i = 4; i < conf->packet_len; i++) {
buf[i] = 0xAB;
}
@@ -228,11 +231,11 @@ static int measure_roundtrip(struct config *conf, int sd) {
count = 0;
for (i = 0; i < conf->packets; i++) {
generate_packet(buf, conf, i);
- seq_num = (buf[1] << 8)| buf[2];
+ seq_num = (buf[2] << 8)| buf[3];
send(sd, buf, conf->packet_len, 0);
gettimeofday(&start_time, NULL);
ret = recv(sd, buf, conf->packet_len, 0);
- if (seq_num != ((buf[1] << 8)| buf[2])) {
+ if (seq_num != ((buf[2] << 8)| buf[3])) {
printf("Sequenze number did not match\n");
continue;
}
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info
2015-06-05 13:32 [PATCH wpan-tools 0/3] wpan-ping fixes Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 1/3] wpan-ping: Take 6LoWPAN dispatch byte into account Stefan Schmidt
@ 2015-06-05 13:32 ` Stefan Schmidt
2015-06-05 16:08 ` Guido Günther
2015-06-05 13:32 ` [PATCH wpan-tools 3/3] wpan-ping: Add .gitignore to ignore generated files Stefan Schmidt
2015-06-06 8:25 ` [PATCH wpan-tools 0/3] wpan-ping fixes Alexander Aring
3 siblings, 1 reply; 8+ messages in thread
From: Stefan Schmidt @ 2015-06-05 13:32 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt, Stefan Schmidt
From: Stefan Schmidt <s.schmidt@samsung.com>
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
src/.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/.gitignore b/src/.gitignore
index d0989d6..356ac21 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,5 +1,6 @@
.deps
iwpan
+iwpan-info.o
iwpan-interface.o
iwpan-iwpan.o
iwpan-sections.o
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH wpan-tools 3/3] wpan-ping: Add .gitignore to ignore generated files
2015-06-05 13:32 [PATCH wpan-tools 0/3] wpan-ping fixes Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 1/3] wpan-ping: Take 6LoWPAN dispatch byte into account Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info Stefan Schmidt
@ 2015-06-05 13:32 ` Stefan Schmidt
2015-06-06 8:25 ` [PATCH wpan-tools 0/3] wpan-ping fixes Alexander Aring
3 siblings, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2015-06-05 13:32 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
wpan-ping/.gitignore | 2 ++
1 file changed, 2 insertions(+)
create mode 100644 wpan-ping/.gitignore
diff --git a/wpan-ping/.gitignore b/wpan-ping/.gitignore
new file mode 100644
index 0000000..0e2e07a
--- /dev/null
+++ b/wpan-ping/.gitignore
@@ -0,0 +1,2 @@
+.deps/
+wpan-ping
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info
2015-06-05 13:32 ` [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info Stefan Schmidt
@ 2015-06-05 16:08 ` Guido Günther
2015-06-05 21:47 ` [PATCH wpan-tools 2/3] gitignore: use wildcard to ignore object files Stefan Schmidt
2015-06-05 21:48 ` [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info Stefan Schmidt
0 siblings, 2 replies; 8+ messages in thread
From: Guido Günther @ 2015-06-05 16:08 UTC (permalink / raw)
To: Stefan Schmidt; +Cc: linux-wpan, Alexander Aring
On Fri, Jun 05, 2015 at 03:32:11PM +0200, Stefan Schmidt wrote:
> From: Stefan Schmidt <s.schmidt@samsung.com>
>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
> src/.gitignore | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/src/.gitignore b/src/.gitignore
> index d0989d6..356ac21 100644
> --- a/src/.gitignore
> +++ b/src/.gitignore
> @@ -1,5 +1,6 @@
> .deps
> iwpan
> +iwpan-info.o
> iwpan-interface.o
> iwpan-iwpan.o
> iwpan-sections.o
What about using a
*.o
wildcard? Everythng else seems cumbersome in the long run.
Cheers,
-- Guido
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH wpan-tools 2/3] gitignore: use wildcard to ignore object files
2015-06-05 16:08 ` Guido Günther
@ 2015-06-05 21:47 ` Stefan Schmidt
2015-06-05 21:48 ` [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info Stefan Schmidt
1 sibling, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2015-06-05 21:47 UTC (permalink / raw)
To: linux-wpan; +Cc: Alexander Aring, Stefan Schmidt, Stefan Schmidt
From: Stefan Schmidt <s.schmidt@samsung.com>
Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
src/.gitignore | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/src/.gitignore b/src/.gitignore
index d0989d6..a0a601d 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,7 +1,3 @@
.deps
iwpan
-iwpan-interface.o
-iwpan-iwpan.o
-iwpan-sections.o
-iwpan-mac.o
-iwpan-phy.o
+*.o
--
2.1.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info
2015-06-05 16:08 ` Guido Günther
2015-06-05 21:47 ` [PATCH wpan-tools 2/3] gitignore: use wildcard to ignore object files Stefan Schmidt
@ 2015-06-05 21:48 ` Stefan Schmidt
1 sibling, 0 replies; 8+ messages in thread
From: Stefan Schmidt @ 2015-06-05 21:48 UTC (permalink / raw)
To: Guido Günther; +Cc: linux-wpan, Alexander Aring
Hello.
On 05/06/15 18:08, Guido Günther wrote:
> On Fri, Jun 05, 2015 at 03:32:11PM +0200, Stefan Schmidt wrote:
>> From: Stefan Schmidt <s.schmidt@samsung.com>
>>
>> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
>> ---
>> src/.gitignore | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/src/.gitignore b/src/.gitignore
>> index d0989d6..356ac21 100644
>> --- a/src/.gitignore
>> +++ b/src/.gitignore
>> @@ -1,5 +1,6 @@
>> .deps
>> iwpan
>> +iwpan-info.o
>> iwpan-interface.o
>> iwpan-iwpan.o
>> iwpan-sections.o
> What about using a
>
> *.o
>
> wildcard? Everythng else seems cumbersome in the long run.
> Cheers,
Good point. Updated patch send. Thanks for the review!
regards
Stefan Schmidt
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH wpan-tools 0/3] wpan-ping fixes
2015-06-05 13:32 [PATCH wpan-tools 0/3] wpan-ping fixes Stefan Schmidt
` (2 preceding siblings ...)
2015-06-05 13:32 ` [PATCH wpan-tools 3/3] wpan-ping: Add .gitignore to ignore generated files Stefan Schmidt
@ 2015-06-06 8:25 ` Alexander Aring
3 siblings, 0 replies; 8+ messages in thread
From: Alexander Aring @ 2015-06-06 8:25 UTC (permalink / raw)
To: Stefan Schmidt; +Cc: linux-wpan
On Fri, Jun 05, 2015 at 03:32:09PM +0200, Stefan Schmidt wrote:
> Hello.
>
> Some smaller fixes. wpan-ping no plays nicely in 6LoWPAN networks by settign
> the dispatch byte to not a 6LoWPAN frame. The other two are just some
> missing gitignore entries I spotted.
>
Applied all, thanks.
- Alex
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-06-06 8:25 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-05 13:32 [PATCH wpan-tools 0/3] wpan-ping fixes Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 1/3] wpan-ping: Take 6LoWPAN dispatch byte into account Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info Stefan Schmidt
2015-06-05 16:08 ` Guido Günther
2015-06-05 21:47 ` [PATCH wpan-tools 2/3] gitignore: use wildcard to ignore object files Stefan Schmidt
2015-06-05 21:48 ` [PATCH wpan-tools 2/3] gitignore: add generated iwpan-info Stefan Schmidt
2015-06-05 13:32 ` [PATCH wpan-tools 3/3] wpan-ping: Add .gitignore to ignore generated files Stefan Schmidt
2015-06-06 8:25 ` [PATCH wpan-tools 0/3] wpan-ping fixes Alexander Aring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox