diff options
author | Bill Meier <wmeier@newsguy.com> | 2010-05-10 15:54:57 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2010-05-10 15:54:57 +0000 |
commit | 10ffd14b8f9c052a9d44faaba462ff36f5542f7a (patch) | |
tree | a705161815ce4b6ab546dbeb6743658d6d50cfe0 /epan/dissectors/packet-dcom-remunkn.c | |
parent | 33dc9a3eb4a71ef14038f611b5d9f0bcad5d5e1a (diff) | |
download | wireshark-10ffd14b8f9c052a9d44faaba462ff36f5542f7a.tar.gz |
Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)
svn path=/trunk/; revision=32735
Diffstat (limited to 'epan/dissectors/packet-dcom-remunkn.c')
-rw-r--r-- | epan/dissectors/packet-dcom-remunkn.c | 406 |
1 files changed, 203 insertions, 203 deletions
diff --git a/epan/dissectors/packet-dcom-remunkn.c b/epan/dissectors/packet-dcom-remunkn.c index 0b1f00111f..24640ad082 100644 --- a/epan/dissectors/packet-dcom-remunkn.c +++ b/epan/dissectors/packet-dcom-remunkn.c @@ -76,225 +76,225 @@ static int proto_remunk2 = -1; typedef struct remunk_remqueryinterface_call_s { - guint iid_count; + guint iid_count; e_uuid_t *iids; } remunk_remqueryinterface_call_t; static int dissect_remunk_remqueryinterface_rqst(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *tree, guint8 *drep) + packet_info *pinfo, proto_tree *tree, guint8 *drep) { - e_uuid_t ipid; - guint32 u32Refs; - guint16 u16IIDs; - guint32 u32ArraySize; - guint32 u32ItemIdx; - e_uuid_t iid; - dcerpc_info *info = (dcerpc_info *) pinfo->private_data; - remunk_remqueryinterface_call_t *call; + e_uuid_t ipid; + guint32 u32Refs; + guint16 u16IIDs; + guint32 u32ArraySize; + guint32 u32ItemIdx; + e_uuid_t iid; + dcerpc_info *info = (dcerpc_info *) pinfo->private_data; + remunk_remqueryinterface_call_t *call; - offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep); + offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep); - offset = dissect_dcom_UUID(tvb, offset, pinfo, tree, drep, - hf_dcom_ipid, &ipid); + offset = dissect_dcom_UUID(tvb, offset, pinfo, tree, drep, + hf_dcom_ipid, &ipid); - offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, - hf_remunk_refs, &u32Refs); + offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, + hf_remunk_refs, &u32Refs); - offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep, - hf_remunk_iids, &u16IIDs); + offset = dissect_dcom_WORD(tvb, offset, pinfo, tree, drep, + hf_remunk_iids, &u16IIDs); - offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep, - &u32ArraySize); + offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep, + &u32ArraySize); /* limit the allocation to a reasonable size */ if(u32ArraySize < 100) { - call = se_alloc(sizeof(remunk_remqueryinterface_call_t) + u32ArraySize * sizeof(e_uuid_t)); - call->iid_count = u32ArraySize; - call->iids = (e_uuid_t *) (call+1); + call = se_alloc(sizeof(remunk_remqueryinterface_call_t) + u32ArraySize * sizeof(e_uuid_t)); + call->iid_count = u32ArraySize; + call->iids = (e_uuid_t *) (call+1); info->call_data->private_data = call; } else { call = NULL; } - for (u32ItemIdx = 0; u32ArraySize--; u32ItemIdx++) { - offset = dissect_dcom_append_UUID(tvb, offset, pinfo, tree, drep, - hf_dcom_iid, u32ItemIdx+1, &iid); + for (u32ItemIdx = 0; u32ArraySize--; u32ItemIdx++) { + offset = dissect_dcom_append_UUID(tvb, offset, pinfo, tree, drep, + hf_dcom_iid, u32ItemIdx+1, &iid); if(call != NULL) { - call->iids[u32ItemIdx] = iid; + call->iids[u32ItemIdx] = iid; } - } + } - return offset; + return offset; } static int dissect_remunk_remqueryinterface_resp(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *tree, guint8 *drep) + packet_info *pinfo, proto_tree *tree, guint8 *drep) { - guint32 u32Pointer; - guint32 u32ArraySize; - guint32 u32ItemIdx; - proto_item *sub_item; - proto_tree *sub_tree; - guint32 u32HResult; - guint32 u32SubStart; - e_uuid_t iid; - e_uuid_t iid_null = DCERPC_UUID_NULL; - dcerpc_info *info = (dcerpc_info *) pinfo->private_data; - remunk_remqueryinterface_call_t *call = info->call_data->private_data; - guint64 oxid; - guint64 oid; - e_uuid_t ipid; + guint32 u32Pointer; + guint32 u32ArraySize; + guint32 u32ItemIdx; + proto_item *sub_item; + proto_tree *sub_tree; + guint32 u32HResult; + guint32 u32SubStart; + e_uuid_t iid; + e_uuid_t iid_null = DCERPC_UUID_NULL; + dcerpc_info *info = (dcerpc_info *) pinfo->private_data; + remunk_remqueryinterface_call_t *call = info->call_data->private_data; + guint64 oxid; + guint64 oid; + e_uuid_t ipid; dcom_interface_t *dcom_if; - offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep); - - offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, - &u32Pointer); - offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep, - &u32ArraySize); + offset = dissect_dcom_that(tvb, offset, pinfo, tree, drep); - u32ItemIdx = 1; - while (u32ArraySize--) { - /* add subtree */ - sub_item = proto_tree_add_item(tree, hf_remunk_qiresult, tvb, offset, 0, FALSE); - sub_tree = proto_item_add_subtree(sub_item, ett_remunk_rqi_result); + offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, + &u32Pointer); + offset = dissect_dcom_dcerpc_array_size(tvb, offset, pinfo, tree, drep, + &u32ArraySize); - /* REMQIRESULT */ - offset = dissect_dcom_HRESULT(tvb, offset, pinfo, sub_tree, drep, - &u32HResult); - u32SubStart = offset - 4; - offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep, - &u32Pointer); - - /* try to read the iid from the request */ - if(call != NULL && u32ItemIdx <= call->iid_count) { - iid = call->iids[u32ItemIdx-1]; - } else { - iid = iid_null; - } + u32ItemIdx = 1; + while (u32ArraySize--) { + /* add subtree */ + sub_item = proto_tree_add_item(tree, hf_remunk_qiresult, tvb, offset, 0, FALSE); + sub_tree = proto_item_add_subtree(sub_item, ett_remunk_rqi_result); + + /* REMQIRESULT */ + offset = dissect_dcom_HRESULT(tvb, offset, pinfo, sub_tree, drep, + &u32HResult); + u32SubStart = offset - 4; + offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, sub_tree, drep, + &u32Pointer); + + /* try to read the iid from the request */ + if(call != NULL && u32ItemIdx <= call->iid_count) { + iid = call->iids[u32ItemIdx-1]; + } else { + iid = iid_null; + } - /* XXX - this doesn't seem to be dependent on the pointer above?!? */ - /*if (u32Pointer) {*/ - offset = dissect_dcom_STDOBJREF(tvb, offset, pinfo, sub_tree, drep, 0 /* hfindex */, - &oxid, &oid, &ipid); - /*}*/ + /* XXX - this doesn't seem to be dependent on the pointer above?!? */ + /*if (u32Pointer) {*/ + offset = dissect_dcom_STDOBJREF(tvb, offset, pinfo, sub_tree, drep, 0 /* hfindex */, + &oxid, &oid, &ipid); + /*}*/ /* add interface instance to database (we currently only handle IPv4) */ if(pinfo->net_src.type == AT_IPv4) { - dcom_if = dcom_interface_new(pinfo, - pinfo->net_src.data, - &iid, oxid, oid, &ipid); + dcom_if = dcom_interface_new(pinfo, + pinfo->net_src.data, + &iid, oxid, oid, &ipid); } - /* update subtree */ - proto_item_append_text(sub_item, "[%u]: %s", - u32ItemIdx, - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); - proto_item_set_len(sub_item, offset - u32SubStart); - - /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " %s[%u]", - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)"), - u32ItemIdx); - } + /* update subtree */ + proto_item_append_text(sub_item, "[%u]: %s", + u32ItemIdx, + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)") ); + proto_item_set_len(sub_item, offset - u32SubStart); + + /* update column info now */ + if (check_col(pinfo->cinfo, COL_INFO)) { + col_append_fstr(pinfo->cinfo, COL_INFO, " %s[%u]", + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)"), + u32ItemIdx); + } - u32ItemIdx++; - } + u32ItemIdx++; + } - /* HRESULT of call */ - offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, - &u32HResult); + /* HRESULT of call */ + offset = dissect_dcom_HRESULT(tvb, offset, pinfo, tree, drep, + &u32HResult); - /* update column info now */ + /* update column info now */ if (check_col(pinfo->cinfo, COL_INFO)) { - col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", - val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)")); - } + col_append_fstr(pinfo->cinfo, COL_INFO, " -> %s", + val_to_str(u32HResult, dcom_hresult_vals, "Unknown (0x%08x)")); + } - return offset; + return offset; } static int dissect_remunk_remrelease_rqst(tvbuff_t *tvb, int offset, - packet_info *pinfo, proto_tree *tree, guint8 *drep) + packet_info *pinfo, proto_tree *tree, guint8 *drep) { - guint32 u32Pointer; - guint32 u32IntRefs; - guint32 u32ItemIdx; - e_uuid_t ipid; - guint32 u32PublicRefs; - guint32 u32PrivateRefs; - const gchar *pszFormat; - proto_item *sub_item; - proto_tree *sub_tree; - guint32 u32SubStart; + guint32 u32Pointer; + guint32 u32IntRefs; + guint32 u32ItemIdx; + e_uuid_t ipid; + guint32 u32PublicRefs; + guint32 u32PrivateRefs; + const gchar *pszFormat; + proto_item *sub_item; + proto_tree *sub_tree; + guint32 u32SubStart; offset = dissect_dcom_this(tvb, offset, pinfo, tree, drep); - offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, - &u32Pointer); + offset = dissect_dcom_dcerpc_pointer(tvb, offset, pinfo, tree, drep, + &u32Pointer); - offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, - hf_remunk_interface_refs, &u32IntRefs); + offset = dissect_dcom_DWORD(tvb, offset, pinfo, tree, drep, + hf_remunk_interface_refs, &u32IntRefs); - /* update column info now */ + /* update column info now */ if (check_col(pinfo->cinfo, COL_INFO)) { - if (u32IntRefs) { - col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u Refs=", u32IntRefs); - } else { - col_append_str(pinfo->cinfo, COL_INFO, " Cnt=0"); - } - } - - u32ItemIdx = 1; - while (u32IntRefs--) { + if (u32IntRefs) { + col_append_fstr(pinfo->cinfo, COL_INFO, " Cnt=%u Refs=", u32IntRefs); + } else { + col_append_str(pinfo->cinfo, COL_INFO, " Cnt=0"); + } + } + + u32ItemIdx = 1; + while (u32IntRefs--) { /* add subtree */ - sub_item = proto_tree_add_item(tree, hf_remunk_reminterfaceref, tvb, offset, 0, FALSE); - sub_tree = proto_item_add_subtree(sub_item, ett_remunk_reminterfaceref); - u32SubStart = offset; - - offset = dissect_dcom_UUID(tvb, offset, pinfo, sub_tree, drep, - hf_dcom_ipid, &ipid); - - offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep, - hf_remunk_public_refs, &u32PublicRefs); - - offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep, - hf_remunk_private_refs, &u32PrivateRefs); - - /* update subtree */ - proto_item_append_text(sub_item, "[%u]: IPID=%s, PublicRefs=%u, PrivateRefs=%u", - u32ItemIdx, - guids_resolve_uuid_to_str(&ipid), - u32PublicRefs, u32PrivateRefs); - proto_item_set_len(sub_item, offset - u32SubStart); - - /* update column info now */ - if (check_col(pinfo->cinfo, COL_INFO)) { - pszFormat = ""; - if (u32ItemIdx == 1) { - pszFormat = "%u-%u"; - } else if (u32ItemIdx < 10) { - pszFormat = ",%u-%u"; - } else if (u32ItemIdx == 10) { - pszFormat = ",..."; - } - col_append_fstr(pinfo->cinfo, COL_INFO, pszFormat, u32PublicRefs, u32PrivateRefs); - } - - u32ItemIdx++; - } - - return offset; + sub_item = proto_tree_add_item(tree, hf_remunk_reminterfaceref, tvb, offset, 0, FALSE); + sub_tree = proto_item_add_subtree(sub_item, ett_remunk_reminterfaceref); + u32SubStart = offset; + + offset = dissect_dcom_UUID(tvb, offset, pinfo, sub_tree, drep, + hf_dcom_ipid, &ipid); + + offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep, + hf_remunk_public_refs, &u32PublicRefs); + + offset = dissect_dcom_DWORD(tvb, offset, pinfo, sub_tree, drep, + hf_remunk_private_refs, &u32PrivateRefs); + + /* update subtree */ + proto_item_append_text(sub_item, "[%u]: IPID=%s, PublicRefs=%u, PrivateRefs=%u", + u32ItemIdx, + guids_resolve_uuid_to_str(&ipid), + u32PublicRefs, u32PrivateRefs); + proto_item_set_len(sub_item, offset - u32SubStart); + + /* update column info now */ + if (check_col(pinfo->cinfo, COL_INFO)) { + pszFormat = ""; + if (u32ItemIdx == 1) { + pszFormat = "%u-%u"; + } else if (u32ItemIdx < 10) { + pszFormat = ",%u-%u"; + } else if (u32ItemIdx == 10) { + pszFormat = ",..."; + } + col_append_fstr(pinfo->cinfo, COL_INFO, pszFormat, u32PublicRefs, u32PrivateRefs); + } + + u32ItemIdx++; + } + + return offset; } @@ -305,7 +305,7 @@ static dcerpc_sub_dissector remunk_dissectors[] = { { 2, "Release", NULL, NULL }, { 3, "RemQueryInterface", dissect_remunk_remqueryinterface_rqst, dissect_remunk_remqueryinterface_resp }, - { 4, "RemAddRef", NULL, NULL }, + { 4, "RemAddRef", NULL, NULL }, { 5, "RemRelease", dissect_remunk_remrelease_rqst, dissect_dcom_simple_resp }, { 0, NULL, NULL, NULL } }; @@ -317,10 +317,10 @@ static dcerpc_sub_dissector remunk2_dissectors[] = { { 2, "Release", NULL, NULL }, { 3, "RemQueryInterface", dissect_remunk_remqueryinterface_rqst, dissect_remunk_remqueryinterface_resp }, - { 4, "RemAddRef", NULL, NULL }, + { 4, "RemAddRef", NULL, NULL }, { 5, "RemRelease", dissect_remunk_remrelease_rqst, dissect_dcom_simple_resp }, - { 6, "RemQueryInterface2", NULL, NULL }, + { 6, "RemQueryInterface2", NULL, NULL }, { 0, NULL, NULL, NULL } }; @@ -329,41 +329,41 @@ static dcerpc_sub_dissector remunk2_dissectors[] = { void proto_register_remunk (void) { - static hf_register_info hf_remunk_rqi_array[] = { + static hf_register_info hf_remunk_rqi_array[] = { { &hf_remunk_opnum, - { "Operation", "remunk_opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - - { &hf_remunk_refs, - { "Refs", "remunk_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_remunk_iids, - { "IIDs", "remunk_iids", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_remunk_qiresult, - { "QIResult", "remunk_qiresult", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_remunk_flags, - { "Flags", "remunk_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, - { &hf_remunk_public_refs, - { "PublicRefs", "remunk_public_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_remunk_reminterfaceref, - { "RemInterfaceRef", "remunk_reminterfaceref", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, - { &hf_remunk_interface_refs, - { "InterfaceRefs", "remunk_int_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, - { &hf_remunk_private_refs, - { "PrivateRefs", "remunk_private_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }} - }; - - static gint *ett_remunk_array[] = { - &ett_remunk, - &ett_remunk_rqi_result, - &ett_remunk2, - &ett_remunk_reminterfaceref - }; - - proto_remunk = proto_register_protocol ("IRemUnknown", "IRemUnknown", "remunk"); - proto_register_field_array (proto_remunk, hf_remunk_rqi_array, array_length (hf_remunk_rqi_array)); - - proto_remunk2 = proto_register_protocol ("IRemUnknown2", "IRemUnknown2", "remunk2"); - - proto_register_subtree_array (ett_remunk_array, array_length (ett_remunk_array)); + { "Operation", "remunk_opnum", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + + { &hf_remunk_refs, + { "Refs", "remunk_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_remunk_iids, + { "IIDs", "remunk_iids", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_remunk_qiresult, + { "QIResult", "remunk_qiresult", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_remunk_flags, + { "Flags", "remunk_flags", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_remunk_public_refs, + { "PublicRefs", "remunk_public_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_remunk_reminterfaceref, + { "RemInterfaceRef", "remunk_reminterfaceref", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_remunk_interface_refs, + { "InterfaceRefs", "remunk_int_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }}, + { &hf_remunk_private_refs, + { "PrivateRefs", "remunk_private_refs", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }} + }; + + static gint *ett_remunk_array[] = { + &ett_remunk, + &ett_remunk_rqi_result, + &ett_remunk2, + &ett_remunk_reminterfaceref + }; + + proto_remunk = proto_register_protocol ("IRemUnknown", "IRemUnknown", "remunk"); + proto_register_field_array (proto_remunk, hf_remunk_rqi_array, array_length (hf_remunk_rqi_array)); + + proto_remunk2 = proto_register_protocol ("IRemUnknown2", "IRemUnknown2", "remunk2"); + + proto_register_subtree_array (ett_remunk_array, array_length (ett_remunk_array)); } void @@ -373,12 +373,12 @@ proto_reg_handoff_remunk (void) /* Register the IPID */ guids_add_uuid(&ipid_remunk, "IPID-IRemUnknown"); - /* Register the interfaces */ - dcerpc_init_uuid(proto_remunk, ett_remunk, - &uuid_remunk, ver_remunk, - remunk_dissectors, hf_remunk_opnum); + /* Register the interfaces */ + dcerpc_init_uuid(proto_remunk, ett_remunk, + &uuid_remunk, ver_remunk, + remunk_dissectors, hf_remunk_opnum); - dcerpc_init_uuid(proto_remunk2, ett_remunk2, - &uuid_remunk2, ver_remunk2, - remunk2_dissectors, hf_remunk_opnum); + dcerpc_init_uuid(proto_remunk2, ett_remunk2, + &uuid_remunk2, ver_remunk2, + remunk2_dissectors, hf_remunk_opnum); } |