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 {
206#define PACKETBUF_ATTR_PACKET_TYPE_DATA 0
207#define PACKETBUF_ATTR_PACKET_TYPE_ACK 1
208#define PACKETBUF_ATTR_PACKET_TYPE_STREAM 2
209#define PACKETBUF_ATTR_PACKET_TYPE_STREAM_END 3
210#define PACKETBUF_ATTR_PACKET_TYPE_TIMESTAMP 4
216 PACKETBUF_ATTR_CHANNEL,
217 PACKETBUF_ATTR_NETWORK_ID,
218 PACKETBUF_ATTR_LINK_QUALITY,
220 PACKETBUF_ATTR_TIMESTAMP,
221 PACKETBUF_ATTR_MAX_MAC_TRANSMISSIONS,
222 PACKETBUF_ATTR_MAC_SEQNO,
223 PACKETBUF_ATTR_MAC_ACK,
224 PACKETBUF_ATTR_MAC_METADATA,
225 PACKETBUF_ATTR_MAC_NO_SRC_ADDR,
226 PACKETBUF_ATTR_MAC_NO_DEST_ADDR,
227#if TSCH_WITH_LINK_SELECTOR
228 PACKETBUF_ATTR_TSCH_SLOTFRAME,
229 PACKETBUF_ATTR_TSCH_TIMESLOT,
230 PACKETBUF_ATTR_TSCH_CHANNEL_OFFSET,
234 PACKETBUF_ATTR_FRAME_TYPE,
235#if LLSEC802154_USES_AUX_HEADER
236 PACKETBUF_ATTR_SECURITY_LEVEL,
238#if LLSEC802154_USES_EXPLICIT_KEYS
239 PACKETBUF_ATTR_KEY_ID_MODE,
240 PACKETBUF_ATTR_KEY_INDEX,
243#if LLSEC802154_USES_FRAME_COUNTER
244 PACKETBUF_ATTR_FRAME_COUNTER_BYTES_0_1,
245 PACKETBUF_ATTR_FRAME_COUNTER_BYTES_2_3,
250 PACKETBUF_ADDR_SENDER,
251 PACKETBUF_ADDR_RECEIVER,
256#define PACKETBUF_NUM_ADDRS 2
257#define PACKETBUF_NUM_ATTRS (PACKETBUF_ATTR_MAX - PACKETBUF_NUM_ADDRS)
258#define PACKETBUF_ADDR_FIRST PACKETBUF_ADDR_SENDER
260#define PACKETBUF_IS_ADDR(type) ((type) >= PACKETBUF_ADDR_FIRST)
262int packetbuf_set_attr(uint8_t type,
const packetbuf_attr_t val);
263packetbuf_attr_t packetbuf_attr(uint8_t type);
264int packetbuf_set_addr(uint8_t type,
const linkaddr_t *
addr);
265const linkaddr_t *packetbuf_addr(uint8_t type);
273void packetbuf_attr_clear(
void);
275void packetbuf_attr_copyto(
struct packetbuf_attr *attrs,
276 struct packetbuf_addr *addrs);
277void packetbuf_attr_copyfrom(
struct packetbuf_attr *attrs,
278 struct packetbuf_addr *addrs);
280#define PACKETBUF_ATTRIBUTES(...) { __VA_ARGS__ PACKETBUF_ATTR_LAST }
281#define PACKETBUF_ATTR_LAST { PACKETBUF_ATTR_NONE, 0 }
283#define PACKETBUF_ATTR_BIT 1
284#define PACKETBUF_ATTR_BYTE 8
285#define PACKETBUF_ADDRSIZE (LINKADDR_SIZE * PACKETBUF_ATTR_BYTE)
287#define PACKETBUF_ATTR_SECURITY_LEVEL_DEFAULT 0xffff
289struct 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.
void packetbuf_clear(void)
Clear and reset the packetbuf.
int packetbuf_holds_broadcast(void)
Checks whether the current packet is a broadcast.
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.