2000-02-15 21:06:58 +00:00
|
|
|
/* packet-tcp.h
|
|
|
|
*
|
2002-05-05 00:57:59 +00:00
|
|
|
* $Id: packet-tcp.h,v 1.11 2002/05/05 00:57:57 guy Exp $
|
2000-02-15 21:06:58 +00:00
|
|
|
*
|
|
|
|
* Ethereal - Network traffic analyzer
|
2001-09-30 23:14:43 +00:00
|
|
|
* By Gerald Combs <gerald@ethereal.com>
|
2000-02-15 21:06:58 +00:00
|
|
|
* Copyright 1998 Gerald Combs
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2000-08-11 13:37:21 +00:00
|
|
|
#ifndef __PACKET_TCP_H__
|
|
|
|
#define __PACKET_TCP_H__
|
|
|
|
|
2001-09-30 23:14:43 +00:00
|
|
|
/*
|
|
|
|
* Private data passed from the TCP dissector to subdissectors.
|
|
|
|
*/
|
|
|
|
struct tcpinfo {
|
Add support for reassembling RPC-over-TCP fragments, and do that in both
RPC and NDMP.
Show the RPC-over-TCP fragment header as a tree with bitfields below it.
Add a routine to show a reported bounds error as an "Unreassembled
Packet" or a "Malformed Packet" depending on whether "pinfo->fragmented"
is set, and have NBNS and RPC use that.
Add "ett_ndmp_file_stats" to the list of ett_ values to be initialized
(it wasn't in that list, and wasn't getting initialized).
When freeing up various hash tables and memory chunks in the RPC
dissector, zero out the pointers to them, just to make sure we don't try
to free them again.
Always destroy the TCP segment key and address memory chunks in
"tcp_desegment_init()", regardless of whether TCP desegmentation is
enabled - we don't *allocate* them if TCP desegmentation isn't enabled,
but we should free them even if it's not enabled. Also, when we free
them, set the pointers to them to null, so we don't double-free them.
Supply to subdissectors called from the TCP dissector the sequence
number of the first byte handed to the sub dissector.
svn path=/trunk/; revision=4753
2002-02-18 23:51:55 +00:00
|
|
|
guint32 seq; /* Sequence number of first byte in the data */
|
2001-09-30 23:14:43 +00:00
|
|
|
gboolean is_reassembled; /* This is reassembled data. */
|
Add support for reassembling RPC-over-TCP fragments, and do that in both
RPC and NDMP.
Show the RPC-over-TCP fragment header as a tree with bitfields below it.
Add a routine to show a reported bounds error as an "Unreassembled
Packet" or a "Malformed Packet" depending on whether "pinfo->fragmented"
is set, and have NBNS and RPC use that.
Add "ett_ndmp_file_stats" to the list of ett_ values to be initialized
(it wasn't in that list, and wasn't getting initialized).
When freeing up various hash tables and memory chunks in the RPC
dissector, zero out the pointers to them, just to make sure we don't try
to free them again.
Always destroy the TCP segment key and address memory chunks in
"tcp_desegment_init()", regardless of whether TCP desegmentation is
enabled - we don't *allocate* them if TCP desegmentation isn't enabled,
but we should free them even if it's not enabled. Also, when we free
them, set the pointers to them to null, so we don't double-free them.
Supply to subdissectors called from the TCP dissector the sequence
number of the first byte handed to the sub dissector.
svn path=/trunk/; revision=4753
2002-02-18 23:51:55 +00:00
|
|
|
gboolean urgent; /* TRUE if "urgent_pointer" is valid */
|
2001-09-30 23:14:43 +00:00
|
|
|
guint16 urgent_pointer; /* Urgent pointer value for the current packet. */
|
|
|
|
};
|
|
|
|
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
/*
|
|
|
|
* Loop for dissecting PDUs within a TCP stream; assumes that a PDU
|
|
|
|
* consists of a fixed-length chunk of data that contains enough information
|
|
|
|
* to determine the length of the PDU, followed by rest of the PDU.
|
|
|
|
*
|
|
|
|
* The first three arguments are the arguments passed to the dissector
|
|
|
|
* that calls this routine.
|
|
|
|
*
|
|
|
|
* "proto_desegment" is the dissector's flag controlling whether it should
|
|
|
|
* desegment PDUs that cross TCP segment boundaries.
|
|
|
|
*
|
|
|
|
* "fixed_len" is the length of the fixed-length part of the PDU.
|
|
|
|
*
|
|
|
|
* "get_pdu_len()" is a routine called to get the length of the PDU from
|
|
|
|
* the fixed-length part of the PDU; it's passed "tvb" and "offset".
|
|
|
|
*
|
|
|
|
* "dissect_pdu()" is the routine to dissect a PDU.
|
|
|
|
*/
|
|
|
|
extern void
|
|
|
|
tcp_dissect_pdus(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
2002-05-05 00:57:59 +00:00
|
|
|
gboolean proto_desegment, guint fixed_len,
|
Make a "tcp_dissect_pdus()" with the standard loop for a TCP segment,
extracting PDUs from it and possibly doing reassembly. Make the COPS,
DNS, DSI, Gryphon, and SCCP dissectors use it.
Add "set_actual_length()", "tcp_dissect_pdus()",
"decode_boolean_bitfield()", "decode_numeric_bitfield()", and
"decode_enumerated_bitfield()" to the list of routines available to
dissectors on platforms where routines in the main program aren't
available to dynamically-loaded code.
Declare routines in "to_str.h" as "extern"; as I remember, that's
necessary to allow the "decode_XXX_bitfield()" routines declared therein
to be made available to plugins as per the above.
Note that new exported routines should be added to the end of the table
if that's the only change being made to the table.
Create a new "plugin_api_decls.h" header file, used to declare both the
"p_" variables and the "p_" structure members in the routine-exporting
mechanism; this reduces the number of places you have to change to
change the list of exported routines.
svn path=/trunk/; revision=5394
2002-05-05 00:16:38 +00:00
|
|
|
guint (*get_pdu_len)(tvbuff_t *, int),
|
|
|
|
void (*dissect_pdu)(tvbuff_t *, packet_info *, proto_tree *));
|
2000-02-15 21:06:58 +00:00
|
|
|
|
Tvbuffify the IP, ICMP, TCP, UDP, OSI CLNP, OSI COTP, OSI CLTP, and OSI
ESIS dissectors.
Register the IP dissector and have dissectors that call it directly
(rather than through a port table) call it through a handle.
Add a routine "tvb_set_reported_length()" which a dissector can use if
it was handed a tvbuff that contains more data than is actually in its
part of the packet - for example, handing a padded Ethernet frame to IP;
the routine sets the reported length of the tvbuff (and also adjusts the
actual length, as appropriate). Then use it in IP.
Given that, "ethertype()" can determine how much of the Ethernet frame
was actually part of an IP datagram (and can do the same for other
protocols under Ethernet that use "tvb_set_reported_length()"; have it
return the actual length, and have "dissect_eth()" and "dissect_vlan()"
use that to mark trailer data in Ethernet II frames as well as in 802.3
frames.
svn path=/trunk/; revision=2658
2000-11-18 10:38:33 +00:00
|
|
|
extern void decode_tcp_ports(tvbuff_t *, int, packet_info *,
|
2000-04-12 22:53:16 +00:00
|
|
|
proto_tree *, int, int);
|
2000-08-11 13:37:21 +00:00
|
|
|
|
|
|
|
#endif
|