|
AquilaOS documentation
How it works, and its code
|
UDP input. More...
Go to the source code of this file.
Functions | |
| void | udp_input (struct netif *netif, struct netbuf *nb, const struct ipv4_hdr *ih) |
| Takes in a UDP datagram that IPv4 received, and delivers it to its socket. | |
UDP input.
A UDP datagram that arrives goes to the socket bound to its destination port. If no socket is bound there, the sender gets an ICMP "port unreachable" (unless the datagram was a broadcast), and the datagram is dropped. Sending is the sockets' (net/inet/socket.c).
Definition in file udp.c.
Takes in a UDP datagram that IPv4 received, and delivers it to its socket.
A datagram with a bad length or checksum is dropped.
| netif | the interface it came in on |
| nb | the datagram, from its UDP header; it is freed or given to the socket |
| ih | the IPv4 header it came with |
Definition at line 24 of file udp.c.
References udp_hdr::checksum, netbuf::data, ipv4_hdr::dst, udp_hdr::dst, ICMP_UNREACH_PORT, icmp_unreachable(), inet_checksum_pseudo(), inet_sock_deliver(), inet_sock_find(), IP_PROTO_UDP, ipv4_is_local(), netbuf::len, udp_hdr::len, netbuf_free(), netbuf_pull(), ntohs, ipv4_hdr::src, udp_hdr::src, netbuf::src_ip, netbuf::src_port, netif::stats, and udp_input().
Referenced by ipv4_input(), and udp_input().