Commit 481f67e2 authored by Jukka Rissanen's avatar Jukka Rissanen
Browse files

net: nbuf: Provide metadata info for sent TCP buf



Create a variable in nbuf metadata area for storing TCP
buf_sent information.

Change-Id: I21a85c58183f1e4997d03d4a93546ddd9b32e977
Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent ab3b4656
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -84,6 +84,10 @@ struct net_nbuf {
#if defined(CONFIG_NET_IPV6)
	uint8_t ext_opt_len; /* IPv6 ND option length */
#endif

#if defined(CONFIG_NET_TCP)
	bool buf_sent; /* Is this net_buf sent or not */
#endif
	/* @endcond */
};

@@ -205,6 +209,18 @@ static inline void net_nbuf_set_ext_opt_len(struct net_buf *buf, uint8_t len)
}
#endif

#if defined(CONFIG_NET_TCP)
static inline uint8_t net_nbuf_buf_sent(struct net_buf *buf)
{
	return ((struct net_nbuf *)net_buf_user_data(buf))->buf_sent;
}

static inline void net_nbuf_set_buf_sent(struct net_buf *buf, bool sent)
{
	((struct net_nbuf *)net_buf_user_data(buf))->buf_sent = sent;
}
#endif

static inline uint16_t net_nbuf_get_len(struct net_buf *buf)
{
	return buf->len;