4 * User Datagram Protocol (RFC 768).
6 * Copyright (c) 2000 Dug Song <dugsong@monkey.org>
8 * $Id: udp.h,v 1.8 2002/04/02 05:05:39 dugsong Exp $
17 uint16_t uh_sport
; /* source port */
18 uint16_t uh_dport
; /* destination port */
19 uint16_t uh_ulen
; /* udp length (including header) */
20 uint16_t uh_sum
; /* udp checksum */
23 #define UDP_PORT_MAX 65535
25 #define udp_pack_hdr(hdr, sport, dport, ulen) do { \
26 struct udp_hdr *udp_pack_p = (struct udp_hdr *)(hdr); \
27 udp_pack_p->uh_sport = htons(sport); \
28 udp_pack_p->uh_dport = htons(dport); \
29 udp_pack_p->uh_ulen = htons(ulen); \
32 #endif /* DNET_UDP_H */