1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #9447 from miri64/gnrc_sixlowpan_frag/enh/add-cur-size

gnrc_sixlowpan_frag: add current_size to exposed struct
This commit is contained in:
Cenk Gündoğan 2018-07-02 14:05:40 +02:00 committed by GitHub
commit 32e823acb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -67,6 +67,10 @@ typedef struct {
uint8_t src_len; /**< length of gnrc_sixlowpan_rbuf_t::src */
uint8_t dst_len; /**< length of gnrc_sixlowpan_rbuf_t::dst */
uint16_t tag; /**< the datagram's tag */
/**
* @brief The number of bytes currently received of the complete datagram
*/
uint16_t current_size;
} gnrc_sixlowpan_rbuf_t;
/**

View File

@ -152,12 +152,12 @@ void rbuf_add(gnrc_netif_hdr_t *netif_hdr, gnrc_pktsnip_t *pkt,
if (_rbuf_update_ints(entry, offset, frag_size)) {
DEBUG("6lo rbuf: add fragment data\n");
entry->cur_size += (uint16_t)frag_size;
entry->super.current_size += (uint16_t)frag_size;
memcpy(((uint8_t *)entry->super.pkt->data) + offset + data_offset, data,
frag_size - data_offset);
}
if (entry->cur_size == entry->super.pkt->size) {
if (entry->super.current_size == entry->super.pkt->size) {
gnrc_pktsnip_t *netif = gnrc_netif_hdr_build(entry->super.src,
entry->super.src_len,
entry->super.dst,
@ -337,7 +337,7 @@ static rbuf_t *_rbuf_get(const void *src, size_t src_len,
res->super.src_len = src_len;
res->super.dst_len = dst_len;
res->super.tag = tag;
res->cur_size = 0;
res->super.current_size = 0;
DEBUG("6lo rfrag: entry %p (%s, ", (void *)res,
gnrc_netif_addr_to_str(res->super.src, res->super.src_len,

View File

@ -65,7 +65,6 @@ typedef struct {
rbuf_int_t *ints; /**< intervals of the fragment */
uint32_t arrival; /**< time in microseconds of arrival of
* last received fragment */
uint16_t cur_size; /**< the datagram's current size */
} rbuf_t;
/**