diff options
52 files changed, 163 insertions, 163 deletions
diff --git a/apps/include/netutils/httpd.h b/apps/include/netutils/httpd.h index d14b6bf4d..5da5ff762 100644 --- a/apps/include/netutils/httpd.h +++ b/apps/include/netutils/httpd.h @@ -80,7 +80,7 @@ * buffer be sufficiently large to contain the entire GET request. */ -#define HTTPD_IOBUFFER_SIZE (3*UIP_TCP_MSS) +#define HTTPD_IOBUFFER_SIZE (3*TCP_MSS) /* This is the maximum size of a file path */ diff --git a/apps/netutils/tftpc/tftpc_internal.h b/apps/netutils/tftpc/tftpc_internal.h index 1a9601c63..436090193 100644 --- a/apps/netutils/tftpc/tftpc_internal.h +++ b/apps/netutils/tftpc/tftpc_internal.h @@ -91,8 +91,8 @@ #define TFTP_DATAHEADERSIZE 4 #define TFTP_MAXPACKETSIZE (TFTP_DATAHEADERSIZE+512) -#if UIP_UDP_MSS < TFTP_MAXPACKETSIZE -# define TFTP_PACKETSIZE UIP_UDP_MSS +#if UDP_MSS < TFTP_MAXPACKETSIZE +# define TFTP_PACKETSIZE UDP_MSS # ifdef CONFIG_CPP_HAVE_WARNING # warning "uIP MSS is too small for TFTP" # endif diff --git a/misc/drivers/rtl8187x/rtl8187x.c b/misc/drivers/rtl8187x/rtl8187x.c index dd07d1d6d..b131ba2d3 100644 --- a/misc/drivers/rtl8187x/rtl8187x.c +++ b/misc/drivers/rtl8187x/rtl8187x.c @@ -2110,7 +2110,7 @@ static inline int rtl8187x_receive(FAR struct rtl8187x_state_s *priv, * and an Ethernet header */ - if (iolen < UIP_LLH_LEN + SIZEOF_RXDESC) + if (iolen < NET_LLH_LEN + SIZEOF_RXDESC) { RTL8187X_STATS(priv, rxtoosmall); RTL8187X_STATS(priv, rxdropped); @@ -2235,9 +2235,9 @@ static inline void rtl8187x_rxdispatch(FAR struct rtl8187x_state_s *priv, /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (ethhdr->type == HTONS(UIP_ETHTYPE_IP6)) + if (ethhdr->type == HTONS(ETHTYPE_IP6)) #else - if (ethhdr->type == HTONS(UIP_ETHTYPE_IP)) + if (ethhdr->type == HTONS(ETHTYPE_IP)) #endif { RTL8187X_STATS(priv, rxippackets); @@ -2254,7 +2254,7 @@ static inline void rtl8187x_rxdispatch(FAR struct rtl8187x_state_s *priv, rtl8187x_transmit(priv); } } - else if (ethhdr->type == htons(UIP_ETHTYPE_ARP)) + else if (ethhdr->type == htons(ETHTYPE_ARP)) { RTL8187X_STATS(priv, rxarppackets); arp_arpin(&priv->ethdev); diff --git a/nuttx/arch/arm/src/c5471/c5471_ethernet.c b/nuttx/arch/arm/src/c5471/c5471_ethernet.c index dcef92518..798b9dcde 100644 --- a/nuttx/arch/arm/src/c5471/c5471_ethernet.c +++ b/nuttx/arch/arm/src/c5471/c5471_ethernet.c @@ -1233,9 +1233,9 @@ static void c5471_receive(struct c5471_driver_s *c5471) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(dev); @@ -1254,7 +1254,7 @@ static void c5471_receive(struct c5471_driver_s *c5471) c5471_transmit(c5471); } } - else if (BUF->type == HTONS(UIP_ETHTYPE_ARP)) + else if (BUF->type == HTONS(ETHTYPE_ARP)) { arp_arpin(dev); diff --git a/nuttx/arch/arm/src/kinetis/kinetis_enet.c b/nuttx/arch/arm/src/kinetis/kinetis_enet.c index 1cc7eac58..fcd90d988 100644 --- a/nuttx/arch/arm/src/kinetis/kinetis_enet.c +++ b/nuttx/arch/arm/src/kinetis/kinetis_enet.c @@ -517,9 +517,9 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(&priv->dev); @@ -535,7 +535,7 @@ static void kinetis_receive(FAR struct kinetis_driver_s *priv) kinetis_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { arp_arpin(&priv->dev); diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c index e1522507c..11a796739 100644 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_ethernet.c @@ -859,9 +859,9 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { /* Handle the incoming Rx packet */ @@ -881,7 +881,7 @@ static void lpc17_rxdone(struct lpc17_driver_s *priv) lpc17_response(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { EMAC_STAT(priv, rx_arp); arp_arpin(&priv->lp_dev); diff --git a/nuttx/arch/arm/src/sam34/sam_emac.c b/nuttx/arch/arm/src/sam34/sam_emac.c index 0fe336195..cd85d7710 100644 --- a/nuttx/arch/arm/src/sam34/sam_emac.c +++ b/nuttx/arch/arm/src/sam34/sam_emac.c @@ -1133,9 +1133,9 @@ static void sam_receive(struct sam_emac_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - else if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + else if (BUF->type == HTONS(ETHTYPE_IP6)) #else - else if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + else if (BUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("IP frame\n"); @@ -1155,7 +1155,7 @@ static void sam_receive(struct sam_emac_s *priv) sam_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP frame\n"); diff --git a/nuttx/arch/arm/src/sama5/sam_emaca.c b/nuttx/arch/arm/src/sama5/sam_emaca.c index 66f924478..acaac9b8c 100644 --- a/nuttx/arch/arm/src/sama5/sam_emaca.c +++ b/nuttx/arch/arm/src/sama5/sam_emaca.c @@ -1173,9 +1173,9 @@ static void sam_receive(struct sam_emac_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - else if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + else if (BUF->type == HTONS(ETHTYPE_IP6)) #else - else if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + else if (BUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("IP frame\n"); @@ -1195,7 +1195,7 @@ static void sam_receive(struct sam_emac_s *priv) sam_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP frame\n"); diff --git a/nuttx/arch/arm/src/sama5/sam_emacb.c b/nuttx/arch/arm/src/sama5/sam_emacb.c index 9a0a70d67..c459b526e 100644 --- a/nuttx/arch/arm/src/sama5/sam_emacb.c +++ b/nuttx/arch/arm/src/sama5/sam_emacb.c @@ -1494,9 +1494,9 @@ static void sam_receive(struct sam_emac_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - else if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + else if (BUF->type == HTONS(ETHTYPE_IP6)) #else - else if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + else if (BUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("IP frame\n"); @@ -1516,7 +1516,7 @@ static void sam_receive(struct sam_emac_s *priv) sam_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP frame\n"); diff --git a/nuttx/arch/arm/src/sama5/sam_gmac.c b/nuttx/arch/arm/src/sama5/sam_gmac.c index 01ad32c58..992e3d72d 100644 --- a/nuttx/arch/arm/src/sama5/sam_gmac.c +++ b/nuttx/arch/arm/src/sama5/sam_gmac.c @@ -1103,9 +1103,9 @@ static void sam_receive(struct sam_gmac_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - else if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + else if (BUF->type == HTONS(ETHTYPE_IP6)) #else - else if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + else if (BUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("IP frame\n"); @@ -1125,7 +1125,7 @@ static void sam_receive(struct sam_gmac_s *priv) sam_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP frame\n"); diff --git a/nuttx/arch/arm/src/stm32/stm32_eth.c b/nuttx/arch/arm/src/stm32/stm32_eth.c index 0b3b3c2ab..29f589e15 100644 --- a/nuttx/arch/arm/src/stm32/stm32_eth.c +++ b/nuttx/arch/arm/src/stm32/stm32_eth.c @@ -1613,9 +1613,9 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - else if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + else if (BUF->type == HTONS(ETHTYPE_IP6)) #else - else if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + else if (BUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("IP frame\n"); @@ -1635,7 +1635,7 @@ static void stm32_receive(FAR struct stm32_ethmac_s *priv) stm32_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP frame\n"); diff --git a/nuttx/arch/arm/src/tiva/tiva_ethernet.c b/nuttx/arch/arm/src/tiva/tiva_ethernet.c index 4a988f1c2..6e97070bf 100644 --- a/nuttx/arch/arm/src/tiva/tiva_ethernet.c +++ b/nuttx/arch/arm/src/tiva/tiva_ethernet.c @@ -514,7 +514,7 @@ static int tiva_transmit(struct tiva_driver_s *priv) pktlen = priv->ld_dev.d_len; nllvdbg("Sending packet, pktlen: %d\n", pktlen); - DEBUGASSERT(pktlen > UIP_LLH_LEN); + DEBUGASSERT(pktlen > NET_LLH_LEN); dbuf = priv->ld_dev.d_buf; regval = (uint32_t)(pktlen - 14); @@ -676,7 +676,7 @@ static void tiva_receive(struct tiva_driver_s *priv) * and 4 byte FCS that are not copied into the uIP packet. */ - if (pktlen > (CONFIG_NET_BUFSIZE + 6) || pktlen <= (UIP_LLH_LEN + 6)) + if (pktlen > (CONFIG_NET_BUFSIZE + 6) || pktlen <= (NET_LLH_LEN + 6)) { int wordlen; @@ -758,9 +758,9 @@ static void tiva_receive(struct tiva_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (ETHBUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (ETHBUF->type == HTONS(ETHTYPE_IP6)) #else - if (ETHBUF->type == HTONS(UIP_ETHTYPE_IP)) + if (ETHBUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("IP packet received (%02x)\n", ETHBUF->type); @@ -779,7 +779,7 @@ static void tiva_receive(struct tiva_driver_s *priv) tiva_transmit(priv); } } - else if (ETHBUF->type == htons(UIP_ETHTYPE_ARP)) + else if (ETHBUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP packet received (%02x)\n", ETHBUF->type); EMAC_STAT(priv, rx_arp); diff --git a/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c b/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c index d9461ed3a..ebf4cc28f 100644 --- a/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c +++ b/nuttx/arch/hc/src/m9s12/m9s12_ethernet.c @@ -259,9 +259,9 @@ static void emac_receive(FAR struct emac_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(&priv->d_dev); @@ -277,7 +277,7 @@ static void emac_receive(FAR struct emac_driver_s *priv) emac_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { arp_arpin(&priv->d_dev); diff --git a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c index fb3d7b269..b76d0d2e9 100644 --- a/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c +++ b/nuttx/arch/mips/src/pic32mx/pic32mx-ethernet.c @@ -1427,9 +1427,9 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { /* Handle the incoming IP packet */ @@ -1449,7 +1449,7 @@ static void pic32mx_rxdone(struct pic32mx_driver_s *priv) pic32mx_response(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { /* Handle the incoming ARP packet */ diff --git a/nuttx/arch/sim/src/up_netdriver.c b/nuttx/arch/sim/src/up_netdriver.c index 649b9afaf..8b22c00f9 100644 --- a/nuttx/arch/sim/src/up_netdriver.c +++ b/nuttx/arch/sim/src/up_netdriver.c @@ -156,14 +156,14 @@ void netdriver_loop(void) * MAC address */ - if (g_sim_dev.d_len > UIP_LLH_LEN && up_comparemac(BUF->ether_dhost, &g_sim_dev.d_mac) == 0) + if (g_sim_dev.d_len > NET_LLH_LEN && up_comparemac(BUF->ether_dhost, &g_sim_dev.d_mac) == 0) { /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->ether_type == htons(UIP_ETHTYPE_IP6)) + if (BUF->ether_type == htons(ETHTYPE_IP6)) #else - if (BUF->ether_type == htons(UIP_ETHTYPE_IP)) + if (BUF->ether_type == htons(ETHTYPE_IP)) #endif { arp_ipin(&g_sim_dev); @@ -180,7 +180,7 @@ void netdriver_loop(void) netdev_send(g_sim_dev.d_buf, g_sim_dev.d_len); } } - else if (BUF->ether_type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->ether_type == htons(ETHTYPE_ARP)) { arp_arpin(&g_sim_dev); diff --git a/nuttx/arch/z80/src/ez80/ez80_emac.c b/nuttx/arch/z80/src/ez80/ez80_emac.c index ab9e08a1a..1926786bf 100644 --- a/nuttx/arch/z80/src/ez80/ez80_emac.c +++ b/nuttx/arch/z80/src/ez80/ez80_emac.c @@ -1266,9 +1266,9 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (ETHBUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (ETHBUF->type == HTONS(ETHTYPE_IP6)) #else - if (ETHBUF->type == HTONS(UIP_ETHTYPE_IP)) + if (ETHBUF->type == HTONS(ETHTYPE_IP)) #endif { nvdbg("IP packet received (%02x)\n", ETHBUF->type); @@ -1287,7 +1287,7 @@ static int ez80emac_receive(struct ez80emac_driver_s *priv) ez80emac_transmit(priv); } } - else if (ETHBUF->type == htons(UIP_ETHTYPE_ARP)) + else if (ETHBUF->type == htons(ETHTYPE_ARP)) { nvdbg("ARP packet received (%02x)\n", ETHBUF->type); EMAC_STAT(priv, rx_arp); diff --git a/nuttx/drivers/net/cs89x0.c b/nuttx/drivers/net/cs89x0.c index 89ac47210..f53430ede 100644 --- a/nuttx/drivers/net/cs89x0.c +++ b/nuttx/drivers/net/cs89x0.c @@ -433,9 +433,9 @@ static void cs89x0_receive(struct cs89x0_driver_s *cs89x0, uint16_t isq) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(&cs89x0->cs_dev); @@ -451,7 +451,7 @@ static void cs89x0_receive(struct cs89x0_driver_s *cs89x0, uint16_t isq) cs89x0_transmit(cs89x0); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { arp_arpin(&cs89x0->cs_dev); diff --git a/nuttx/drivers/net/dm90x0.c b/nuttx/drivers/net/dm90x0.c index f3c4090a1..5db1a4870 100644 --- a/nuttx/drivers/net/dm90x0.c +++ b/nuttx/drivers/net/dm90x0.c @@ -963,7 +963,7 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x) /* Also check if the packet is a valid size for the uIP configuration */ - else if (rx.desc.rx_len < UIP_LLH_LEN || rx.desc.rx_len > (CONFIG_NET_BUFSIZE + 2)) + else if (rx.desc.rx_len < NET_LLH_LEN || rx.desc.rx_len > (CONFIG_NET_BUFSIZE + 2)) { #if defined(CONFIG_DM9X_STATS) dm9x->dm_nrxlengtherrors++; @@ -983,9 +983,9 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(&dm9x->dm_dev); @@ -1001,7 +1001,7 @@ static void dm9x_receive(struct dm9x_driver_s *dm9x) dm9x_transmit(dm9x); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { arp_arpin(&dm9x->dm_dev); diff --git a/nuttx/drivers/net/e1000.c b/nuttx/drivers/net/e1000.c index ce3fe13ce..fe9f5acde 100644 --- a/nuttx/drivers/net/e1000.c +++ b/nuttx/drivers/net/e1000.c @@ -567,10 +567,10 @@ static void e1000_receive(struct e1000_dev *e1000) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else { - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(&e1000->netdev); @@ -586,7 +586,7 @@ static void e1000_receive(struct e1000_dev *e1000) e1000_transmit(e1000); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { arp_arpin(&e1000->netdev); diff --git a/nuttx/drivers/net/enc28j60.c b/nuttx/drivers/net/enc28j60.c index 25a0272e8..36ee9966b 100644 --- a/nuttx/drivers/net/enc28j60.c +++ b/nuttx/drivers/net/enc28j60.c @@ -1372,9 +1372,9 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("IP packet received (%02x)\n", BUF->type); @@ -1391,7 +1391,7 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv) enc_transmit(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP packet received (%02x)\n", BUF->type); arp_arpin(&priv->dev); @@ -1482,7 +1482,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv) /* Check for a usable packet length (4 added for the CRC) */ - else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (UIP_LLH_LEN + 4)) + else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (NET_LLH_LEN + 4)) { nlldbg("Bad packet size dropped (%d)\n", pktlen); #ifdef CONFIG_ENC28J60_STATS diff --git a/nuttx/drivers/net/encx24j600.c b/nuttx/drivers/net/encx24j600.c index d6cd1386e..a6c4f8ce2 100644 --- a/nuttx/drivers/net/encx24j600.c +++ b/nuttx/drivers/net/encx24j600.c @@ -1489,9 +1489,9 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { nllvdbg("Try to process IP packet (%02x)\n", BUF->type); @@ -1518,7 +1518,7 @@ static void enc_rxdispatch(FAR struct enc_driver_s *priv) enc_txenqueue(priv); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { nllvdbg("ARP packet received (%02x)\n", BUF->type); arp_arpin(&priv->dev); @@ -1649,7 +1649,7 @@ static void enc_pktif(FAR struct enc_driver_s *priv) /* Check for a usable packet length (4 added for the CRC) */ - else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (UIP_LLH_LEN + 4)) + else if (pktlen > (CONFIG_NET_BUFSIZE + 4) || pktlen <= (NET_LLH_LEN + 4)) { nlldbg("Bad packet size dropped (%d)\n", pktlen); diff --git a/nuttx/drivers/net/skeleton.c b/nuttx/drivers/net/skeleton.c index 63ff38d6d..19eeca5ab 100644 --- a/nuttx/drivers/net/skeleton.c +++ b/nuttx/drivers/net/skeleton.c @@ -259,9 +259,9 @@ static void skel_receive(FAR struct skel_driver_s *skel) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(&skel->sk_dev); @@ -277,7 +277,7 @@ static void skel_receive(FAR struct skel_driver_s *skel) skel_transmit(skel); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) + else if (BUF->type == htons(ETHTYPE_ARP)) { arp_arpin(&skel->sk_dev); diff --git a/nuttx/drivers/net/slip.c b/nuttx/drivers/net/slip.c index 56a61d531..083eb4ec2 100644 --- a/nuttx/drivers/net/slip.c +++ b/nuttx/drivers/net/slip.c @@ -74,8 +74,8 @@ /* Configuration ************************************************************/ -#if UIP_LLH_LEN > 0 -# error "UIP_LLH_LEN must be set to zero" +#if NET_LLH_LEN > 0 +# error "NET_LLH_LEN must be set to zero" #endif #ifndef CONFIG_NET_NOINTS diff --git a/nuttx/drivers/net/vnet.c b/nuttx/drivers/net/vnet.c index 8817f6b90..aa8c85424 100644 --- a/nuttx/drivers/net/vnet.c +++ b/nuttx/drivers/net/vnet.c @@ -288,9 +288,9 @@ void rtos_vnet_recv(struct rgmp_vnet *rgmp_vnet, char *data, int len) /* We only accept IP packets of the configured type and ARP packets */ #ifdef CONFIG_NET_IPv6 - if (BUF->type == HTONS(UIP_ETHTYPE_IP6)) + if (BUF->type == HTONS(ETHTYPE_IP6)) #else - if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + if (BUF->type == HTONS(ETHTYPE_IP)) #endif { arp_ipin(&vnet->sk_dev); @@ -303,7 +303,7 @@ void rtos_vnet_recv(struct rgmp_vnet *rgmp_vnet, char *data, int len) vnet_transmit(vnet); } } - else if (BUF->type == htons(UIP_ETHTYPE_ARP)) { + else if (BUF->type == htons(ETHTYPE_ARP)) { arp_arpin(&vnet->sk_dev); // If the above function invocation resulted in data that should be diff --git a/nuttx/fs/nfs/nfs_vfsops.c b/nuttx/fs/nfs/nfs_vfsops.c index 0a45c0307..7a35c1317 100644 --- a/nuttx/fs/nfs/nfs_vfsops.c +++ b/nuttx/fs/nfs/nfs_vfsops.c @@ -1715,9 +1715,9 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data, /* But don't let the buffer size exceed the MSS of the socket type */ - if (buflen > UIP_UDP_MSS) + if (buflen > UDP_MSS) { - buflen = UIP_UDP_MSS; + buflen = UDP_MSS; } /* Create an instance of the mountpt state structure */ diff --git a/nuttx/include/nuttx/net/arp.h b/nuttx/include/nuttx/net/arp.h index 06f54d9d8..ebc8e9dc4 100644 --- a/nuttx/include/nuttx/net/arp.h +++ b/nuttx/include/nuttx/net/arp.h @@ -60,13 +60,13 @@ /* Recognized values of the type bytes in the Ethernet header */ -#define UIP_ETHTYPE_ARP 0x0806 /* Address resolution protocol */ -#define UIP_ETHTYPE_IP 0x0800 /* IP protocol */ -#define UIP_ETHTYPE_IP6 0x86dd /* IP protocol version 6 */ +#define ETHTYPE_ARP 0x0806 /* Address resolution protocol */ +#define ETHTYPE_IP 0x0800 /* IP protocol */ +#define ETHTYPE_IP6 0x86dd /* IP protocol version 6 */ /* Size of the Ethernet header */ -#define UIP_ETHH_LEN 14 /* Minimum size: 2*6 + 2 */ +#define ETHHDR_LEN 14 /* Minimum size: 2*6 + 2 */ /**************************************************************************** * Public Types diff --git a/nuttx/include/nuttx/net/netconfig.h b/nuttx/include/nuttx/net/netconfig.h index 80fa26f66..73f4cea00 100644 --- a/nuttx/include/nuttx/net/netconfig.h +++ b/nuttx/include/nuttx/net/netconfig.h @@ -89,11 +89,11 @@ # ifdef CONFIG_NET_IPv6 # error "SLIP is not implemented for IPv6" # endif -# define UIP_LLH_LEN 0 +# define NET_LLH_LEN 0 #else # define CONFIG_NET_ETHERNET 1 # define CONFIG_NET_ARP 1 -# define UIP_LLH_LEN 14 +# define NET_LLH_LEN 14 #endif /* Layer 3/4 Configuration Options ******************************************/ @@ -158,10 +158,10 @@ #endif /* The UDP maximum packet size. This is should not be to set to more - * than CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN. + * than CONFIG_NET_BUFSIZE - NET_LLH_LEN - UIP_IPUDPH_LEN. */ -#define UIP_UDP_MSS (CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_IPUDPH_LEN) +#define UDP_MSS (CONFIG_NET_BUFSIZE - NET_LLH_LEN - UIP_IPUDPH_LEN) /* TCP configuration options */ @@ -223,10 +223,10 @@ #define UIP_MAXSYNRTX 5 /* The TCP maximum segment size. This is should not be set to more - * than CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN. + * than CONFIG_NET_BUFSIZE - NET_LLH_LEN - UIP_TCPIP_HLEN. */ -#define UIP_TCP_MSS (CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) +#define TCP_MSS (CONFIG_NET_BUFSIZE - NET_LLH_LEN - UIP_TCPIP_HLEN) /* The size of the advertised receiver's window. * @@ -236,7 +236,7 @@ */ #ifndef CONFIG_NET_RECEIVE_WINDOW -# define CONFIG_NET_RECEIVE_WINDOW UIP_TCP_MSS +# define CONFIG_NET_RECEIVE_WINDOW TCP_MSS #endif /* How long a connection should stay in the TIME_WAIT state. diff --git a/nuttx/include/nuttx/net/netdev.h b/nuttx/include/nuttx/net/netdev.h index 76556b86b..30f404d62 100644 --- a/nuttx/include/nuttx/net/netdev.h +++ b/nuttx/include/nuttx/net/netdev.h @@ -110,7 +110,7 @@ struct net_driver_s * driver should place incoming data into this buffer. When sending data, * the device driver should read the link level headers and the TCP/IP * headers from this buffer. The size of the link level headers is - * configured by the UIP_LLH_LEN define. + * configured by the NET_LLH_LEN define. * * uIP will handle only a single buffer for both incoming and outgoing * packets. However, the drive design may be concurrently send and @@ -246,7 +246,7 @@ typedef int (*devif_poll_callback_t)(struct net_driver_s *dev); * dev->d_len = ethernet_devicedrver_poll(); * if (dev->d_len > 0) * { - * if (BUF->type == HTONS(UIP_ETHTYPE_IP)) + * if (BUF->type == HTONS(ETHTYPE_IP)) * { * arp_ipin(); * devif_input(dev); @@ -256,7 +256,7 @@ typedef int (*devif_poll_callback_t)(struct net_driver_s *dev); * devicedriver_send(); * } * } - * else if (BUF->type == HTONS(UIP_ETHTYPE_ARP)) + * else if (BUF->type == HTONS(ETHTYPE_ARP)) * { * arp_arpin(); * if (dev->d_len > 0) diff --git a/nuttx/include/nuttx/net/tcp.h b/nuttx/include/nuttx/net/tcp.h index 3b62d4a29..38c259002 100644 --- a/nuttx/include/nuttx/net/tcp.h +++ b/nuttx/include/nuttx/net/tcp.h @@ -120,10 +120,10 @@ * This is a long established rule. */ -#if UIP_TCP_MSS > 576 +#if TCP_MSS > 576 # define UIP_TCP_INITIAL_MSS 576 #else -# define UIP_TCP_INITIAL_MSS UIP_TCP_MSS +# define UIP_TCP_INITIAL_MSS TCP_MSS #endif #ifdef CONFIG_NET_TCP_WRITE_BUFFERS diff --git a/nuttx/include/nuttx/net/uip.h b/nuttx/include/nuttx/net/uip.h index 7fcffb7b2..1e3ad46f3 100644 --- a/nuttx/include/nuttx/net/uip.h +++ b/nuttx/include/nuttx/net/uip.h @@ -139,7 +139,7 @@ * snprintf(dev->d_appdata, UIP_APPDATA_SIZE, "%u\n", i); */ -#define UIP_APPDATA_SIZE (CONFIG_NET_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) +#define UIP_APPDATA_SIZE (CONFIG_NET_BUFSIZE - NET_LLH_LEN - UIP_TCPIP_HLEN) #define UIP_PROTO_ICMP 1 #define UIP_PROTO_IGMP 2 @@ -205,7 +205,7 @@ struct net_iphdr_s #endif /* CONFIG_NET_IPv6 */ }; -/* Describes a uIP callback +/* Describes a device interface callback * * flink - Supports a singly linked list * event - Provides the address of the callback function entry point. @@ -213,8 +213,8 @@ struct net_iphdr_s * udp_conn_s. * priv - Holds a reference to application specific data that will * provided - * flags - Set by the application to inform the uIP layer which flags - * are and are not handled by the callback. + * flags - Set by the application to inform the lower layer which flags + * were and were not handled by the callback. */ struct net_driver_s; /* Forward reference */ diff --git a/nuttx/net/arp/arp_inout.c b/nuttx/net/arp/arp_inout.c index 4026a99e6..09d17b944 100644 --- a/nuttx/net/arp/arp_inout.c +++ b/nuttx/net/arp/arp_inout.c @@ -84,8 +84,8 @@ #define RASIZE 4 /* Size of ROUTER ALERT */ #define ETHBUF ((struct eth_hdr_s *)&dev->d_buf[0]) -#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[UIP_LLH_LEN]) -#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define ARPBUF ((struct arp_hdr_s *)&dev->d_buf[NET_LLH_LEN]) +#define IPBUF ((struct arp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Private Types @@ -237,7 +237,7 @@ void arp_arpin(struct net_driver_s *dev) struct arp_hdr_s *parp = ARPBUF; in_addr_t ipaddr; - if (dev->d_len < (sizeof(struct arp_hdr_s) + UIP_LLH_LEN)) + if (dev->d_len < (sizeof(struct arp_hdr_s) + NET_LLH_LEN)) { nlldbg("Too small\n"); dev->d_len = 0; @@ -276,8 +276,8 @@ void arp_arpin(struct net_driver_s *dev) net_ipaddr_hdrcopy(parp->ah_sipaddr, &dev->d_ipaddr); arp_dump(parp); - peth->type = HTONS(UIP_ETHTYPE_ARP); - dev->d_len = sizeof(struct arp_hdr_s) + UIP_LLH_LEN; + peth->type = HTONS(ETHTYPE_ARP); + dev->d_len = sizeof(struct arp_hdr_s) + NET_LLH_LEN; } break; @@ -432,13 +432,13 @@ void arp_out(struct net_driver_s *dev) parp->ah_opcode = HTONS(ARP_REQUEST); parp->ah_hwtype = HTONS(ARP_HWTYPE_ETH); - parp->ah_protocol = HTONS(UIP_ETHTYPE_IP); + parp->ah_protocol = HTONS(ETHTYPE_IP); parp->ah_hwlen = ETHER_ADDR_LEN; parp->ah_protolen = 4; arp_dump(parp); - peth->type = HTONS(UIP_ETHTYPE_ARP); - dev->d_len = sizeof(struct arp_hdr_s) + UIP_LLH_LEN; + peth->type = HTONS(ETHTYPE_ARP); + dev->d_len = sizeof(struct arp_hdr_s) + NET_LLH_LEN; return; } @@ -450,8 +450,8 @@ void arp_out(struct net_driver_s *dev) /* Finish populating the Ethernet header */ memcpy(peth->src, dev->d_mac.ether_addr_octet, ETHER_ADDR_LEN); - peth->type = HTONS(UIP_ETHTYPE_IP); - dev->d_len += UIP_LLH_LEN; + peth->type = HTONS(ETHTYPE_IP); + dev->d_len += NET_LLH_LEN; } #endif /* CONFIG_NET_ARP */ diff --git a/nuttx/net/devif/devif_input.c b/nuttx/net/devif/devif_input.c index a31412e88..55555cb55 100644 --- a/nuttx/net/devif/devif_input.c +++ b/nuttx/net/devif/devif_input.c @@ -107,13 +107,13 @@ /* Macros. */ -#define BUF ((FAR struct net_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define BUF ((FAR struct net_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) #define FBUF ((FAR struct net_iphdr_s *)&g_reassembly_buffer[0]) /* IP fragment re-assembly */ #define IP_MF 0x20 -#define UIP_REASS_BUFSIZE (CONFIG_NET_BUFSIZE - UIP_LLH_LEN) +#define UIP_REASS_BUFSIZE (CONFIG_NET_BUFSIZE - NET_LLH_LEN) #define UIP_REASS_FLAG_LASTFRAG 0x01 /**************************************************************************** diff --git a/nuttx/net/icmp/icmp_input.c b/nuttx/net/icmp/icmp_input.c index 44dbfba28..63c94c979 100644 --- a/nuttx/net/icmp/icmp_input.c +++ b/nuttx/net/icmp/icmp_input.c @@ -64,7 +64,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Public Variables diff --git a/nuttx/net/icmp/icmp_ping.c b/nuttx/net/icmp/icmp_ping.c index 5271f179c..11763503a 100644 --- a/nuttx/net/icmp/icmp_ping.c +++ b/nuttx/net/icmp/icmp_ping.c @@ -62,8 +62,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) -#define ICMPDAT (&dev->d_buf[UIP_LLH_LEN + sizeof(struct icmp_iphdr_s)]) +#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) +#define ICMPDAT (&dev->d_buf[NET_LLH_LEN + sizeof(struct icmp_iphdr_s)]) /* Allocate a new ICMP data callback */ diff --git a/nuttx/net/icmp/icmp_poll.c b/nuttx/net/icmp/icmp_poll.c index 720b2c69b..849f8acd7 100644 --- a/nuttx/net/icmp/icmp_poll.c +++ b/nuttx/net/icmp/icmp_poll.c @@ -90,8 +90,8 @@ void icmp_poll(FAR struct net_driver_s *dev) { /* Setup for the application callback */ - dev->d_appdata = &dev->d_buf[UIP_LLH_LEN + UIP_IPICMPH_LEN]; - dev->d_snddata = &dev->d_buf[UIP_LLH_LEN + UIP_IPICMPH_LEN]; + dev->d_appdata = &dev->d_buf[NET_LLH_LEN + UIP_IPICMPH_LEN]; + dev->d_snddata = &dev->d_buf[NET_LLH_LEN + UIP_IPICMPH_LEN]; dev->d_len = 0; dev->d_sndlen = 0; diff --git a/nuttx/net/icmp/icmp_send.c b/nuttx/net/icmp/icmp_send.c index 443600f1c..3bb3a884a 100644 --- a/nuttx/net/icmp/icmp_send.c +++ b/nuttx/net/icmp/icmp_send.c @@ -55,7 +55,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Public Variables diff --git a/nuttx/net/igmp/igmp_input.c b/nuttx/net/igmp/igmp_input.c index b3f2090bb..7668f81c5 100644 --- a/nuttx/net/igmp/igmp_input.c +++ b/nuttx/net/igmp/igmp_input.c @@ -61,7 +61,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define IGMPBUF ((struct igmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define IGMPBUF ((struct igmp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Private Functions @@ -124,7 +124,7 @@ void igmp_input(struct net_driver_s *dev) /* Verify the message length */ - if (dev->d_len < UIP_LLH_LEN+UIP_IPIGMPH_LEN) + if (dev->d_len < NET_LLH_LEN+UIP_IPIGMPH_LEN) { IGMP_STATINCR(g_netstats.igmp.length_errors); nlldbg("Length error\n"); diff --git a/nuttx/net/igmp/igmp_poll.c b/nuttx/net/igmp/igmp_poll.c index cdef3111e..8d998bdab 100644 --- a/nuttx/net/igmp/igmp_poll.c +++ b/nuttx/net/igmp/igmp_poll.c @@ -151,8 +151,8 @@ void igmp_poll(FAR struct net_driver_s *dev) /* Setup the poll operation */ - dev->d_appdata = &dev->d_buf[UIP_LLH_LEN + UIP_IPIGMPH_LEN]; - dev->d_snddata = &dev->d_buf[UIP_LLH_LEN + UIP_IPIGMPH_LEN]; + dev->d_appdata = &dev->d_buf[NET_LLH_LEN + UIP_IPIGMPH_LEN]; + dev->d_snddata = &dev->d_buf[NET_LLH_LEN + UIP_IPIGMPH_LEN]; dev->d_len = 0; dev->d_sndlen = 0; diff --git a/nuttx/net/igmp/igmp_send.c b/nuttx/net/igmp/igmp_send.c index 5134b2b51..ec7b02189 100644 --- a/nuttx/net/igmp/igmp_send.c +++ b/nuttx/net/igmp/igmp_send.c @@ -75,7 +75,7 @@ /* Buffer layout */ #define RASIZE (4) -#define IGMPBUF ((struct igmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define IGMPBUF ((struct igmp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Public Variables diff --git a/nuttx/net/pkt/pkt_poll.c b/nuttx/net/pkt/pkt_poll.c index 33b3bfb41..060ea75fd 100644 --- a/nuttx/net/pkt/pkt_poll.c +++ b/nuttx/net/pkt/pkt_poll.c @@ -104,8 +104,8 @@ void pkt_poll(FAR struct net_driver_s *dev, FAR struct pkt_conn_s *conn) { /* Setup for the application callback */ - dev->d_appdata = &dev->d_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; - dev->d_snddata = &dev->d_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; + dev->d_appdata = &dev->d_buf[NET_LLH_LEN + UIP_IPUDPH_LEN]; + dev->d_snddata = &dev->d_buf[NET_LLH_LEN + UIP_IPUDPH_LEN]; dev->d_len = 0; dev->d_sndlen = 0; diff --git a/nuttx/net/socket/net_sendfile.c b/nuttx/net/socket/net_sendfile.c index e70af9eef..ab392e01a 100644 --- a/nuttx/net/socket/net_sendfile.c +++ b/nuttx/net/socket/net_sendfile.c @@ -75,7 +75,7 @@ # define CONFIG_NET_TCP_SPLIT_SIZE 40 #endif -#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Private Types diff --git a/nuttx/net/socket/recvfrom.c b/nuttx/net/socket/recvfrom.c index cd1334554..c6ccee67b 100644 --- a/nuttx/net/socket/recvfrom.c +++ b/nuttx/net/socket/recvfrom.c @@ -71,8 +71,8 @@ * Definitions ****************************************************************************/ -#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) -#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) +#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Private Types diff --git a/nuttx/net/tcp/tcp_input.c b/nuttx/net/tcp/tcp_input.c index 49455febc..62b0aff7b 100644 --- a/nuttx/net/tcp/tcp_input.c +++ b/nuttx/net/tcp/tcp_input.c @@ -64,7 +64,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define BUF ((struct tcp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define BUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Public Variables @@ -110,8 +110,8 @@ void tcp_input(struct net_driver_s *dev) int len; int i; - dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; - dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; + dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN]; + dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN]; #ifdef CONFIG_NET_STATISTICS g_netstats.tcp.recv++; @@ -219,7 +219,7 @@ void tcp_input(struct net_driver_s *dev) { for (i = 0; i < ((pbuf->tcpoffset >> 4) - 5) << 2 ;) { - opt = dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + i]; + opt = dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + i]; if (opt == TCP_OPT_END) { /* End of options. */ @@ -233,13 +233,13 @@ void tcp_input(struct net_driver_s *dev) ++i; } else if (opt == TCP_OPT_MSS && - dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + i] == TCP_OPT_MSS_LEN) + dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 1 + i] == TCP_OPT_MSS_LEN) { /* An MSS option with the right option length. */ - tmp16 = ((uint16_t)dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + i] << 8) | - (uint16_t)dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + 3 + i]; - conn->mss = tmp16 > UIP_TCP_MSS ? UIP_TCP_MSS : tmp16; + tmp16 = ((uint16_t)dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 2 + i] << 8) | + (uint16_t)dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN + 3 + i]; + conn->mss = tmp16 > TCP_MSS ? TCP_MSS : tmp16; /* And we are done processing options. */ @@ -251,7 +251,7 @@ void tcp_input(struct net_driver_s *dev) * can skip past them. */ - if (dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + i] == 0) + if (dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 1 + i] == 0) { /* If the length field is zero, the options are malformed * and we don't process them further. @@ -259,7 +259,7 @@ void tcp_input(struct net_driver_s *dev) break; } - i += dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + i]; + i += dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 1 + i]; } } } @@ -509,7 +509,7 @@ found: { for (i = 0; i < ((pbuf->tcpoffset >> 4) - 5) << 2 ;) { - opt = dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN + i]; + opt = dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN + i]; if (opt == TCP_OPT_END) { /* End of options. */ @@ -523,14 +523,14 @@ found: ++i; } else if (opt == TCP_OPT_MSS && - dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + i] == TCP_OPT_MSS_LEN) + dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 1 + i] == TCP_OPT_MSS_LEN) { /* An MSS option with the right option length. */ tmp16 = - (dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 2 + i] << 8) | - dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 3 + i]; - conn->mss = tmp16 > UIP_TCP_MSS ? UIP_TCP_MSS : tmp16; + (dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 2 + i] << 8) | + dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 3 + i]; + conn->mss = tmp16 > TCP_MSS ? TCP_MSS : tmp16; /* And we are done processing options. */ @@ -542,7 +542,7 @@ found: * easily can skip past them. */ - if (dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + i] == 0) + if (dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 1 + i] == 0) { /* If the length field is zero, the options are * malformed and we don't process them further. @@ -550,7 +550,7 @@ found: break; } - i += dev->d_buf[UIP_TCPIP_HLEN + UIP_LLH_LEN + 1 + i]; + i += dev->d_buf[UIP_TCPIP_HLEN + NET_LLH_LEN + 1 + i]; } } } @@ -692,7 +692,7 @@ found: * When the application is called, the d_len field * contains the length of the incoming data. The application can * access the incoming data through the global pointer - * d_appdata, which usually points UIP_IPTCPH_LEN + UIP_LLH_LEN + * d_appdata, which usually points UIP_IPTCPH_LEN + NET_LLH_LEN * bytes into the d_buf array. * * If the application wishes to send any data, this data should be diff --git a/nuttx/net/tcp/tcp_poll.c b/nuttx/net/tcp/tcp_poll.c index a63661391..b02ccd762 100644 --- a/nuttx/net/tcp/tcp_poll.c +++ b/nuttx/net/tcp/tcp_poll.c @@ -104,8 +104,8 @@ void tcp_poll(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn) { /* Set up for the callback */ - dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; - dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; + dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN]; + dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN]; dev->d_len = 0; dev->d_sndlen = 0; diff --git a/nuttx/net/tcp/tcp_send.c b/nuttx/net/tcp/tcp_send.c index 4e84d667d..7d792c827 100644 --- a/nuttx/net/tcp/tcp_send.c +++ b/nuttx/net/tcp/tcp_send.c @@ -60,7 +60,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define BUF ((struct tcp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define BUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Public Variables @@ -358,8 +358,8 @@ void tcp_ack(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, pbuf->optdata[0] = TCP_OPT_MSS; pbuf->optdata[1] = TCP_OPT_MSS_LEN; - pbuf->optdata[2] = (UIP_TCP_MSS) / 256; - pbuf->optdata[3] = (UIP_TCP_MSS) & 255; + pbuf->optdata[2] = (TCP_MSS) / 256; + pbuf->optdata[3] = (TCP_MSS) & 255; dev->d_len = UIP_IPTCPH_LEN + TCP_OPT_MSS_LEN; pbuf->tcpoffset = ((UIP_TCPH_LEN + TCP_OPT_MSS_LEN) / 4) << 4; diff --git a/nuttx/net/tcp/tcp_send_buffered.c b/nuttx/net/tcp/tcp_send_buffered.c index dda1233d0..fd8fbd2c9 100644 --- a/nuttx/net/tcp/tcp_send_buffered.c +++ b/nuttx/net/tcp/tcp_send_buffered.c @@ -77,7 +77,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /* Debug */ diff --git a/nuttx/net/tcp/tcp_send_unbuffered.c b/nuttx/net/tcp/tcp_send_unbuffered.c index 193db3f34..ad7f5d237 100644 --- a/nuttx/net/tcp/tcp_send_unbuffered.c +++ b/nuttx/net/tcp/tcp_send_unbuffered.c @@ -69,7 +69,7 @@ # define CONFIG_NET_TCP_SPLIT_SIZE 40 #endif -#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define TCPBUF ((struct tcp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Private Types diff --git a/nuttx/net/tcp/tcp_timer.c b/nuttx/net/tcp/tcp_timer.c index 441c2106d..7bed2764e 100644 --- a/nuttx/net/tcp/tcp_timer.c +++ b/nuttx/net/tcp/tcp_timer.c @@ -101,8 +101,8 @@ void tcp_timer(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, { uint8_t result; - dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; - dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + UIP_LLH_LEN]; + dev->d_snddata = &dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN]; + dev->d_appdata = &dev->d_buf[UIP_IPTCPH_LEN + NET_LLH_LEN]; /* Increase the TCP sequence number */ diff --git a/nuttx/net/udp/udp_input.c b/nuttx/net/udp/udp_input.c index 4627883e3..3183ccd98 100644 --- a/nuttx/net/udp/udp_input.c +++ b/nuttx/net/udp/udp_input.c @@ -61,7 +61,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Public Variables @@ -115,7 +115,7 @@ int udp_input(FAR struct net_driver_s *dev) dev->d_len -= UIP_IPUDPH_LEN; #ifdef CONFIG_NET_UDP_CHECKSUMS - dev->d_appdata = &dev->d_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; + dev->d_appdata = &dev->d_buf[NET_LLH_LEN + UIP_IPUDPH_LEN]; if (pbuf->udpchksum != 0 && udp_chksum(dev) != 0xffff) { #ifdef CONFIG_NET_STATISTICS @@ -137,8 +137,8 @@ int udp_input(FAR struct net_driver_s *dev) /* Set-up for the application callback */ - dev->d_appdata = &dev->d_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; - dev->d_snddata = &dev->d_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; + dev->d_appdata = &dev->d_buf[NET_LLH_LEN + UIP_IPUDPH_LEN]; + dev->d_snddata = &dev->d_buf[NET_LLH_LEN + UIP_IPUDPH_LEN]; dev->d_sndlen = 0; /* Perform the application callback */ diff --git a/nuttx/net/udp/udp_poll.c b/nuttx/net/udp/udp_poll.c index 3f612c38e..e09520fd5 100644 --- a/nuttx/net/udp/udp_poll.c +++ b/nuttx/net/udp/udp_poll.c @@ -101,8 +101,8 @@ void udp_poll(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn) { /* Set-up for the application callback */ - dev->d_appdata = &dev->d_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; - dev->d_snddata = &dev->d_buf[UIP_LLH_LEN + UIP_IPUDPH_LEN]; + dev->d_appdata = &dev->d_buf[NET_LLH_LEN + UIP_IPUDPH_LEN]; + dev->d_snddata = &dev->d_buf[NET_LLH_LEN + UIP_IPUDPH_LEN]; dev->d_len = 0; dev->d_sndlen = 0; diff --git a/nuttx/net/udp/udp_send.c b/nuttx/net/udp/udp_send.c index b3bc9a408..b8d0457d1 100644 --- a/nuttx/net/udp/udp_send.c +++ b/nuttx/net/udp/udp_send.c @@ -60,7 +60,7 @@ * Pre-processor Definitions ****************************************************************************/ -#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Public Variables diff --git a/nuttx/net/utils/net_chksum.c b/nuttx/net/utils/net_chksum.c index 0f1d13bc9..55aa75339 100644 --- a/nuttx/net/utils/net_chksum.c +++ b/nuttx/net/utils/net_chksum.c @@ -54,8 +54,8 @@ * Pre-processor Definitions ****************************************************************************/ -#define BUF ((struct net_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) -#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN]) +#define BUF ((struct net_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) +#define ICMPBUF ((struct icmp_iphdr_s *)&dev->d_buf[NET_LLH_LEN]) /**************************************************************************** * Private Data @@ -145,7 +145,7 @@ static uint16_t upper_layer_chksum(FAR struct net_driver_s *dev, uint8_t proto) /* Sum TCP header and data. */ - sum = chksum(sum, &dev->d_buf[UIP_IPH_LEN + UIP_LLH_LEN], upper_layer_len); + sum = chksum(sum, &dev->d_buf[UIP_IPH_LEN + NET_LLH_LEN], upper_layer_len); return (sum == 0) ? 0xffff : htons(sum); } @@ -285,7 +285,7 @@ uint16_t ip_chksum(FAR struct net_driver_s *dev) { uint16_t sum; - sum = chksum(0, &dev->d_buf[UIP_LLH_LEN], UIP_IPH_LEN); + sum = chksum(0, &dev->d_buf[NET_LLH_LEN], UIP_IPH_LEN); return (sum == 0) ? 0xffff : htons(sum); } #endif /* CONFIG_NET_ARCH_CHKSUM */ |