summaryrefslogtreecommitdiff
path: root/nuttx/net/udp/udp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/net/udp/udp_input.c')
-rw-r--r--nuttx/net/udp/udp_input.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/nuttx/net/udp/udp_input.c b/nuttx/net/udp/udp_input.c
index 9097fe077..13b2e100d 100644
--- a/nuttx/net/udp/udp_input.c
+++ b/nuttx/net/udp/udp_input.c
@@ -52,12 +52,13 @@
#include <nuttx/net/netdev.h>
#include "uip/uip.h"
+#include "udp/udp.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
-#define UDPBUF ((struct uip_udpip_hdr *)&dev->d_buf[UIP_LLH_LEN])
+#define UDPBUF ((struct udp_iphdr_s *)&dev->d_buf[UIP_LLH_LEN])
/****************************************************************************
* Public Variables
@@ -76,7 +77,7 @@
****************************************************************************/
/****************************************************************************
- * Name: uip_udpinput
+ * Name: udp_input
*
* Description:
* Handle incoming UDP input
@@ -94,10 +95,10 @@
*
****************************************************************************/
-int uip_udpinput(FAR struct uip_driver_s *dev)
+int udp_input(FAR struct uip_driver_s *dev)
{
- struct uip_udp_conn *conn;
- struct uip_udpip_hdr *pbuf = UDPBUF;
+ FAR struct udp_conn_s *conn;
+ FAR struct udp_iphdr_s *pbuf = UDPBUF;
int ret = OK;
#ifdef CONFIG_NET_STATISTICS
@@ -112,7 +113,7 @@ int uip_udpinput(FAR struct uip_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];
- if (pbuf->udpchksum != 0 && uip_udpchksum(dev) != 0xffff)
+ if (pbuf->udpchksum != 0 && udp_chksum(dev) != 0xffff)
{
#ifdef CONFIG_NET_STATISTICS
uip_stat.udp.drop++;
@@ -126,7 +127,7 @@ int uip_udpinput(FAR struct uip_driver_s *dev)
{
/* Demultiplex this UDP packet between the UDP "connections". */
- conn = uip_udpactive(pbuf);
+ conn = udp_active(pbuf);
if (conn)
{
uint16_t flags;
@@ -139,7 +140,7 @@ int uip_udpinput(FAR struct uip_driver_s *dev)
/* Perform the application callback */
- flags = uip_udpcallback(dev, conn, UIP_NEWDATA);
+ flags = udp_callback(dev, conn, UIP_NEWDATA);
/* If the operation was successful, the UIP_NEWDATA flag is removed
* and thus the packet can be deleted (OK will be returned).
@@ -158,7 +159,7 @@ int uip_udpinput(FAR struct uip_driver_s *dev)
if (dev->d_sndlen > 0)
{
- uip_udpsend(dev, conn);
+ udp_send(dev, conn);
}
}
else