Added method to framer that returns the header length if the framer

would create a header with the current packet information.

This allows sicslowpan to calculate the max payload size without
consuming a sequence number or clearing/restoring the packet buffer.
This commit is contained in:
Niclas Finne 2014-04-11 17:03:23 +02:00
parent dbb8f3ec13
commit 68730566a3
5 changed files with 42 additions and 15 deletions

View file

@ -55,6 +55,12 @@ struct nullmac_hdr {
linkaddr_t sender;
};
/*---------------------------------------------------------------------------*/
static int
hdr_length(void)
{
return sizeof(struct nullmac_hdr);
}
/*---------------------------------------------------------------------------*/
static int
create(void)
@ -91,5 +97,5 @@ parse(void)
}
/*---------------------------------------------------------------------------*/
const struct framer framer_nullmac = {
create, parse
hdr_length, create, parse
};