Add definitions to support a local loopback link layer

This commit is contained in:
Gregory Nutt
2015-08-24 08:25:08 -06:00
parent 47bab42498
commit ea2fafb024
5 changed files with 37 additions and 8 deletions
+1
View File
@@ -76,6 +76,7 @@
enum net_lltype_e
{
NET_LL_ETHERNET = 0, /* Ethernet */
NET_LL_LOOPBACK, /* Local loopback */
NET_LL_SLIP, /* Serial Line Internet Protocol (SLIP) */
NET_LL_PPP, /* Point-to-Point Protocol (PPP) */
NET_LL_TUN, /* TUN Virtual Network Device */
+10 -3
View File
@@ -157,7 +157,7 @@
# define MAX_NET_DEV_MTU CONFIG_NET_ETH_MTU
#else
/* Perhaps only Unix domain sockets */
/* Perhaps only Unix domain sockets of the loopback device */
# define NET_LL_HDRLEN(d) 0
# define NET_DEV_MTU(d) 0
@@ -166,6 +166,10 @@
#endif /* MULTILINK or SLIP or ETHERNET */
/* For the loopback device, we will use the largest representable MTU */
#define NET_LO_MTU UINT16_MAX
/* Layer 3/4 Configuration Options ******************************************/
/* IP configuration options */
@@ -346,6 +350,7 @@
*/
#define TCP_MSS(d,h) (NET_DEV_MTU(d) - NET_LL_HDRLEN(d) - TCP_HDRLEN - (h))
#define LO_TCP_MSS(h) (NET_LO_MTU - (h))
/* If Ethernet is supported, then it will have the smaller MSS */
@@ -402,15 +407,17 @@
* See the note above regarding the TCP MSS and CONFIG_NET_MULTILINK.
*/
#define NET_LO_TCP_RECVWNDO LO_TCP_MSS(0)
#ifdef CONFIG_NET_SLIP
# ifndef CONFIG_NET_SLIP_TCP_RECVWNDO
# define CONFIG_NET_SLIP_TCP_RECVWNDO SLIP_TCP_MSS
# define CONFIG_NET_SLIP_TCP_RECVWNDO SLIP_TCP_MSS(0)
# endif
#endif
#ifdef CONFIG_NET_ETHERNET
# ifndef CONFIG_NET_ETH_TCP_RECVWNDO
# define CONFIG_NET_ETH_TCP_RECVWNDO ETH_TCP_MSS
# define CONFIG_NET_ETH_TCP_RECVWNDO ETH_TCP_MSS(0)
# endif
#endif