mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
treewide: use new gnrc_pkt API functions instead of utlist.h macros
This commit is contained in:
parent
d491e827fb
commit
45144fb4a4
@ -178,10 +178,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
|
||||
gnrc_pktbuf_remove_snip(pkt, mac_hdr);
|
||||
gnrc_pktbuf_remove_snip(pkt, esp_hdr);
|
||||
LL_APPEND(pkt, netif_hdr);
|
||||
|
||||
return pkt;
|
||||
|
||||
return gnrc_pkt_append(pkt, netif_hdr);
|
||||
err:
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return NULL;
|
||||
|
@ -168,9 +168,7 @@ static gnrc_pktsnip_t *gnrc_nrfmin_recv(gnrc_netif_t *dev)
|
||||
|
||||
/* finally: remove the nrfmin header and append the netif header */
|
||||
gnrc_pktbuf_remove_snip(pkt_snip, hdr_snip);
|
||||
LL_APPEND(pkt_snip, netif_snip);
|
||||
|
||||
return pkt_snip;
|
||||
return gnrc_pkt_append(pkt_snip, netif_snip);
|
||||
}
|
||||
|
||||
static const gnrc_netif_ops_t gnrc_nrfmin_ops = {
|
||||
|
@ -96,7 +96,7 @@ static gnrc_pktsnip_t *cc1xxx_adpt_recv(gnrc_netif_t *netif)
|
||||
DEBUG("[cc1xxx-gnrc] recv: successfully parsed packet\n");
|
||||
|
||||
/* and append the netif header */
|
||||
LL_APPEND(payload, hdr);
|
||||
payload = gnrc_pkt_append(payload, hdr);
|
||||
|
||||
#ifdef MODULE_NETSTATS_L2
|
||||
netif->stats.rx_count++;
|
||||
|
@ -95,9 +95,7 @@ static gnrc_pktsnip_t *xbee_adpt_recv(gnrc_netif_t *netif)
|
||||
DEBUG("[xbee-gnrc] recv: successfully parsed packet\n");
|
||||
|
||||
/* and append the netif header */
|
||||
LL_APPEND(payload, netif_snip);
|
||||
|
||||
return payload;
|
||||
return gnrc_pkt_append(payload, netif_snip);
|
||||
}
|
||||
|
||||
static int xbee_adpt_send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
|
||||
|
@ -94,7 +94,7 @@ static void send(char *addr_str, char *port_str, char *data, unsigned int num,
|
||||
gnrc_pktsnip_t *netif_hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
|
||||
gnrc_netif_hdr_set_netif(netif_hdr->data, netif);
|
||||
LL_PREPEND(ip, netif_hdr);
|
||||
ip = gnrc_pkt_prepend(ip, netif_hdr);
|
||||
}
|
||||
/* send packet */
|
||||
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_UDP, GNRC_NETREG_DEMUX_CTX_ALL, ip)) {
|
||||
|
@ -94,7 +94,7 @@ static void send(char *addr_str, char *port_str, char *data, unsigned int num,
|
||||
gnrc_pktsnip_t *netif_hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
|
||||
gnrc_netif_hdr_set_netif(netif_hdr->data, netif);
|
||||
LL_PREPEND(ip, netif_hdr);
|
||||
ip = gnrc_pkt_prepend(ip, netif_hdr);
|
||||
}
|
||||
/* send packet */
|
||||
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_UDP, GNRC_NETREG_DEMUX_CTX_ALL, ip)) {
|
||||
|
@ -119,7 +119,7 @@ static void _handle_raw_sixlowpan(ble_mac_inbuf_t *inbuf)
|
||||
od_hex_dump(inbuf->payload, inbuf->len, OD_WIDTH_DEFAULT);
|
||||
#endif
|
||||
|
||||
LL_APPEND(pkt, netif_hdr);
|
||||
pkt = gnrc_pkt_append(pkt, netif_hdr);
|
||||
|
||||
/* throw away packet if no one is interested */
|
||||
if (!gnrc_netapi_dispatch_receive(pkt->type, GNRC_NETREG_DEMUX_CTX_ALL, pkt)) {
|
||||
|
@ -175,7 +175,7 @@ static int _parse_packet(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt,
|
||||
gnrc_netif_hdr_set_netif(netif_hdr, netif);
|
||||
pkt->type = state->proto;
|
||||
gnrc_pktbuf_remove_snip(pkt, pkt->next);
|
||||
LL_APPEND(pkt, netif_snip);
|
||||
pkt = gnrc_pkt_append(pkt, netif_snip);
|
||||
|
||||
gnrc_pktsnip_t *gomach_snip = NULL;
|
||||
gnrc_gomach_hdr_t *gomach_hdr = NULL;
|
||||
|
@ -218,7 +218,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
#endif
|
||||
#endif
|
||||
gnrc_pktbuf_remove_snip(pkt, ieee802154_hdr);
|
||||
LL_APPEND(pkt, netif_hdr);
|
||||
pkt = gnrc_pkt_append(pkt, netif_hdr);
|
||||
}
|
||||
|
||||
DEBUG("_recv_ieee802154: reallocating.\n");
|
||||
|
@ -246,7 +246,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
gnrc_netif_hdr_set_netif(netif_hdr->data, netif);
|
||||
|
||||
gnrc_pktbuf_remove_snip(pkt, eth_hdr);
|
||||
LL_APPEND(pkt, netif_hdr);
|
||||
pkt = gnrc_pkt_append(pkt, netif_hdr);
|
||||
}
|
||||
|
||||
out:
|
||||
|
@ -132,7 +132,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
hdr->lqi = rx_info.lqi;
|
||||
hdr->rssi = rx_info.rssi;
|
||||
gnrc_netif_hdr_set_netif(hdr, netif);
|
||||
LL_APPEND(pkt, netif_snip);
|
||||
pkt = gnrc_pkt_append(pkt, netif_snip);
|
||||
}
|
||||
else {
|
||||
/* Normal mode, try to parse the frame according to IEEE 802.15.4 */
|
||||
@ -204,7 +204,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netif_t *netif)
|
||||
#endif
|
||||
#endif
|
||||
gnrc_pktbuf_remove_snip(pkt, ieee802154_hdr);
|
||||
LL_APPEND(pkt, netif_hdr);
|
||||
pkt = gnrc_pkt_append(pkt, netif_hdr);
|
||||
}
|
||||
|
||||
DEBUG("_recv_ieee802154: reallocating.\n");
|
||||
|
@ -101,7 +101,7 @@ void gnrc_icmpv6_echo_req_handle(gnrc_netif_t *netif, ipv6_hdr_t *ipv6_hdr,
|
||||
/* (netif == NULL) => ipv6_hdr->dst is loopback address */
|
||||
gnrc_netif_hdr_set_netif(hdr->data, netif);
|
||||
|
||||
LL_PREPEND(pkt, hdr);
|
||||
pkt = gnrc_pkt_prepend(pkt, hdr);
|
||||
|
||||
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_IPV6, GNRC_NETREG_DEMUX_CTX_ALL,
|
||||
pkt)) {
|
||||
|
@ -221,7 +221,7 @@ static void _send(gnrc_pktsnip_t *pkt, const gnrc_pktsnip_t *orig_pkt,
|
||||
return;
|
||||
}
|
||||
gnrc_netif_hdr_set_netif(netif->data, iface);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
}
|
||||
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_IPV6,
|
||||
GNRC_NETREG_DEMUX_CTX_ALL,
|
||||
|
@ -344,7 +344,7 @@ gnrc_pktsnip_t *gnrc_ipv6_ext_build(gnrc_pktsnip_t *ipv6, gnrc_pktsnip_t *next,
|
||||
}
|
||||
|
||||
if (ipv6 != NULL) {
|
||||
LL_SEARCH_SCALAR(ipv6, prev, next, next);
|
||||
prev = gnrc_pkt_prev_snip(ipv6, next);
|
||||
|
||||
if (prev == NULL) {
|
||||
return NULL;
|
||||
|
@ -311,9 +311,7 @@ static gnrc_pktsnip_t *_create_netif_hdr(uint8_t *dst_l2addr,
|
||||
hdr->flags = flags;
|
||||
|
||||
/* add netif_hdr to front of the pkt list */
|
||||
LL_PREPEND(pkt, netif_hdr);
|
||||
|
||||
return pkt;
|
||||
return gnrc_pkt_prepend(pkt, netif_hdr);
|
||||
}
|
||||
|
||||
static bool _is_ipv6_hdr(gnrc_pktsnip_t *hdr)
|
||||
|
@ -851,7 +851,7 @@ static void _send_delayed_nbr_adv(const gnrc_netif_t *netif,
|
||||
return;
|
||||
}
|
||||
gnrc_netif_hdr_set_netif(pkt->data, netif);
|
||||
LL_PREPEND(payload, pkt);
|
||||
pkt = gnrc_pkt_prepend(payload, pkt);
|
||||
_evtimer_add(pkt, GNRC_IPV6_NIB_SND_NA, &nce->snd_na,
|
||||
random_uint32_range(0, NDP_MAX_ANYCAST_MS_DELAY));
|
||||
}
|
||||
@ -1240,7 +1240,8 @@ static bool _resolve_addr(const ipv6_addr_t *dst, gnrc_netif_t *netif,
|
||||
return false;
|
||||
}
|
||||
gnrc_netif_hdr_set_netif(netif_hdr->data, netif);
|
||||
LL_PREPEND(queue_entry->pkt, netif_hdr);
|
||||
queue_entry->pkt = gnrc_pkt_prepend(queue_entry->pkt,
|
||||
netif_hdr);
|
||||
}
|
||||
gnrc_pktqueue_add(&entry->pktqueue, queue_entry);
|
||||
}
|
||||
|
@ -610,8 +610,7 @@ static gnrc_pktsnip_t *_build_headers(gnrc_netif_t *netif,
|
||||
return NULL;
|
||||
}
|
||||
gnrc_netif_hdr_set_netif(l2hdr->data, netif);
|
||||
LL_PREPEND(iphdr, l2hdr);
|
||||
return l2hdr;
|
||||
return gnrc_pkt_prepend(iphdr, l2hdr);
|
||||
}
|
||||
|
||||
static inline size_t _get_l2src(const gnrc_netif_t *netif, uint8_t *l2src)
|
||||
|
@ -116,9 +116,7 @@ static gnrc_pktsnip_t *_build_frag_pkt(gnrc_pktsnip_t *pkt,
|
||||
frag_hdr->tag = byteorder_htons(fbuf->tag);
|
||||
|
||||
|
||||
LL_PREPEND(frag, netif);
|
||||
|
||||
return frag;
|
||||
return gnrc_pkt_prepend(frag, netif);
|
||||
}
|
||||
|
||||
static uint16_t _copy_pkt_to_frag(uint8_t *data, const gnrc_pktsnip_t *pkt,
|
||||
|
@ -627,7 +627,7 @@ int gnrc_sixlowpan_frag_rb_dispatch_when_complete(gnrc_sixlowpan_frag_rb_t *rbuf
|
||||
new_netif_hdr->flags = netif_hdr->flags;
|
||||
new_netif_hdr->lqi = netif_hdr->lqi;
|
||||
new_netif_hdr->rssi = netif_hdr->rssi;
|
||||
LL_APPEND(rbuf->pkt, netif);
|
||||
rbuf->pkt = gnrc_pkt_append(rbuf->pkt, netif);
|
||||
#if IS_USED(MODULE_GNRC_SIXLOWPAN_FRAG_STATS)
|
||||
gnrc_sixlowpan_frag_stats_get()->fragments += _count_frags(rbuf);
|
||||
gnrc_sixlowpan_frag_stats_get()->datagrams++;
|
||||
|
@ -797,8 +797,8 @@ void gnrc_sixlowpan_iphc_recv(gnrc_pktsnip_t *sixlo, void *rbuf_ptr,
|
||||
ipv6))) {
|
||||
/* add netif header to `ipv6` so its flags can be used when
|
||||
* forwarding the fragment */
|
||||
LL_DELETE(sixlo, netif);
|
||||
LL_APPEND(ipv6, netif);
|
||||
sixlo = gnrc_pkt_delete(sixlo, netif);
|
||||
ipv6 = gnrc_pkt_append(ipv6, netif);
|
||||
/* provide space to copy remaining payload */
|
||||
if (gnrc_pktbuf_realloc_data(ipv6, uncomp_hdr_len + sixlo->size -
|
||||
payload_offset) != 0) {
|
||||
@ -862,8 +862,8 @@ void gnrc_sixlowpan_iphc_recv(gnrc_pktsnip_t *sixlo, void *rbuf_ptr,
|
||||
#endif /* MODULE_GNRC_SIXLOWPAN_FRAG_VRB */
|
||||
}
|
||||
else {
|
||||
LL_DELETE(sixlo, netif);
|
||||
LL_APPEND(ipv6, netif);
|
||||
sixlo = gnrc_pkt_delete(sixlo, netif);
|
||||
ipv6 = gnrc_pkt_append(ipv6, netif);
|
||||
gnrc_sixlowpan_dispatch_recv(ipv6, NULL, page);
|
||||
}
|
||||
gnrc_pktbuf_release(sixlo);
|
||||
|
@ -18,7 +18,7 @@
|
||||
gnrc_pktsnip_t *gnrc_pktbuf_remove_snip(gnrc_pktsnip_t *pkt,
|
||||
gnrc_pktsnip_t *snip)
|
||||
{
|
||||
LL_DELETE(pkt, snip);
|
||||
pkt = gnrc_pkt_delete(pkt, snip);
|
||||
snip->next = NULL;
|
||||
gnrc_pktbuf_release(snip);
|
||||
|
||||
@ -32,8 +32,8 @@ gnrc_pktsnip_t *gnrc_pktbuf_replace_snip(gnrc_pktsnip_t *pkt,
|
||||
/* If add is a list we need to preserve its tail */
|
||||
if (add->next != NULL) {
|
||||
gnrc_pktsnip_t *tail = add->next;
|
||||
gnrc_pktsnip_t *back;
|
||||
LL_SEARCH_SCALAR(tail, back, next, NULL); /* find the last snip in add */
|
||||
/* find the last snip in tail */
|
||||
gnrc_pktsnip_t *back = gnrc_pkt_prev_snip(tail, NULL);
|
||||
/* Replace old */
|
||||
LL_REPLACE_ELEM(pkt, old, add);
|
||||
/* and wire in the tail between */
|
||||
|
@ -224,7 +224,7 @@ void gnrc_rpl_send(gnrc_pktsnip_t *pkt, kernel_pid_t iface, ipv6_addr_t *src, ip
|
||||
return;
|
||||
}
|
||||
gnrc_netif_hdr_set_netif(hdr->data, netif);
|
||||
LL_PREPEND(pkt, hdr);
|
||||
pkt = gnrc_pkt_prepend(pkt, hdr);
|
||||
|
||||
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_IPV6, GNRC_NETREG_DEMUX_CTX_ALL, pkt)) {
|
||||
DEBUG("RPL: cannot send packet: no subscribers found.\n");
|
||||
|
@ -231,7 +231,7 @@ ssize_t gnrc_sock_send(gnrc_pktsnip_t *payload, sock_ip_ep_t *local,
|
||||
}
|
||||
netif_hdr = netif->data;
|
||||
netif_hdr->if_pid = iface;
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
}
|
||||
#ifdef MODULE_GNRC_NETERR
|
||||
/* cppcheck-suppress uninitvar
|
||||
|
@ -132,8 +132,7 @@ int _pkt_build_reset_from_pkt(gnrc_pktsnip_t **out_pkt, gnrc_pktsnip_t *in_pkt)
|
||||
}
|
||||
else {
|
||||
((gnrc_netif_hdr_t *)net_snp->data)->if_pid = net_hdr->if_pid;
|
||||
LL_PREPEND(ip6_snp, net_snp);
|
||||
*(out_pkt) = net_snp;
|
||||
*(out_pkt) = gnrc_pkt_prepend(ip6_snp, net_snp);
|
||||
}
|
||||
}
|
||||
#else
|
||||
@ -240,8 +239,7 @@ int _pkt_build(gnrc_tcp_tcb_t *tcb, gnrc_pktsnip_t **out_pkt, uint16_t *seq_con,
|
||||
}
|
||||
else {
|
||||
((gnrc_netif_hdr_t *)net_snp->data)->if_pid = (kernel_pid_t)tcb->ll_iface;
|
||||
LL_PREPEND(ip6_snp, net_snp);
|
||||
*(out_pkt) = net_snp;
|
||||
*(out_pkt) = gnrc_pkt_prepend(ip6_snp, net_snp);
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
@ -321,7 +321,7 @@ static void _pinger(_ping_data_t *data)
|
||||
goto error_exit;
|
||||
}
|
||||
gnrc_netif_hdr_set_netif(tmp->data, data->netif);
|
||||
LL_PREPEND(pkt, tmp);
|
||||
pkt = gnrc_pkt_prepend(pkt, tmp);
|
||||
}
|
||||
if (data->datalen >= sizeof(uint32_t)) {
|
||||
uint32_t now = xtimer_now_usec();
|
||||
|
@ -1593,7 +1593,7 @@ int _gnrc_netif_send(int argc, char **argv)
|
||||
gnrc_pktbuf_release(pkt);
|
||||
return 1;
|
||||
}
|
||||
LL_PREPEND(pkt, hdr);
|
||||
pkt = gnrc_pkt_prepend(pkt, hdr);
|
||||
nethdr = (gnrc_netif_hdr_t *)hdr->data;
|
||||
nethdr->flags = flags;
|
||||
/* and send it */
|
||||
|
@ -96,7 +96,7 @@ static void send(char *addr_str, char *port_str, char *data_len_str, unsigned in
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
|
||||
((gnrc_netif_hdr_t *)netif->data)->if_pid = (kernel_pid_t)iface;
|
||||
LL_PREPEND(ip, netif);
|
||||
ip = gnrc_pkt_prepend(ip, netif);
|
||||
}
|
||||
/* send packet */
|
||||
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_UDP, GNRC_NETREG_DEMUX_CTX_ALL, ip)) {
|
||||
|
@ -1189,7 +1189,7 @@ static void test_netapi_send__raw_unicast_ethernet_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(pkt);
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(ðernet_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1204,7 +1204,7 @@ static void test_netapi_send__raw_broadcast_ethernet_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
hdr = netif->data;
|
||||
hdr->flags |= GNRC_NETIF_HDR_FLAGS_BROADCAST;
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(ðernet_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1217,7 +1217,7 @@ static void test_netapi_send__raw_unicast_ieee802154_long_long_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(pkt);
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1230,7 +1230,7 @@ static void test_netapi_send__raw_unicast_ieee802154_long_short_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(pkt);
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1248,7 +1248,7 @@ static void test_netapi_send__raw_unicast_ieee802154_short_long_packet1(void)
|
||||
0, &src_len, sizeof(src_len)));
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
/* reset src_len */
|
||||
src_len = 8U;
|
||||
@ -1268,7 +1268,7 @@ static void test_netapi_send__raw_unicast_ieee802154_short_long_packet2(void)
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(src, sizeof(src),
|
||||
dst, sizeof(dst));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1286,7 +1286,7 @@ static void test_netapi_send__raw_unicast_ieee802154_short_short_packet(void)
|
||||
0, &src_len, sizeof(src_len)));
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst, sizeof(dst));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
/* reset src_len */
|
||||
src_len = 8U;
|
||||
@ -1306,7 +1306,7 @@ static void test_netapi_send__raw_broadcast_ieee802154_long_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
hdr = netif->data;
|
||||
hdr->flags |= GNRC_NETIF_HDR_FLAGS_BROADCAST;
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1326,7 +1326,7 @@ static void test_netapi_send__raw_broadcast_ieee802154_short_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
hdr = netif->data;
|
||||
hdr->flags |= GNRC_NETIF_HDR_FLAGS_BROADCAST;
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
/* reset src_len */
|
||||
src_len = 8U;
|
||||
@ -1360,7 +1360,7 @@ static void test_netapi_send__ipv6_unicast_ethernet_packet(void)
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst_netif,
|
||||
sizeof(dst_netif));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(ðernet_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1387,7 +1387,7 @@ static void test_netapi_send__ipv6_multicast_ethernet_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
netif_hdr = netif->data;
|
||||
netif_hdr->flags |= GNRC_NETIF_HDR_FLAGS_MULTICAST;
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(ðernet_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1416,7 +1416,7 @@ static void test_netapi_send__ipv6_unicast_ieee802154_packet(void)
|
||||
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(NULL, 0, dst_netif,
|
||||
sizeof(dst_netif));
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
}
|
||||
|
||||
@ -1443,7 +1443,7 @@ static void test_netapi_send__ipv6_multicast_ieee802154_packet(void)
|
||||
TEST_ASSERT_NOT_NULL(netif);
|
||||
netif_hdr = netif->data;
|
||||
netif_hdr->flags |= GNRC_NETIF_HDR_FLAGS_MULTICAST;
|
||||
LL_PREPEND(pkt, netif);
|
||||
pkt = gnrc_pkt_prepend(pkt, netif);
|
||||
gnrc_netif_send(&ieee802154_netif, pkt);
|
||||
}
|
||||
|
||||
|
@ -62,14 +62,13 @@ static gnrc_pktsnip_t *_build_ipv6_packet(const ipv6_addr_t *src,
|
||||
ipv6_hdr->len = byteorder_htons((uint16_t)payload->size);
|
||||
ipv6_hdr->nh = nh;
|
||||
ipv6_hdr->hl = 64;
|
||||
LL_APPEND(payload, ipv6);
|
||||
payload = gnrc_pkt_append(payload, ipv6);
|
||||
netif_hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
if (netif_hdr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
((gnrc_netif_hdr_t *)netif_hdr->data)->if_pid = (kernel_pid_t)netif;
|
||||
LL_APPEND(payload, netif_hdr);
|
||||
return payload;
|
||||
return gnrc_pkt_append(payload, netif_hdr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -85,14 +85,13 @@ static gnrc_pktsnip_t *_build_udp_packet(const ipv6_addr_t *src,
|
||||
else {
|
||||
udp_hdr->checksum = byteorder_htons(~csum);
|
||||
}
|
||||
LL_APPEND(udp, ipv6);
|
||||
udp = gnrc_pkt_append(udp, ipv6);
|
||||
netif_hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
if (netif_hdr == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
((gnrc_netif_hdr_t *)netif_hdr->data)->if_pid = (kernel_pid_t)netif;
|
||||
LL_APPEND(udp, netif_hdr);
|
||||
return udp;
|
||||
return gnrc_pkt_append(udp, netif_hdr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,7 +148,7 @@ static void send(char *addr_str, char *port_str, char *data_len_str, unsigned in
|
||||
return;
|
||||
}
|
||||
gnrc_netif_hdr_set_netif(netif_hdr->data, netif);
|
||||
LL_PREPEND(ip, netif_hdr);
|
||||
ip = gnrc_pkt_prepend(ip, netif_hdr);
|
||||
}
|
||||
/* send packet */
|
||||
if (!gnrc_netapi_dispatch_send(GNRC_NETTYPE_UDP, GNRC_NETREG_DEMUX_CTX_ALL, ip)) {
|
||||
|
@ -104,7 +104,7 @@ static int test_send(void)
|
||||
puts("Could not allocate send header");
|
||||
return 0;
|
||||
}
|
||||
LL_PREPEND(pkt, hdr);
|
||||
pkt = gnrc_pkt_prepend(pkt, hdr);
|
||||
/* prepare expected data */
|
||||
memcpy(exp_mac->dst, _test_dst, sizeof(_test_dst));
|
||||
memcpy(exp_mac->src, _dev_addr, sizeof(_dev_addr));
|
||||
|
@ -63,7 +63,7 @@ static void test_gnrc_mac_queue_tx_packet(void)
|
||||
hdr = gnrc_netif_hdr_build(NULL, 0, NULL, 0);
|
||||
gnrc_pktsnip_t *pkt_bcast = gnrc_pktbuf_add(NULL, TEST_STRING12, sizeof(TEST_STRING12),
|
||||
GNRC_NETTYPE_UNDEF);
|
||||
LL_APPEND(hdr, pkt_bcast);
|
||||
hdr = gnrc_pkt_append(hdr, pkt_bcast);
|
||||
pkt_bcast = hdr;
|
||||
|
||||
netif_hdr = hdr->data;
|
||||
@ -72,13 +72,13 @@ static void test_gnrc_mac_queue_tx_packet(void)
|
||||
hdr = gnrc_netif_hdr_build(NULL, 0, dst_addr, 2);
|
||||
gnrc_pktsnip_t *pkt1 = gnrc_pktbuf_add(NULL, TEST_STRING4, sizeof(TEST_STRING4),
|
||||
GNRC_NETTYPE_UNDEF);
|
||||
LL_APPEND(hdr, pkt1);
|
||||
hdr = gnrc_pkt_append(hdr, pkt1);
|
||||
pkt1 = hdr;
|
||||
|
||||
hdr = gnrc_netif_hdr_build(NULL, 0, dst_addr, 2);
|
||||
gnrc_pktsnip_t *pkt2 = gnrc_pktbuf_add(NULL, TEST_STRING8, sizeof(TEST_STRING8),
|
||||
GNRC_NETTYPE_UNDEF);
|
||||
LL_APPEND(hdr, pkt2);
|
||||
hdr = gnrc_pkt_append(hdr, pkt2);
|
||||
pkt2 = hdr;
|
||||
|
||||
dst_addr[0] = 0x44;
|
||||
@ -87,7 +87,7 @@ static void test_gnrc_mac_queue_tx_packet(void)
|
||||
hdr = gnrc_netif_hdr_build(NULL, 0, dst_addr, 2);
|
||||
gnrc_pktsnip_t *pkt3 = gnrc_pktbuf_add(NULL, TEST_STRING16, sizeof(TEST_STRING16),
|
||||
GNRC_NETTYPE_UNDEF);
|
||||
LL_APPEND(hdr, pkt3);
|
||||
hdr = gnrc_pkt_append(hdr, pkt3);
|
||||
pkt3 = hdr;
|
||||
|
||||
#if CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0
|
||||
|
Loading…
Reference in New Issue
Block a user