10Sstevel@tonic-gate /* 2*4987Sdanmcd * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 30Sstevel@tonic-gate * Use is subject to license terms. 40Sstevel@tonic-gate */ 50Sstevel@tonic-gate 60Sstevel@tonic-gate /* 70Sstevel@tonic-gate * Copyright (c) 1982, 1986 Regents of the University of California. 80Sstevel@tonic-gate * All rights reserved. The Berkeley software License Agreement 90Sstevel@tonic-gate * specifies the terms and conditions for redistribution. 100Sstevel@tonic-gate */ 110Sstevel@tonic-gate 120Sstevel@tonic-gate /* 130Sstevel@tonic-gate * Udp protocol header. 140Sstevel@tonic-gate * Per RFC 768, September, 1981. 150Sstevel@tonic-gate */ 160Sstevel@tonic-gate 170Sstevel@tonic-gate #ifndef _NETINET_UDP_H 180Sstevel@tonic-gate #define _NETINET_UDP_H 190Sstevel@tonic-gate 200Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 210Sstevel@tonic-gate /* udp.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86 */ 220Sstevel@tonic-gate 230Sstevel@tonic-gate #ifdef __cplusplus 240Sstevel@tonic-gate extern "C" { 250Sstevel@tonic-gate #endif 260Sstevel@tonic-gate 270Sstevel@tonic-gate struct udphdr { 280Sstevel@tonic-gate in_port_t uh_sport; /* source port */ 290Sstevel@tonic-gate in_port_t uh_dport; /* destination port */ 300Sstevel@tonic-gate int16_t uh_ulen; /* udp length */ 310Sstevel@tonic-gate uint16_t uh_sum; /* udp checksum */ 320Sstevel@tonic-gate }; 330Sstevel@tonic-gate 340Sstevel@tonic-gate /* Option definitions. */ 350Sstevel@tonic-gate #define UDP_ANONPRIVBIND 0x0100 /* for internal use only */ 360Sstevel@tonic-gate #define UDP_EXCLBIND 0x0101 /* for internal use only */ 370Sstevel@tonic-gate #define UDP_RCVHDR 0x0102 /* for internal use only */ 38*4987Sdanmcd #define UDP_NAT_T_ENDPOINT 0x0103 /* for internal use only */ 390Sstevel@tonic-gate /* 400Sstevel@tonic-gate * Following option in UDP_ namespace required to be exposed through 410Sstevel@tonic-gate * <xti.h> (It also requires exposing options not implemented). The options 420Sstevel@tonic-gate * with potential for conflicts use #ifndef guards. 430Sstevel@tonic-gate * 440Sstevel@tonic-gate */ 450Sstevel@tonic-gate #ifndef UDP_CHECKSUM 460Sstevel@tonic-gate #define UDP_CHECKSUM 0x0600 470Sstevel@tonic-gate #endif 480Sstevel@tonic-gate 490Sstevel@tonic-gate #ifdef __cplusplus 500Sstevel@tonic-gate } 510Sstevel@tonic-gate #endif 520Sstevel@tonic-gate 530Sstevel@tonic-gate #endif /* _NETINET_UDP_H */ 54