Rename "dissect_ndr_char_string()" and "dissect_ndr_wchar_string()" to

"dissect_ndr_char_cvstring()" and "dissect_ndr_wchar_cvstring()", to
indicate that they're for conformant varying strings.

Rename "dissect_ndr_character_array()" to "dissect_ndr_cvstring()", to
indicate that it's for conformant varying strings.

svn path=/trunk/; revision=7096
This commit is contained in:
Guy Harris 2003-02-07 22:44:54 +00:00
parent 9a348d5736
commit e9f0f4b74f
9 changed files with 48 additions and 36 deletions

View File

@ -3,7 +3,7 @@
* Copyright 2001,2003 Tim Potter <tpot@samba.org>
* 2002 Added LSA command dissectors Ronnie Sahlberg
*
* $Id: packet-dcerpc-lsa.c,v 1.70 2003/02/07 22:31:30 guy Exp $
* $Id: packet-dcerpc-lsa.c,v 1.71 2003/02/07 22:44:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -596,7 +596,7 @@ lsa_dissect_lsaopenpolicy2_rqst(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, char *drep)
{
offset = dissect_ndr_pointer_cb(tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_UNIQUE, "Server",
dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE, "Server",
hf_lsa_server, cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | CB_STR_SAVE | 1));

View File

@ -2,7 +2,7 @@
* Routines for MS Exchange MAPI
* Copyright 2002, Ronnie Sahlberg
*
* $Id: packet-dcerpc-mapi.c,v 1.18 2003/02/07 08:56:11 guy Exp $
* $Id: packet-dcerpc-mapi.c,v 1.19 2003/02/07 22:44:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -236,7 +236,7 @@ static int
mapi_logon_rqst(tvbuff_t *tvb, int offset,
packet_info *pinfo, proto_tree *tree, char *drep)
{
offset = dissect_ndr_character_array(tvb, offset, pinfo, tree, drep,
offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep,
sizeof(guint8), hf_mapi_unknown_string, TRUE);
DISSECT_UNKNOWN(tvb_length_remaining(tvb, offset));
@ -256,12 +256,12 @@ mapi_logon_reply(tvbuff_t *tvb, int offset,
DISSECT_UNKNOWN(20); /* this is 20 bytes, unless there are pointers */
offset = dissect_ndr_character_array(tvb, offset, pinfo, tree, drep,
offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep,
sizeof(guint8), hf_mapi_unknown_string, TRUE);
DISSECT_UNKNOWN(6); /* possibly 1 or 2 bytes padding here */
offset = dissect_ndr_character_array(tvb, offset, pinfo, tree, drep,
offset = dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep,
sizeof(guint8), hf_mapi_unknown_string, TRUE);
DISSECT_UNKNOWN( tvb_length_remaining(tvb, offset)-4 );

View File

@ -3,7 +3,7 @@
* Copyright 2001,2003 Tim Potter <tpot@samba.org>
* 2002 structure and command dissectors by Ronnie Sahlberg
*
* $Id: packet-dcerpc-netlogon.c,v 1.72 2003/02/07 22:31:30 guy Exp $
* $Id: packet-dcerpc-netlogon.c,v 1.73 2003/02/07 22:44:52 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1398,7 +1398,7 @@ netlogon_dissect_netserverreqchallenge_rqst(tvbuff_t *tvb, int offset,
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_REF,
dissect_ndr_wchar_cvstring, NDR_POINTER_REF,
"Computer Name", hf_netlogon_computer_name,
cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | 1));
@ -4424,7 +4424,7 @@ netlogon_dissect_UNICODE_STRING(tvbuff_t *tvb, int offset,
}
offset = dissect_ndr_pointer_cb(tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, type,
dissect_ndr_wchar_cvstring, type,
name, hf_index, callback, NULL);
proto_item_set_len(item, offset-old_offset);

View File

@ -2,7 +2,7 @@
* Routines for DCERPC over SMB packet disassembly
* Copyright 2001-2003, Tim Potter <tpot@samba.org>
*
* $Id: packet-dcerpc-nt.c,v 1.65 2003/02/07 22:31:30 guy Exp $
* $Id: packet-dcerpc-nt.c,v 1.66 2003/02/07 22:44:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -81,7 +81,7 @@ dissect_ndr_counted_string_cb(tvbuff_t *tvb, int offset,
hf_nt_cs_size, &size);
offset = dissect_ndr_pointer_cb(tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_UNIQUE,
dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
"Character Array", hf_index, callback, callback_args);
return offset;
@ -676,7 +676,7 @@ int dissect_ndr_str_pointer_item(tvbuff_t *tvb, gint offset,
{
return dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, type, text, hf_index,
dissect_ndr_wchar_cvstring, type, text, hf_index,
cb_str_postprocess, GINT_TO_POINTER(levels + 1));
}

View File

@ -3,7 +3,7 @@
* Copyright 2001,2003 Tim Potter <tpot@samba.org>
* 2002 Added all command dissectors Ronnie Sahlberg
*
* $Id: packet-dcerpc-samr.c,v 1.74 2003/02/07 22:31:30 guy Exp $
* $Id: packet-dcerpc-samr.c,v 1.75 2003/02/07 22:44:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1135,7 +1135,7 @@ samr_dissect_connect2_rqst(tvbuff_t *tvb, int offset,
{
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_UNIQUE,
dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
"Server", hf_samr_server, cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | CB_STR_SAVE | 1));
@ -1153,7 +1153,7 @@ samr_dissect_connect4_rqst(tvbuff_t *tvb, int offset,
{
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_UNIQUE,
dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
"Server", hf_samr_server, cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | 1));

View File

@ -2,7 +2,7 @@
* Routines for SMB \PIPE\spoolss packet disassembly
* Copyright 2001-2003, Tim Potter <tpot@samba.org>
*
* $Id: packet-dcerpc-spoolss.c,v 1.84 2003/02/07 22:31:31 guy Exp $
* $Id: packet-dcerpc-spoolss.c,v 1.85 2003/02/07 22:44:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -2703,7 +2703,7 @@ static int SpoolssOpenPrinterEx_q(tvbuff_t *tvb, int offset,
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_UNIQUE,
dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
"Printer name", hf_spoolss_printername, cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | CB_STR_SAVE | 1));
@ -4206,7 +4206,7 @@ static int dissect_FORM_CTR(tvbuff_t *tvb, int offset,
static int dissect_form_name(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, char *drep)
{
return dissect_ndr_character_array(tvb, offset, pinfo, tree, drep,
return dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep,
sizeof(guint16),
hf_spoolss_form_name, TRUE);
}

View File

@ -9,7 +9,7 @@
* 2002, some share information levels implemented based on samba
* sources.
*
* $Id: packet-dcerpc-srvsvc.c,v 1.51 2003/02/07 22:31:31 guy Exp $
* $Id: packet-dcerpc-srvsvc.c,v 1.52 2003/02/07 22:44:53 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -2947,13 +2947,13 @@ srvsvc_dissect_netrsharegetinfo_rqst(tvbuff_t *tvb, int offset,
{
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_UNIQUE,
dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
"Server", hf_srvsvc_server, cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | 1));
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_REF,
dissect_ndr_wchar_cvstring, NDR_POINTER_REF,
"Share", hf_srvsvc_share, cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | 1));
@ -5294,7 +5294,7 @@ srvsvc_dissect_netrservergetinfo_rqst(tvbuff_t *tvb, int offset,
{
offset = dissect_ndr_pointer_cb(
tvb, offset, pinfo, tree, drep,
dissect_ndr_wchar_string, NDR_POINTER_UNIQUE,
dissect_ndr_wchar_cvstring, NDR_POINTER_UNIQUE,
"Server", hf_srvsvc_server, cb_str_postprocess,
GINT_TO_POINTER(CB_STR_COL_INFO | 1));

View File

@ -2,7 +2,7 @@
* Routines for DCERPC packet disassembly
* Copyright 2001, Todd Sabin <tas@webspan.net>
*
* $Id: packet-dcerpc.c,v 1.103 2003/02/07 22:31:31 guy Exp $
* $Id: packet-dcerpc.c,v 1.104 2003/02/07 22:44:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -1001,7 +1001,7 @@ fake_unicode(tvbuff_t *tvb, int offset, int len)
XXX - does this need to do all the conformant array stuff that
"dissect_ndr_ucvarray()" does? */
int
dissect_ndr_character_array(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_ndr_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, char *drep, int size_is,
int hfinfo, gboolean add_subtree)
{
@ -1063,26 +1063,38 @@ dissect_ndr_character_array(tvbuff_t *tvb, int offset, packet_info *pinfo,
return offset;
}
/* Dissect an string of chars. This corresponds to
IDL of the form '[string] char *foo' */
/* Dissect an conformant varying string of chars.
This corresponds to IDL of the form '[string] char *foo'.
XXX - at least according to the DCE RPC 1.1 spec, a string has
a null terminator, which isn't necessary as a terminator for
the transfer language (as there's a length), but is presumably
there for the benefit of null-terminated-string languages
such as C. Is this ever used for purely counted strings?
(Not that it matters if it is.) */
int
dissect_ndr_char_string(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_ndr_char_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, char *drep)
{
return dissect_ndr_character_array(tvb, offset, pinfo, tree, drep,
return dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep,
sizeof(guint8), hf_dcerpc_array_buffer,
FALSE);
}
/* Dissect an string of wchars (wide characters). This corresponds to
IDL of the form '[string] wchar *foo' */
/* Dissect a conformant varying string of wchars (wide characters).
This corresponds to IDL of the form '[string] wchar *foo'
XXX - at least according to the DCE RPC 1.1 spec, a string has
a null terminator, which isn't necessary as a terminator for
the transfer language (as there's a length), but is presumably
there for the benefit of null-terminated-string languages
such as C. Is this ever used for purely counted strings?
(Not that it matters if it is.) */
int
dissect_ndr_wchar_string(tvbuff_t *tvb, int offset, packet_info *pinfo,
dissect_ndr_wchar_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, char *drep)
{
return dissect_ndr_character_array(tvb, offset, pinfo, tree, drep,
return dissect_ndr_cvstring(tvb, offset, pinfo, tree, drep,
sizeof(guint16), hf_dcerpc_array_buffer,
FALSE);
}

View File

@ -1,7 +1,7 @@
/* packet-dcerpc.h
* Copyright 2001, Todd Sabin <tas@webspan.net>
*
* $Id: packet-dcerpc.h,v 1.28 2003/02/07 22:31:32 guy Exp $
* $Id: packet-dcerpc.h,v 1.29 2003/02/07 22:44:54 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@ -193,12 +193,12 @@ int dissect_ndr_byte_array(tvbuff_t *tvb, int offset, packet_info *pinfo,
char *fake_unicode(tvbuff_t *tvb, int offset, int len);
int dissect_ndr_character_array(tvbuff_t *tvb, int offset, packet_info *pinfo,
int dissect_ndr_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, char *drep, int size_is,
int hfinfo, gboolean add_subtree);
int dissect_ndr_char_string(tvbuff_t *tvb, int offset, packet_info *pinfo,
int dissect_ndr_char_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, char *drep);
int dissect_ndr_wchar_string(tvbuff_t *tvb, int offset, packet_info *pinfo,
int dissect_ndr_wchar_cvstring(tvbuff_t *tvb, int offset, packet_info *pinfo,
proto_tree *tree, char *drep);
typedef struct _dcerpc_sub_dissector {