1c398230bSWarner Losh /*- 2df8bae1dSRodney W. Grimes * Copyright (c) 1982, 1986, 1993 33329b236SRobert Watson * The Regents of the University of California. 43329b236SRobert Watson * All rights reserved. 5df8bae1dSRodney W. Grimes * 6df8bae1dSRodney W. Grimes * Redistribution and use in source and binary forms, with or without 7df8bae1dSRodney W. Grimes * modification, are permitted provided that the following conditions 8df8bae1dSRodney W. Grimes * are met: 9df8bae1dSRodney W. Grimes * 1. Redistributions of source code must retain the above copyright 10df8bae1dSRodney W. Grimes * notice, this list of conditions and the following disclaimer. 11df8bae1dSRodney W. Grimes * 2. Redistributions in binary form must reproduce the above copyright 12df8bae1dSRodney W. Grimes * notice, this list of conditions and the following disclaimer in the 13df8bae1dSRodney W. Grimes * documentation and/or other materials provided with the distribution. 14*fbbd9655SWarner Losh * 3. Neither the name of the University nor the names of its contributors 15df8bae1dSRodney W. Grimes * may be used to endorse or promote products derived from this software 16df8bae1dSRodney W. Grimes * without specific prior written permission. 17df8bae1dSRodney W. Grimes * 18df8bae1dSRodney W. Grimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19df8bae1dSRodney W. Grimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20df8bae1dSRodney W. Grimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21df8bae1dSRodney W. Grimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22df8bae1dSRodney W. Grimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23df8bae1dSRodney W. Grimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24df8bae1dSRodney W. Grimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25df8bae1dSRodney W. Grimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26df8bae1dSRodney W. Grimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27df8bae1dSRodney W. Grimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28df8bae1dSRodney W. Grimes * SUCH DAMAGE. 29df8bae1dSRodney W. Grimes * 30df8bae1dSRodney W. Grimes * @(#)udp.h 8.1 (Berkeley) 6/10/93 31c3aac50fSPeter Wemm * $FreeBSD$ 32df8bae1dSRodney W. Grimes */ 33df8bae1dSRodney W. Grimes 34707f139eSPaul Richards #ifndef _NETINET_UDP_H_ 35707f139eSPaul Richards #define _NETINET_UDP_H_ 36707f139eSPaul Richards 37df8bae1dSRodney W. Grimes /* 383329b236SRobert Watson * UDP protocol header. 39df8bae1dSRodney W. Grimes * Per RFC 768, September, 1981. 40df8bae1dSRodney W. Grimes */ 41df8bae1dSRodney W. Grimes struct udphdr { 42df8bae1dSRodney W. Grimes u_short uh_sport; /* source port */ 43df8bae1dSRodney W. Grimes u_short uh_dport; /* destination port */ 44430d30d8SBill Fenner u_short uh_ulen; /* udp length */ 45df8bae1dSRodney W. Grimes u_short uh_sum; /* udp checksum */ 46df8bae1dSRodney W. Grimes }; 47707f139eSPaul Richards 487b495c44SVANHULLEBUS Yvan /* 497b495c44SVANHULLEBUS Yvan * User-settable options (used with setsockopt). 507b495c44SVANHULLEBUS Yvan */ 511d77fa5aSJohn Baldwin #define UDP_ENCAP 1 527b495c44SVANHULLEBUS Yvan 530d25fab4SJohn Baldwin /* Start of reserved space for third-party user-settable options. */ 540d25fab4SJohn Baldwin #define UDP_VENDOR SO_VENDOR 557b495c44SVANHULLEBUS Yvan 567b495c44SVANHULLEBUS Yvan /* 577b495c44SVANHULLEBUS Yvan * UDP Encapsulation of IPsec Packets options. 587b495c44SVANHULLEBUS Yvan */ 597b495c44SVANHULLEBUS Yvan /* Encapsulation types. */ 607b495c44SVANHULLEBUS Yvan #define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ 61fcf59617SAndrey V. Elsukov #define UDP_ENCAP_ESPINUDP 2 /* RFC3948 */ 627b495c44SVANHULLEBUS Yvan 637b495c44SVANHULLEBUS Yvan /* Default ESP in UDP encapsulation port. */ 647b495c44SVANHULLEBUS Yvan #define UDP_ENCAP_ESPINUDP_PORT 500 657b495c44SVANHULLEBUS Yvan 667b495c44SVANHULLEBUS Yvan /* Maximum UDP fragment size for ESP over UDP. */ 677b495c44SVANHULLEBUS Yvan #define UDP_ENCAP_ESPINUDP_MAXFRAGLEN 552 687b495c44SVANHULLEBUS Yvan 69707f139eSPaul Richards #endif 70