Batch of filterable expert infos.

Also added a note about deprecating expert_add_info_format

svn path=/trunk/; revision=50270
This commit is contained in:
Michael Mann 2013-06-30 22:19:37 +00:00
parent 20674d8877
commit 5bbc26236a
6 changed files with 119 additions and 46 deletions

View File

@ -4627,6 +4627,8 @@ static gint ett_bacapp_tag = -1;
static gint ett_bacapp_list = -1;
static gint ett_bacapp_value = -1;
static expert_field ei_bacapp_bad_length = EI_INIT;
static dissector_handle_t data_handle;
static gint32 propertyIdentifier = -1;
static gint32 propertyArrayIndex = -1;
@ -5129,7 +5131,7 @@ fTagHeaderTree (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
} /* if (tree) */
if (*lvt > tvb_length(tvb)) {
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti, &ei_bacapp_bad_length,
"LVT length too long: %d > %d", *lvt,
tvb_length(tvb));
*lvt = 1;
@ -5226,7 +5228,7 @@ fDevice_Instance (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint off
ti = proto_tree_add_item(tree, hf, tvb, offset+tag_len, safe_lvt, ENC_BIG_ENDIAN);
if (lvt != safe_lvt)
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti, &ei_bacapp_bad_length,
"This field claims to be an impossible %u bytes, while the max is %u", lvt, safe_lvt);
subtree = proto_item_add_subtree(ti, ett_bacapp_tag);
@ -7070,7 +7072,7 @@ fVendorIdentifier (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint of
if ((lvt < 1) || (lvt > 2)) { /* vendorIDs >= 1 and <= 2 are supported */
proto_item *expert_item;
expert_item = proto_tree_add_text(tree, tvb, 0, lvt, "Wrong length indicated. Expected 1 or 2, got %u", lvt);
expert_add_info_format(pinfo, expert_item, PI_MALFORMED, PI_ERROR, "Wrong length indicated. Expected 1 or 2, got %u", lvt);
expert_add_info_format_text(pinfo, expert_item, &ei_bacapp_bad_length, "Wrong length indicated. Expected 1 or 2, got %u", lvt);
PROTO_ITEM_SET_GENERATED(expert_item);
return offset+tag_len+lvt;
}
@ -7106,7 +7108,7 @@ fRestartReason (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint offse
if (lvt != 1) {
proto_item *expert_item;
expert_item = proto_tree_add_text(tree, tvb, 0, lvt, "Wrong length indicated. Expected 1, got %u", lvt);
expert_add_info_format(pinfo, expert_item, PI_MALFORMED, PI_ERROR, "Wrong length indicated. Expected 1, got %u", lvt);
expert_add_info_format_text(pinfo, expert_item, &ei_bacapp_bad_length, "Wrong length indicated. Expected 1, got %u", lvt);
PROTO_ITEM_SET_GENERATED(expert_item);
return offset+tag_len+lvt;
}
@ -11108,11 +11110,19 @@ proto_register_bacapp(void)
};
static ei_register_info ei[] = {
{ &ei_bacapp_bad_length, { "bacapp.bad_length", PI_MALFORMED, PI_ERROR, "Wrong length indicated", EXPFILL }},
};
expert_module_t* expert_bacapp;
proto_bacapp = proto_register_protocol("Building Automation and Control Network APDU",
"BACapp", "bacapp");
proto_register_field_array(proto_bacapp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_bacapp = expert_register_protocol(proto_bacapp);
expert_register_field_array(expert_bacapp, ei, array_length(ei));
register_dissector("bacapp", dissect_bacapp, proto_bacapp);
register_init_routine (&bacapp_init_routine);

View File

@ -98,6 +98,8 @@ static const fragment_items clnp_frag_items = {
"segments"
};
static expert_field ei_clnp_length = EI_INIT;
static dissector_handle_t clnp_handle;
static dissector_handle_t ositp_handle;
static dissector_handle_t ositp_inactive_handle;
@ -270,7 +272,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (cnf_hdr_len < FIXED_PART_LEN) {
/* Header length is less than the length of the fixed part of
the header. */
expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_len, &ei_clnp_length,
"Header length value < minimum length %u",
FIXED_PART_LEN);
return;
@ -318,7 +320,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
segment_length);
if (segment_length < cnf_hdr_len) {
/* Segment length is less than the header length. */
expert_add_info_format(pinfo, ti_pdu_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_pdu_len, &ei_clnp_length,
"PDU length < header length %u", cnf_hdr_len);
return;
}
@ -369,7 +371,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (opt_len < 1) {
/* Header length is less than the minimum value in CLNP,
including the destination address length. */
expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_len, &ei_clnp_length,
"Header length value < %u",
FIXED_PART_LEN + 1);
return;
@ -386,7 +388,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Header length is less than the minimum value,
including the destination address length and the
destination address. */
expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_len, &ei_clnp_length,
"Header length value < %u",
FIXED_PART_LEN + 1 + dst_len);
return;
@ -406,7 +408,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* Header length is less than the minimum value,
including the destination address length, the
destination address, and the source address length. */
expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_len, &ei_clnp_length,
"Header length value < %u",
FIXED_PART_LEN + 1 + dst_len + 1);
return;
@ -424,7 +426,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
including the destination address length, the
destination address, the source address length,
and the source address. */
expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_len, &ei_clnp_length,
"Header length value < %u",
FIXED_PART_LEN + 1 + dst_len + 1 + src_len);
return;
@ -449,7 +451,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
including the destination address length, the
destination address, the source address length,
the source address, and the segmentation part. */
expert_add_info_format(pinfo, ti_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_len, &ei_clnp_length,
"Header length value < %u",
FIXED_PART_LEN + 1 + dst_len + 1 + SEGMENTATION_PART_LEN);
return;
@ -468,7 +470,7 @@ dissect_clnp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
total_length);
if (total_length < segment_length) {
/* Reassembled length is less than the length of this segment. */
expert_add_info_format(pinfo, ti_tot_len, PI_MALFORMED, PI_ERROR,
expert_add_info_format_text(pinfo, ti_tot_len, &ei_clnp_length,
"Total length < segment length %u", segment_length);
return;
}
@ -721,11 +723,18 @@ proto_register_clnp(void)
&ett_clnp_disc_pdu,
};
static ei_register_info ei[] = {
{ &ei_clnp_length, { "clnp.len.bad", PI_MALFORMED, PI_ERROR, "Header length value bad", EXPFILL }},
};
module_t *clnp_module;
expert_module_t* expert_clnp;
proto_clnp = proto_register_protocol(PROTO_STRING_CLNP, "CLNP", "clnp");
proto_register_field_array(proto_clnp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_clnp = expert_register_protocol(proto_clnp);
expert_register_field_array(expert_clnp, ei, array_length(ei));
register_dissector("clnp", dissect_clnp, proto_clnp);
register_heur_dissector_list("clnp", &clnp_heur_subdissector_list);
register_init_routine(clnp_reassemble_init);

View File

@ -186,6 +186,14 @@ static gint ett_forces_astreason_tlv = -1;
/*Main_TLV unknown subtree*/
static gint ett_forces_unknown_tlv = -1;
static expert_field ei_forces_length = EI_INIT;
static expert_field ei_forces_tlv_type = EI_INIT;
static expert_field ei_forces_tlv_length = EI_INIT;
static expert_field ei_forces_lfbselect_tlv_type_operation_path_length = EI_INIT;
static expert_field ei_forces_lfbselect_tlv_type_operation_type = EI_INIT;
static expert_field ei_forces_redirect_tlv_redirect_data_tlv_length = EI_INIT;
/*ACK values and the strings to be displayed*/
static const value_string main_header_flags_ack_vals[] = {
{ 0x0, "NoACK" },
@ -308,7 +316,7 @@ dissect_path_data_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint
tvb, offset+2, 2, ENC_BIG_ENDIAN);
if (length_TLV < TLV_TL_LENGTH)
{
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Bogus TLV length: %u", length_TLV);
expert_add_info_format_text(pinfo, ti, &ei_forces_lfbselect_tlv_type_operation_path_length, "Bogus TLV length: %u", length_TLV);
break;
}
proto_item_set_len(ti, length_TLV);
@ -365,7 +373,7 @@ dissect_operation_tlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint
ti = proto_tree_add_item(oper_tree, hf_forces_lfbselect_tlv_type_operation_type,
tvb, offset, 2, ENC_BIG_ENDIAN);
if (try_val_to_str(type, operation_type_vals) == NULL)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
expert_add_info_format_text(pinfo, ti, &ei_forces_lfbselect_tlv_type_operation_type,
"Bogus: ForCES Operation TLV (Type:0x%04x) is not supported", type);
length = tvb_get_ntohs(tvb, offset+2);
@ -451,13 +459,11 @@ dissect_redirecttlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gint of
if (tvb_reported_length_remaining(tvb, offset) < length_redirect)
{
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
"Bogus: Redirect Data TLV length (%u bytes) is wrong", length_redirect);
expert_add_info_format_text(pinfo, ti, &ei_forces_redirect_tlv_redirect_data_tlv_length, "Bogus: Redirect Data TLV length (%u bytes) is wrong", length_redirect);
}
else if (length_redirect < TLV_TL_LENGTH + MIN_IP_HEADER_LENGTH)
{
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
"Bogus: Redirect Data TLV length (%u bytes) not big enough for IP layer", length_redirect);
expert_add_info_format_text(pinfo, ti, &ei_forces_redirect_tlv_redirect_data_tlv_length, "Bogus: Redirect Data TLV length (%u bytes) not big enough for IP layer", length_redirect);
}
else
{
@ -507,12 +513,10 @@ dissect_forces(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offs
ti = proto_tree_add_uint_format( forces_main_header_tree, hf_forces_length,
tvb, offset+2, 2, length_count, "Length: %u Bytes", length_count);
if (length_count != tvb_reported_length_remaining(tvb, offset))
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
"Bogus: ForCES Header length (%u bytes) is wrong),should be (%u bytes)",
expert_add_info_format_text(pinfo, ti, &ei_forces_length, "Bogus: ForCES Header length (%u bytes) is wrong),should be (%u bytes)",
length_count, tvb_reported_length_remaining(tvb, offset));
if (length_count < 24)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
"Bogus: ForCES Header length (%u bytes) is less than 24bytes)", length_count);
expert_add_info_format_text(pinfo, ti, &ei_forces_length, "Bogus: ForCES Header length (%u bytes) is less than 24bytes)", length_count);
col_add_fstr(pinfo->cinfo, COL_INFO, "Message Type: %s, Total Length: %u Bytes",
val_to_str(message_type, message_type_vals, "Unknown messagetype 0x%x"), length_count);
@ -546,12 +550,11 @@ dissect_forces(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offs
ti = proto_tree_add_uint_format(forces_tlv_tree, hf_forces_tlv_length,
tvb, offset+2, 2, length_count, "Length: %u Bytes", length_count);
if (tvb_reported_length_remaining(tvb, offset) < length_count)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
"Bogus: Main TLV length (%u bytes) is wrong", length_count);
expert_add_info_format_text(pinfo, ti, &ei_forces_tlv_length, "Bogus: Main TLV length (%u bytes) is wrong", length_count);
if (length_count < TLV_TL_LENGTH)
{
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Bogus TLV length: %u", length_count);
expert_add_info_format_text(pinfo, ti, &ei_forces_tlv_length, "Bogus TLV length: %u", length_count);
break;
}
@ -585,8 +588,7 @@ dissect_forces(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guint32 offs
break;
default:
expert_add_info_format(pinfo, tlv_item, PI_PROTOCOL, PI_WARN,
"Bogus: The Main_TLV type is unknown");
expert_add_info(pinfo, tlv_item, &ei_forces_tlv_type);
ti = proto_tree_add_text(forces_tlv_tree, tvb, offset, length_count, "Unknown TLV");
tlv_tree = proto_item_add_subtree(ti, ett_forces_unknown_tlv);
proto_tree_add_item(tlv_tree, hf_forces_unknown_tlv, tvb, offset, length_count, ENC_NA);
@ -617,6 +619,7 @@ void
proto_register_forces(void)
{
module_t *forces_module;
expert_module_t* expert_forces;
/* Setup list of header fields See Section 1.6.1 for details*/
static hf_register_info hf[] = {
@ -805,12 +808,23 @@ proto_register_forces(void)
&ett_forces_unknown_tlv
};
static ei_register_info ei[] = {
{ &ei_forces_length, { "forces.length.bad", PI_PROTOCOL, PI_WARN, "ForCES Header length is wrong", EXPFILL }},
{ &ei_forces_tlv_type, { "forces.tlv.type.unknown", PI_PROTOCOL, PI_WARN, "Bogus: The Main_TLV type is unknown", EXPFILL }},
{ &ei_forces_tlv_length, { "forces.tlv.length.bad", PI_PROTOCOL, PI_WARN, "Bogus TLV length", EXPFILL }},
{ &ei_forces_lfbselect_tlv_type_operation_path_length, { "forces.lfbselect.tlv.type.operation.path.length.bad", PI_PROTOCOL, PI_WARN, "Bogus TLV length", EXPFILL }},
{ &ei_forces_lfbselect_tlv_type_operation_type, { "forces.lfbselect.tlv.type.operation.type.unsupported", PI_PROTOCOL, PI_WARN, "ForCES Operation TLV is not supported", EXPFILL }},
{ &ei_forces_redirect_tlv_redirect_data_tlv_length, { "forces.redirect.tlv.redirect.data.tlv.length.bad", PI_PROTOCOL, PI_WARN, "Redirect Data TLV length is wrong", EXPFILL }},
};
/* Register the protocol name and description */
proto_forces = proto_register_protocol("Forwarding and Control Element Separation Protocol", "ForCES", "forces");
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_forces, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_forces = expert_register_protocol(proto_forces);
expert_register_field_array(expert_forces, ei, array_length(ei));
forces_module = prefs_register_protocol(proto_forces,proto_reg_handoff_forces);

View File

@ -142,6 +142,17 @@ static gint ett_ged125_float_field = -1;
static gint ett_ged125_service_control_header = -1;
static gint ett_ged125_service_control_data = -1;
static expert_field ei_ged125_OperationalStatus_normal = EI_INIT;
static expert_field ei_ged125_OperationalStatus_loss_redundant_component = EI_INIT;
static expert_field ei_ged125_OperationalStatus_degraded_call_processing = EI_INIT;
static expert_field ei_ged125_OperationalStatus_conditions_prevent_call = EI_INIT;
static expert_field ei_ged125_OperationalStatus_invalid_message = EI_INIT;
static expert_field ei_ged125_length_bad = EI_INIT;
static expert_field ei_ged125_sendseqno_and_dialogueid = EI_INIT;
static expert_field ei_ged125_service_control_value_unknown = EI_INIT;
static expert_field ei_ged125_trunk_group_id = EI_INIT;
static expert_field ei_ged125_TrunkCount_invalid = EI_INIT;
/* Preferences */
static guint global_tcp_port_ged125 = 0;
static gboolean ged125_desegment_body = TRUE;
@ -517,16 +528,15 @@ OperationalStatus_funk(tvbuff_t* tvb, packet_info *pinfo, proto_tree* tree, gint
ti = proto_tree_add_item(tree, hf_ged125_OperationalStatus, tvb, *offset, 4, ENC_BIG_ENDIAN);
if(value == 0)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_NOTE, "Normal Operation");
expert_add_info(pinfo, ti, &ei_ged125_OperationalStatus_normal);
else if(value <= 31 && value >0)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_NOTE,
"Loss of redundant component or other transparent failure; still fully functional for call processing");
expert_add_info(pinfo, ti, &ei_ged125_OperationalStatus_loss_redundant_component);
else if(value <= 63 && value >= 32 ) /*32-63*/
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_NOTE, "Degraded call processing" );
expert_add_info(pinfo, ti, &ei_ged125_OperationalStatus_degraded_call_processing);
else if(value <= 127 && value >= 64 ) /*64-127*/
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_NOTE, "Conditions prevent call processing" );
expert_add_info(pinfo, ti, &ei_ged125_OperationalStatus_conditions_prevent_call);
else if(value > 127) /*error*/
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Error: Invalid message" );
expert_add_info(pinfo, ti, &ei_ged125_OperationalStatus_invalid_message);
*offset+=4;
}
@ -637,7 +647,7 @@ floating_fields(tvbuff_t* tvb, packet_info *pinfo, proto_tree* tree, gint offset
if ((offset + length > size) && (length > 0))
{
expert_add_info_format(pinfo, ti, PI_MALFORMED, PI_ERROR, "Incorrect size given in the packet (corrupted)");
expert_add_info(pinfo, ti, &ei_ged125_length_bad);
break;
}
@ -735,8 +745,7 @@ service_control_dissect(tvbuff_t* tvb,proto_tree* msg_tree, proto_tree* ged125_t
if ((DialogueID != SendSeqNo) &&
((DialogueID == 0xFFFFFFFF) || (SendSeqNo == 0xFFFFFFFF)))
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
"Both SendSeqNo & DialogueID must be NULL because at least one is NULL");
expert_add_info(pinfo, ti, &ei_ged125_sendseqno_and_dialogueid);
ti = proto_tree_add_uint(service_tree, hf_ged125_service_control_value,
tvb, *offset-12, 4, mess_type);
@ -964,8 +973,7 @@ service_control_dissect(tvbuff_t* tvb,proto_tree* msg_tree, proto_tree* ged125_t
break;
default:
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN,
"Unknown Service-Control Message Sub-type, aborting dissection");
expert_add_info(pinfo, ti, &ei_ged125_service_control_value_unknown);
}
}
@ -1063,13 +1071,13 @@ dissect_ged125_base_messages(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree
ti = proto_tree_add_item(ged125_message_tree, hf_ged125_InvokeID, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
if (value > 65535)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "TrunkGroupID must be between 0-65535");
expert_add_info(pinfo, ti, &ei_ged125_trunk_group_id);
value = tvb_get_ntohl(tvb, offset);
ti = proto_tree_add_item(ged125_message_tree, hf_ged125_TrunkCount, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
if (value > 1023)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Invalid number of trunks (max is 1023)");
expert_add_info(pinfo, ti, &ei_ged125_TrunkCount_invalid);
proto_tree_add_item(ged125_message_tree, hf_ged125_CallsInToday, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
@ -1202,7 +1210,7 @@ dissect_ged125_base_messages(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree
ti = proto_tree_add_item(ged125_message_tree, hf_ged125_TrunkCount, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
if (value > 1023)
expert_add_info_format(pinfo, ti, PI_PROTOCOL, PI_WARN, "Invalid number of trunks (max is 1023)");
expert_add_info(pinfo, ti, &ei_ged125_TrunkCount_invalid);
proto_tree_add_item(ged125_message_tree, hf_ged125_InService, tvb, offset, 4, ENC_BIG_ENDIAN);
offset+=4;
@ -1723,9 +1731,27 @@ proto_register_ged125 (void)
&ett_ged125_service_control_data
};
static ei_register_info ei[] = {
{ &ei_ged125_OperationalStatus_normal, { "ged125.operational_status.normal", PI_PROTOCOL, PI_NOTE, "Normal Operation", EXPFILL }},
{ &ei_ged125_OperationalStatus_loss_redundant_component, { "ged125.operational_status.loss_redundant_component", PI_PROTOCOL, PI_NOTE,
"Loss of redundant component or other transparent failure; still fully functional for call processing", EXPFILL }},
{ &ei_ged125_OperationalStatus_degraded_call_processing, { "ged125.operational_status.degraded_call_processing", PI_PROTOCOL, PI_NOTE, "Degraded call processing", EXPFILL }},
{ &ei_ged125_OperationalStatus_conditions_prevent_call, { "ged125.operational_status.conditions_prevent_call", PI_PROTOCOL, PI_NOTE, "Conditions prevent call processing", EXPFILL }},
{ &ei_ged125_OperationalStatus_invalid_message, { "ged125.operational_status.invalid_message", PI_PROTOCOL, PI_WARN, "Error: Invalid message", EXPFILL }},
{ &ei_ged125_length_bad, { "ged125.length.bad", PI_MALFORMED, PI_ERROR, "Incorrect size given in the packet (corrupted)", EXPFILL }},
{ &ei_ged125_sendseqno_and_dialogueid, { "ged125.sendseqno_and_dialogueid", PI_PROTOCOL, PI_WARN, "Both SendSeqNo & DialogueID must be NULL because at least one is NULL", EXPFILL }},
{ &ei_ged125_service_control_value_unknown, { "ged125.service_control_value.unknown", PI_PROTOCOL, PI_WARN, "Unknown Service-Control Message Sub-type, aborting dissection", EXPFILL }},
{ &ei_ged125_trunk_group_id, { "ged125.trunk_group_id.bad_range", PI_PROTOCOL, PI_WARN, "TrunkGroupID must be between 0-65535", EXPFILL }},
{ &ei_ged125_TrunkCount_invalid, { "ged125.trunk_count.invalid", PI_PROTOCOL, PI_WARN, "Invalid number of trunks (max is 1023)", EXPFILL }},
};
expert_module_t* expert_ged125;
proto_ged125 = proto_register_protocol ("Cisco GED-125 Protocol", "GED125", "ged125");
proto_register_field_array (proto_ged125, hf, array_length (hf));
proto_register_subtree_array (ett, array_length (ett));
expert_ged125 = expert_register_protocol(proto_ged125);
expert_register_field_array(expert_ged125, ei, array_length(ei));
new_register_dissector("ged125", dissect_ged125, proto_ged125);
ged125_module = prefs_register_protocol(proto_ged125, NULL);

View File

@ -178,6 +178,10 @@ static gint ett_iax2_fragments = -1;
static gint ett_iax2_trunk_cmddata = -1;
static gint ett_iax2_trunk_call = -1;
static expert_field ei_iax_too_many_transfers = EI_INIT;
static expert_field ei_iax_circuit_id_conflict = EI_INIT;
static expert_field ei_iax_peer_address_unsupported = EI_INIT;
static const fragment_items iax2_fragment_items = {
&ett_iax2_fragment,
&ett_iax2_fragments,
@ -701,7 +705,7 @@ static circuit_t *iax2_new_circuit_for_call(packet_info *pinfo, proto_item * ite
if ((reversed && iax_call->n_reverse_circuit_ids >= IAX_MAX_TRANSFERS) ||
(! reversed && iax_call->n_forward_circuit_ids >= IAX_MAX_TRANSFERS)) {
expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_WARN, "Too many transfers for iax_call");
expert_add_info(pinfo, item, &ei_iax_too_many_transfers);
return NULL;
}
@ -804,7 +808,7 @@ static iax_call_data *iax_lookup_call_from_dest(packet_info *pinfo, proto_item *
g_debug("++ done");
#endif
} else if (!is_reverse_circuit(src_circuit_id, iax_call)) {
expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_WARN,
expert_add_info_format_text(pinfo, item, &ei_iax_circuit_id_conflict,
"IAX Packet %u from circuit ids %u->%u conflicts with earlier call with circuit ids %u->%u",
framenum,
src_circuit_id, dst_circuit_id,
@ -820,7 +824,7 @@ static iax_call_data *iax_lookup_call_from_dest(packet_info *pinfo, proto_item *
reversed = FALSE;
if (!is_forward_circuit(src_circuit_id, iax_call)) {
expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_WARN,
expert_add_info_format_text(pinfo, item, &ei_iax_circuit_id_conflict,
"IAX Packet %u from circuit ids %u->%u conflicts with earlier call with circuit ids %u->%u",
framenum,
src_circuit_id, dst_circuit_id,
@ -1226,7 +1230,7 @@ static guint32 dissect_ies(tvbuff_t *tvb, packet_info *pinfo, guint32 offset,
break;
default:
expert_add_info_format(pinfo, iax_item, PI_PROTOCOL, PI_WARN,
expert_add_info_format_text(pinfo, iax_item, &ei_iax_peer_address_unsupported,
"Not supported in IAX dissector: peer address family of %u", apparent_addr_family);
break;
}
@ -3030,6 +3034,14 @@ proto_register_iax2(void)
&ett_iax2_trunk_call
};
static ei_register_info ei[] = {
{ &ei_iax_too_many_transfers, { "iax.too_many_transfers", PI_PROTOCOL, PI_WARN, "Too many transfers for iax_call", EXPFILL }},
{ &ei_iax_circuit_id_conflict, { "iax.circuit_id_conflict", PI_PROTOCOL, PI_WARN, "Circuit ID conflict", EXPFILL }},
{ &ei_iax_peer_address_unsupported, { "iax.peer_address_unsupported", PI_PROTOCOL, PI_WARN, "Peer address unsupported", EXPFILL }},
};
expert_module_t* expert_iax;
/* initialize the hf_iax2_ies[] array to -1 */
memset(hf_iax2_ies, 0xff, sizeof(hf_iax2_ies));
@ -3037,6 +3049,8 @@ proto_register_iax2(void)
proto_register_protocol("Inter-Asterisk eXchange v2", "IAX2", "iax2");
proto_register_field_array(proto_iax2, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_iax = expert_register_protocol(proto_iax2);
expert_register_field_array(expert_iax, ei, array_length(ei));
register_dissector("iax2", dissect_iax2, proto_iax2);

View File

@ -139,7 +139,7 @@ expert_update_comment_count(guint64 count);
WS_DLL_PUBLIC void
expert_add_info(packet_info *pinfo, proto_item *pi, expert_field* eiindex);
/** Add an expert info.
/** Add an expert info. TO BE DEPRECATED IN ITS CURRENT FORM!!!
Add an expert info tree to a protocol item, with classification and message.
@param pinfo Packet info of the currently processed packet. May be NULL if
pi is supplied