3 udpread, udpwrite \- read and write UDP packets
14 typedef struct Udphdr Udphdr;
17 uchar raddr[IPaddrlen]; /* remote address and port */
18 uchar laddr[IPaddrlen]; /* local address and port */
24 long udpread(int fd, Udphdr *hdr, void *data, long n)
27 long udpwrite(int fd, Udphdr *hdr, void *data, long n)
32 read and write UDP packets from the UDP network connection
33 established on file descriptor
39 bytes of packet body into
43 and returns the number of bytes stored in
51 in a UDP packet with header
56 frames the addresses as local and remote
57 instead of source and destination.
60 filled in for a packet read by
62 can be used unchanged in
64 to send a response back to the sender of the original packet.