packet: access packet data through flex array

pull/9939/head
Victor Julien 2 years ago committed by Victor Julien
parent bc7508e4df
commit 9ae2cd0c59

@ -217,8 +217,8 @@ typedef struct Address_ {
#define GET_TCP_DST_PORT(p) ((p)->dp)
#define GET_PKT_LEN(p) ((p)->pktlen)
#define GET_PKT_DATA(p) ((((p)->ext_pkt) == NULL ) ? (uint8_t *)((p) + 1) : (p)->ext_pkt)
#define GET_PKT_DIRECT_DATA(p) (uint8_t *)((p) + 1)
#define GET_PKT_DATA(p) ((((p)->ext_pkt) == NULL) ? GET_PKT_DIRECT_DATA(p) : (p)->ext_pkt)
#define GET_PKT_DIRECT_DATA(p) (p)->pkt_data
#define GET_PKT_DIRECT_MAX_SIZE(p) (default_packet_size)
#define SET_PKT_LEN(p, len) do { \
@ -651,6 +651,11 @@ typedef struct Packet_
*/
SCSpinlock tunnel_lock;
} persistent;
/** flex array accessor to allocated packet data. Size of the additional
* data is `default_packet_size`. If this is insufficient,
* Packet::ext_pkt will be used instead. */
uint8_t pkt_data[];
} Packet;
/** highest mtu of the interfaces we monitor */

Loading…
Cancel
Save