diff --git a/sys/net/application_layer/ng_zep/ng_zep.c b/sys/net/application_layer/ng_zep/ng_zep.c index 4b3a887440e33cb547ae6913b17d42e72aa7d11a..4c53efd79c6d96533742d813e0f8d922c9b087c9 100644 --- a/sys/net/application_layer/ng_zep/ng_zep.c +++ b/sys/net/application_layer/ng_zep/ng_zep.c @@ -728,7 +728,7 @@ static ng_pktsnip_t *_create_received(ng_zep_t *dev, ng_pktsnip_t *pkt, return NULL; } - payload = ng_pktbuf_add(pkt, pkt->data, pkt->size - 2, dev->proto); + payload = ng_pktbuf_mark(pkt, pkt->size - 2, dev->proto); if (payload == NULL) { return NULL; @@ -742,7 +742,7 @@ static ng_pktsnip_t *_create_received(ng_zep_t *dev, ng_pktsnip_t *pkt, return NULL; } - mhr = ng_pktbuf_add(pkt, pkt->data, mhr_len, NG_NETTYPE_UNDEF); + mhr = ng_pktbuf_mark(pkt, mhr_len, NG_NETTYPE_UNDEF); /* TODO: send ACK */ @@ -776,7 +776,7 @@ static ng_pktsnip_t *_recv_v1(ng_zep_t *dev, ng_pktsnip_t *pkt) return NULL; } - zep = ng_pktbuf_add(pkt, pkt->data, sizeof(ng_zep_v1_hdr_t), NG_NETTYPE_UNDEF); + zep = ng_pktbuf_mark(pkt, sizeof(ng_zep_v1_hdr_t), NG_NETTYPE_UNDEF); if (zep == NULL) { return NULL; @@ -807,7 +807,7 @@ static ng_pktsnip_t *_recv_v2(ng_zep_t *dev, ng_pktsnip_t *pkt) return NULL; } - zep = ng_pktbuf_add(pkt, pkt->data, sizeof(ng_zep_v2_data_hdr_t), NG_NETTYPE_UNDEF); + zep = ng_pktbuf_mark(pkt, sizeof(ng_zep_v2_data_hdr_t), NG_NETTYPE_UNDEF); if (zep == NULL) { return NULL; diff --git a/sys/net/crosslayer/ng_pktbuf_static/ng_pktbuf_static.c b/sys/net/crosslayer/ng_pktbuf_static/ng_pktbuf_static.c index 88f9b8b95eb032c8d1742cd2b812c048df1a9656..6c520b622bbd17d6a67ab7f1227fe4c2b520db31 100644 --- a/sys/net/crosslayer/ng_pktbuf_static/ng_pktbuf_static.c +++ b/sys/net/crosslayer/ng_pktbuf_static/ng_pktbuf_static.c @@ -235,7 +235,7 @@ ng_pktsnip_t *ng_pktbuf_start_write(ng_pktsnip_t *pkt) #ifdef DEVELHELP #ifdef MODULE_OD -void _print_chunk(void *chunk, size_t size, int num) +static inline void _print_chunk(void *chunk, size_t size, int num) { printf("================ chunk %3d (size: %4u) ================\n", num, (unsigned int)size); @@ -243,7 +243,7 @@ void _print_chunk(void *chunk, size_t size, int num) OD_FLAGS_ADDRESS_HEX | OD_FLAGS_BYTES_HEX | OD_FLAGS_LENGTH_1); } -void _print_unused(_unused_t *ptr) +static inline void _print_unused(_unused_t *ptr) { printf("~ unused: %p (next: %p, size: %4u) ~\n", (void *)ptr, (void *)ptr->next, ptr->size); @@ -283,7 +283,7 @@ void ng_pktbuf_stats(void) } if (chunk <= &_pktbuf[NG_PKTBUF_SIZE - 1]) { - _print_chunk(chunk, &_pktbuf[NG_PKTBUF_SIZE] - chunk, count++); + _print_chunk(chunk, &_pktbuf[NG_PKTBUF_SIZE] - chunk, count); } #else DEBUG("pktbuf: needs od module\n"); diff --git a/sys/net/network_layer/ng_ipv6/ext/ng_ipv6_ext.c b/sys/net/network_layer/ng_ipv6/ext/ng_ipv6_ext.c index 1f746e0ad0f0ed47bb4f6192d0197ca179a316a0..f1b6ef95409de3d4b4031ff3de6d2d74c2b12a8a 100644 --- a/sys/net/network_layer/ng_ipv6/ext/ng_ipv6_ext.c +++ b/sys/net/network_layer/ng_ipv6/ext/ng_ipv6_ext.c @@ -54,7 +54,7 @@ bool ng_ipv6_ext_demux(kernel_pid_t iface, ng_pktsnip_t *pkt, } } - ext_snip = ng_pktbuf_add(pkt, pkt->data, offset, NG_NETTYPE_IPV6); + ext_snip = ng_pktbuf_mark(pkt, offset, NG_NETTYPE_IPV6); if (ext_snip == NULL) { return false; diff --git a/sys/net/network_layer/ng_ipv6/ng_ipv6.c b/sys/net/network_layer/ng_ipv6/ng_ipv6.c index 328d7f5ebb39b0426d5448d9dbcba97c111e74e3..5deee0c335c49af7ef085c4369bdbe8acf9dfa0f 100644 --- a/sys/net/network_layer/ng_ipv6/ng_ipv6.c +++ b/sys/net/network_layer/ng_ipv6/ng_ipv6.c @@ -630,8 +630,7 @@ static void _receive(ng_pktsnip_t *pkt) pkt = ipv6; /* reset pkt from temporary variable */ - ipv6 = ng_pktbuf_add(pkt, pkt->data, sizeof(ng_ipv6_hdr_t), - NG_NETTYPE_IPV6); + ipv6 = ng_pktbuf_mark(pkt, sizeof(ng_ipv6_hdr_t), NG_NETTYPE_IPV6); if (ipv6 == NULL) { DEBUG("ipv6: error marking IPv6 header, dropping packet\n"); diff --git a/sys/net/network_layer/ng_sixlowpan/iphc/ng_sixlowpan_iphc.c b/sys/net/network_layer/ng_sixlowpan/iphc/ng_sixlowpan_iphc.c index eb29da9a89b2d766404b68ae1cad5163e7cc70e4..9fe0043f4dffc8cc38efd6df8bac7f490869baeb 100644 --- a/sys/net/network_layer/ng_sixlowpan/iphc/ng_sixlowpan_iphc.c +++ b/sys/net/network_layer/ng_sixlowpan/iphc/ng_sixlowpan_iphc.c @@ -369,7 +369,7 @@ bool ng_sixlowpan_iphc_decode(ng_pktsnip_t *pkt) /* TODO: add next header decoding */ /* remove 6LoWPAN dispatch */ - payload = ng_pktbuf_add(pkt, pkt->data, payload_offset, NG_NETTYPE_SIXLOWPAN); + payload = ng_pktbuf_mark(pkt, payload_offset, NG_NETTYPE_SIXLOWPAN); pkt = ng_pktbuf_remove_snip(pkt, payload); /* set IPv6 header payload length field to the length of whatever is left diff --git a/sys/net/network_layer/ng_sixlowpan/ng_sixlowpan.c b/sys/net/network_layer/ng_sixlowpan/ng_sixlowpan.c index f2c60f199e3b75b3ca808f3b208030ee36a17f35..2cfa09986b9a9b83304f521157c9e659cfee6f82 100644 --- a/sys/net/network_layer/ng_sixlowpan/ng_sixlowpan.c +++ b/sys/net/network_layer/ng_sixlowpan/ng_sixlowpan.c @@ -103,8 +103,7 @@ static void _receive(ng_pktsnip_t *pkt) } /* packet is uncompressed: just mark and remove the dispatch */ - sixlowpan = ng_pktbuf_add(payload, payload->data, sizeof(uint8_t), - NG_NETTYPE_SIXLOWPAN); + sixlowpan = ng_pktbuf_mark(payload, sizeof(uint8_t), NG_NETTYPE_SIXLOWPAN); if (sixlowpan == NULL) { DEBUG("6lo: can not mark 6LoWPAN dispatch\n"); diff --git a/sys/net/transport_layer/ng_udp/ng_udp.c b/sys/net/transport_layer/ng_udp/ng_udp.c index 4e3f0ce27dae968abeb123c12504100b5a229584..5910bf19c3bbc0cc97ffa2f83ca1a6c292b5af6d 100644 --- a/sys/net/transport_layer/ng_udp/ng_udp.c +++ b/sys/net/transport_layer/ng_udp/ng_udp.c @@ -107,7 +107,7 @@ static void _receive(ng_pktsnip_t *pkt) return; } pkt = udp; - udp = ng_pktbuf_add(pkt, pkt->data, sizeof(ng_udp_hdr_t), NG_NETTYPE_UDP); + udp = ng_pktbuf_mark(pkt, sizeof(ng_udp_hdr_t), NG_NETTYPE_UDP); if (udp == NULL) { DEBUG("udp: error marking UDP header, dropping packet\n"); ng_pktbuf_release(pkt);