63 #ifdef PACKETBUF_CONF_SIZE 64 #define PACKETBUF_SIZE PACKETBUF_CONF_SIZE 66 #define PACKETBUF_SIZE 128 196 typedef uint16_t packetbuf_attr_t;
198 struct packetbuf_attr {
199 packetbuf_attr_t val;
201 struct packetbuf_addr {
205 #define PACKETBUF_ATTR_PACKET_TYPE_DATA 0 206 #define PACKETBUF_ATTR_PACKET_TYPE_ACK 1 207 #define PACKETBUF_ATTR_PACKET_TYPE_STREAM 2 208 #define PACKETBUF_ATTR_PACKET_TYPE_STREAM_END 3 209 #define PACKETBUF_ATTR_PACKET_TYPE_TIMESTAMP 4 215 PACKETBUF_ATTR_CHANNEL,
216 PACKETBUF_ATTR_NETWORK_ID,
217 PACKETBUF_ATTR_LINK_QUALITY,
219 PACKETBUF_ATTR_TIMESTAMP,
220 PACKETBUF_ATTR_MAX_MAC_TRANSMISSIONS,
221 PACKETBUF_ATTR_MAC_SEQNO,
222 PACKETBUF_ATTR_MAC_ACK,
223 PACKETBUF_ATTR_MAC_METADATA,
224 PACKETBUF_ATTR_MAC_NO_SRC_ADDR,
225 PACKETBUF_ATTR_MAC_NO_DEST_ADDR,
226 #if TSCH_WITH_LINK_SELECTOR 227 PACKETBUF_ATTR_TSCH_SLOTFRAME,
228 PACKETBUF_ATTR_TSCH_TIMESLOT,
232 PACKETBUF_ATTR_FRAME_TYPE,
233 #if LLSEC802154_USES_AUX_HEADER 234 PACKETBUF_ATTR_SECURITY_LEVEL,
236 #if LLSEC802154_USES_EXPLICIT_KEYS 237 PACKETBUF_ATTR_KEY_ID_MODE,
238 PACKETBUF_ATTR_KEY_INDEX,
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) 255 int packetbuf_set_attr(uint8_t type,
const packetbuf_attr_t val);
256 packetbuf_attr_t packetbuf_attr(uint8_t type);
257 int packetbuf_set_addr(uint8_t type,
const linkaddr_t *
addr);
258 const linkaddr_t *packetbuf_addr(uint8_t type);
266 void packetbuf_attr_clear(
void);
268 void packetbuf_attr_copyto(
struct packetbuf_attr *attrs,
269 struct packetbuf_addr *addrs);
270 void 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 struct packetbuf_attrlist {
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.
void packetbuf_clear(void)
Clear and reset the packetbuf.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
int packetbuf_hdralloc(int size)
Extend the header of the packetbuf, for outbound 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
int packetbuf_hdrreduce(int size)
Reduce the header in the packetbuf, for incoming packets.
Common functionality of 802.15.4-compliant llsec_drivers.
int packetbuf_copyto(void *to)
Copy the entire packetbuf to an external buffer.
uint8_t packetbuf_hdrlen(void)
Get the length of the header in the packetbuf.
uint16_t packetbuf_datalen(void)
Get the length of the data in the packetbuf.
uint16_t packetbuf_totlen(void)
Get the total length of the header and data in the packetbuf.
int packetbuf_copyfrom(const void *from, uint16_t len)
Copy from external data into the packetbuf.
int packetbuf_holds_broadcast(void)
Checks whether the current packet is a broadcast.
void * packetbuf_hdrptr(void)
Get a pointer to the header in the packetbuf, for outbound packets.
void packetbuf_set_datalen(uint16_t len)
Set the length of the data in the packetbuf.