1*53ee8cc1Swenshuai.xi /* Copyright (C) 1991, 92, 93, 95, 96, 97, 2004 Free Software Foundation, Inc. 2*53ee8cc1Swenshuai.xi This file is part of the GNU C Library. 3*53ee8cc1Swenshuai.xi 4*53ee8cc1Swenshuai.xi The GNU C Library is free software; you can redistribute it and/or 5*53ee8cc1Swenshuai.xi modify it under the terms of the GNU Lesser General Public 6*53ee8cc1Swenshuai.xi License as published by the Free Software Foundation; either 7*53ee8cc1Swenshuai.xi version 2.1 of the License, or (at your option) any later version. 8*53ee8cc1Swenshuai.xi 9*53ee8cc1Swenshuai.xi The GNU C Library is distributed in the hope that it will be useful, 10*53ee8cc1Swenshuai.xi but WITHOUT ANY WARRANTY; without even the implied warranty of 11*53ee8cc1Swenshuai.xi MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12*53ee8cc1Swenshuai.xi Lesser General Public License for more details. 13*53ee8cc1Swenshuai.xi 14*53ee8cc1Swenshuai.xi You should have received a copy of the GNU Lesser General Public 15*53ee8cc1Swenshuai.xi License along with the GNU C Library; if not, write to the Free 16*53ee8cc1Swenshuai.xi Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17*53ee8cc1Swenshuai.xi 02111-1307 USA. */ 18*53ee8cc1Swenshuai.xi 19*53ee8cc1Swenshuai.xi /* 20*53ee8cc1Swenshuai.xi * Copyright (C) 1982, 1986 Regents of the University of California. 21*53ee8cc1Swenshuai.xi * All rights reserved. 22*53ee8cc1Swenshuai.xi * 23*53ee8cc1Swenshuai.xi * Redistribution and use in source and binary forms, with or without 24*53ee8cc1Swenshuai.xi * modification, are permitted provided that the following conditions 25*53ee8cc1Swenshuai.xi * are met: 26*53ee8cc1Swenshuai.xi * 1. Redistributions of source code must retain the above copyright 27*53ee8cc1Swenshuai.xi * notice, this list of conditions and the following disclaimer. 28*53ee8cc1Swenshuai.xi * 2. Redistributions in binary form must reproduce the above copyright 29*53ee8cc1Swenshuai.xi * notice, this list of conditions and the following disclaimer in the 30*53ee8cc1Swenshuai.xi * documentation and/or other materials provided with the distribution. 31*53ee8cc1Swenshuai.xi * 4. Neither the name of the University nor the names of its contributors 32*53ee8cc1Swenshuai.xi * may be used to endorse or promote products derived from this software 33*53ee8cc1Swenshuai.xi * without specific prior written permission. 34*53ee8cc1Swenshuai.xi * 35*53ee8cc1Swenshuai.xi * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 36*53ee8cc1Swenshuai.xi * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 37*53ee8cc1Swenshuai.xi * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 38*53ee8cc1Swenshuai.xi * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 39*53ee8cc1Swenshuai.xi * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 40*53ee8cc1Swenshuai.xi * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 41*53ee8cc1Swenshuai.xi * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 42*53ee8cc1Swenshuai.xi * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 43*53ee8cc1Swenshuai.xi * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 44*53ee8cc1Swenshuai.xi * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 45*53ee8cc1Swenshuai.xi * SUCH DAMAGE. 46*53ee8cc1Swenshuai.xi */ 47*53ee8cc1Swenshuai.xi 48*53ee8cc1Swenshuai.xi #ifndef __NETINET_UDP_H 49*53ee8cc1Swenshuai.xi #define __NETINET_UDP_H 1 50*53ee8cc1Swenshuai.xi 51*53ee8cc1Swenshuai.xi #include <features.h> 52*53ee8cc1Swenshuai.xi #include <sys/types.h> 53*53ee8cc1Swenshuai.xi 54*53ee8cc1Swenshuai.xi 55*53ee8cc1Swenshuai.xi /* UDP header as specified by RFC 768, August 1980. */ 56*53ee8cc1Swenshuai.xi #ifdef __FAVOR_BSD 57*53ee8cc1Swenshuai.xi 58*53ee8cc1Swenshuai.xi struct udphdr 59*53ee8cc1Swenshuai.xi { 60*53ee8cc1Swenshuai.xi u_int16_t uh_sport; /* source port */ 61*53ee8cc1Swenshuai.xi u_int16_t uh_dport; /* destination port */ 62*53ee8cc1Swenshuai.xi u_int16_t uh_ulen; /* udp length */ 63*53ee8cc1Swenshuai.xi u_int16_t uh_sum; /* udp checksum */ 64*53ee8cc1Swenshuai.xi }; 65*53ee8cc1Swenshuai.xi 66*53ee8cc1Swenshuai.xi #else 67*53ee8cc1Swenshuai.xi 68*53ee8cc1Swenshuai.xi struct udphdr 69*53ee8cc1Swenshuai.xi { 70*53ee8cc1Swenshuai.xi u_int16_t source; 71*53ee8cc1Swenshuai.xi u_int16_t dest; 72*53ee8cc1Swenshuai.xi u_int16_t len; 73*53ee8cc1Swenshuai.xi u_int16_t check; 74*53ee8cc1Swenshuai.xi }; 75*53ee8cc1Swenshuai.xi #endif 76*53ee8cc1Swenshuai.xi 77*53ee8cc1Swenshuai.xi #define SOL_UDP 17 /* sockopt level for UDP */ 78*53ee8cc1Swenshuai.xi 79*53ee8cc1Swenshuai.xi #endif /* netinet/udp.h */ 80