diff options
author | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2007-02-25 01:34:41 +0000 |
---|---|---|
committer | Ronnie Sahlberg <ronnie_sahlberg@ozemail.com.au> | 2007-02-25 01:34:41 +0000 |
commit | aa3d3793b70531c0fbd9d30a819267dcbaefc9f3 (patch) | |
tree | d96cbedd850ce71e2de85b19f5198dd80ca33f8c /epan/dissectors/packet-dcerpc-ndr.c | |
parent | 87f05b8bdaaf5d20ca26a3d5aabd7763fa79c793 (diff) |
add new PIDL friendly helpers for dissection of integer types.
these new helpers take a parameter that can be used to decorate the tree and summary line (when this parameter is acted upon/implemented in the code inside the helpers)
WINREG was regenerated using a patched version of PIDL. Mainline version of PIDL does not yet have this patch applied.
svn path=/trunk/; revision=20918
Diffstat (limited to 'epan/dissectors/packet-dcerpc-ndr.c')
-rw-r--r-- | epan/dissectors/packet-dcerpc-ndr.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/epan/dissectors/packet-dcerpc-ndr.c b/epan/dissectors/packet-dcerpc-ndr.c index 34a6599764..9330900716 100644 --- a/epan/dissectors/packet-dcerpc-ndr.c +++ b/epan/dissectors/packet-dcerpc-ndr.c @@ -60,6 +60,25 @@ dissect_ndr_uint8 (tvbuff_t *tvb, gint offset, packet_info *pinfo, } int +PIDL_dissect_uint8 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, guint8 *drep, + int hfindex, guint32 param _U_) +{ + dcerpc_info *di; + + di=pinfo->private_data; + if(di->conformant_run){ + /* just a run to handle conformant arrays, no scalars to dissect */ + return offset; + } + + /* no alignment needed */ + return dissect_dcerpc_uint8 (tvb, offset, pinfo, + tree, drep, hfindex, NULL); +} + + +int dissect_ndr_uint16 (tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, guint16 *pdata) @@ -81,6 +100,27 @@ dissect_ndr_uint16 (tvbuff_t *tvb, gint offset, packet_info *pinfo, } int +PIDL_dissect_uint16 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, guint8 *drep, + int hfindex, guint32 param _U_) +{ + dcerpc_info *di; + + di=pinfo->private_data; + if(di->conformant_run){ + /* just a run to handle conformant arrays, no scalars to dissect */ + return offset; + } + + + if (offset % 2) { + offset++; + } + return dissect_dcerpc_uint16 (tvb, offset, pinfo, + tree, drep, hfindex, NULL); +} + +int dissect_ndr_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, guint32 *pdata) @@ -101,6 +141,27 @@ dissect_ndr_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo, tree, drep, hfindex, pdata); } +int +PIDL_dissect_uint32 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, guint8 *drep, + int hfindex, guint32 param _U_) +{ + dcerpc_info *di; + + di=pinfo->private_data; + if(di->conformant_run){ + /* just a run to handle conformant arrays, no scalars to dissect */ + return offset; + } + + + if (offset % 4) { + offset += 4 - (offset % 4); + } + return dissect_dcerpc_uint32 (tvb, offset, pinfo, + tree, drep, hfindex, NULL); +} + /* Double uint32 This function dissects the 64bit datatype that is common for ms interfaces and which is 32bit aligned. @@ -150,6 +211,26 @@ dissect_ndr_uint64 (tvbuff_t *tvb, gint offset, packet_info *pinfo, } int +PIDL_dissect_uint64 (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, guint8 *drep, + int hfindex, guint32 param _U_) +{ + dcerpc_info *di; + + di=pinfo->private_data; + if(di->conformant_run){ + /* just a run to handle conformant arrays, no scalars to dissect */ + return offset; + } + + if (offset % 8) { + offset += 8 - (offset % 8); + } + return dissect_dcerpc_uint64 (tvb, offset, pinfo, + tree, drep, hfindex, NULL); +} + +int dissect_ndr_float(tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, gfloat *pdata) |