xref: /titanic_41/usr/src/uts/common/netinet/udp.h (revision 437220cd296f6d8b6654d6d52508b40b1e2d1ac7)
17c478bd9Sstevel@tonic-gate /*
2*437220cdSdanmcd  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate /*
77c478bd9Sstevel@tonic-gate  * Copyright (c) 1982, 1986 Regents of the University of California.
87c478bd9Sstevel@tonic-gate  * All rights reserved.  The Berkeley software License Agreement
97c478bd9Sstevel@tonic-gate  * specifies the terms and conditions for redistribution.
107c478bd9Sstevel@tonic-gate  */
117c478bd9Sstevel@tonic-gate 
127c478bd9Sstevel@tonic-gate /*
137c478bd9Sstevel@tonic-gate  * Udp protocol header.
147c478bd9Sstevel@tonic-gate  * Per RFC 768, September, 1981.
157c478bd9Sstevel@tonic-gate  */
167c478bd9Sstevel@tonic-gate 
177c478bd9Sstevel@tonic-gate #ifndef	_NETINET_UDP_H
187c478bd9Sstevel@tonic-gate #define	_NETINET_UDP_H
197c478bd9Sstevel@tonic-gate 
207c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
217c478bd9Sstevel@tonic-gate /* udp.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86	*/
227c478bd9Sstevel@tonic-gate 
237c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
247c478bd9Sstevel@tonic-gate extern "C" {
257c478bd9Sstevel@tonic-gate #endif
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate struct udphdr {
287c478bd9Sstevel@tonic-gate 	in_port_t	uh_sport;		/* source port */
297c478bd9Sstevel@tonic-gate 	in_port_t	uh_dport;		/* destination port */
307c478bd9Sstevel@tonic-gate 	int16_t		uh_ulen;		/* udp length */
317c478bd9Sstevel@tonic-gate 	uint16_t	uh_sum;			/* udp checksum */
327c478bd9Sstevel@tonic-gate };
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate /* Option definitions. */
357c478bd9Sstevel@tonic-gate #define	UDP_ANONPRIVBIND	0x0100		/* for internal use only */
367c478bd9Sstevel@tonic-gate #define	UDP_EXCLBIND		0x0101		/* for internal use only */
377c478bd9Sstevel@tonic-gate #define	UDP_RCVHDR		0x0102		/* for internal use only */
38*437220cdSdanmcd #define	UDP_NAT_T_ENDPOINT	0x0103		/* for internal use only */
397c478bd9Sstevel@tonic-gate /*
407c478bd9Sstevel@tonic-gate  * Following option in UDP_ namespace required to be exposed through
417c478bd9Sstevel@tonic-gate  * <xti.h> (It also requires exposing options not implemented). The options
427c478bd9Sstevel@tonic-gate  * with potential for conflicts use #ifndef guards.
437c478bd9Sstevel@tonic-gate  *
447c478bd9Sstevel@tonic-gate  */
457c478bd9Sstevel@tonic-gate #ifndef UDP_CHECKSUM
467c478bd9Sstevel@tonic-gate #define	UDP_CHECKSUM	0x0600
477c478bd9Sstevel@tonic-gate #endif
487c478bd9Sstevel@tonic-gate 
497c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
507c478bd9Sstevel@tonic-gate }
517c478bd9Sstevel@tonic-gate #endif
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #endif	/* _NETINET_UDP_H */
54