1139823Simp/*-
21541Srgrimes * Copyright (c) 1982, 1986, 1993
3166841Srwatson *	The Regents of the University of California.
4166841Srwatson * All rights reserved.
51541Srgrimes *
61541Srgrimes * Redistribution and use in source and binary forms, with or without
71541Srgrimes * modification, are permitted provided that the following conditions
81541Srgrimes * are met:
91541Srgrimes * 1. Redistributions of source code must retain the above copyright
101541Srgrimes *    notice, this list of conditions and the following disclaimer.
111541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
121541Srgrimes *    notice, this list of conditions and the following disclaimer in the
131541Srgrimes *    documentation and/or other materials provided with the distribution.
141541Srgrimes * 4. Neither the name of the University nor the names of its contributors
151541Srgrimes *    may be used to endorse or promote products derived from this software
161541Srgrimes *    without specific prior written permission.
171541Srgrimes *
181541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
191541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
201541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
211541Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
221541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
231541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
241541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
251541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
261541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
271541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
281541Srgrimes * SUCH DAMAGE.
291541Srgrimes *
301541Srgrimes *	@(#)udp.h	8.1 (Berkeley) 6/10/93
3150477Speter * $FreeBSD$
321541Srgrimes */
331541Srgrimes
342169Spaul#ifndef _NETINET_UDP_H_
35166841Srwatson#define	_NETINET_UDP_H_
362169Spaul
371541Srgrimes/*
38166841Srwatson * UDP protocol header.
391541Srgrimes * Per RFC 768, September, 1981.
401541Srgrimes */
411541Srgrimesstruct udphdr {
421541Srgrimes	u_short	uh_sport;		/* source port */
431541Srgrimes	u_short	uh_dport;		/* destination port */
4419183Sfenner	u_short	uh_ulen;		/* udp length */
451541Srgrimes	u_short	uh_sum;			/* udp checksum */
461541Srgrimes};
472169Spaul
48194062Svanhu/*
49194062Svanhu * User-settable options (used with setsockopt).
50194062Svanhu */
51245823Sjhb#define	UDP_ENCAP			1
52194062Svanhu
53246210Sjhb/* Start of reserved space for third-party user-settable options. */
54246210Sjhb#define	UDP_VENDOR			SO_VENDOR
55194062Svanhu
56194062Svanhu/*
57194062Svanhu * UDP Encapsulation of IPsec Packets options.
58194062Svanhu */
59194062Svanhu/* Encapsulation types. */
60217126Sjhb#define	UDP_ENCAP_ESPINUDP_NON_IKE	1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
61194062Svanhu#define	UDP_ENCAP_ESPINUDP		2 /* draft-ietf-ipsec-udp-encaps-02+ */
62194062Svanhu
63194062Svanhu/* Default ESP in UDP encapsulation port. */
64194062Svanhu#define	UDP_ENCAP_ESPINUDP_PORT		500
65194062Svanhu
66194062Svanhu/* Maximum UDP fragment size for ESP over UDP. */
67194062Svanhu#define	UDP_ENCAP_ESPINUDP_MAXFRAGLEN	552
68194062Svanhu
692169Spaul#endif
70