diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2007-11-26 16:38:26 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2007-11-26 16:38:26 +0000 |
commit | e5461f33076882a7ee6ed326c1edfef679c86619 (patch) | |
tree | 63965893e6b5acb1145067527c288bb9e2c256bb /epan/dissectors/packet-dcerpc-spoolss.c | |
parent | d580971f07baed775f3c7bfc912ab10ac2a0dcf7 (diff) |
From Kai Blin:
Dissect the PRINTER_INFO structure in the SpoolssEnumPrinters call.
From me:
Add the level info to COL_INFO.
svn path=/trunk/; revision=23600
Diffstat (limited to 'epan/dissectors/packet-dcerpc-spoolss.c')
-rw-r--r-- | epan/dissectors/packet-dcerpc-spoolss.c | 61 |
1 files changed, 60 insertions, 1 deletions
diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c index 479f34e6cf..f4198dfff6 100644 --- a/epan/dissectors/packet-dcerpc-spoolss.c +++ b/epan/dissectors/packet-dcerpc-spoolss.c @@ -3870,6 +3870,8 @@ static int SpoolssEnumPrinters_q(tvbuff_t *tvb, int offset, packet_info *pinfo, guint32 level, flags; proto_tree *flags_subtree; proto_item *flags_item; + dcerpc_info *di = (dcerpc_info *)pinfo->private_data; + dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; /* Parse packet */ @@ -3918,6 +3920,11 @@ static int SpoolssEnumPrinters_q(tvbuff_t *tvb, int offset, packet_info *pinfo, offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_level, &level); + /* GetPrinter() stores the level in se_data */ + if(!pinfo->fd->flags.visited){ + dcv->se_data = GINT_TO_POINTER((int)level); + } + if (check_col(pinfo->cinfo, COL_INFO)) col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); @@ -3934,11 +3941,63 @@ static int SpoolssEnumPrinters_r(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree, guint8 *drep _U_) { guint32 num_drivers; + dcerpc_info *di = (dcerpc_info *)pinfo->private_data; + dcerpc_call_value *dcv = (dcerpc_call_value *)di->call_data; + gint16 level = GPOINTER_TO_INT(dcv->se_data); + BUFFER buffer; + proto_item *item; + proto_tree *subtree = NULL; + + if (check_col(pinfo->cinfo, COL_INFO)) + col_append_fstr(pinfo->cinfo, COL_INFO, ", level %d", level); /* Parse packet */ offset = dissect_spoolss_buffer( - tvb, offset, pinfo, tree, drep, NULL); + tvb, offset, pinfo, tree, drep, &buffer); + + if (buffer.tvb) { + switch(level) { + case 0: + case 1: + case 2: + case 3: + case 7: + item = proto_tree_add_text( + buffer.tree, buffer.tvb, 0, -1, + "Printer info level %d", level); + subtree = proto_item_add_subtree( + item, ett_PRINTER_INFO); + break; + } + switch(level) { + case 0: + dissect_PRINTER_INFO_0( + buffer.tvb, 0, pinfo, subtree, drep); + break; + case 1: + dissect_PRINTER_INFO_1( + buffer.tvb, 0, pinfo, subtree, drep); + break; + case 2: + dissect_PRINTER_INFO_2( + buffer.tvb, 0, pinfo, subtree, drep); + break; + case 3: + dissect_PRINTER_INFO_3( + buffer.tvb, 0, pinfo, subtree, drep); + break; + case 7: + dissect_PRINTER_INFO_7( + buffer.tvb, 0, pinfo, subtree, drep); + break; + default: + proto_tree_add_text( + buffer.tree, buffer.tvb, 0, -1, + "[Unknown printer info level %d]", level); + break; + } + } offset = dissect_ndr_uint32( tvb, offset, pinfo, tree, drep, hf_needed, NULL); |