Commit ad2e6615 authored by Jukka Rissanen's avatar Jukka Rissanen
Browse files

net: Enable TCP support



User can enable TCP server (listening socket) support in the
IP stack. This commit does not yet have TCP client (connecting
socket) support.

Change-Id: I75dd02a81addc1d1e026463b53631d56378157df
Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent d0ba82a5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -106,6 +106,9 @@ struct ip_buf {
	void *uip_udp_conn;
	linkaddr_t dest;
	linkaddr_t src;
#if defined(CONFIG_NETWORKING_WITH_TCP)
	int8_t sent_status; /* tells if the TCP packet was sent ok or not */
#endif

	/* Neighbor discovery vars. Note that we are using void pointers here
	 * so that we do not need to include Contiki headers in this file.
@@ -203,6 +206,7 @@ struct ip_buf {
#define ip_buf_ll_dest(buf) (((struct ip_buf *)net_buf_user_data((buf)))->dest)
#define ip_buf_context(buf) (((struct ip_buf *)net_buf_user_data((buf)))->context)
#define ip_buf_type(ptr) (((struct ip_buf *)net_buf_user_data((ptr)))->type)
#define ip_buf_sent_status(ptr) (((struct ip_buf *)net_buf_user_data((ptr)))->sent_status)
/* @endcond */

/** NET_BUF_IP
+6 −0
Original line number Diff line number Diff line
@@ -42,6 +42,12 @@ extern "C" {
#define NET_PRINT(...)
#endif /* CONFIG_NETWORKING_WITH_LOGGING */

enum net_tcp_type {
	NET_TCP_TYPE_UNKNOWN = 0,
	NET_TCP_TYPE_SERVER,
	NET_TCP_TYPE_CLIENT,
};

struct net_buf;
struct net_context;

+7 −0
Original line number Diff line number Diff line
@@ -105,6 +105,13 @@ struct net_tuple {
	enum ip_protocol ip_proto;
};

#if defined(CONFIG_NETWORKING_WITH_TCP)
enum tcp_event_type {
	TCP_READ_EVENT = 1,
	TCP_WRITE_EVENT,
};
#endif

#ifdef __cplusplus
}
#endif
+18 −0
Original line number Diff line number Diff line
@@ -115,6 +115,24 @@ config NETWORKING_IPV6_NO_ND
	  slip and tun device.
endif

config	NETWORKING_WITH_TCP
	bool
	prompt "Enable TCP protocol"
	depends on NETWORKING
	default n
	help
	  Enable Transmission and Control Protocol (TCP) support.

config	TCP_MSS
	int
	prompt "TCP maximum segment size"
	depends on NETWORKING_WITH_TCP
	default 0
	help
	  Tweak the TCP maximum segment size. Normally one should
	  not change this but let the IP stack to calculate a best
	  size for it.

config	NETWORKING_WITH_RPL
	bool
	prompt "Enable RPL (ripple) IPv6 mesh routing protocol"
+13 −0
Original line number Diff line number Diff line
@@ -39,6 +39,12 @@ config NETWORK_IP_STACK_DEBUG_FULL
	bool "Print both messages and annotations"
endchoice

config NETWORK_IP_STACK_DEBUG_CONTEXT
	bool "Debug network context allocation"
	default n
	help
	  Enables printing of network context allocations and frees.

config NETWORK_IP_STACK_DEBUG_NET_BUF
	bool "Debug network buffer allocation"
	default n
@@ -51,6 +57,13 @@ config NETWORK_IP_STACK_DEBUG_RECV_SEND
	help
	  Enables generic debug printing when receiving and sending data.

config NETWORK_IP_STACK_DEBUG_TCP_PSOCK
	bool "Debug network TCP protosockets"
	depends on NETWORKING_WITH_TCP
	default n
	help
	  Enables debugging the protosockets used in TCP engine.

config NETWORK_IP_STACK_DEBUG_IPV6
	bool "Debug core IPv6"
	depends on NETWORKING_WITH_IPV6
Loading