diff options
author | Michael Mann <mmann78@netscape.net> | 2013-05-27 17:30:43 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-05-27 17:30:43 +0000 |
commit | ea177a2575dc4900c7ef2aa78bfe9b2a1173f7fb (patch) | |
tree | 626615fdfd431d78baefe2e59fb28f6b774959aa /epan/dissectors/packet-ndps.c | |
parent | c6af00a977cf7c7a3c914c79009eaa87bd19c56f (diff) | |
download | wireshark-ea177a2575dc4900c7ef2aa78bfe9b2a1173f7fb.tar.gz |
Batch of filterable expert infos
svn path=/trunk/; revision=49596
Diffstat (limited to 'epan/dissectors/packet-ndps.c')
-rw-r--r-- | epan/dissectors/packet-ndps.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ndps.c b/epan/dissectors/packet-ndps.c index 73c6658a7f..63e416a555 100644 --- a/epan/dissectors/packet-ndps.c +++ b/epan/dissectors/packet-ndps.c @@ -355,6 +355,10 @@ static int hf_spx_ndps_func_broker = -1; static gint ett_ndps = -1; +static expert_field ei_ndps_problem_type = EI_INIT; +static expert_field ei_ndps_return_code = EI_INIT; +static expert_field ei_ndps_rpc_acc_stat = EI_INIT; + /* desegmentation of NDPS over TCP */ static gboolean ndps_desegment = TRUE; @@ -6732,7 +6736,7 @@ ndps_error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int foffset ndps_problem_type = tvb_get_ntohl(tvb, foffset); col_set_str(pinfo->cinfo, COL_INFO, "R NDPS - Error"); expert_item = proto_tree_add_uint(ndps_tree, hf_ndps_problem_type, tvb, foffset, 4, ndps_problem_type); - expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "Fault: %s", val_to_str(ndps_problem_type, error_type_enum, "Unknown NDPS Error (0x%08x)")); + expert_add_info_format_text(pinfo, expert_item, &ei_ndps_problem_type, "Fault: %s", val_to_str(ndps_problem_type, error_type_enum, "Unknown NDPS Error (0x%08x)")); foffset += 4; switch(ndps_problem_type) { @@ -6933,7 +6937,7 @@ return_code(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int foffse expert_status = tvb_get_ntohl(tvb, foffset); expert_item = proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN); if (expert_status != 0) { - expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "Fault: %s", val_to_str(expert_status, ndps_error_types, "Unknown NDPS Error (0x%08x)")); + expert_add_info_format_text(pinfo, expert_item, &ei_ndps_return_code, "Fault: %s", val_to_str(expert_status, ndps_error_types, "Unknown NDPS Error (0x%08x)")); } foffset += 4; if (check_col(pinfo->cinfo, COL_INFO) && tvb_get_ntohl(tvb, foffset-4) != 0) @@ -7010,7 +7014,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int expert_item = proto_tree_add_item(ndps_tree, hf_ndps_rpc_acc_stat, tvb, foffset, 4, ENC_BIG_ENDIAN); expert_status = tvb_get_ntohl(tvb, foffset); if (expert_status != 0) { - expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "Fault: %s", val_to_str(expert_status, accept_stat, "Unknown NDPS Error (0x%08x)")); + expert_add_info_format_text(pinfo, expert_item, &ei_ndps_rpc_acc_stat, "Fault: %s", val_to_str(expert_status, accept_stat, "Unknown NDPS Error (0x%08x)")); } foffset += 4; if (tvb_length_remaining(tvb,foffset) < 4 ) { @@ -7032,7 +7036,7 @@ dissect_ndps_reply(tvbuff_t *tvb, packet_info *pinfo, proto_tree *ndps_tree, int { expert_status = tvb_get_ntohl(tvb, foffset); expert_item = proto_tree_add_item(ndps_tree, hf_ndps_return_code, tvb, foffset, 4, ENC_BIG_ENDIAN); - expert_add_info_format(pinfo, expert_item, PI_RESPONSE_CODE, PI_ERROR, "Fault: %s", val_to_str(expert_status, ndps_error_types, "Unknown NDPS Error (0x%08x)")); + expert_add_info_format_text(pinfo, expert_item, &ei_ndps_return_code, "Fault: %s", val_to_str(expert_status, ndps_error_types, "Unknown NDPS Error (0x%08x)")); col_append_str(pinfo->cinfo, COL_INFO, "- Error"); return foffset; } @@ -9764,11 +9768,21 @@ proto_register_ndps(void) &ett_ndps_segments, &ett_ndps_segment, }; + + static ei_register_info ei[] = { + { &ei_ndps_problem_type, { "ndps.problem_type.expert", PI_RESPONSE_CODE, PI_NOTE, "Fault", EXPFILL }}, + { &ei_ndps_return_code, { "ndps.return_code.expert", PI_RESPONSE_CODE, PI_NOTE, "Fault", EXPFILL }}, + { &ei_ndps_rpc_acc_stat, { "ndps.rpc_acc_stat.expert", PI_RESPONSE_CODE, PI_NOTE, "Fault", EXPFILL }}, + }; + module_t *ndps_module; + expert_module_t* expert_ndps; proto_ndps = proto_register_protocol("Novell Distributed Print System", "NDPS", "ndps"); proto_register_field_array(proto_ndps, hf_ndps, array_length(hf_ndps)); proto_register_subtree_array(ett, array_length(ett)); + expert_ndps = expert_register_protocol(proto_ndps); + expert_register_field_array(expert_ndps, ei, array_length(ei)); ndps_module = prefs_register_protocol(proto_ndps, NULL); prefs_register_bool_preference(ndps_module, "desegment_tcp", |