diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-01-12 21:20:50 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-01-12 21:20:50 +0000 |
commit | aa139758f9e8eeca06a2157cf5ffff8dee8083d9 (patch) | |
tree | cf5cf816dcb91f823c24af64a7b037da7a0740d8 | |
parent | 24c519ca86955fcf0db561634ff417f1a3f976c2 (diff) | |
download | wireshark-aa139758f9e8eeca06a2157cf5ffff8dee8083d9.tar.gz |
add new function dissect_dcerpc_uuid_t and let dissect_ndr_uuid_t call it
svn path=/trunk/; revision=13006
-rw-r--r-- | epan/dissectors/packet-dcerpc-ndr.c | 30 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc.c | 54 | ||||
-rw-r--r-- | epan/dissectors/packet-dcerpc.h | 4 | ||||
-rw-r--r-- | epan/dissectors/packet-dcom.c | 50 |
4 files changed, 60 insertions, 78 deletions
diff --git a/epan/dissectors/packet-dcerpc-ndr.c b/epan/dissectors/packet-dcerpc-ndr.c index df2193ca72..bfa3baad21 100644 --- a/epan/dissectors/packet-dcerpc-ndr.c +++ b/epan/dissectors/packet-dcerpc-ndr.c @@ -192,10 +192,7 @@ dissect_ndr_uuid_t (tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, e_uuid_t *pdata) { - e_uuid_t uuid; dcerpc_info *di; - char uuid_str[DCERPC_UUID_STR_LEN]; - int uuid_str_len; di=pinfo->private_data; if(di->conformant_run){ @@ -207,31 +204,8 @@ dissect_ndr_uuid_t (tvbuff_t *tvb, gint offset, packet_info *pinfo, if (offset % 4) { offset += 4 - (offset % 4); } - dcerpc_tvb_get_uuid (tvb, offset, drep, &uuid); - if (tree) { - /* - * XXX - look up the UUID to see if it's registered, and use - * the name of the protocol? Unfortunately, we need the version - * as well. - */ - uuid_str_len = snprintf(uuid_str, DCERPC_UUID_STR_LEN, - "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - uuid.Data1, uuid.Data2, uuid.Data3, - uuid.Data4[0], uuid.Data4[1], - uuid.Data4[2], uuid.Data4[3], - uuid.Data4[4], uuid.Data4[5], - uuid.Data4[6], uuid.Data4[7]); - if (uuid_str_len >= DCERPC_UUID_STR_LEN) - memset(uuid_str, 0, DCERPC_UUID_STR_LEN); - proto_tree_add_string_format (tree, hfindex, tvb, offset, 16, - uuid_str, "%s: %s", - proto_registrar_get_name(hfindex), - uuid_str); - } - if (pdata) { - *pdata = uuid; - } - return offset + 16; + return dissect_dcerpc_uuid_t (tvb, offset, pinfo, + tree, drep, hfindex, pdata); } /* diff --git a/epan/dissectors/packet-dcerpc.c b/epan/dissectors/packet-dcerpc.c index 2e33fedc72..33860a8c58 100644 --- a/epan/dissectors/packet-dcerpc.c +++ b/epan/dissectors/packet-dcerpc.c @@ -1088,6 +1088,60 @@ dissect_dcerpc_double(tvbuff_t *tvb, gint offset, packet_info *pinfo _U_, } +int +dissect_dcerpc_uuid_t (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, e_uuid_t *pdata) +{ + e_uuid_t uuid; + header_field_info* hfi; +#if 0 + gchar *uuid_name; +#endif + + + dcerpc_tvb_get_uuid (tvb, offset, drep, &uuid); + if (tree) { + /* get name of protocol field to prepend it later */ + hfi = proto_registrar_get_nth(hfindex); + +#if 0 + /* XXX - get the name won't work correct, as we don't know the version of this uuid (if it has one) */ + /* look for a registered uuid name */ + uuid_name = dcerpc_get_uuid_name(&uuid, 0); + + if (uuid_name) { + /* we know the name of this uuid */ + proto_tree_add_string_format (tree, hfindex, tvb, offset, 16, "", + "%s: %s (%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)", + hfi->name, uuid_name, + uuid.Data1, uuid.Data2, uuid.Data3, + uuid.Data4[0], uuid.Data4[1], + uuid.Data4[2], uuid.Data4[3], + uuid.Data4[4], uuid.Data4[5], + uuid.Data4[6], uuid.Data4[7]); + } else { +#endif + /* we don't know the name of this uuid */ + proto_tree_add_string_format (tree, hfindex, tvb, offset, 16, "", + "%s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", + hfi->name, + uuid.Data1, uuid.Data2, uuid.Data3, + uuid.Data4[0], uuid.Data4[1], + uuid.Data4[2], uuid.Data4[3], + uuid.Data4[4], uuid.Data4[5], + uuid.Data4[6], uuid.Data4[7]); +#if 0 + } +#endif + } + if (pdata) { + *pdata = uuid; + } + return offset + 16; +} + + /* * a couple simpler things */ diff --git a/epan/dissectors/packet-dcerpc.h b/epan/dissectors/packet-dcerpc.h index ce1b45dc42..81f8bef23c 100644 --- a/epan/dissectors/packet-dcerpc.h +++ b/epan/dissectors/packet-dcerpc.h @@ -135,6 +135,10 @@ int dissect_dcerpc_double (tvbuff_t *tvb, gint offset, packet_info *pinfo, int dissect_dcerpc_time_t (tvbuff_t *tvb, gint offset, packet_info *pinfo, proto_tree *tree, guint8 *drep, int hfindex, guint32 *pdata); +int dissect_dcerpc_uuid_t (tvbuff_t *tvb, gint offset, packet_info *pinfo, + proto_tree *tree, char *drep, + int hfindex, e_uuid_t *pdata); + /* * NDR routines for subdissectors. */ diff --git a/epan/dissectors/packet-dcom.c b/epan/dissectors/packet-dcom.c index 1bc0d14e56..a4d08870e1 100644 --- a/epan/dissectors/packet-dcom.c +++ b/epan/dissectors/packet-dcom.c @@ -670,56 +670,6 @@ gchar* dcom_uuid_to_str(e_uuid_t *uuid) { } -#if 0 -/* currently unused (do not remove) */ -int -dissect_dcerpc_uuid_t (tvbuff_t *tvb, gint offset, packet_info *pinfo, - proto_tree *tree, char *drep, - int hfindex, e_uuid_t *pdata) -{ - e_uuid_t uuid; - gchar *uuid_name; - header_field_info* hfi; - - - dcerpc_tvb_get_uuid (tvb, offset, drep, &uuid); - if (tree) { - /* get name of protocol field to prepend it later */ - hfi = proto_registrar_get_nth(hfindex); - - /* look for a registered uuid name */ - uuid_name = dcerpc_get_uuid_name(&uuid, 0); - - if (uuid_name) { - /* we know the name of this uuid */ - proto_tree_add_string_format (tree, hfindex, tvb, offset, 16, "", - "%s: %s (%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x)", - hfi->name, uuid_name, - uuid.Data1, uuid.Data2, uuid.Data3, - uuid.Data4[0], uuid.Data4[1], - uuid.Data4[2], uuid.Data4[3], - uuid.Data4[4], uuid.Data4[5], - uuid.Data4[6], uuid.Data4[7]); - } else { - /* we don't know the name of this uuid */ - proto_tree_add_string_format (tree, hfindex, tvb, offset, 16, "", - "%s: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - hfi->name, - uuid.Data1, uuid.Data2, uuid.Data3, - uuid.Data4[0], uuid.Data4[1], - uuid.Data4[2], uuid.Data4[3], - uuid.Data4[4], uuid.Data4[5], - uuid.Data4[6], uuid.Data4[7]); - } - } - if (pdata) { - *pdata = uuid; - } - return offset + 16; -} -#endif - - /* dissect 64bits integer with alignment of 8 bytes (use this for VT_I8 type only) */ int dissect_dcom_I8(tvbuff_t *tvb, gint offset, packet_info *pinfo, |