00001 /* $NetBSD: udp.h,v 1.6 1995/04/13 06:37:10 cgd Exp $ */ 00002 00003 /* 00004 * Copyright (c) 1982, 1986, 1993 00005 * The Regents of the University of California. All rights reserved. 00006 * 00007 * Redistribution and use in source and binary forms, with or without 00008 * modification, are permitted provided that the following conditions 00009 * are met: 00010 * 1. Redistributions of source code must retain the above copyright 00011 * notice, this list of conditions and the following disclaimer. 00012 * 2. Redistributions in binary form must reproduce the above copyright 00013 * notice, this list of conditions and the following disclaimer in the 00014 * documentation and/or other materials provided with the distribution. 00015 * 3. Neither the name of the University nor the names of its contributors 00016 * may be used to endorse or promote products derived from this software 00017 * without specific prior written permission. 00018 * 00019 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 00020 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00021 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00022 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 00023 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00024 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00025 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00026 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00027 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00028 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00029 * SUCH DAMAGE. 00030 * 00031 * @(#)udp.h 8.1 (Berkeley) 6/10/93 00032 */ 00033 00034 /* 00035 * Portions Copyright (c) 2004,2009 by Internet Systems Consortium, Inc. ("ISC") 00036 * Portions Copyright (c) 2000-2003 by Internet Software Consortium 00037 * 00038 * Permission to use, copy, modify, and distribute this software for any 00039 * purpose with or without fee is hereby granted, provided that the above 00040 * copyright notice and this permission notice appear in all copies. 00041 * 00042 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 00043 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 00044 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 00045 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 00046 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 00047 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 00048 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00049 * 00050 * Internet Systems Consortium, Inc. 00051 * 950 Charter Street 00052 * Redwood City, CA 94063 00053 * <info@isc.org> 00054 * https://www.isc.org/ 00055 */ 00056 00057 /* 00058 * Udp protocol header. 00059 * Per RFC 768, September, 1981. 00060 */ 00061 struct udphdr { 00062 u_int16_t uh_sport; /* source port */ 00063 u_int16_t uh_dport; /* destination port */ 00064 u_int16_t uh_ulen; /* udp length */ 00065 u_int16_t uh_sum; /* udp checksum */ 00066 };