1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3*0Sstevel@tonic-gate  * Use is subject to license terms.
4*0Sstevel@tonic-gate  */
5*0Sstevel@tonic-gate 
6*0Sstevel@tonic-gate /*
7*0Sstevel@tonic-gate  * Copyright (c) 1982, 1986 Regents of the University of California.
8*0Sstevel@tonic-gate  * All rights reserved.  The Berkeley software License Agreement
9*0Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
10*0Sstevel@tonic-gate  */
11*0Sstevel@tonic-gate 
12*0Sstevel@tonic-gate /*
13*0Sstevel@tonic-gate  * Udp protocol header.
14*0Sstevel@tonic-gate  * Per RFC 768, September, 1981.
15*0Sstevel@tonic-gate  */
16*0Sstevel@tonic-gate 
17*0Sstevel@tonic-gate #ifndef	_NETINET_UDP_H
18*0Sstevel@tonic-gate #define	_NETINET_UDP_H
19*0Sstevel@tonic-gate 
20*0Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
21*0Sstevel@tonic-gate /* udp.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86	*/
22*0Sstevel@tonic-gate 
23*0Sstevel@tonic-gate #ifdef	__cplusplus
24*0Sstevel@tonic-gate extern "C" {
25*0Sstevel@tonic-gate #endif
26*0Sstevel@tonic-gate 
27*0Sstevel@tonic-gate struct udphdr {
28*0Sstevel@tonic-gate 	in_port_t	uh_sport;		/* source port */
29*0Sstevel@tonic-gate 	in_port_t	uh_dport;		/* destination port */
30*0Sstevel@tonic-gate 	int16_t		uh_ulen;		/* udp length */
31*0Sstevel@tonic-gate 	uint16_t	uh_sum;			/* udp checksum */
32*0Sstevel@tonic-gate };
33*0Sstevel@tonic-gate 
34*0Sstevel@tonic-gate /* Option definitions. */
35*0Sstevel@tonic-gate #define	UDP_ANONPRIVBIND	0x0100		/* for internal use only */
36*0Sstevel@tonic-gate #define	UDP_EXCLBIND		0x0101		/* for internal use only */
37*0Sstevel@tonic-gate #define	UDP_RCVHDR		0x0102		/* for internal use only */
38*0Sstevel@tonic-gate /*
39*0Sstevel@tonic-gate  * Following option in UDP_ namespace required to be exposed through
40*0Sstevel@tonic-gate  * <xti.h> (It also requires exposing options not implemented). The options
41*0Sstevel@tonic-gate  * with potential for conflicts use #ifndef guards.
42*0Sstevel@tonic-gate  *
43*0Sstevel@tonic-gate  */
44*0Sstevel@tonic-gate #ifndef UDP_CHECKSUM
45*0Sstevel@tonic-gate #define	UDP_CHECKSUM	0x0600
46*0Sstevel@tonic-gate #endif
47*0Sstevel@tonic-gate 
48*0Sstevel@tonic-gate #ifdef	__cplusplus
49*0Sstevel@tonic-gate }
50*0Sstevel@tonic-gate #endif
51*0Sstevel@tonic-gate 
52*0Sstevel@tonic-gate #endif	/* _NETINET_UDP_H */
53