64#ifdef PACKETBUF_CONF_SIZE
65#define PACKETBUF_SIZE PACKETBUF_CONF_SIZE
67#define PACKETBUF_SIZE 128
197typedef uint16_t packetbuf_attr_t;
199struct packetbuf_attr {
200 packetbuf_attr_t val;
202struct packetbuf_addr {
210 PACKETBUF_ATTR_CHANNEL,
211 PACKETBUF_ATTR_NETWORK_ID,
212 PACKETBUF_ATTR_LINK_QUALITY,
214 PACKETBUF_ATTR_MAX_MAC_TRANSMISSIONS,
215 PACKETBUF_ATTR_MAC_SEQNO,
216 PACKETBUF_ATTR_MAC_ACK,
217 PACKETBUF_ATTR_MAC_METADATA,
218 PACKETBUF_ATTR_MAC_NO_SRC_ADDR,
219 PACKETBUF_ATTR_MAC_NO_DEST_ADDR,
220#if TSCH_WITH_LINK_SELECTOR
221 PACKETBUF_ATTR_TSCH_SLOTFRAME,
222 PACKETBUF_ATTR_TSCH_TIMESLOT,
223 PACKETBUF_ATTR_TSCH_CHANNEL_OFFSET,
227 PACKETBUF_ATTR_FRAME_TYPE,
228#if LLSEC802154_USES_AUX_HEADER
229 PACKETBUF_ATTR_SECURITY_LEVEL,
231#if LLSEC802154_USES_EXPLICIT_KEYS
232 PACKETBUF_ATTR_KEY_ID_MODE,
233 PACKETBUF_ATTR_KEY_INDEX,
236#if LLSEC802154_USES_FRAME_COUNTER
237 PACKETBUF_ATTR_FRAME_COUNTER_BYTES_0_1,
238 PACKETBUF_ATTR_FRAME_COUNTER_BYTES_2_3,
243 PACKETBUF_ADDR_SENDER,
244 PACKETBUF_ADDR_RECEIVER,
249#define PACKETBUF_NUM_ADDRS 2
250#define PACKETBUF_NUM_ATTRS (PACKETBUF_ATTR_MAX - PACKETBUF_NUM_ADDRS)
251#define PACKETBUF_ADDR_FIRST PACKETBUF_ADDR_SENDER
253#define PACKETBUF_IS_ADDR(type) ((type) >= PACKETBUF_ADDR_FIRST)
255void packetbuf_set_attr(uint8_t type,
const packetbuf_attr_t val);
256packetbuf_attr_t packetbuf_attr(uint8_t type);
257void packetbuf_set_addr(uint8_t type,
const linkaddr_t *
addr);
258const linkaddr_t *packetbuf_addr(uint8_t type);
266void packetbuf_attr_clear(
void);
268void packetbuf_attr_copyto(
struct packetbuf_attr *attrs,
269 struct packetbuf_addr *addrs);
270void packetbuf_attr_copyfrom(
struct packetbuf_attr *attrs,
271 struct packetbuf_addr *addrs);
273#define PACKETBUF_ATTRIBUTES(...) { __VA_ARGS__ PACKETBUF_ATTR_LAST }
274#define PACKETBUF_ATTR_LAST { PACKETBUF_ATTR_NONE, 0 }
276#define PACKETBUF_ATTR_BIT 1
277#define PACKETBUF_ATTR_BYTE 8
278#define PACKETBUF_ADDRSIZE (LINKADDR_SIZE * PACKETBUF_ATTR_BYTE)
280#define PACKETBUF_ATTR_SECURITY_LEVEL_DEFAULT 0xffff
282struct packetbuf_attrlist {
LLSEC802154 Security related configuration.
void packetbuf_set_datalen(uint16_t len)
Set the length of the data in the packetbuf.
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.
uint16_t packetbuf_totlen(void)
Get the total length of the header and data in the packetbuf.
uint16_t packetbuf_datalen(void)
Get the length of the data in the packetbuf.
uint8_t packetbuf_hdrlen(void)
Get the length of the header in the packetbuf.
int packetbuf_copyfrom(const void *from, uint16_t len)
Copy from external data into the packetbuf.
void * packetbuf_hdrptr(void)
Get a pointer to the header in the packetbuf, for outbound packets.
bool packetbuf_holds_broadcast(void)
Checks whether the current packet is a broadcast.
void packetbuf_clear(void)
Clear and reset the packetbuf.
int packetbuf_copyto(void *to)
Copy the entire packetbuf to an external buffer.
int packetbuf_hdralloc(int size)
Extend the header of the packetbuf, for outbound packets.
int packetbuf_hdrreduce(int size)
Reduce the header in the packetbuf, for incoming packets.
uint16_t packetbuf_remaininglen(void)
Get the total length of the remaining space in the packetbuf.
Header file for the link-layer address representation.
Common functionality of 802.15.4-compliant llsec_drivers.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.