From 5ebf118bf33ca1eb7e3e085df1c069595478af7e Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 27 Nov 2001 09:27:29 +0000 Subject: From Todd Sabin: o Modifies the dcerpc handoff to subdissectors slightly. It also needs to pass the data representation to the subdissector. Also, if no subdissector is found, it puts a "Stub data" entry in the tree. o Adds optional TCP desegmentation to the dcerpc layer. Note that dcerpc has it's own ability to fragment PDUs. This isn't for dealing with that, but with the case of a single PDU being broken over more than one TCP segment. o Adds a little bit of dissection to packet-dcerpc-epm.c. Mainly just proof of concept for the dcerpc handoff stuff. (Writing this is how I realized the need for the drep.) o Adds packet-dcerpc-ndr.c, which will contain NDR dissection routines for use by subdissectors. Also, support added for multiple PDUs per segment for DCERPC-over-TCP (and, potentially, other byte-stream transports). svn path=/trunk/; revision=4285 --- packet-dcerpc.h | 39 +++++++++++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 4 deletions(-) (limited to 'packet-dcerpc.h') diff --git a/packet-dcerpc.h b/packet-dcerpc.h index ef7089a357..14a207a988 100644 --- a/packet-dcerpc.h +++ b/packet-dcerpc.h @@ -1,7 +1,7 @@ /* packet-dcerpc.h * Copyright 2001, Todd Sabin * - * $Id: packet-dcerpc.h,v 1.3 2001/11/18 22:44:07 guy Exp $ + * $Id: packet-dcerpc.h,v 1.4 2001/11/27 09:27:29 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -83,12 +83,43 @@ typedef struct _e_dce_dg_common_hdr_t { #define PDU_ALTER_ACK 15 #define PDU_AUTH3 16 - +/* + * helpers for packet-dcerpc.c and packet-dcerpc-ndr.c + * If you're writing a subdissector, you almost certainly want the + * NDR functions below. + */ guint16 dcerpc_tvb_get_ntohs (tvbuff_t *tvb, gint offset, char *drep); guint32 dcerpc_tvb_get_ntohl (tvbuff_t *tvb, gint offset, char *drep); void dcerpc_tvb_get_uuid (tvbuff_t *tvb, gint offset, char *drep, e_uuid_t *uuid); - -typedef int (dcerpc_dissect_fnct_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree); +int dissect_dcerpc_uint8 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, guint8 *pdata); +int dissect_dcerpc_uint16 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, guint16 *pdata); +int dissect_dcerpc_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, guint32 *pdata); + + +/* + * NDR routines for subdissectors. + */ +int dissect_ndr_uint8 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, guint8 *pdata); +int dissect_ndr_uint16 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, guint16 *pdata); +int dissect_ndr_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, guint32 *pdata); +int dissect_ndr_uuid_t (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, e_uuid_t *pdata); + + +typedef int (dcerpc_dissect_fnct_t)(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, char *drep); typedef struct _dcerpc_sub_dissector { guint16 num; -- cgit v1.2.3