void udp_poll(FAR struct net_driver_s *dev, FAR struct udp_conn_s *conn) { /* Verify that the UDP connection is valid */ if (conn->lport != 0) { /* Set-up for the application callback */ dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPUDP_HDRLEN]; dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPUDP_HDRLEN]; dev->d_len = 0; dev->d_sndlen = 0; /* Perform the application callback */ (void)udp_callback(dev, conn, UDP_POLL); /* If the application has data to send, setup the UDP/IP header */ if (dev->d_sndlen > 0) { udp_send(dev, conn); return; } } /* Make sure that d_len is zero meaning that there is nothing to be sent */ dev->d_len = 0; }
void igmp_poll(FAR struct net_driver_s *dev) { FAR struct igmp_group_s *group; nllvdbg("Entry\n"); /* Setup the poll operation */ dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPIGMP_HDRLEN]; dev->d_snddata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPIGMP_HDRLEN]; dev->d_len = 0; dev->d_sndlen = 0; /* Check each member of the group */ for (group = (FAR struct igmp_group_s *)dev->grplist.head; group; group = group->next) { /* Does this member have a pending outgoing message? */ if (IS_SCHEDMSG(group->flags)) { /* Yes, create the IGMP message in the driver buffer */ igmp_sched_send(dev, group); /* Mark the message as sent and break out */ CLR_SCHEDMSG(group->flags); break; } } }
void pkt_poll(FAR struct net_driver_s *dev, FAR struct pkt_conn_s *conn) { ninfo("IN\n"); /* Verify that the packet connection is valid */ if (conn) { /* Setup for the application callback */ dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPv4UDP_HDRLEN]; dev->d_len = 0; dev->d_sndlen = 0; /* Perform the application callback */ (void)pkt_callback(dev, conn, PKT_POLL); /* If the application has data to send, setup the UDP/IP header */ if (dev->d_sndlen > 0) { //devif_pkt_send(dev, conn); return; } } /* Make sure that d_len is zero meaning that there is nothing to be sent */ dev->d_len = 0; }
void udp_ipv6_select(FAR struct net_driver_s *dev) { /* Set a bit in the d_flags to distinguish this from an IPv6 packet */ IFF_SET_IPv6(dev->d_flags); /* Set the offset to the beginning of the UDP data payload */ dev->d_appdata = &dev->d_buf[IPv6UDP_HDRLEN + NET_LL_HDRLEN(dev)]; }
void icmpv6_poll(FAR struct net_driver_s *dev) { /* Setup for the application callback */ dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMPv6_HDRLEN]; dev->d_len = 0; dev->d_sndlen = 0; /* Perform the application callback */ (void)devif_callback_execute(dev, NULL, ICMPv6_POLL, g_icmpv6_conn.list); }
void icmp_poll(FAR struct net_driver_s *dev) { /* Setup for the application callback */ dev->d_appdata = &dev->d_buf[NET_LL_HDRLEN(dev) + IPICMP_HDRLEN]; dev->d_len = 0; dev->d_sndlen = 0; /* Perform the application callback */ (void)devif_conn_event(dev, NULL, ICMP_POLL, dev->d_conncb); }