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