NET: More renaming

This commit is contained in:
Gregory Nutt 2014-07-04 15:40:49 -06:00
parent b732388fcb
commit cce35ce975
49 changed files with 156 additions and 156 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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");

View File

@ -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);

View File

@ -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);

View File

@ -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 */

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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

View File

@ -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.

View File

@ -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)

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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
/****************************************************************************

View File

@ -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

View File

@ -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 */

View File

@ -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;

View File

@ -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

View File

@ -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");

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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 */

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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;

View File

@ -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

View File

@ -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 */