1*e7d50bf6Schristos /* $NetBSD: tcpip.h,v 1.1 2012/03/24 02:08:34 christos Exp $ */ 2*e7d50bf6Schristos 3*e7d50bf6Schristos /* 4*e7d50bf6Schristos * Copyright (c) 1982, 1986, 1993 5*e7d50bf6Schristos * The Regents of the University of California. All rights reserved. 6*e7d50bf6Schristos * 7*e7d50bf6Schristos * Redistribution and use in source and binary forms, with or without 8*e7d50bf6Schristos * modification, are permitted provided that the following conditions 9*e7d50bf6Schristos * are met: 10*e7d50bf6Schristos * 1. Redistributions of source code must retain the above copyright 11*e7d50bf6Schristos * notice, this list of conditions and the following disclaimer. 12*e7d50bf6Schristos * 2. Redistributions in binary form must reproduce the above copyright 13*e7d50bf6Schristos * notice, this list of conditions and the following disclaimer in the 14*e7d50bf6Schristos * documentation and/or other materials provided with the distribution. 15*e7d50bf6Schristos * 3. Neither the name of the University nor the names of its contributors 16*e7d50bf6Schristos * may be used to endorse or promote products derived from this software 17*e7d50bf6Schristos * without specific prior written permission. 18*e7d50bf6Schristos * 19*e7d50bf6Schristos * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20*e7d50bf6Schristos * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21*e7d50bf6Schristos * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22*e7d50bf6Schristos * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 23*e7d50bf6Schristos * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24*e7d50bf6Schristos * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25*e7d50bf6Schristos * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26*e7d50bf6Schristos * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27*e7d50bf6Schristos * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28*e7d50bf6Schristos * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29*e7d50bf6Schristos * SUCH DAMAGE. 30*e7d50bf6Schristos * 31*e7d50bf6Schristos * @(#)tcpip.h 8.1 (Berkeley) 6/10/93 32*e7d50bf6Schristos * Id: tcpip.h,v 2.2.2.3 2004/05/26 15:45:48 darrenr Exp 33*e7d50bf6Schristos */ 34*e7d50bf6Schristos 35*e7d50bf6Schristos #ifndef _NETINET_TCPIP_H_ 36*e7d50bf6Schristos #define _NETINET_TCPIP_H_ 37*e7d50bf6Schristos 38*e7d50bf6Schristos # if defined(linux) && !defined(LINUX_IPOVLY) 39*e7d50bf6Schristos # define LINUX_IPOVLY 40*e7d50bf6Schristos struct ipovly { 41*e7d50bf6Schristos caddr_t ih_next, ih_prev; /* for protocol sequence q's */ 42*e7d50bf6Schristos u_char ih_x1; /* (unused) */ 43*e7d50bf6Schristos u_char ih_pr; /* protocol */ 44*e7d50bf6Schristos short ih_len; /* protocol length */ 45*e7d50bf6Schristos struct in_addr ih_src; /* source internet address */ 46*e7d50bf6Schristos struct in_addr ih_dst; /* destination internet address */ 47*e7d50bf6Schristos }; 48*e7d50bf6Schristos # endif 49*e7d50bf6Schristos 50*e7d50bf6Schristos /* 51*e7d50bf6Schristos * Tcp+ip header, after ip options removed. 52*e7d50bf6Schristos */ 53*e7d50bf6Schristos struct tcpiphdr { 54*e7d50bf6Schristos struct ipovly ti_i; /* overlaid ip structure */ 55*e7d50bf6Schristos struct tcphdr ti_t; /* tcp header */ 56*e7d50bf6Schristos }; 57*e7d50bf6Schristos 58*e7d50bf6Schristos #ifdef notyet 59*e7d50bf6Schristos /* 60*e7d50bf6Schristos * Tcp+ip header, after ip options removed but including TCP options. 61*e7d50bf6Schristos */ 62*e7d50bf6Schristos struct full_tcpiphdr { 63*e7d50bf6Schristos struct ipovly ti_i; /* overlaid ip structure */ 64*e7d50bf6Schristos struct tcphdr ti_t; /* tcp header */ 65*e7d50bf6Schristos char ti_o[TCP_MAXOLEN]; /* space for tcp options */ 66*e7d50bf6Schristos }; 67*e7d50bf6Schristos #endif /* notyet */ 68*e7d50bf6Schristos #define ti_next ti_i.ih_next 69*e7d50bf6Schristos #define ti_prev ti_i.ih_prev 70*e7d50bf6Schristos #define ti_x1 ti_i.ih_x1 71*e7d50bf6Schristos #define ti_pr ti_i.ih_pr 72*e7d50bf6Schristos #define ti_len ti_i.ih_len 73*e7d50bf6Schristos #define ti_src ti_i.ih_src 74*e7d50bf6Schristos #define ti_dst ti_i.ih_dst 75*e7d50bf6Schristos #define ti_sport ti_t.th_sport 76*e7d50bf6Schristos #define ti_dport ti_t.th_dport 77*e7d50bf6Schristos #define ti_seq ti_t.th_seq 78*e7d50bf6Schristos #define ti_ack ti_t.th_ack 79*e7d50bf6Schristos #define ti_x2 ti_t.th_x2 80*e7d50bf6Schristos #define ti_off ti_t.th_off 81*e7d50bf6Schristos #define ti_flags ti_t.th_flags 82*e7d50bf6Schristos #define ti_win ti_t.th_win 83*e7d50bf6Schristos #define ti_sum ti_t.th_sum 84*e7d50bf6Schristos #define ti_urp ti_t.th_urp 85*e7d50bf6Schristos 86*e7d50bf6Schristos #endif 87