1/* 2 * Copyright (c) 1982, 1986, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)tcp.h 8.1 (Berkeley) 6/10/93 |
34 * $Id: tcp.h,v 1.8 1997/02/22 09:41:37 peter Exp $ |
35 */ 36 37#ifndef _NETINET_TCP_H_ 38#define _NETINET_TCP_H_ 39 40typedef u_long tcp_seq; 41typedef u_long tcp_cc; /* connection count per rfc1644 */ 42 43/* 44 * TCP header. 45 * Per RFC 793, September, 1981. 46 */ 47struct tcphdr { 48 u_short th_sport; /* source port */ 49 u_short th_dport; /* destination port */ 50 tcp_seq th_seq; /* sequence number */ 51 tcp_seq th_ack; /* acknowledgement number */ 52#if BYTE_ORDER == LITTLE_ENDIAN |
53 u_int th_x2:4, /* (unused) */ |
54 th_off:4; /* data offset */ 55#endif 56#if BYTE_ORDER == BIG_ENDIAN |
57 u_int th_off:4, /* data offset */ |
58 th_x2:4; /* (unused) */ 59#endif 60 u_char th_flags; 61#define TH_FIN 0x01 62#define TH_SYN 0x02 63#define TH_RST 0x04 64#define TH_PUSH 0x08 65#define TH_ACK 0x10 --- 57 unchanged lines hidden --- |