3 * $Id: packet-tcp.h,v 1.21 2003/12/30 00:03:48 guy Exp $
5 * Ethereal - Network traffic analyzer
6 * By Gerald Combs <gerald@ethereal.com>
7 * Copyright 1998 Gerald Combs
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #ifndef __PACKET_TCP_H__
25 #define __PACKET_TCP_H__
38 /* the tcp header structure, passed to tap listeners */
42 gboolean th_have_seglen; /* TRUE if th_seglen is valid */
44 guint32 th_win; /* make it 32 bits so we can handle some scaling */
54 * Private data passed from the TCP dissector to subdissectors.
57 guint32 seq; /* Sequence number of first byte in the data */
58 guint32 nxtseq; /* Sequence number of first byte after data */
59 gboolean is_reassembled; /* This is reassembled data. */
60 gboolean urgent; /* TRUE if "urgent_pointer" is valid */
61 guint16 urgent_pointer; /* Urgent pointer value for the current packet. */
65 * Loop for dissecting PDUs within a TCP stream; assumes that a PDU
66 * consists of a fixed-length chunk of data that contains enough information
67 * to determine the length of the PDU, followed by rest of the PDU.
69 * The first three arguments are the arguments passed to the dissector
70 * that calls this routine.
72 * "proto_desegment" is the dissector's flag controlling whether it should
73 * desegment PDUs that cross TCP segment boundaries.
75 * "fixed_len" is the length of the fixed-length part of the PDU.
77 * "get_pdu_len()" is a routine called to get the length of the PDU from
78 * the fixed-length part of the PDU; it's passed "tvb" and "offset".
80 * "dissect_pdu()" is the routine to dissect a PDU.
83 tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
84 gboolean proto_desegment, guint fixed_len,
85 guint (*get_pdu_len)(tvbuff_t *, int),
86 void (*dissect_pdu)(tvbuff_t *, packet_info *, proto_tree *));
88 extern gboolean decode_tcp_ports(tvbuff_t *, int, packet_info *,
89 proto_tree *, int, int);
91 extern void dissect_tcp_payload(tvbuff_t *tvb, packet_info *pinfo, int offset,
92 guint32 seq, guint32 nxtseq, guint32 sport,
93 guint32 dport, proto_tree *tree,
94 proto_tree *tcp_tree);