* Routines for dcerpc endpoint mapper dissection
* Copyright 2001, Todd Sabin <tas@webspan.net>
*
- * $Id: packet-dcerpc-epm.c,v 1.16 2002/10/23 00:48:33 guy Exp $
+ * $Id: packet-dcerpc-epm.c,v 1.21 2003/08/04 02:49:03 tpot Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_pointer_UUID, NDR_POINTER_PTR,
- "Object:", hf_epm_object, 0);
+ "Object:", hf_epm_object);
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_pointer_IF_ID, NDR_POINTER_PTR,
- "Interface:", hf_epm_if_id, 0);
+ "Interface:", hf_epm_if_id);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_epm_ver_opt, NULL);
- if (tree) {
- proto_tree_add_bytes (tree, hf_epm_hnd, tvb, offset, 20,
- tvb_get_ptr (tvb, offset, 20));
- }
- offset += 20;
+
+ offset = dissect_ndr_ctx_hnd (tvb, offset, pinfo, tree, drep,
+ hf_epm_hnd, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_epm_max_ents, NULL);
guint32 len;
gint strlen;
dcerpc_info *di;
- char *str;
+ const char *str;
di=pinfo->private_data;
if(di->conformant_run){
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_tower, NDR_POINTER_PTR,
- "Tower pointer:", -1, 1);
+ "Tower pointer:", -1);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_epm_ann_offset, NULL);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_epm_ann_len, &len);
- str=(char *)tvb_get_ptr(tvb, offset, -1);
+ str=(const char *)tvb_get_ptr(tvb, offset, -1);
strlen=len;
strlen=MIN(strlen,tvb_length_remaining(tvb, offset));
proto_tree_add_item(tree, hf_epm_annotation, tvb, offset, len, TRUE);
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_ept_entry_t_array, NDR_POINTER_REF,
- "Entries:", -1, 1);
+ "Entries:", -1);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_epm_rc, NULL);
{
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_tower, NDR_POINTER_PTR,
- "Tower pointer:", -1, 1);
+ "Tower pointer:", -1);
return offset;
}
static int
/* [in, ptr] twr_p_t map_tower */
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_tower, NDR_POINTER_PTR,
- "Tower pointer:", -1, 1);
+ "Tower pointer:", -1);
/* [in, out] ept_lookup_handle_t *entry_handle */
offset = dissect_ndr_ctx_hnd (tvb, offset, pinfo, tree, drep,
/* [out, length_is(*num_towers), size_is(max_towers), ptr] twr_p_t towers[] */
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_tower_array, NDR_POINTER_REF,
- "Tower array:", -1, 1);
+ "Tower array:", -1);
/* [out] error_status_t *status */
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_ept_entry_t_ucarray, NDR_POINTER_REF,
- "Entries:", -1, 1);
+ "Entries:", -1);
offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
hf_epm_replace, NULL);
offset = dissect_ndr_pointer(tvb, offset, pinfo, tree, drep,
epm_dissect_ept_entry_t_ucarray, NDR_POINTER_REF,
- "Entries:", -1, 1);
+ "Entries:", -1);
return offset;
}
}
+
+static int
+epm_dissect_ept_lookup_handle_free_rqst (tvbuff_t *tvb, int offset,
+ packet_info *pinfo, proto_tree *tree,
+ char *drep)
+{
+ offset = dissect_ndr_ctx_hnd (tvb, offset, pinfo, tree, drep,
+ hf_epm_hnd, NULL);
+
+ return offset;
+}
+
+static int
+epm_dissect_ept_lookup_handle_free_resp (tvbuff_t *tvb, int offset,
+ packet_info *pinfo, proto_tree *tree,
+ char *drep)
+{
+ offset = dissect_ndr_ctx_hnd (tvb, offset, pinfo, tree, drep,
+ hf_epm_hnd, NULL);
+
+ offset = dissect_ndr_uint32 (tvb, offset, pinfo, tree, drep,
+ hf_epm_rc, NULL);
+
+ return offset;
+}
+
+
static dcerpc_sub_dissector epm_dissectors[] = {
{ 0, "Insert",
epm_dissect_ept_insert_rqst,
{ 3, "Map",
epm_dissect_ept_map_rqst,
epm_dissect_ept_map_resp },
- { 4, "ept_lookup_handle_free", NULL, NULL },
- { 5, "ept_inq_object", NULL, NULL },
- { 6, "ept_mgmt_delete", NULL, NULL },
+ { 4, "LookupHandleFree",
+ epm_dissect_ept_lookup_handle_free_rqst,
+ epm_dissect_ept_lookup_handle_free_resp },
+ { 5, "InqObject", NULL, NULL },
+ { 6, "MgmtDelete", NULL, NULL },
{ 0, NULL, NULL, NULL }
};
-static const value_string epm_opnum_vals[] = {
- { 0, "Insert" },
- { 1, "Delete" },
- { 2, "Lookup" },
- { 3, "Map" },
- { 4, "lookup_handle_free" },
- { 5, "inq_object" },
- { 6, "mgmt_delete" },
- { 0, NULL }
-};
-
void
proto_register_epm (void)
{
static hf_register_info hf[] = {
{ &hf_epm_opnum,
{ "Operation", "epm.opnum", FT_UINT16, BASE_DEC,
- VALS(epm_opnum_vals), 0x0, "Operation", HFILL }},
+ NULL, 0x0, "Operation", HFILL }},
{ &hf_epm_inquiry_type,
{ "Inquiry type", "epm.inq_type", FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL }},
{ &hf_epm_object,