diff --git a/include/net/net_context.h b/include/net/net_context.h index e0d1c7cdf6e..e7d20279012 100644 --- a/include/net/net_context.h +++ b/include/net/net_context.h @@ -237,6 +237,14 @@ struct net_context { /** TCP connection information */ struct net_tcp *tcp; #endif /* CONFIG_NET_TCP */ + +#if defined(CONFIG_NET_SOCKETS) + /** Per-socket packet or connection queues */ + union { + struct k_fifo recv_q; + struct k_fifo accept_q; + }; +#endif /* CONFIG_NET_SOCKETS */ }; static inline bool net_context_is_used(struct net_context *context) diff --git a/include/net/net_pkt.h b/include/net/net_pkt.h index 3d38349f06a..da4fa6b6a21 100644 --- a/include/net/net_pkt.h +++ b/include/net/net_pkt.h @@ -71,7 +71,9 @@ struct net_pkt { sys_snode_t sent_list; #endif - u8_t sent : 1; /* Is this sent or not + u8_t sent_or_eof: 1; /* For outgoing packet: is this sent or not + * For incoming packet of a socket: last + * packet before EOF * Used only if defined(CONFIG_NET_TCP) */ u8_t forwarding : 1; /* Are we forwarding this pkt @@ -188,13 +190,25 @@ static inline void net_pkt_set_next_hdr(struct net_pkt *pkt, u8_t *hdr) #if defined(CONFIG_NET_TCP) static inline u8_t net_pkt_sent(struct net_pkt *pkt) { - return pkt->sent; + return pkt->sent_or_eof; } static inline void net_pkt_set_sent(struct net_pkt *pkt, bool sent) { - pkt->sent = sent; + pkt->sent_or_eof = sent; } + +#if defined(CONFIG_NET_SOCKETS) +static inline u8_t net_pkt_eof(struct net_pkt *pkt) +{ + return pkt->sent_or_eof; +} + +static inline void net_pkt_set_eof(struct net_pkt *pkt, bool eof) +{ + pkt->sent_or_eof = eof; +} +#endif #endif #if defined(CONFIG_NET_ROUTE)