mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
NET: Rename network interrupt event flags more appropriately: TCP_, UDP_, ICMP_, or PKT_ vs UIP_
This commit is contained in:
@@ -187,7 +187,7 @@ void icmp_input(FAR struct net_driver_s *dev)
|
||||
#ifdef CONFIG_NET_ICMP_PING
|
||||
else if (picmp->type == ICMP_ECHO_REPLY && g_echocallback)
|
||||
{
|
||||
(void)devif_callback_execute(dev, picmp, UIP_ECHOREPLY, g_echocallback);
|
||||
(void)devif_callback_execute(dev, picmp, ICMP_ECHOREPLY, g_echocallback);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -269,7 +269,7 @@ typeerr:
|
||||
#ifdef CONFIG_NET_ICMP_PING
|
||||
else if (picmp->type == ICMP6_ECHO_REPLY && g_echocallback)
|
||||
{
|
||||
uint16_t flags = UIP_ECHOREPLY;
|
||||
uint16_t flags = ICMP_ECHOREPLY;
|
||||
|
||||
if (g_echocallback)
|
||||
{
|
||||
@@ -280,7 +280,7 @@ typeerr:
|
||||
|
||||
/* If the ECHO reply was not handled, then drop the packet */
|
||||
|
||||
if (flags == UIP_ECHOREPLY)
|
||||
if (flags == ICMP_ECHOREPLY)
|
||||
{
|
||||
/* The ECHO reply was not handled */
|
||||
|
||||
|
||||
@@ -136,7 +136,8 @@ static inline int ping_timeout(FAR struct icmp_ping_s *pstate)
|
||||
*
|
||||
* Description:
|
||||
* This function is called from the interrupt level to perform the actual
|
||||
* ECHO request and/or ECHO reply actions when polled by the uIP layer.
|
||||
* ECHO request and/or ECHO reply actions when polled by the lower, device
|
||||
* interfacing layer.
|
||||
*
|
||||
* Parameters:
|
||||
* dev The structure of the network driver that caused the interrupt
|
||||
@@ -168,7 +169,7 @@ static uint16_t ping_interrupt(FAR struct net_driver_s *dev, FAR void *conn,
|
||||
* response from a previous ping.
|
||||
*/
|
||||
|
||||
if ((flags & UIP_ECHOREPLY) != 0 && conn != NULL)
|
||||
if ((flags & ICMP_ECHOREPLY) != 0 && conn != NULL)
|
||||
{
|
||||
FAR struct icmp_iphdr_s *icmp = (FAR struct icmp_iphdr_s *)conn;
|
||||
|
||||
@@ -179,7 +180,7 @@ static uint16_t ping_interrupt(FAR struct net_driver_s *dev, FAR void *conn,
|
||||
{
|
||||
/* Consume the ECHOREPLY */
|
||||
|
||||
flags &= ~UIP_ECHOREPLY;
|
||||
flags &= ~ICMP_ECHOREPLY;
|
||||
dev->d_len = 0;
|
||||
|
||||
/* Return the result to the caller */
|
||||
@@ -204,7 +205,7 @@ static uint16_t ping_interrupt(FAR struct net_driver_s *dev, FAR void *conn,
|
||||
*/
|
||||
|
||||
if (dev->d_sndlen <= 0 && /* Packet available */
|
||||
(flags & UIP_NEWDATA) == 0 && /* No incoming data */
|
||||
(flags & ICMP_NEWDATA) == 0 && /* No incoming data */
|
||||
!pstate->png_sent) /* Request not sent */
|
||||
{
|
||||
FAR struct icmp_iphdr_s *picmp = ICMPBUF;
|
||||
@@ -350,7 +351,7 @@ int icmp_ping(net_ipaddr_t addr, uint16_t id, uint16_t seqno,
|
||||
state.png_cb = icmp_callback_alloc();
|
||||
if (state.png_cb)
|
||||
{
|
||||
state.png_cb->flags = UIP_POLL|UIP_ECHOREPLY;
|
||||
state.png_cb->flags = (ICMP_POLL | ICMP_ECHOREPLY);
|
||||
state.png_cb->priv = (void*)&state;
|
||||
state.png_cb->event = ping_interrupt;
|
||||
state.png_result = -EINTR; /* Assume sem-wait interrupted by signal */
|
||||
|
||||
@@ -98,7 +98,7 @@ void icmp_poll(FAR struct net_driver_s *dev)
|
||||
|
||||
/* Perform the application callback */
|
||||
|
||||
(void)devif_callback_execute(dev, NULL, UIP_POLL, g_echocallback);
|
||||
(void)devif_callback_execute(dev, NULL, ICMP_POLL, g_echocallback);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_NET && CONFIG_NET_ICMP && CONFIG_NET_ICMP_PING */
|
||||
|
||||
Reference in New Issue
Block a user