![]() |
Functions | |
int | NutUdpInput (NUTDEVICE *dev, NETBUF *nb) |
Handle incoming UDP packets. | |
int | NutUdpOutput (UDPSOCKET *sock, uint32_t daddr, uint16_t port, NETBUF *nb) |
Send a UDP packet. |
UDP only provides checksumming of data and multiplexing by port number. Therefore, an application program must deal directly with end-to-end communication problems like retransmission, flow control etc., if required.
Applications should call the UDP Socket API when using this protocol.
int NutUdpInput | ( | NUTDEVICE * | dev, | |
NETBUF * | nb | |||
) |
Handle incoming UDP packets.
nb | Network buffer structure containing the UDP packet. |
Definition at line 158 of file udpin.c.
References ICMP_UNREACH, ICMP_UNREACH_PORT, NBAF_UNICAST, NutEventPost(), NutIcmpResponse(), NutNetBufFree(), NutUdpFindSocket(), and UDPHDR::uh_dport.
Referenced by NutUdpCreateSocket().
Send a UDP packet.
sock | Socket descriptor. This pointer must have been retrieved by calling NutUdpCreateSocket(). | |
daddr | IP address of the remote host in network byte order. | |
port | Remote port number in host byte order. | |
nb | Network buffer structure containing the datagram. This buffer will be released if the function returns an error. |
Definition at line 152 of file udpout.c.
References htons, IPPROTO_UDP, NBAF_TRANSPORT, NutIpChkSum(), NutIpChkSumPartial(), NutIpOutput(), NutIpPseudoChkSumPartial(), NutIpRouteQuery(), NutNetBufAlloc(), UDPHDR::uh_dport, UDPHDR::uh_sport, UDPHDR::uh_sum, and UDPHDR::uh_ulen.
Referenced by NutUdpSendTo().