From 79e76d05a0a75674f9a530ce3395425d9d8fc55d Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 24 Mar 2015 15:26:07 +0100 Subject: [PATCH 1/2] nettype: introduce type for ng_netif_hdr_t --- sys/include/net/ng_nettype.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/include/net/ng_nettype.h b/sys/include/net/ng_nettype.h index 798f6905a18d..6fb71701cfdb 100644 --- a/sys/include/net/ng_nettype.h +++ b/sys/include/net/ng_nettype.h @@ -37,6 +37,11 @@ extern "C" { * @note Expand at will. */ typedef enum { + /** + * @brief Protocol is as defined in @ref ng_netif_hdr_t. Not usable with + * @ref net_ng_netreg + */ + NG_NETTYPE_NETIF = -1, NG_NETTYPE_UNDEF = 0, /**< Protocol is undefined */ #ifdef MODULE_NG_SIXLOWPAN From 70c1e4dd37ac0f4ee9a3e08986fb71402d65359b Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 24 Mar 2015 15:28:07 +0100 Subject: [PATCH 2/2] shell: adapt for new nettype_t value --- sys/shell/commands/sc_netif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/shell/commands/sc_netif.c b/sys/shell/commands/sc_netif.c index 0ebbe94ef2f5..2e72ac57d9e9 100644 --- a/sys/shell/commands/sc_netif.c +++ b/sys/shell/commands/sc_netif.c @@ -324,7 +324,7 @@ void _netif_send(int argc, char **argv) /* put packet together */ pkt = ng_pktbuf_add(NULL, argv[3], strlen(argv[3]), NG_NETTYPE_UNDEF); pkt = ng_pktbuf_add(pkt, NULL, sizeof(ng_netif_hdr_t) + addr_len, - NG_NETTYPE_UNDEF); + NG_NETTYPE_NETIF); nethdr = (ng_netif_hdr_t *)pkt->data; ng_netif_hdr_init(nethdr, 0, addr_len); ng_netif_hdr_set_dst_addr(nethdr, addr, addr_len);