forked from osmocom/wireshark
Batch of filterable expert info.
svn path=/trunk/; revision=51625
This commit is contained in:
parent
7dbc052d78
commit
e597acdc48
|
@ -407,6 +407,8 @@ static int hf_alcap_leg_release_cause = -1;
|
|||
static expert_field ei_alcap_parameter_field_bad_length = EI_INIT;
|
||||
static expert_field ei_alcap_undecoded = EI_INIT;
|
||||
static expert_field ei_alcap_release_cause_not31 = EI_INIT;
|
||||
static expert_field ei_alcap_abnormal_release = EI_INIT;
|
||||
static expert_field ei_alcap_response = EI_INIT;
|
||||
|
||||
static gboolean keep_persistent_info = TRUE;
|
||||
|
||||
|
@ -447,7 +449,7 @@ static const gchar* dissect_fields_cau(packet_info* pinfo, tvbuff_t *tvb, proto_
|
|||
pi = proto_tree_add_item(tree, hf_alcap_cau_value_itu, tvb, offset+1, 1, ENC_BIG_ENDIAN);
|
||||
|
||||
if ( msg_info->release_cause && msg_info->release_cause != 31 )
|
||||
expert_add_info_format(pinfo, pi, PI_RESPONSE_CODE, PI_WARN, "Abnormal Release");
|
||||
expert_add_info(pinfo, pi, &ei_alcap_abnormal_release);
|
||||
|
||||
ret_str = val_to_str(msg_info->release_cause, cause_values_itu, "Unknown(%u)");
|
||||
} else {
|
||||
|
@ -1241,7 +1243,7 @@ static alcap_param_info_t param_infos[] = {
|
|||
|
||||
typedef struct _alcap_msg_type_info_t {
|
||||
const gchar* abbr;
|
||||
int severity;
|
||||
int severity; /* XXX - not used */
|
||||
} alcap_msg_type_info_t;
|
||||
|
||||
static const alcap_msg_type_info_t msg_types[] = {
|
||||
|
@ -1362,7 +1364,7 @@ static void dissect_alcap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
|
|||
|
||||
msg_type = GET_MSG_TYPE(msg_info->msg_type);
|
||||
|
||||
expert_add_info_format(pinfo, pi, PI_RESPONSE_CODE, msg_type->severity, " ");
|
||||
expert_add_info(pinfo, pi, &ei_alcap_response);
|
||||
|
||||
col_set_str(pinfo->cinfo, COL_INFO, msg_type->abbr);
|
||||
|
||||
|
@ -2407,6 +2409,8 @@ proto_register_alcap(void)
|
|||
{ &ei_alcap_parameter_field_bad_length, { "alcap.parameter_field_bad_length", PI_MALFORMED, PI_WARN, "Wrong length for parameter fields", EXPFILL }},
|
||||
{ &ei_alcap_undecoded, { "alcap.undecoded", PI_UNDECODED, PI_WARN, "Undecoded", EXPFILL }},
|
||||
{ &ei_alcap_release_cause_not31, { "alcap.leg.cause.not31", PI_RESPONSE_CODE, PI_WARN, "Leg Release cause != 31", EXPFILL }},
|
||||
{ &ei_alcap_abnormal_release, { "alcap.abnormal_release", PI_RESPONSE_CODE, PI_WARN, "Abnormal Release", EXPFILL }},
|
||||
{ &ei_alcap_response, { "alcap.response", PI_RESPONSE_CODE, PI_NOTE, " ", EXPFILL }},
|
||||
};
|
||||
|
||||
proto_alcap = proto_register_protocol(alcap_proto_name, alcap_proto_name_short, "alcap");
|
||||
|
|
|
@ -1326,6 +1326,24 @@ static gint ett_amqp_0_10_map = -1;
|
|||
static gint ett_amqp_0_10_array = -1;
|
||||
|
||||
static expert_field ei_amqp_bad_flag_value = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_stream_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_basic_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_frame_type = EI_INIT;
|
||||
static expert_field ei_amqp_field_short = EI_INIT;
|
||||
static expert_field ei_amqp_bad_length = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_command_class = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_tunnel_method = EI_INIT;
|
||||
static expert_field ei_amqp_invalid_class_code = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_access_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_tx_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_header_class = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_connection_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_queue_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_channel_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_dtx_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_method_class = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_file_method = EI_INIT;
|
||||
static expert_field ei_amqp_unknown_exchange_method = EI_INIT;
|
||||
|
||||
/* Various enumerations */
|
||||
|
||||
|
@ -1811,8 +1829,7 @@ dissect_amqp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
/* Minimal frame size is 8 bytes - smaller frames are malformed */
|
||||
if (tvb_reported_length (tvb) < 8) {
|
||||
expert_add_info_format(pinfo, NULL, PI_MALFORMED, PI_ERROR,
|
||||
"Require frame at least 8 bytes long");
|
||||
expert_add_info_format_text(pinfo, NULL, &ei_amqp_bad_length, "Require frame at least 8 bytes long");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1933,7 +1950,6 @@ dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
|
|||
const char *amqp_typename;
|
||||
const char *value;
|
||||
int field_start;
|
||||
proto_item *ti;
|
||||
|
||||
field_table_tree = proto_item_add_subtree(item, ett_amqp);
|
||||
|
||||
|
@ -2042,12 +2058,7 @@ dissect_amqp_0_9_field_table(tvbuff_t *tvb, packet_info *pinfo, int offset, guin
|
|||
return;
|
||||
|
||||
too_short:
|
||||
ti = proto_tree_add_text(field_table_tree, tvb, field_start,
|
||||
offset - field_start,
|
||||
"Field is cut off by the end of the field table");
|
||||
expert_add_info_format(pinfo, ti,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Field is cut off by the end of the field table");
|
||||
proto_tree_add_expert(field_table_tree, pinfo, &ei_amqp_field_short, tvb, field_start, offset - field_start);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3069,8 +3080,7 @@ dissect_amqp_0_10_execution(tvbuff_t *tvb,
|
|||
proto_tree_add_item(args_tree, class_hf,
|
||||
tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
else
|
||||
expert_add_info_format(pinfo, args_tree, PI_PROTOCOL, PI_WARN,
|
||||
"Invalid class code %x", amqp_class);
|
||||
expert_add_info_format_text(pinfo, args_tree, &ei_amqp_invalid_class_code, "Invalid class code %x", amqp_class);
|
||||
AMQP_INCREMENT(offset, 1, length);
|
||||
}
|
||||
if (flag1 & 0x10) {
|
||||
|
@ -5661,9 +5671,7 @@ dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
offset, length);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree, PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown command/control class %d",
|
||||
tvb_get_guint8(tvb, offset + 0));
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_command_class, "Unknown command/control class %d", tvb_get_guint8(tvb, offset + 0));
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -5693,8 +5701,7 @@ dissect_amqp_0_10_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
break;
|
||||
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree, PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown frame type %d", frame_type);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %d", frame_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5815,10 +5822,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown connection method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_connection_method, "Unknown connection method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_CHANNEL:
|
||||
|
@ -5875,10 +5879,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown channel method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_channel_method, "Unknown channel method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_ACCESS:
|
||||
|
@ -5904,10 +5905,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_fence(pinfo->cinfo, COL_INFO);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown access method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_access_method, "Unknown access method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_EXCHANGE:
|
||||
|
@ -5946,10 +5944,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown exchange method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_exchange_method, "Unknown exchange method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_QUEUE:
|
||||
|
@ -6005,10 +6000,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown queue method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_queue_method, "Unknown queue method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_BASIC:
|
||||
|
@ -6085,10 +6077,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown basic method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_basic_method, "Unknown basic method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_FILE:
|
||||
|
@ -6161,10 +6150,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown file method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_file_method, "Unknown file method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_STREAM:
|
||||
|
@ -6217,10 +6203,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown stream method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_stream_method, "Unknown stream method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_TX:
|
||||
|
@ -6261,10 +6244,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown tx method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_tx_method, "Unknown tx method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_DTX:
|
||||
|
@ -6297,10 +6277,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
11, args_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown dtx method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_dtx_method, "Unknown dtx method %u", method_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_CLASS_TUNNEL:
|
||||
|
@ -6319,17 +6296,11 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_fence(pinfo->cinfo, COL_INFO);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown tunnel method %u",
|
||||
method_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_tunnel_method, "Unknown tunnel method %u", method_id);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown method class %u",
|
||||
class_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_method_class, "Unknown method class %u", class_id);
|
||||
}
|
||||
break;
|
||||
case AMQP_0_9_FRAME_TYPE_CONTENT_HEADER:
|
||||
|
@ -6363,10 +6334,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
pinfo, 21, prop_tree);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown header class %u",
|
||||
class_id);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_header_class, "Unknown header class %u", class_id);
|
||||
}
|
||||
col_append_str(pinfo->cinfo, COL_INFO, "Content-Header ");
|
||||
col_set_fence(pinfo->cinfo, COL_INFO);
|
||||
|
@ -6378,10 +6346,7 @@ dissect_amqp_0_9_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_fence(pinfo->cinfo, COL_INFO);
|
||||
break;
|
||||
default:
|
||||
expert_add_info_format(pinfo, amqp_tree,
|
||||
PI_PROTOCOL, PI_ERROR,
|
||||
"Unknown frame type %u",
|
||||
frame_type);
|
||||
expert_add_info_format_text(pinfo, amqp_tree, &ei_amqp_unknown_frame_type, "Unknown frame type %u", frame_type);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10577,6 +10542,24 @@ proto_register_amqp(void)
|
|||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_amqp_bad_flag_value, { "amqp.bad_flag_value", PI_PROTOCOL, PI_WARN, "Bad flag value", EXPFILL }},
|
||||
{ &ei_amqp_bad_length, { "amqp.bad_length", PI_MALFORMED, PI_ERROR, "Bad frame length", EXPFILL }},
|
||||
{ &ei_amqp_field_short, { "amqp.field_short", PI_PROTOCOL, PI_ERROR, "Field is cut off by the end of the field table", EXPFILL }},
|
||||
{ &ei_amqp_invalid_class_code, { "amqp.unknown.class_code", PI_PROTOCOL, PI_WARN, "Invalid class code", EXPFILL }},
|
||||
{ &ei_amqp_unknown_command_class, { "amqp.unknown.command_class", PI_PROTOCOL, PI_ERROR, "Unknown command/control class", EXPFILL }},
|
||||
{ &ei_amqp_unknown_frame_type, { "amqp.unknown.frame_type", PI_PROTOCOL, PI_ERROR, "Unknown frame type", EXPFILL }},
|
||||
{ &ei_amqp_unknown_connection_method, { "amqp.unknown.method.connection", PI_PROTOCOL, PI_ERROR, "Unknown connection method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_channel_method, { "amqp.unknown.method.channel", PI_PROTOCOL, PI_ERROR, "Unknown channel method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_access_method, { "amqp.unknown.method.access", PI_PROTOCOL, PI_ERROR, "Unknown access method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_exchange_method, { "amqp.unknown.method.exchange", PI_PROTOCOL, PI_ERROR, "Unknown exchange method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_queue_method, { "amqp.unknown.method.queue", PI_PROTOCOL, PI_ERROR, "Unknown queue method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_basic_method, { "amqp.unknown.method.basic", PI_PROTOCOL, PI_ERROR, "Unknown basic method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_file_method, { "amqp.unknown.method.file", PI_PROTOCOL, PI_ERROR, "Unknown file method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_stream_method, { "amqp.unknown.method.stream", PI_PROTOCOL, PI_ERROR, "Unknown stream method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_tx_method, { "amqp.unknown.method.tx", PI_PROTOCOL, PI_ERROR, "Unknown tx method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_dtx_method, { "amqp.unknown.method.dtx", PI_PROTOCOL, PI_ERROR, "Unknown dtx method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_tunnel_method, { "amqp.unknown.method.tunnel", PI_PROTOCOL, PI_ERROR, "Unknown tunnel method", EXPFILL }},
|
||||
{ &ei_amqp_unknown_method_class, { "amqp.unknown.method.class", PI_PROTOCOL, PI_ERROR, "Unknown method class", EXPFILL }},
|
||||
{ &ei_amqp_unknown_header_class, { "amqp.unknown.header_class", PI_PROTOCOL, PI_ERROR, "Unknown header class", EXPFILL }},
|
||||
};
|
||||
|
||||
expert_module_t* expert_amqp;
|
||||
|
|
|
@ -1679,6 +1679,17 @@ static gint ett_r3debuglogrecord = -1;
|
|||
static gint ett_r3setdatetime = -1;
|
||||
static gint ett_r3manageuser = -1;
|
||||
|
||||
static expert_field ei_r3_response_hasdata_octet_2 = EI_INIT;
|
||||
static expert_field ei_r3_mfgfield_too_many_adc_values = EI_INIT;
|
||||
static expert_field ei_r3_peekpoke_operation = EI_INIT;
|
||||
static expert_field ei_r3_response_hasdata_octet_1 = EI_INIT;
|
||||
static expert_field ei_r3_reserved_upstream_command_value = EI_INIT;
|
||||
static expert_field ei_r3_firmwaredownload_action = EI_INIT;
|
||||
static expert_field ei_r3_malformed_length = EI_INIT;
|
||||
static expert_field ei_r3_mfgfield = EI_INIT;
|
||||
static expert_field ei_r3_unknown_command_value = EI_INIT;
|
||||
static expert_field ei_r3_response_hasdata_octet_3 = EI_INIT;
|
||||
static expert_field ei_r3_cmd_downloadfirmwaretimeout = EI_INIT;
|
||||
|
||||
/*
|
||||
* Indicates next command to be processed as a manufacturing command
|
||||
|
@ -3540,8 +3551,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
if (fieldLength < 2)
|
||||
{
|
||||
dataLength = 0;
|
||||
expert_add_info_format (pinfo, upstreamfield_length, PI_UNDECODED, PI_WARN,
|
||||
"Malformed length value -- all fields are at least 2 octets.");
|
||||
expert_add_info_format_text(pinfo, upstreamfield_length, &ei_r3_malformed_length, "Malformed length value -- all fields are at least 2 octets.");
|
||||
}
|
||||
|
||||
offset += 2;
|
||||
|
@ -3598,8 +3608,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
{
|
||||
if (dataLength != 9)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed event log field -- expected 9 octets");
|
||||
expert_add_info_format_text(pinfo, upstreamfield_length, &ei_r3_malformed_length, "Malformed event log field -- expected 9 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3628,8 +3637,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
{
|
||||
if (dataLength != 8)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed date/time field -- expected 8 octets");
|
||||
expert_add_info_format_text(pinfo, upstreamfield_length, &ei_r3_malformed_length, "Malformed date/time field -- expected 8 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3661,8 +3669,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
|
||||
if (dataLength != 49)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed declined log field -- expected 49 octets");
|
||||
expert_add_info_format_text(pinfo, upstreamfield_length, &ei_r3_malformed_length, "Malformed declined log field -- expected 49 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3700,8 +3707,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
{
|
||||
if (dataLength != 3)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed expiration field -- expected 3 octets");
|
||||
expert_add_info_format_text(pinfo, upstreamfield_length, &ei_r3_malformed_length, "Malformed expiration field -- expected 3 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3726,8 +3732,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
{
|
||||
if (dataLength != 4)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed timezone field -- expected 4 octets");
|
||||
expert_add_info_format_text(pinfo, upstreamfield_length, &ei_r3_malformed_length, "Malformed timezone field -- expected 4 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3753,8 +3758,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
{
|
||||
if (dataLength != 9)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed alarm log field -- expected 9 octets");
|
||||
expert_add_info_format_text(pinfo, upstreamfield_length, &ei_r3_malformed_length, "Malformed alarm log field -- expected 9 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3796,8 +3800,7 @@ dissect_r3_upstreamfields (tvbuff_t *tvb, guint32 start_offset, guint32 length,
|
|||
static void
|
||||
dissect_r3_upstreamcommand_reserved (tvbuff_t *tvb _U_, guint32 start_offset _U_, guint32 length _U_, packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"\"Reserved\" Upstream Command value");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_r3_reserved_upstream_command_value, tvb, start_offset, length);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -3844,8 +3847,7 @@ dissect_r3_upstreamcommand_dumpeventlog (tvbuff_t *tvb, guint32 start_offset, gu
|
|||
|
||||
if (length != 11)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed event log record -- expected 10 octets");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "Malformed event log record -- expected 10 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -3925,7 +3927,7 @@ dissect_r3_upstreamcommand_queryconfig (tvbuff_t *tvb, guint32 start_offset, gui
|
|||
|
||||
pi = proto_tree_add_item (upstreamfield_tree, hf_r3_configitemlength, tvb, offset + 0, 1, ENC_LITTLE_ENDIAN);
|
||||
if (item_length == 0) {
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_WARN, "Invalid item length");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_r3_malformed_length, "Invalid item length");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3998,31 +4000,26 @@ dissect_r3_upstreamcommand_mfg (tvbuff_t *tvb, guint32 start_offset, guint32 len
|
|||
proto_tree *mfg_tree = NULL;
|
||||
guint8 mfg_fld;
|
||||
tvbuff_t *mfg_tvb;
|
||||
proto_item *mfg_item;
|
||||
const gchar *cn;
|
||||
|
||||
DISSECTOR_ASSERT(start_offset == 0);
|
||||
|
||||
mfg_tvb = tvb_new_subset_remaining (tvb, 2);
|
||||
mfg_fld = tvb_get_guint8 (tvb, 1);
|
||||
|
||||
if (tree)
|
||||
{
|
||||
proto_item *mfg_item;
|
||||
const gchar *cn;
|
||||
cn = val_to_str_ext_const (mfg_fld, &r3_mfgfieldnames_ext, "[Unknown Mfg Field]");
|
||||
|
||||
cn = val_to_str_ext_const (mfg_fld, &r3_mfgfieldnames_ext, "[Unknown Mfg Field]");
|
||||
proto_tree_add_item (tree, hf_r3_mfgfield_length, tvb, 0, 1, ENC_LITTLE_ENDIAN);
|
||||
|
||||
proto_tree_add_item (tree, hf_r3_mfgfield_length, tvb, 0, 1, ENC_LITTLE_ENDIAN);
|
||||
mfg_item = proto_tree_add_text (tree, tvb, 1, -1, "Upstream Manufacturing Field: %s (%u)", cn, mfg_fld);
|
||||
mfg_tree = proto_item_add_subtree (mfg_item, ett_r3commandmfg);
|
||||
|
||||
mfg_item = proto_tree_add_text (tree, tvb, 1, -1, "Upstream Manufacturing Field: %s (%u)", cn, mfg_fld);
|
||||
mfg_tree = proto_item_add_subtree (mfg_item, ett_r3commandmfg);
|
||||
|
||||
proto_tree_add_item (mfg_tree, hf_r3_mfgfield, tvb, 1, 1, ENC_LITTLE_ENDIAN);
|
||||
}
|
||||
proto_tree_add_item (mfg_tree, hf_r3_mfgfield, tvb, 1, 1, ENC_LITTLE_ENDIAN);
|
||||
|
||||
if (mfg_fld >= MFGFIELD_LAST)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Unknown manufacturing command value");
|
||||
expert_add_info(pinfo, mfg_item, &ei_r3_mfgfield);
|
||||
}
|
||||
else if (r3upstreammfgfield_dissect [mfg_fld])
|
||||
(*r3upstreammfgfield_dissect [mfg_fld]) (mfg_tvb, 0, length, pinfo, mfg_tree);
|
||||
|
@ -4180,8 +4177,7 @@ dissect_r3_upstreammfgfield_iopins (tvbuff_t *tvb, guint32 start_offset, guint32
|
|||
len = MAX(0, tvb_length_remaining(tvb, start_offset));
|
||||
if (len % 3 != 0)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"IOPINS data length not modulo 3 == 0");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "IOPINS data length not modulo 3 == 0");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4225,8 +4221,7 @@ dissect_r3_upstreammfgfield_adcs (tvbuff_t *tvb, guint32 start_offset, guint32 l
|
|||
|
||||
if (len > 8)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"MFG Field: too many adc values");
|
||||
expert_add_info(pinfo, proto_tree_get_parent (tree), &ei_r3_mfgfield_too_many_adc_values);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4644,7 +4639,7 @@ dissect_r3_upstreammfgfield_peekpoke (tvbuff_t *tvb, guint32 start_offset, guint
|
|||
break;
|
||||
|
||||
default :
|
||||
expert_add_info_format (pinfo, peekpoke_op_item, PI_UNDECODED, PI_WARN, "Unknown peekpoke operation value");
|
||||
expert_add_info(pinfo, peekpoke_op_item, &ei_r3_peekpoke_operation);
|
||||
return; /* quit */
|
||||
}
|
||||
}
|
||||
|
@ -4714,9 +4709,7 @@ dissect_r3_upstreammfgfield_capabilities (tvbuff_t *tvb, guint32 start_offset, g
|
|||
octets = tvb_get_guint8 (tvb, i);
|
||||
if (!octets)
|
||||
{
|
||||
cf_item = proto_tree_add_text (tree, tvb, 0, len, "Capabilities (unknown items)");
|
||||
expert_add_info_format(pinfo, cf_item, PI_MALFORMED, PI_WARN,
|
||||
"Capabilities could not be decoded because length of 0 encountered");
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_r3_malformed_length, tvb, 0, len, "Capabilities could not be decoded because length of 0 encountered");
|
||||
return;
|
||||
}
|
||||
i += octets;
|
||||
|
@ -4753,8 +4746,7 @@ dissect_r3_upstreammfgfield_dumpm41t81 (tvbuff_t *tvb, guint32 start_offset, gui
|
|||
|
||||
if (tvb_length_remaining (tvb, 0) != 20)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Length of M41T81 RTC register dump not 20 octets");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "Length of M41T81 RTC register dump not 20 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4873,8 +4865,7 @@ dissect_r3_upstreammfgfield_checksumresults (tvbuff_t *tvb, guint32 start_offset
|
|||
len = MAX(0, tvb_length_remaining(tvb, 0));
|
||||
if (len % 3 != 0)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Checksum results data length not modulo 3 == 0");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (tree), &ei_r3_malformed_length, "Checksum results data length not modulo 3 == 0");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5040,11 +5031,11 @@ dissect_r3_response_hasdata (tvbuff_t *tvb, guint32 start_offset, guint32 length
|
|||
upstreamCmd = tvb_get_guint8 (tvb, 3);
|
||||
|
||||
if (tvb_get_guint8 (tvb, 1) != CMD_RESPONSE)
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN, "Octet 1 not CMD_RESPONSE");
|
||||
expert_add_info(pinfo, proto_tree_get_parent (tree), &ei_r3_response_hasdata_octet_1);
|
||||
else if (tvb_get_guint8 (tvb, 2) != RESPONSETYPE_HASDATA)
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN, "Octet 2 not RESPONSE_HASDATA");
|
||||
expert_add_info(pinfo, proto_tree_get_parent (tree), &ei_r3_response_hasdata_octet_2);
|
||||
else if (upstreamCmd >= UPSTREAMCOMMAND_LAST)
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN, "Octet 3 >= UPSTREAMCOMMAND_LAST");
|
||||
expert_add_info(pinfo, proto_tree_get_parent (tree), &ei_r3_response_hasdata_octet_3);
|
||||
else
|
||||
{
|
||||
proto_tree *upstreamcommand_tree = NULL;
|
||||
|
@ -5097,8 +5088,7 @@ dissect_r3_cmd_response (tvbuff_t *tvb, guint32 start_offset, guint32 length, pa
|
|||
|
||||
if (responseType >= RESPONSETYPE_LAST)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"Octet 3 >= UPSTREAMCOMMAND_LAST");
|
||||
expert_add_info(pinfo, proto_tree_get_parent (tree), &ei_r3_response_hasdata_octet_3);
|
||||
}
|
||||
else if (r3response_dissect [responseType])
|
||||
(*r3response_dissect [responseType]) (payload_tvb, 0, length, pinfo, tree);
|
||||
|
@ -5233,7 +5223,7 @@ dissect_r3_cmd_setconfig (tvbuff_t *tvb, guint32 start_offset, guint32 length _U
|
|||
sc_item = proto_tree_add_item (sc_tree, hf_r3_configitemlength, payload_tvb, offset + 0, 1, ENC_LITTLE_ENDIAN);
|
||||
proto_tree_add_item (sc_tree, hf_r3_configitem, payload_tvb, offset + 1, 1, ENC_LITTLE_ENDIAN);
|
||||
if (item_length == 0) {
|
||||
expert_add_info_format(pinfo, sc_item, PI_MALFORMED, PI_WARN, "Invalid item length");
|
||||
expert_add_info_format_text(pinfo, sc_item, &ei_r3_malformed_length, "Invalid item length");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5337,8 +5327,7 @@ dissect_r3_cmd_manageuser (tvbuff_t *tvb, guint32 start_offset, guint32 length _
|
|||
if (paramLength < 2)
|
||||
{
|
||||
dataLength = 0;
|
||||
expert_add_info_format (pinfo, len_field, PI_UNDECODED, PI_WARN,
|
||||
"Malformed length value -- all fields are at least 2 octets.");
|
||||
expert_add_info_format_text(pinfo, len_field, &ei_r3_malformed_length, "Malformed length value -- all fields are at least 2 octets.");
|
||||
}
|
||||
|
||||
offset += 2;
|
||||
|
@ -5356,8 +5345,7 @@ dissect_r3_cmd_manageuser (tvbuff_t *tvb, guint32 start_offset, guint32 length _
|
|||
case ADDUSERPARAMTYPE_EXCEPTIONGROUP :
|
||||
if (dataLength != 1)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (mu_tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed field -- expected 1 octet");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (mu_tree), &ei_r3_malformed_length, "Malformed field -- expected 1 octet");
|
||||
}
|
||||
else
|
||||
proto_tree_add_item (mu_tree, hf_r3_adduserparamtypearray [paramType], payload_tvb, offset, dataLength, ENC_LITTLE_ENDIAN);
|
||||
|
@ -5366,8 +5354,7 @@ dissect_r3_cmd_manageuser (tvbuff_t *tvb, guint32 start_offset, guint32 length _
|
|||
case ADDUSERPARAMTYPE_USERNO :
|
||||
if (dataLength != 2)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (mu_tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed field -- expected 2 octets");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (mu_tree), &ei_r3_malformed_length, "Malformed field -- expected 2 octets");
|
||||
}
|
||||
else
|
||||
proto_tree_add_item (mu_tree, hf_r3_adduserparamtypearray [paramType], payload_tvb, offset, dataLength, ENC_LITTLE_ENDIAN);
|
||||
|
@ -5382,8 +5369,7 @@ dissect_r3_cmd_manageuser (tvbuff_t *tvb, guint32 start_offset, guint32 length _
|
|||
{
|
||||
if (dataLength != 3)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (mu_tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed expiration field -- expected 3 octets");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (mu_tree), &ei_r3_malformed_length, "Malformed expiration field -- expected 3 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5411,8 +5397,7 @@ dissect_r3_cmd_manageuser (tvbuff_t *tvb, guint32 start_offset, guint32 length _
|
|||
{
|
||||
if (dataLength != 4)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (mu_tree), PI_UNDECODED, PI_WARN,
|
||||
"Malformed timezone field -- expected 4 octets");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (mu_tree), &ei_r3_malformed_length, "Malformed timezone field -- expected 4 octets");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -5728,8 +5713,8 @@ dissect_r3_cmd_alarmconfigure (tvbuff_t *tvb, guint32 start_offset, guint32 leng
|
|||
alarm_len = tvb_get_guint8 (payload_tvb, offset + 0);
|
||||
pi = proto_tree_add_item (alarmcfg_tree, hf_r3_alarm_length, payload_tvb, offset + 0, 1, ENC_LITTLE_ENDIAN);
|
||||
if (alarm_len == 0) {
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_WARN,
|
||||
"Alarm length equal to 0; payload could be partially decoded");
|
||||
expert_add_info_format_text (pinfo, pi, &ei_r3_malformed_length,
|
||||
"Alarm length equal to 0. Payload could be partially decoded");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5958,7 +5943,7 @@ dissect_r3_cmd_downloadfirmware (tvbuff_t *tvb, guint32 start_offset, guint32 le
|
|||
break;
|
||||
|
||||
default :
|
||||
expert_add_info_format (pinfo, dlfw_action_item, PI_UNDECODED, PI_WARN, "Unknown Firmware download action");
|
||||
expert_add_info(pinfo, dlfw_action_item, &ei_r3_firmwaredownload_action);
|
||||
return; /* quit */
|
||||
}
|
||||
|
||||
|
@ -6003,8 +5988,7 @@ dissect_r3_cmd_downloadfirmwaretimeout (tvbuff_t *tvb, guint32 start_offset, gui
|
|||
|
||||
proto_tree_add_item (tree, hf_r3_commanddata, payload_tvb, 0, -1, ENC_NA);
|
||||
}
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (tree), PI_UNDECODED, PI_WARN,
|
||||
"[### Need nice warning here]"); /* XXX: ??? */
|
||||
expert_add_info(pinfo, proto_tree_get_parent (tree), &ei_r3_cmd_downloadfirmwaretimeout); /* XXX: ??? */
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -6312,8 +6296,7 @@ dissect_r3_cmdmfg_forceoptions (tvbuff_t *tvb, guint32 start_offset, guint32 len
|
|||
case 4 : proto_tree_add_item (force_tree, hf_r3_forceoptions_state_32, tvb, start_offset + i + 2, 4, ENC_LITTLE_ENDIAN);
|
||||
break;
|
||||
default :
|
||||
expert_add_info_format (pinfo, force_item_item, PI_UNDECODED, PI_WARN,
|
||||
"Invalid length for Forceoptions State entry");
|
||||
expert_add_info_format_text(pinfo, force_item_item, &ei_r3_malformed_length, "Invalid length for Forceoptions State entry");
|
||||
return; /* quit */
|
||||
break;
|
||||
}
|
||||
|
@ -6487,7 +6470,7 @@ dissect_r3_cmdmfg_peekpoke (tvbuff_t *tvb, guint32 start_offset, guint32 length
|
|||
break;
|
||||
|
||||
default :
|
||||
expert_add_info_format (pinfo, peekpoke_op_item, PI_UNDECODED, PI_WARN, "Unknown Mfg peekpoke operation value");
|
||||
expert_add_info_format_text(pinfo, peekpoke_op_item, &ei_r3_peekpoke_operation, "Unknown Mfg peekpoke operation value");
|
||||
return; /* quit */
|
||||
}
|
||||
}
|
||||
|
@ -6626,7 +6609,7 @@ dissect_r3_command (tvbuff_t *tvb, guint32 start_offset, guint32 length, packet_
|
|||
if (!mfgCommandFlag)
|
||||
{
|
||||
if (cmd >= CMD_LAST)
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (cmd_tree), PI_UNDECODED, PI_WARN, "Unknown command value");
|
||||
expert_add_info(pinfo, proto_tree_get_parent (cmd_tree), &ei_r3_unknown_command_value);
|
||||
else if (r3command_dissect [cmd])
|
||||
(*r3command_dissect [cmd]) (tvb, start_offset, length, pinfo, cmd_tree);
|
||||
}
|
||||
|
@ -6636,8 +6619,7 @@ dissect_r3_command (tvbuff_t *tvb, guint32 start_offset, guint32 length, packet_
|
|||
|
||||
if (cmd >= CMDMFG_LAST)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (cmd_tree), PI_UNDECODED, PI_WARN,
|
||||
"Unknown manufacturing command value");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (cmd_tree), &ei_r3_unknown_command_value, "Unknown manufacturing command value");
|
||||
}
|
||||
else if (r3commandmfg_dissect [cmd])
|
||||
(*r3commandmfg_dissect [cmd]) (tvb, start_offset, length, pinfo, cmd_tree);
|
||||
|
@ -6703,8 +6685,8 @@ dissect_r3_packet (tvbuff_t *tvb, packet_info *pinfo, proto_tree *r3_tree)
|
|||
octConsumed = dissect_r3_command (tvb, offset, 0, pinfo, payload_tree);
|
||||
if(octConsumed == 0)
|
||||
{
|
||||
expert_add_info_format (pinfo, proto_tree_get_parent (payload_tree), PI_MALFORMED, PI_WARN,
|
||||
"Command length equal to 0; payload could be partially decoded");
|
||||
expert_add_info_format_text(pinfo, proto_tree_get_parent (payload_tree), &ei_r3_malformed_length,
|
||||
"Command length equal to 0. Payload could be partially decoded");
|
||||
offset = tvb_reported_length (tvb) - 3; /* just do CRC stuff ?? */
|
||||
break;
|
||||
}
|
||||
|
@ -10069,10 +10051,28 @@ void proto_register_r3 (void)
|
|||
&ett_r3manageuser
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_r3_malformed_length, { "r3.malformed_length", PI_MALFORMED, PI_ERROR, "Malformed length", EXPFILL }},
|
||||
{ &ei_r3_reserved_upstream_command_value, { "r3.reserved_upstream_command_value", PI_UNDECODED, PI_WARN, "\"Reserved\" Upstream Command value", EXPFILL }},
|
||||
{ &ei_r3_mfgfield, { "r3.mfgfield.field.unknown", PI_UNDECODED, PI_WARN, "Unknown manufacturing command value", EXPFILL }},
|
||||
{ &ei_r3_mfgfield_too_many_adc_values, { "r3.mfgfield.too_many_adc_values", PI_PROTOCOL, PI_WARN, "MFG Field: too many adc values", EXPFILL }},
|
||||
{ &ei_r3_peekpoke_operation, { "r3.peekpoke.operation.unknown", PI_UNDECODED, PI_WARN, "Unknown peekpoke operation value", EXPFILL }},
|
||||
{ &ei_r3_response_hasdata_octet_1, { "r3.response_hasdata.octet_1_not_cmd_response", PI_PROTOCOL, PI_WARN, "Octet 1 not CMD_RESPONSE", EXPFILL }},
|
||||
{ &ei_r3_response_hasdata_octet_2, { "r3.response_hasdata.octet_2_not_response_hasdata", PI_PROTOCOL, PI_WARN, "Octet 2 not RESPONSE_HASDATA", EXPFILL }},
|
||||
{ &ei_r3_response_hasdata_octet_3, { "r3.response_hasdata.octet_3_ge_upstreamcommand_last", PI_PROTOCOL, PI_WARN, "Octet 3 >= UPSTREAMCOMMAND_LAST", EXPFILL }},
|
||||
{ &ei_r3_firmwaredownload_action, { "r3.firmwaredownload.action.unknown", PI_PROTOCOL, PI_WARN, "Unknown Firmware download action", EXPFILL }},
|
||||
{ &ei_r3_cmd_downloadfirmwaretimeout, { "r3.r3.command.downloadfirmwaretimeout", PI_UNDECODED, PI_WARN, "Download Firmware Timeout", EXPFILL }},
|
||||
{ &ei_r3_unknown_command_value, { "r3.command.unknown", PI_UNDECODED, PI_WARN, "Unknown command value", EXPFILL }},
|
||||
};
|
||||
|
||||
expert_module_t* expert_r3;
|
||||
|
||||
proto_r3 = proto_register_protocol ("Assa Abloy R3", "R3", "r3");
|
||||
register_dissector ("r3", dissect_r3, proto_r3);
|
||||
proto_register_field_array (proto_r3, hf, array_length (hf));
|
||||
proto_register_subtree_array (ett, array_length (ett));
|
||||
expert_r3 = expert_register_protocol(proto_r3);
|
||||
expert_register_field_array(expert_r3, ei, array_length(ei));
|
||||
}
|
||||
|
||||
void proto_reg_handoff_r3 (void)
|
||||
|
|
|
@ -194,6 +194,11 @@ static gint st_collectd_values_hosts = -1;
|
|||
static gint st_collectd_values_plugins = -1;
|
||||
static gint st_collectd_values_types = -1;
|
||||
|
||||
static expert_field ei_collectd_type = EI_INIT;
|
||||
static expert_field ei_collectd_invalid_length = EI_INIT;
|
||||
static expert_field ei_collectd_data_valcnt = EI_INIT;
|
||||
static expert_field ei_collectd_garbage = EI_INIT;
|
||||
|
||||
/* Prototype for the handoff function */
|
||||
void proto_reg_handoff_collectd (void);
|
||||
|
||||
|
@ -381,7 +386,7 @@ dissect_collectd_string (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
|
|||
"collectd %s segment: Length = %i <BAD>",
|
||||
val_to_str_const (type, part_names, "UNKNOWN"),
|
||||
length);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"String part with invalid part length: "
|
||||
"Part is longer than rest of package.");
|
||||
return (-1);
|
||||
|
@ -441,11 +446,9 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
|
|||
type);
|
||||
proto_tree_add_uint (pt, hf_collectd_length, tvb, offset + 2, 2,
|
||||
length);
|
||||
pi = proto_tree_add_text (pt, tvb, offset + 4, -1,
|
||||
proto_tree_add_expert_format(pt, pinfo, &ei_collectd_garbage, tvb, offset + 4, -1,
|
||||
"Garbage at end of packet: Length = %i <BAD>",
|
||||
size - 4);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Garbage at end of packet");
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
@ -461,7 +464,7 @@ dissect_collectd_integer (tvbuff_t *tvb, packet_info *pinfo, gint type_hf,
|
|||
type);
|
||||
pi = proto_tree_add_uint (pt, hf_collectd_length, tvb,
|
||||
offset + 2, 2, length);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"Invalid length field for an integer part.");
|
||||
|
||||
return (-1);
|
||||
|
@ -694,12 +697,9 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset,
|
|||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
proto_tree_add_uint (pt, hf_collectd_length, tvb, offset + 2, 2,
|
||||
length);
|
||||
pi = proto_tree_add_text (pt, tvb, offset + 4, -1,
|
||||
proto_tree_add_expert_format(pt, pinfo, &ei_collectd_garbage, tvb, offset + 4, -1,
|
||||
"Garbage at end of packet: Length = %i <BAD>",
|
||||
size - 4);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Garbage at end of packet");
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
@ -713,7 +713,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset,
|
|||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
pi = proto_tree_add_uint (pt, hf_collectd_length, tvb,
|
||||
offset + 2, 2, length);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"Invalid length field for a values part.");
|
||||
|
||||
return (-1);
|
||||
|
@ -746,9 +746,7 @@ dissect_collectd_part_values (tvbuff_t *tvb, packet_info *pinfo, gint offset,
|
|||
pi = proto_tree_add_item (pt, hf_collectd_data_valcnt, tvb,
|
||||
offset + 4, 2, ENC_BIG_ENDIAN);
|
||||
if (values_count != corrected_values_count)
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_WARN,
|
||||
"Number of values and length of part do not match. "
|
||||
"Assuming length is correct.");
|
||||
expert_add_info(pinfo, pi, &ei_collectd_data_valcnt);
|
||||
|
||||
values_count = corrected_values_count;
|
||||
|
||||
|
@ -790,12 +788,9 @@ dissect_collectd_signature (tvbuff_t *tvb, packet_info *pinfo,
|
|||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
proto_tree_add_uint (pt, hf_collectd_length, tvb, offset + 2, 2,
|
||||
length);
|
||||
pi = proto_tree_add_text (pt, tvb, offset + 4, -1,
|
||||
proto_tree_add_expert_format(pt, pinfo, &ei_collectd_garbage, tvb, offset + 4, -1,
|
||||
"Garbage at end of packet: Length = %i <BAD>",
|
||||
size - 4);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Garbage at end of packet");
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
@ -809,7 +804,7 @@ dissect_collectd_signature (tvbuff_t *tvb, packet_info *pinfo,
|
|||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
pi = proto_tree_add_uint (pt, hf_collectd_length, tvb,
|
||||
offset + 2, 2, length);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"Invalid length field for a signature part.");
|
||||
|
||||
return (-1);
|
||||
|
@ -861,12 +856,9 @@ dissect_collectd_encrypted (tvbuff_t *tvb, packet_info *pinfo,
|
|||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
proto_tree_add_uint (pt, hf_collectd_length, tvb, offset + 2, 2,
|
||||
length);
|
||||
pi = proto_tree_add_text (pt, tvb, offset + 4, -1,
|
||||
proto_tree_add_expert_format(pt, pinfo, &ei_collectd_garbage, tvb, offset + 4, -1,
|
||||
"Garbage at end of packet: Length = %i <BAD>",
|
||||
size - 4);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Garbage at end of packet");
|
||||
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
@ -880,7 +872,7 @@ dissect_collectd_encrypted (tvbuff_t *tvb, packet_info *pinfo,
|
|||
proto_tree_add_uint (pt, hf_collectd_type, tvb, offset, 2, type);
|
||||
pi = proto_tree_add_uint (pt, hf_collectd_length, tvb,
|
||||
offset + 2, 2, length);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"Invalid length field for an encryption part.");
|
||||
|
||||
return (-1);
|
||||
|
@ -899,7 +891,7 @@ dissect_collectd_encrypted (tvbuff_t *tvb, packet_info *pinfo,
|
|||
offset + 2, 2, length);
|
||||
pi = proto_tree_add_uint (pt, hf_collectd_data_username_len, tvb,
|
||||
offset + 4, 2, length);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"Invalid username length field for an encryption part.");
|
||||
|
||||
return (-1);
|
||||
|
@ -1075,13 +1067,10 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
* at the end of the packet. */
|
||||
if (size < 4)
|
||||
{
|
||||
pi = proto_tree_add_text (collectd_tree, tvb,
|
||||
proto_tree_add_expert_format(pt, pinfo, &ei_collectd_garbage, tvb,
|
||||
offset, -1,
|
||||
"Garbage at end of packet: Length = %i <BAD>",
|
||||
size);
|
||||
expert_add_info_format (pinfo, pi, PI_MALFORMED,
|
||||
PI_ERROR,
|
||||
"Garbage at end of packet");
|
||||
pkt_errors++;
|
||||
break;
|
||||
}
|
||||
|
@ -1108,13 +1097,11 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
offset + 2, 2, part_length);
|
||||
|
||||
if (part_length < 4)
|
||||
expert_add_info_format (pinfo, pi,
|
||||
PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"Bad part length: Is %i, expected at least 4",
|
||||
part_length);
|
||||
else
|
||||
expert_add_info_format (pinfo, pi,
|
||||
PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_invalid_length,
|
||||
"Bad part length: Larger than remaining packet size.");
|
||||
|
||||
pkt_errors++;
|
||||
|
@ -1349,8 +1336,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
proto_tree_add_item (pt, hf_collectd_data, tvb,
|
||||
offset + 4, part_length - 4, ENC_NA);
|
||||
|
||||
expert_add_info_format (pinfo, pi,
|
||||
PI_UNDECODED, PI_NOTE,
|
||||
expert_add_info_format_text(pinfo, pi, &ei_collectd_type,
|
||||
"Unknown part type %#x. Cannot decode data.",
|
||||
part_type);
|
||||
}
|
||||
|
@ -1398,6 +1384,7 @@ dissect_collectd (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
void proto_register_collectd(void)
|
||||
{
|
||||
module_t *collectd_module;
|
||||
expert_module_t* expert_collectd;
|
||||
|
||||
/* Setup list of header fields */
|
||||
static hf_register_info hf[] = {
|
||||
|
@ -1515,13 +1502,21 @@ void proto_register_collectd(void)
|
|||
&ett_collectd_unknown,
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_collectd_invalid_length, { "collectd.invalid_length", PI_MALFORMED, PI_ERROR, "Invalid length", EXPFILL }},
|
||||
{ &ei_collectd_garbage, { "collectd.garbage", PI_MALFORMED, PI_ERROR, "Garbage at end of packet", EXPFILL }},
|
||||
{ &ei_collectd_data_valcnt, { "collectd.data.valcnt.mismatch", PI_MALFORMED, PI_WARN, "Number of values and length of part do not match. Assuming length is correct.", EXPFILL }},
|
||||
{ &ei_collectd_type, { "collectd.type.unknown", PI_UNDECODED, PI_NOTE, "Unknown part type", EXPFILL }},
|
||||
};
|
||||
|
||||
/* Register the protocol name and description */
|
||||
proto_collectd = proto_register_protocol("collectd network data",
|
||||
"collectd", "collectd");
|
||||
proto_collectd = proto_register_protocol("collectd network data", "collectd", "collectd");
|
||||
|
||||
/* Required function calls to register the header fields and subtrees used */
|
||||
proto_register_field_array(proto_collectd, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
expert_collectd = expert_register_protocol(proto_collectd);
|
||||
expert_register_field_array(expert_collectd, ei, array_length(ei));
|
||||
|
||||
tap_collectd = register_tap ("collectd");
|
||||
|
||||
|
|
|
@ -601,6 +601,15 @@ static gint ett_dcerpc_fragments = -1;
|
|||
static gint ett_dcerpc_fragment = -1;
|
||||
static gint ett_dcerpc_krb5_auth_verf = -1;
|
||||
|
||||
static expert_field ei_dcerpc_fragment_multiple = EI_INIT;
|
||||
static expert_field ei_dcerpc_cn_status = EI_INIT;
|
||||
static expert_field ei_dcerpc_fragment_reassembled = EI_INIT;
|
||||
static expert_field ei_dcerpc_fragment = EI_INIT;
|
||||
static expert_field ei_dcerpc_no_request_found = EI_INIT;
|
||||
static expert_field ei_dcerpc_context_change = EI_INIT;
|
||||
static expert_field ei_dcerpc_cn_ctx_id_no_bind = EI_INIT;
|
||||
static expert_field ei_dcerpc_bind_not_acknowledged = EI_INIT;
|
||||
|
||||
static const fragment_items dcerpc_frag_items = {
|
||||
&ett_dcerpc_fragments,
|
||||
&ett_dcerpc_fragment,
|
||||
|
@ -3386,8 +3395,7 @@ dissect_dcerpc_cn_stub(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
pinfo, tree, dcerpc_tree, payload_tvb, decrypted_tvb,
|
||||
hdr->drep, di, auth_info);
|
||||
|
||||
expert_add_info_format(pinfo, NULL, PI_REASSEMBLE, PI_CHAT,
|
||||
"%s fragment", fragment_type(hdr->flags));
|
||||
expert_add_info_format_text(pinfo, NULL, &ei_dcerpc_fragment, "%s fragment", fragment_type(hdr->flags));
|
||||
|
||||
pinfo->fragmented = save_fragmented;
|
||||
return;
|
||||
|
@ -3467,9 +3475,7 @@ end_cn_stub:
|
|||
|
||||
pinfo->fragmented = FALSE;
|
||||
|
||||
expert_add_info_format(pinfo, frag_tree_item, PI_REASSEMBLE, PI_CHAT,
|
||||
"%s fragment, reassembled",
|
||||
fragment_type(hdr->flags));
|
||||
expert_add_info_format_text(pinfo, frag_tree_item, &ei_dcerpc_fragment_reassembled, "%s fragment, reassembled", fragment_type(hdr->flags));
|
||||
|
||||
dcerpc_try_handoff(pinfo, tree, dcerpc_tree, next_tvb,
|
||||
next_tvb, hdr->drep, di, auth_info);
|
||||
|
@ -3489,14 +3495,12 @@ end_cn_stub:
|
|||
}
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO,
|
||||
" [DCE/RPC %s fragment, reas: #%u]", fragment_type(hdr->flags), fd_head->reassembled_in);
|
||||
expert_add_info_format(pinfo, NULL, PI_REASSEMBLE, PI_CHAT,
|
||||
"%s fragment, reassembled in #%u", fragment_type(hdr->flags), fd_head->reassembled_in);
|
||||
expert_add_info_format_text(pinfo, NULL, &ei_dcerpc_fragment_reassembled, "%s fragment, reassembled in #%u", fragment_type(hdr->flags), fd_head->reassembled_in);
|
||||
}
|
||||
} else {
|
||||
/* Reassembly not complete - some fragments
|
||||
are missing. Just show the stub data. */
|
||||
expert_add_info_format(pinfo, NULL, PI_REASSEMBLE, PI_CHAT,
|
||||
"%s fragment", fragment_type(hdr->flags));
|
||||
expert_add_info_format_text(pinfo, NULL, &ei_dcerpc_fragment, "%s fragment", fragment_type(hdr->flags));
|
||||
|
||||
if (decrypted_tvb) {
|
||||
show_stub_data(decrypted_tvb, 0, tree, auth_info, FALSE);
|
||||
|
@ -3725,10 +3729,7 @@ dissect_dcerpc_cn_rqst(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
value->req_frame);
|
||||
} else {
|
||||
/* no bind information, simply show stub data */
|
||||
pi = proto_tree_add_text(dcerpc_tree, tvb, offset, 0, "No bind info for this interface Context ID - capture start too late?");
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_UNDECODED, PI_NOTE, "No bind info for interface Context ID:%u",
|
||||
ctx_id);
|
||||
proto_tree_add_expert_format(dcerpc_tree, pinfo, &ei_dcerpc_cn_ctx_id_no_bind, tvb, offset, 0, "No bind info for interface Context ID %u - capture start too late?", ctx_id);
|
||||
show_stub_data(tvb, offset, dcerpc_tree, &auth_info, TRUE);
|
||||
}
|
||||
}
|
||||
|
@ -3852,10 +3853,7 @@ dissect_dcerpc_cn_resp(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
pi = proto_tree_add_time(dcerpc_tree, hf_dcerpc_time, tvb, offset, 0, &delta_ts);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
} else {
|
||||
pi = proto_tree_add_text(dcerpc_tree,
|
||||
tvb, 0, 0, "No request to this DCE/RPC call found");
|
||||
expert_add_info_format(pinfo, pi, PI_SEQUENCE, PI_NOTE,
|
||||
"No request to this DCE/RPC call found");
|
||||
proto_tree_add_expert(dcerpc_tree, pinfo, &ei_dcerpc_no_request_found, tvb, 0, 0);
|
||||
}
|
||||
|
||||
dissect_dcerpc_cn_stub(tvb, offset, pinfo, dcerpc_tree, tree,
|
||||
|
@ -3863,10 +3861,7 @@ dissect_dcerpc_cn_resp(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
value->rep_frame);
|
||||
} else {
|
||||
/* no bind information, simply show stub data */
|
||||
pi = proto_tree_add_text(dcerpc_tree, tvb, offset, 0, "No bind info for this interface Context ID - capture start too late?");
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_UNDECODED, PI_NOTE, "No bind info for interface Context ID:%u",
|
||||
ctx_id);
|
||||
proto_tree_add_expert_format(dcerpc_tree, pinfo, &ei_dcerpc_cn_ctx_id_no_bind, tvb, offset, 0, "No bind info for interface Context ID %u - capture start too late?", ctx_id);
|
||||
show_stub_data(tvb, offset, dcerpc_tree, &auth_info, TRUE);
|
||||
}
|
||||
}
|
||||
|
@ -3906,13 +3901,10 @@ dissect_dcerpc_cn_fault(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
? tvb_get_letohl(tvb, offset)
|
||||
: tvb_get_ntohl(tvb, offset));
|
||||
|
||||
if (dcerpc_tree) {
|
||||
pi = proto_tree_add_item(dcerpc_tree, hf_dcerpc_cn_status, tvb, offset, 4, DREP_ENC_INTEGER(hdr->drep));
|
||||
}
|
||||
pi = proto_tree_add_item(dcerpc_tree, hf_dcerpc_cn_status, tvb, offset, 4, DREP_ENC_INTEGER(hdr->drep));
|
||||
offset+=4;
|
||||
|
||||
expert_add_info_format(pinfo, pi, PI_RESPONSE_CODE, PI_NOTE, "Fault: %s",
|
||||
val_to_str(status, reject_status_vals, "Unknown (0x%08x)"));
|
||||
expert_add_info_format_text(pinfo, pi, &ei_dcerpc_cn_status, "Fault: %s", val_to_str(status, reject_status_vals, "Unknown (0x%08x)"));
|
||||
|
||||
/* save context ID for use with dcerpc_add_conv_to_bind_table() */
|
||||
pinfo->dcectxid = ctx_id;
|
||||
|
@ -3994,10 +3986,7 @@ dissect_dcerpc_cn_fault(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
pi = proto_tree_add_time(dcerpc_tree, hf_dcerpc_time, tvb, offset, 0, &delta_ts);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
} else {
|
||||
pi = proto_tree_add_text(dcerpc_tree,
|
||||
tvb, 0, 0, "No request to this DCE/RPC call found");
|
||||
expert_add_info_format(pinfo, pi, PI_SEQUENCE, PI_NOTE,
|
||||
"No request to this DCE/RPC call found");
|
||||
proto_tree_add_expert(dcerpc_tree, pinfo, &ei_dcerpc_no_request_found, tvb, 0, 0);
|
||||
}
|
||||
|
||||
length = tvb_length_remaining(tvb, offset);
|
||||
|
@ -4537,7 +4526,7 @@ dissect_dcerpc_cn(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
|
||||
if (pinfo->dcectxid != 0) {
|
||||
/* this is not the first DCE-RPC request/response in this (TCP?-)PDU */
|
||||
expert_add_info_format(pinfo, NULL, PI_SEQUENCE, PI_CHAT, "Multiple DCE/RPC fragments/PDU's in one packet");
|
||||
expert_add_info(pinfo, NULL, &ei_dcerpc_fragment_multiple);
|
||||
}
|
||||
|
||||
offset = start_offset;
|
||||
|
@ -4559,11 +4548,10 @@ dissect_dcerpc_cn(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
#if 0 /* XXX - too much "output noise", removed for now */
|
||||
if (hdr.ptype == PDU_BIND || hdr.ptype == PDU_ALTER ||
|
||||
hdr.ptype == PDU_BIND_ACK || hdr.ptype == PDU_ALTER_ACK)
|
||||
expert_add_info_format(pinfo, tf, PI_SEQUENCE, PI_CHAT, "Context change: %s",
|
||||
val_to_str(hdr.ptype, pckt_vals, "(0x%x)"));
|
||||
expert_add_info_format_text(pinfo, tf, &ei_dcerpc_context_change, "Context change: %s", val_to_str(hdr.ptype, pckt_vals, "(0x%x)"));
|
||||
#endif
|
||||
if (hdr.ptype == PDU_BIND_NAK)
|
||||
expert_add_info_format(pinfo, tf, PI_SEQUENCE, PI_WARN, "Bind not acknowledged");
|
||||
expert_add_info(pinfo, tf, &ei_dcerpc_bind_not_acknowledged);
|
||||
|
||||
if (tree) {
|
||||
proto_item_append_text(ti, " %s, Fragment: %s",
|
||||
|
@ -5252,10 +5240,7 @@ dissect_dcerpc_dg_resp(tvbuff_t *tvb, int offset, packet_info *pinfo,
|
|||
pi = proto_tree_add_time(dcerpc_tree, hf_dcerpc_time, tvb, offset, 0, &delta_ts);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
} else {
|
||||
pi = proto_tree_add_text(dcerpc_tree,
|
||||
tvb, 0, 0, "No request to this DCE/RPC call found");
|
||||
expert_add_info_format(pinfo, pi, PI_SEQUENCE, PI_NOTE,
|
||||
"No request to this DCE/RPC call found");
|
||||
proto_tree_add_expert(dcerpc_tree, pinfo, &ei_dcerpc_no_request_found, tvb, 0, 0);
|
||||
}
|
||||
dissect_dcerpc_dg_stub(tvb, offset, pinfo, dcerpc_tree, tree, hdr, di);
|
||||
}
|
||||
|
@ -6034,11 +6019,27 @@ proto_register_dcerpc(void)
|
|||
&ett_dcerpc_fragment,
|
||||
&ett_dcerpc_krb5_auth_verf,
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_dcerpc_fragment, { "dcerpc.fragment", PI_REASSEMBLE, PI_CHAT, "%s fragment", EXPFILL }},
|
||||
{ &ei_dcerpc_fragment_reassembled, { "dcerpc.fragment_reassembled", PI_REASSEMBLE, PI_CHAT, "%s fragment, reassembled", EXPFILL }},
|
||||
{ &ei_dcerpc_cn_ctx_id_no_bind, { "dcerpc.cn_ctx_id.no_bind", PI_UNDECODED, PI_NOTE, "No bind info for interface Context ID %u - capture start too late?", EXPFILL }},
|
||||
{ &ei_dcerpc_no_request_found, { "dcerpc.no_request_found", PI_SEQUENCE, PI_NOTE, "No request to this DCE/RPC call found", EXPFILL }},
|
||||
{ &ei_dcerpc_cn_status, { "dcerpc.cn_status.expert", PI_RESPONSE_CODE, PI_NOTE, "Fault: %s", EXPFILL }},
|
||||
{ &ei_dcerpc_fragment_multiple, { "dcerpc.fragment_multiple", PI_SEQUENCE, PI_CHAT, "Multiple DCE/RPC fragments/PDU's in one packet", EXPFILL }},
|
||||
{ &ei_dcerpc_context_change, { "dcerpc.context_change", PI_SEQUENCE, PI_CHAT, "Context change: %s", EXPFILL }},
|
||||
{ &ei_dcerpc_bind_not_acknowledged, { "dcerpc.bind_not_acknowledged", PI_SEQUENCE, PI_WARN, "Bind not acknowledged", EXPFILL }},
|
||||
};
|
||||
|
||||
module_t *dcerpc_module;
|
||||
expert_module_t* expert_dcerpc;
|
||||
|
||||
proto_dcerpc = proto_register_protocol("Distributed Computing Environment / Remote Procedure Call (DCE/RPC)", "DCERPC", "dcerpc");
|
||||
proto_register_field_array(proto_dcerpc, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
expert_dcerpc = expert_register_protocol(proto_dcerpc);
|
||||
expert_register_field_array(expert_dcerpc, ei, array_length(ei));
|
||||
|
||||
register_init_routine(dcerpc_init_protocol);
|
||||
dcerpc_module = prefs_register_protocol(proto_dcerpc, NULL);
|
||||
prefs_register_bool_preference(dcerpc_module,
|
||||
|
|
|
@ -281,6 +281,14 @@ static gint ett_err = -1;
|
|||
|
||||
|
||||
static expert_field ei_diameter_reserved_bit_set = EI_INIT;
|
||||
static expert_field ei_diameter_avp_len = EI_INIT;
|
||||
static expert_field ei_diameter_avp_no_data = EI_INIT;
|
||||
static expert_field ei_diameter_application_id = EI_INIT;
|
||||
static expert_field ei_diameter_version = EI_INIT;
|
||||
static expert_field ei_diameter_avp_pad = EI_INIT;
|
||||
static expert_field ei_diameter_code = EI_INIT;
|
||||
static expert_field ei_diameter_avp_code = EI_INIT;
|
||||
static expert_field ei_diameter_avp_vendor_id = EI_INIT;
|
||||
|
||||
/* Tap for Diameter */
|
||||
static int diameter_tap = -1;
|
||||
|
@ -498,12 +506,9 @@ dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset)
|
|||
/* Code */
|
||||
if (a == &unknown_avp) {
|
||||
proto_tree *tu = proto_item_add_subtree(pi,ett_unknown);
|
||||
pi = proto_tree_add_text(tu,tvb,offset,4,"Unknown AVP, "
|
||||
"if you know what this is you can add it to dictionary.xml");
|
||||
expert_add_info_format(c->pinfo, pi, PI_UNDECODED, PI_WARN,
|
||||
"Unknown AVP %u (vendor=%s)", code,
|
||||
val_to_str_ext_const(vendorid, &sminmpec_values_ext, "Unknown"));
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
proto_tree_add_expert_format(tu, c->pinfo, &ei_diameter_avp_code, tvb, offset, 4,
|
||||
"Unknown AVP %u (vendor=%s), if you know what this is you can add it to dictionary.xml", code,
|
||||
val_to_str_ext_const(vendorid, &sminmpec_values_ext, "Unknown"));
|
||||
}
|
||||
|
||||
offset += 4;
|
||||
|
@ -540,19 +545,14 @@ dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset)
|
|||
pi = proto_tree_add_item(avp_tree,hf_diameter_avp_vendor_id,tvb,offset,4,ENC_BIG_ENDIAN);
|
||||
if (vendor == &unknown_vendor) {
|
||||
proto_tree *tu = proto_item_add_subtree(pi,ett_unknown);
|
||||
pi = proto_tree_add_text(tu,tvb,offset,4,"Unknown Vendor, "
|
||||
"if you know whose this is you can add it to dictionary.xml");
|
||||
expert_add_info_format(c->pinfo, pi, PI_UNDECODED, PI_WARN, "Unknown Vendor");
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
proto_tree_add_expert(tu, c->pinfo, &ei_diameter_avp_vendor_id, tvb, offset, 4);
|
||||
}
|
||||
offset += 4;
|
||||
}
|
||||
|
||||
if ( len == (guint32)(vendor_flag ? 12 : 8) ) {
|
||||
/* Data is empty so return now */
|
||||
pi = proto_tree_add_text(avp_tree,tvb,offset,0,"No data");
|
||||
expert_add_info_format(c->pinfo, pi, PI_UNDECODED, PI_WARN, "Data is empty");
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
proto_tree_add_expert(avp_tree, c->pinfo, &ei_diameter_avp_no_data, tvb, offset, 0);
|
||||
/* pad_len is always 0 in this case, but kept here for consistency */
|
||||
return len+pad_len;
|
||||
}
|
||||
|
@ -579,7 +579,7 @@ dissect_diameter_avp(diam_ctx_t *c, tvbuff_t *tvb, int offset)
|
|||
pi = proto_tree_add_item(avp_tree, hf_diameter_avp_pad, tvb, offset, pad_len, ENC_NA);
|
||||
for (i=0; i < pad_len; i++) {
|
||||
if (tvb_get_guint8(tvb, offset++) != 0) {
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE, "Padding is non-zero");
|
||||
expert_add_info(c->pinfo, pi, &ei_diameter_avp_pad);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -602,16 +602,14 @@ address_rfc_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
switch (addr_type ) {
|
||||
case 1:
|
||||
if (len != 4) {
|
||||
pi = proto_tree_add_text(pt,tvb,2,len,"Wrong length for IPv4 Address: %d instead of 4",len);
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_WARN, "Wrong length for IPv4 Address");
|
||||
proto_tree_add_expert_format(pt, c->pinfo, &ei_diameter_avp_len, tvb, 2, len, "Wrong length for IPv4 Address: %d instead of 4", len);
|
||||
return "[Malformed]";
|
||||
}
|
||||
pi = proto_tree_add_item(pt,t->hf_ipv4,tvb,2,4,ENC_BIG_ENDIAN);
|
||||
break;
|
||||
case 2:
|
||||
if (len != 16) {
|
||||
pi = proto_tree_add_text(pt,tvb,2,len,"Wrong length for IPv6 Address: %d instead of 16",len);
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_WARN, "Wrong length for IPv6 Address");
|
||||
proto_tree_add_expert_format(pt, c->pinfo, &ei_diameter_avp_len, tvb, 2, len, "Wrong length for IPv6 Address: %d instead of 16", len);
|
||||
return "[Malformed]";
|
||||
}
|
||||
pi = proto_tree_add_item(pt,t->hf_ipv6,tvb,2,16,ENC_NA);
|
||||
|
@ -657,9 +655,8 @@ time_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
proto_item *pi;
|
||||
|
||||
if ( len != 4 ) {
|
||||
pi = proto_tree_add_text(c->tree, tvb, 0, 4, "Error! AVP value MUST be 4 bytes");
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Timestamp Length (%u)", len);
|
||||
proto_tree_add_expert_format(c->tree, c->pinfo, &ei_diameter_avp_len, tvb, 0, 4,
|
||||
"Bad Timestamp Length: %d instead of 4", len);
|
||||
return "[Malformed]";
|
||||
}
|
||||
|
||||
|
@ -687,8 +684,8 @@ address_v16_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
break;
|
||||
default:
|
||||
pi = proto_tree_add_item(pt,t->hf_other,tvb,0,len,ENC_BIG_ENDIAN);
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Address Length (%u)", len);
|
||||
expert_add_info_format_text(c->pinfo, pi, &ei_diameter_avp_len,
|
||||
"Bad Address Length (%u)", len);
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -736,8 +733,8 @@ integer32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
pi = proto_tree_add_bytes_format(c->tree, hf_diameter_avp_data_wrong_length,
|
||||
tvb, 0, length, NULL,
|
||||
"Error! Bad Integer32 Length");
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Integer32 Length (%u)", length);
|
||||
expert_add_info_format_text(c->pinfo, pi, &ei_diameter_avp_len,
|
||||
"Bad Integer32 Length (%u)", length);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
label = NULL;
|
||||
}
|
||||
|
@ -762,8 +759,8 @@ integer64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
pi = proto_tree_add_bytes_format(c->tree, hf_diameter_avp_data_wrong_length,
|
||||
tvb, 0, length, NULL,
|
||||
"Error! Bad Integer64 Length");
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Integer64 Length (%u)", length);
|
||||
expert_add_info_format_text(c->pinfo, pi, &ei_diameter_avp_len,
|
||||
"Bad Integer64 Length (%u)", length);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
label = NULL;
|
||||
}
|
||||
|
@ -788,8 +785,8 @@ unsigned32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
pi = proto_tree_add_bytes_format(c->tree, hf_diameter_avp_data_wrong_length,
|
||||
tvb, 0, length, NULL,
|
||||
"Error! Bad Unsigned32 Length");
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Unsigned32 Length (%u)", length);
|
||||
expert_add_info_format_text(c->pinfo, pi, &ei_diameter_avp_len,
|
||||
"Bad Unsigned32 Length (%u)", length);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
label = NULL;
|
||||
}
|
||||
|
@ -814,8 +811,8 @@ unsigned64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
pi = proto_tree_add_bytes_format(c->tree, hf_diameter_avp_data_wrong_length,
|
||||
tvb, 0, length, NULL,
|
||||
"Error! Bad Unsigned64 Length");
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Unsigned64 Length (%u)", length);
|
||||
expert_add_info_format_text(c->pinfo, pi, &ei_diameter_avp_len,
|
||||
"Bad Unsigned64 Length (%u)", length);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
label = NULL;
|
||||
}
|
||||
|
@ -840,8 +837,8 @@ float32_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
pi = proto_tree_add_bytes_format(c->tree, hf_diameter_avp_data_wrong_length,
|
||||
tvb, 0, length, NULL,
|
||||
"Error! Bad Float32 Length");
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Float32 Length (%u)", length);
|
||||
expert_add_info_format_text(c->pinfo, pi, &ei_diameter_avp_len,
|
||||
"Bad Float32 Length (%u)", length);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
label = NULL;
|
||||
}
|
||||
|
@ -866,8 +863,8 @@ float64_avp(diam_ctx_t *c, diam_avp_t *a, tvbuff_t *tvb)
|
|||
pi = proto_tree_add_bytes_format(c->tree, hf_diameter_avp_data_wrong_length,
|
||||
tvb, 0, length, NULL,
|
||||
"Error! Bad Float64 Length");
|
||||
expert_add_info_format(c->pinfo, pi, PI_MALFORMED, PI_NOTE,
|
||||
"Bad Float64 Length (%u)", length);
|
||||
expert_add_info_format_text(c->pinfo, pi, &ei_diameter_avp_len,
|
||||
"Bad Float64 Length (%u)", length);
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
label = NULL;
|
||||
}
|
||||
|
@ -983,11 +980,8 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
if (try_val_to_str(diam_sub_dis_inf->application_id, dictionary.applications) == NULL) {
|
||||
proto_tree *tu = proto_item_add_subtree(app_item,ett_unknown);
|
||||
proto_item *iu = proto_tree_add_text(tu, tvb, 8, 4, "Unknown Application Id, "
|
||||
"if you know what this is you can add it to dictionary.xml");
|
||||
expert_add_info_format(c->pinfo, iu, PI_UNDECODED, PI_WARN,
|
||||
"Unknown Application Id (%u)", diam_sub_dis_inf->application_id);
|
||||
PROTO_ITEM_SET_GENERATED(iu);
|
||||
proto_tree_add_expert_format(tu, c->pinfo, &ei_diameter_application_id, tvb, 8, 4,
|
||||
"Unknown Application Id (%u), if you know what this is you can add it to dictionary.xml", diam_sub_dis_inf->application_id);
|
||||
}
|
||||
|
||||
c->version_rfc = TRUE;
|
||||
|
@ -996,9 +990,7 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
default:
|
||||
{
|
||||
proto_tree *pt = proto_item_add_subtree(version_item,ett_err);
|
||||
proto_item *pi_local = proto_tree_add_text(pt,tvb,0,1,"Unknown Diameter Version (decoding as RFC 3588)");
|
||||
expert_add_info_format(pinfo, pi_local, PI_UNDECODED, PI_WARN, "Unknown Diameter Version");
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
proto_tree_add_expert(pt, pinfo, &ei_diameter_version, tvb, 0, 1);
|
||||
c->version_rfc = TRUE;
|
||||
cmd_vs = VND_CMD_VS(&no_vnd);
|
||||
break;
|
||||
|
@ -1025,10 +1017,7 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
proto_item_append_text(cmd_item," %s", cmd_str);
|
||||
if (strcmp(cmd_str, "Unknown") == 0) {
|
||||
proto_tree *tu = proto_item_add_subtree(cmd_item,ett_unknown);
|
||||
proto_item *iu = proto_tree_add_text(tu,tvb, 5 ,3,"Unknown command, "
|
||||
"if you know what this is you can add it to dictionary.xml");
|
||||
expert_add_info_format(c->pinfo, iu, PI_UNDECODED, PI_WARN, "Unknown command (%u)", cmd);
|
||||
PROTO_ITEM_SET_GENERATED(iu);
|
||||
proto_tree_add_expert(tu, c->pinfo, &ei_diameter_code, tvb, 5, 3);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1039,7 +1028,7 @@ dissect_diameter_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
|
||||
/* Conversation tracking stuff */
|
||||
/*
|
||||
* FIXME: Looking at epan/conversation.c it seems unlike that this will work properly in
|
||||
* FIXME: Looking at epan/conversation.c it seems unlikely that this will work properly in
|
||||
* multi-homed SCTP connections. This will probably need to be fixed at some point.
|
||||
*/
|
||||
|
||||
|
@ -1840,6 +1829,14 @@ real_proto_register_diameter(void)
|
|||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_diameter_reserved_bit_set, { "diameter.reserved_bit_set", PI_MALFORMED, PI_WARN, "Reserved bit set", EXPFILL }},
|
||||
{ &ei_diameter_avp_code, { "diameter.avp.code.unknown", PI_UNDECODED, PI_WARN, "Unknown AVP, if you know what this is you can add it to dictionary.xml", EXPFILL }},
|
||||
{ &ei_diameter_avp_vendor_id, { "diameter.unknown_vendor", PI_UNDECODED, PI_WARN, "Unknown Vendor, if you know whose this is you can add it to dictionary.xml", EXPFILL }},
|
||||
{ &ei_diameter_avp_no_data, { "diameter.avp.no_data", PI_UNDECODED, PI_WARN, "Data is empty", EXPFILL }},
|
||||
{ &ei_diameter_avp_pad, { "diameter.avp.pad.non_zero", PI_MALFORMED, PI_NOTE, "Padding is non-zero", EXPFILL }},
|
||||
{ &ei_diameter_avp_len, { "diameter.avp.invalid-len", PI_MALFORMED, PI_WARN, "Wrong length", EXPFILL }},
|
||||
{ &ei_diameter_application_id, { "diameter.applicationId.unknown", PI_UNDECODED, PI_WARN, "Unknown Application Id, if you know what this is you can add it to dictionary.xml", EXPFILL }},
|
||||
{ &ei_diameter_version, { "diameter.version.unknown", PI_UNDECODED, PI_WARN, "Unknown Diameter Version (decoding as RFC 3588)", EXPFILL }},
|
||||
{ &ei_diameter_code, { "diameter.cmd.code.unknown", PI_UNDECODED, PI_WARN, "Unknown command, if you know what this is you can add it to dictionary.xml", EXPFILL }},
|
||||
};
|
||||
|
||||
wmem_array_append(build_dict.hf, hf_base, array_length(hf_base));
|
||||
|
|
|
@ -1045,6 +1045,35 @@ static int hf_dvbci_sas_sess_state = -1;
|
|||
static int hf_dvbci_sas_msg_nb = -1;
|
||||
static int hf_dvbci_sas_msg_len = -1;
|
||||
|
||||
static expert_field ei_dvbci_spdu_tag = EI_INIT;
|
||||
static expert_field ei_dvbci_sac_payload_enc = EI_INIT;
|
||||
static expert_field ei_dvbci_buf_size = EI_INIT;
|
||||
static expert_field ei_dvbci_cicam_nit_table_id = EI_INIT;
|
||||
static expert_field ei_dvbci_c_tpdu_tag = EI_INIT;
|
||||
static expert_field ei_dvbci_res_class = EI_INIT;
|
||||
static expert_field ei_dvbci_bad_length = EI_INIT;
|
||||
static expert_field ei_dvbci_apdu_not_supported = EI_INIT;
|
||||
static expert_field ei_dvbci_not_text_more_or_text_last = EI_INIT;
|
||||
static expert_field ei_dvbci_apu_cam_to_host = EI_INIT;
|
||||
static expert_field ei_dvbci_ca_pmt_cmd_id = EI_INIT;
|
||||
static expert_field ei_dvbci_ml = EI_INIT;
|
||||
static expert_field ei_dvbci_cup_progress = EI_INIT;
|
||||
static expert_field ei_dvbci_sb_value = EI_INIT;
|
||||
static expert_field ei_dvbci_spdu_cam_to_host = EI_INIT;
|
||||
static expert_field ei_dvbci_spdu_host_to_cam = EI_INIT;
|
||||
static expert_field ei_dvbci_network_id = EI_INIT;
|
||||
static expert_field ei_dvbci_dvbci_char_tbl = EI_INIT;
|
||||
static expert_field ei_dvbci_t_c_id = EI_INIT;
|
||||
static expert_field ei_dvbci_tpdu_status_tag = EI_INIT;
|
||||
static expert_field ei_dvbci_r_tpdu_tag = EI_INIT;
|
||||
static expert_field ei_dvbci_cor_addr = EI_INIT;
|
||||
static expert_field ei_dvbci_pin_evt_cent = EI_INIT;
|
||||
static expert_field ei_dvbci_res_ver = EI_INIT;
|
||||
static expert_field ei_dvbci_apdu_tag = EI_INIT;
|
||||
static expert_field ei_dvbci_r_tpdu_status_mandatory = EI_INIT;
|
||||
static expert_field ei_dvbci_apu_host_to_cam = EI_INIT;
|
||||
static expert_field ei_dvbci_sig_qual = EI_INIT;
|
||||
|
||||
static dissector_table_t sas_msg_dissector_table;
|
||||
|
||||
static reassembly_table tpdu_reassembly_table;
|
||||
|
@ -2161,7 +2190,6 @@ dissect_si_string(tvbuff_t *tvb, gint offset, gint str_len,
|
|||
{
|
||||
guint8 byte0;
|
||||
guint8 *si_str = NULL;
|
||||
proto_item *pi;
|
||||
|
||||
if (!title) /* we always have a title for our strings */
|
||||
return;
|
||||
|
@ -2176,10 +2204,7 @@ dissect_si_string(tvbuff_t *tvb, gint offset, gint str_len,
|
|||
str_len--;
|
||||
}
|
||||
else if (byte0>=0x10 && byte0 <= 0x1F) {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, 1,
|
||||
"Invalid/unsupported character table");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Character tables with multi-byte encoding are not supported");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_dvbci_dvbci_char_tbl, tvb, offset, 1);
|
||||
offset++;
|
||||
str_len--;
|
||||
proto_tree_add_text(tree, tvb, offset, str_len, "encoded text");
|
||||
|
@ -2234,7 +2259,6 @@ dissect_ca_desc(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
proto_tree *tree)
|
||||
{
|
||||
gint offset_start;
|
||||
proto_item *pi;
|
||||
guint8 tag, len_byte;
|
||||
proto_item *ti = NULL;
|
||||
proto_tree *ca_desc_tree = NULL;
|
||||
|
@ -2244,9 +2268,7 @@ dissect_ca_desc(tvbuff_t *tvb, gint offset, packet_info *pinfo,
|
|||
tag = tvb_get_guint8(tvb,offset);
|
||||
if (tag != CA_DESC_TAG) {
|
||||
/* we could skip unknown descriptors and make this a warning */
|
||||
pi = proto_tree_add_text(tree, tvb, offset, 1, "Invalid descriptor");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"The ca_pmt shall only contain ca descriptors (tag 0x9)");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_dvbci_ca_pmt_cmd_id, tvb, offset, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2424,15 +2446,12 @@ dissect_dvbci_payload_rm(guint32 tag, gint len_field,
|
|||
packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
const gchar *tag_str;
|
||||
proto_item *pi;
|
||||
|
||||
if (tag==T_PROFILE) {
|
||||
if (len_field % RES_ID_LEN) {
|
||||
tag_str = val_to_str(tag, dvbci_apdu_tag, "Unknown: %d");
|
||||
pi = proto_tree_add_text(tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Length field for %s must be a multiple of 4 bytes",
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field, %s must be a multiple of 4 bytes",
|
||||
tag_str);
|
||||
return;
|
||||
}
|
||||
|
@ -2504,10 +2523,8 @@ dissect_dvbci_payload_ca(guint32 tag, gint len_field,
|
|||
if (tag==T_CA_INFO) {
|
||||
if (len_field % 2) {
|
||||
tag_str = val_to_str(tag, dvbci_apdu_tag, "Unknown: %d");
|
||||
pi = proto_tree_add_text(tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Length field for %s must be a multiple of 2 bytes",
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field, %s must be a multiple of 2 bytes",
|
||||
tag_str);
|
||||
return;
|
||||
}
|
||||
|
@ -2643,8 +2660,7 @@ dissect_dvbci_payload_hc(guint32 tag, gint len_field _U_,
|
|||
pi = proto_tree_add_item(
|
||||
tree, hf_dvbci_network_id, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
if (nid) {
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_NOTE,
|
||||
"Network ID is usually ignored by hosts");
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_network_id);
|
||||
}
|
||||
offset += 2;
|
||||
onid = tvb_get_ntohs(tvb, offset);
|
||||
|
@ -2757,19 +2773,15 @@ dissect_dvbci_payload_dt(guint32 tag, gint len_field,
|
|||
else if (tag==T_DATE_TIME) {
|
||||
if (len_field!=5 && len_field!=7) {
|
||||
tag_str = val_to_str_const(tag, dvbci_apdu_tag, "unknown");
|
||||
pi = proto_tree_add_text(tree, tvb, APDU_TAG_SIZE, offset-APDU_TAG_SIZE,
|
||||
"Invalid APDU length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Length field for %s must be 5 or 7 bytes", tag_str);
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, APDU_TAG_SIZE, offset-APDU_TAG_SIZE,
|
||||
"Invalid APDU length field, %s must be 5 or 7 bytes", tag_str);
|
||||
return;
|
||||
}
|
||||
|
||||
time_field_len = read_utc_time(tvb, offset, &utc_time);
|
||||
if (time_field_len<0) {
|
||||
pi = proto_tree_add_text(
|
||||
tree, tvb, offset, 5, "Invalid UTC time field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"2 bytes MJD, 3 bytes BCD time hhmmss");
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, offset, 5,
|
||||
"Invalid UTC time field, 2 bytes MJD, 3 bytes BCD time hhmmss");
|
||||
return;
|
||||
}
|
||||
proto_tree_add_time_format(tree, hf_dvbci_utc_time,
|
||||
|
@ -2800,7 +2812,6 @@ dissect_dvbci_payload_mmi(guint32 tag, gint len_field,
|
|||
packet_info *pinfo, proto_tree *tree)
|
||||
{
|
||||
gint offset_start;
|
||||
proto_item *pi;
|
||||
guint8 close_mmi_cmd_id;
|
||||
guint8 disp_ctl_cmd, disp_rep_id;
|
||||
const gchar *disp_ctl_cmd_str = NULL, *disp_rep_id_str = NULL;
|
||||
|
@ -2822,10 +2833,8 @@ dissect_dvbci_payload_mmi(guint32 tag, gint len_field,
|
|||
/* apdu layer len field checks are sufficient for "immediate" */
|
||||
if (close_mmi_cmd_id == CLOSE_MMI_CMD_ID_DELAY) {
|
||||
if (len_field != 2) {
|
||||
pi = proto_tree_add_text(tree, tvb,
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb,
|
||||
APDU_TAG_SIZE, offset_start-APDU_TAG_SIZE,
|
||||
"Length field mismatch");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Length field must be 2");
|
||||
return;
|
||||
}
|
||||
|
@ -2847,10 +2856,8 @@ dissect_dvbci_payload_mmi(guint32 tag, gint len_field,
|
|||
proto_tree_add_item(tree, hf_dvbci_mmi_mode, tvb,
|
||||
offset, 1, ENC_BIG_ENDIAN);
|
||||
if (len_field != 2) {
|
||||
pi = proto_tree_add_text(tree, tvb,
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb,
|
||||
APDU_TAG_SIZE, offset_start-APDU_TAG_SIZE,
|
||||
"Length field mismatch");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Length field must be 2");
|
||||
return;
|
||||
}
|
||||
|
@ -2937,11 +2944,7 @@ dissect_dvbci_payload_mmi(guint32 tag, gint len_field,
|
|||
text_len = dissect_dvbci_text("Item", tvb, offset, pinfo, tree);
|
||||
/* minimum is apdu tag + 1 byte len field */
|
||||
if (text_len<APDU_TAG_SIZE+1) {
|
||||
pi = proto_tree_add_text(
|
||||
tree, tvb, offset, -1, "Invalid item");
|
||||
expert_add_info_format(
|
||||
pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Items must be text_more() or text_last() objects");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_dvbci_not_text_more_or_text_last, tvb, offset, -1);
|
||||
return;
|
||||
}
|
||||
offset += text_len;
|
||||
|
@ -3000,7 +3003,6 @@ dissect_dvbci_payload_cup(guint32 tag, gint len_field _U_,
|
|||
guint8 upgrade_type;
|
||||
guint16 download_time;
|
||||
guint8 answer, progress;
|
||||
proto_item *pi;
|
||||
|
||||
switch(tag) {
|
||||
case T_CAM_FIRMWARE_UPGRADE:
|
||||
|
@ -3031,10 +3033,7 @@ dissect_dvbci_payload_cup(guint32 tag, gint len_field _U_,
|
|||
case T_CAM_FIRMWARE_UPGRADE_PROGRESS:
|
||||
progress = tvb_get_guint8(tvb, offset);
|
||||
if (progress > 100) {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, 1,
|
||||
"Invalid value for progress");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"progress is in percent, value must be between 0 and 100");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_dvbci_cup_progress, tvb, offset, 1);
|
||||
}
|
||||
else {
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%d%%", progress);
|
||||
|
@ -3084,8 +3083,7 @@ dissect_sac_msg(guint32 tag, tvbuff_t *tvb, gint offset,
|
|||
enc_flag_pi = proto_tree_add_item(tree, hf_dvbci_sac_payload_enc,
|
||||
tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
if (exported && enc_flag) {
|
||||
expert_add_info_format(pinfo, enc_flag_pi, PI_PROTOCOL, PI_NOTE,
|
||||
"The original PDU was encrypted, this exported PDU is in the clear");
|
||||
expert_add_info(pinfo, enc_flag_pi, &ei_dvbci_sac_payload_enc);
|
||||
enc_flag = 0;
|
||||
}
|
||||
offset++;
|
||||
|
@ -3241,10 +3239,8 @@ dissect_dvbci_payload_cc(guint32 tag, gint len_field _U_,
|
|||
}
|
||||
else {
|
||||
if (read_utc_time(tvb, offset, &utc_time) < 0) {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, UTC_TIME_LEN,
|
||||
"Invalid UTC time field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"2 bytes MJD, 3 bytes BCD time hhmmss");
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, offset, UTC_TIME_LEN,
|
||||
"Invalid UTC time field, 2 bytes MJD, 3 bytes BCD time hhmmss");
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
@ -3275,10 +3271,8 @@ dissect_dvbci_payload_cc(guint32 tag, gint len_field _U_,
|
|||
dissect_rating(tvb, offset, pinfo, tree);
|
||||
offset++;
|
||||
if (read_utc_time(tvb, offset, &utc_time) < 0) {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, UTC_TIME_LEN,
|
||||
"Invalid UTC time field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"2 bytes MJD, 3 bytes BCD time hhmmss");
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, offset, UTC_TIME_LEN,
|
||||
"Invalid UTC time field, 2 bytes MJD, 3 bytes BCD time hhmmss");
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
@ -3289,14 +3283,11 @@ dissect_dvbci_payload_cc(guint32 tag, gint len_field _U_,
|
|||
}
|
||||
offset += UTC_TIME_LEN;
|
||||
evt_cent = tvb_get_guint8(tvb, offset);
|
||||
if (evt_cent > 100) {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, 1,
|
||||
"Invalid value for event time centiseconds");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Value must be between 0 and 100");
|
||||
}
|
||||
proto_tree_add_item(tree, hf_dvbci_pin_evt_cent,
|
||||
pi = proto_tree_add_item(tree, hf_dvbci_pin_evt_cent,
|
||||
tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
if (evt_cent > 100) {
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_pin_evt_cent);
|
||||
}
|
||||
offset++;
|
||||
/* length field was already checked by the caller */
|
||||
proto_tree_add_item(tree, hf_dvbci_cc_priv_data, tvb, offset,
|
||||
|
@ -3526,10 +3517,8 @@ dissect_dvbci_payload_lsc(guint32 tag, gint len_field,
|
|||
case COMMS_CMD_ID_ENQUIRE_STATUS:
|
||||
/* len_field == 1 -> only id, no further parameters */
|
||||
if (len_field != 1) {
|
||||
pi = proto_tree_add_text(tree, tvb,
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb,
|
||||
APDU_TAG_SIZE, offset_start-APDU_TAG_SIZE,
|
||||
"Length field mismatch");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Length field must be 1");
|
||||
}
|
||||
break;
|
||||
|
@ -3540,11 +3529,9 @@ dissect_dvbci_payload_lsc(guint32 tag, gint len_field,
|
|||
else if (param_len == 3)
|
||||
buf_size = tvb_get_ntohs(tvb, offset);
|
||||
else {
|
||||
pi = proto_tree_add_text(tree, tvb,
|
||||
APDU_TAG_SIZE, offset_start-APDU_TAG_SIZE,
|
||||
"Length field mismatch");
|
||||
/* length field == 1 byte id + param_len */
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb,
|
||||
APDU_TAG_SIZE, offset_start-APDU_TAG_SIZE,
|
||||
"Length field must be 3 or 4");
|
||||
break;
|
||||
}
|
||||
|
@ -3680,11 +3667,8 @@ dissect_dvbci_payload_opp(guint32 tag, gint len_field _U_,
|
|||
do {
|
||||
table_id = tvb_get_guint8(nit_loop_tvb, nit_loop_offset);
|
||||
if (table_id != TABLE_ID_CICAM_NIT) {
|
||||
pi = proto_tree_add_text(tree,
|
||||
nit_loop_tvb, nit_loop_offset, 1,
|
||||
"Invalid table id for the CICAM NIT");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"CICAM NIT must have table id 0x40 (NIT actual)");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_dvbci_cicam_nit_table_id,
|
||||
nit_loop_tvb, nit_loop_offset, 1);
|
||||
}
|
||||
nit_loop_partial_tvb =
|
||||
tvb_new_subset_remaining(nit_loop_tvb, nit_loop_offset);
|
||||
|
@ -3792,13 +3776,12 @@ dissect_dvbci_payload_opp(guint32 tag, gint len_field _U_,
|
|||
tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
offset++;
|
||||
sig_qual = tvb_get_guint8(tvb, offset);
|
||||
proto_tree_add_item(tree, hf_dvbci_sig_qual,
|
||||
pi = proto_tree_add_item(tree, hf_dvbci_sig_qual,
|
||||
tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
if (sig_strength>100 || sig_qual>100) {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, 1,
|
||||
"Invalid value for signal strength / signal quality");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Values are in percent (0 to 100)");
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_sig_qual);
|
||||
}
|
||||
offset++;
|
||||
proto_tree_add_item(tree, hf_dvbci_opp_tune_status,
|
||||
|
@ -3904,25 +3887,18 @@ dissect_dvbci_apdu(tvbuff_t *tvb, circuit_t *circuit,
|
|||
|
||||
col_set_str(pinfo->cinfo, COL_INFO,
|
||||
val_to_str_const(tag, dvbci_apdu_tag, "Unknown/invalid APDU"));
|
||||
if (tag_str) {
|
||||
proto_tree_add_item(
|
||||
pi = proto_tree_add_item(
|
||||
app_tree, hf_dvbci_apdu_tag, tvb, 0, APDU_TAG_SIZE, ENC_BIG_ENDIAN);
|
||||
}
|
||||
else {
|
||||
pi = proto_tree_add_text(app_tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid or unsupported APDU tag");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid or unsupported APDU tag");
|
||||
if (tag_str == NULL) {
|
||||
expert_add_info(pinfo, app_tree, &ei_dvbci_apdu_tag);
|
||||
return;
|
||||
}
|
||||
|
||||
offset = dissect_ber_length(pinfo, app_tree, tvb, offset, &len_field, NULL);
|
||||
if ((offset+len_field) != apdu_len) {
|
||||
pi = proto_tree_add_text(app_tree, tvb,
|
||||
proto_tree_add_expert_format(app_tree, pinfo, &ei_dvbci_bad_length, tvb,
|
||||
APDU_TAG_SIZE, offset-APDU_TAG_SIZE,
|
||||
"Length field mismatch");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Length field is different from the number of apdu payload bytes");
|
||||
"Length field is different from the number of apdu payload bytes");
|
||||
/* we need len_field bytes of apdu payload to call
|
||||
ai->dissect_payload() and continue dissecting */
|
||||
if (apdu_len < offset+len_field)
|
||||
|
@ -3932,38 +3908,26 @@ dissect_dvbci_apdu(tvbuff_t *tvb, circuit_t *circuit,
|
|||
ai = (apdu_info_t *)g_hash_table_lookup(apdu_table,
|
||||
GUINT_TO_POINTER((guint)tag));
|
||||
if (!ai) {
|
||||
pi = proto_tree_add_text(
|
||||
app_tree, tvb, 0, APDU_TAG_SIZE, "Unknown APDU");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Dissection of this APDU is not supported");
|
||||
proto_tree_add_expert(app_tree, pinfo, &ei_dvbci_apdu_not_supported, tvb, 0, APDU_TAG_SIZE);
|
||||
return;
|
||||
}
|
||||
if (ai->direction!=DIRECTION_ANY && ai->direction!=direction) {
|
||||
pi = proto_tree_add_text(app_tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU direction");
|
||||
if (ai->direction==DATA_HOST_TO_CAM) {
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"This APDU must be sent from host to CAM");
|
||||
proto_tree_add_expert(app_tree, pinfo, &ei_dvbci_apu_host_to_cam, tvb, 0, APDU_TAG_SIZE);
|
||||
}
|
||||
else {
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"This APDU must be sent from CAM to host");
|
||||
proto_tree_add_expert(app_tree, pinfo, &ei_dvbci_apu_cam_to_host, tvb, 0, APDU_TAG_SIZE);
|
||||
}
|
||||
/* don't return, we can continue dissecting the APDU */
|
||||
}
|
||||
if (ai->min_len_field!=LEN_FIELD_ANY && len_field<ai->min_len_field) {
|
||||
pi = proto_tree_add_text(app_tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Minimum length field for %s is %d",
|
||||
tag_str, ai->min_len_field);
|
||||
proto_tree_add_expert_format(app_tree, pinfo, &ei_dvbci_bad_length, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field, minimum length field for %s is %d", tag_str, ai->min_len_field);
|
||||
return;
|
||||
}
|
||||
if (ai->len_field!=LEN_FIELD_ANY && len_field!=ai->len_field) {
|
||||
pi = proto_tree_add_text(app_tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Length field for %s must be %d", tag_str, ai->len_field);
|
||||
proto_tree_add_expert_format(app_tree, pinfo, &ei_dvbci_bad_length, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid APDU length field, length field for %s must be %d", tag_str, ai->len_field);
|
||||
return;
|
||||
}
|
||||
if (circuit) {
|
||||
|
@ -3973,17 +3937,13 @@ dissect_dvbci_apdu(tvbuff_t *tvb, circuit_t *circuit,
|
|||
ai_res_class_str = val_to_str_const(ai->res_class, dvbci_res_class, "Unknown");
|
||||
|
||||
if(RES_CLASS(apdu_res_id) != ai->res_class) {
|
||||
pi = proto_tree_add_text(app_tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid resource class for this apdu");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"%s can only be sent on a %s session",
|
||||
proto_tree_add_expert_format(app_tree, pinfo, &ei_dvbci_res_class, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid resource class for this apdu, %s can only be sent on a %s session",
|
||||
tag_str, ai_res_class_str);
|
||||
}
|
||||
if(RES_VER(apdu_res_id) < ai->res_min_ver) {
|
||||
pi = proto_tree_add_text(app_tree, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid resource version for this apdu");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"%s apdu requires at least %s version %d",
|
||||
proto_tree_add_expert_format(app_tree, pinfo, &ei_dvbci_res_ver, tvb, 0, APDU_TAG_SIZE,
|
||||
"Invalid resource version for this apdu, %s apdu requires at least %s version %d",
|
||||
tag_str, ai_res_class_str, ai->res_min_ver);
|
||||
}
|
||||
/* don't return, we can continue dissecting the APDU */
|
||||
|
@ -4030,13 +3990,9 @@ dissect_dvbci_spdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
tag_str = try_val_to_str(tag, dvbci_spdu_tag);
|
||||
col_add_str(pinfo->cinfo, COL_INFO,
|
||||
val_to_str_const(tag, dvbci_spdu_tag, "Invalid SPDU"));
|
||||
if (tag_str) {
|
||||
proto_tree_add_item(sess_tree, hf_dvbci_spdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN);
|
||||
}
|
||||
else {
|
||||
pi = proto_tree_add_text(sess_tree, tvb, 0, 1, "Invalid SPDU tag");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"See table 14 in the DVB-CI specification");
|
||||
pi = proto_tree_add_item(sess_tree, hf_dvbci_spdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN);
|
||||
if (tag_str == NULL) {
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_spdu_tag);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4047,23 +4003,17 @@ dissect_dvbci_spdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
if (!si)
|
||||
return;
|
||||
if (si->direction!=0 && si->direction!=direction) {
|
||||
pi = proto_tree_add_text(sess_tree, tvb, 0, 1,
|
||||
"Invalid SPDU direction");
|
||||
if (si->direction==DATA_HOST_TO_CAM) {
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"This SPDU must be sent from host to CAM");
|
||||
proto_tree_add_expert(sess_tree, pinfo, &ei_dvbci_spdu_host_to_cam, tvb, 0, 1);
|
||||
}
|
||||
else {
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"This SPDU must be sent from CAM to host");
|
||||
proto_tree_add_expert(sess_tree, pinfo, &ei_dvbci_spdu_cam_to_host, tvb, 0, 1);
|
||||
}
|
||||
}
|
||||
if (si->len_field != len_field) {
|
||||
/* offset points to 1st byte after the length field */
|
||||
pi = proto_tree_add_text(sess_tree, tvb, 1, offset-1,
|
||||
"Invalid SPDU length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Correct length field for %s is %d", tag_str, si->len_field);
|
||||
proto_tree_add_expert_format(sess_tree, pinfo, &ei_dvbci_bad_length, tvb, 1, offset-1,
|
||||
"Invalid SPDU length field, correct length field for %s is %d", tag_str, si->len_field);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -4175,10 +4125,7 @@ dissect_dvbci_tpdu_status(tvbuff_t *tvb, gint offset,
|
|||
|
||||
tag = tvb_get_guint8(tvb, offset_new);
|
||||
if (tag!=T_SB) {
|
||||
pi = proto_tree_add_text(
|
||||
tree, tvb, offset_new, 1, "Invalid status tag");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"This must always be T_SB (0x80)");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_dvbci_tpdu_status_tag, tvb, offset_new, 1);
|
||||
return -1;
|
||||
}
|
||||
col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "T_SB");
|
||||
|
@ -4189,17 +4136,14 @@ dissect_dvbci_tpdu_status(tvbuff_t *tvb, gint offset,
|
|||
offset_new = dissect_ber_length(
|
||||
pinfo, tree, tvb, offset_new, &len_field, NULL);
|
||||
if (len_field != 2) {
|
||||
pi = proto_tree_add_text(
|
||||
tree, tvb, len_start_offset, offset_new-len_start_offset,
|
||||
"Invalid status length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"This must always be 2");
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, len_start_offset, offset_new-len_start_offset,
|
||||
"Invalid status length field, this must always be 2");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
t_c_id = tvb_get_guint8(tvb, offset_new);
|
||||
proto_tree_add_item(tree, hf_dvbci_t_c_id, tvb, offset_new, 1, ENC_BIG_ENDIAN);
|
||||
pi = proto_tree_add_item(tree, hf_dvbci_t_c_id, tvb, offset_new, 1, ENC_BIG_ENDIAN);
|
||||
/* tcid in transport header and link layer must only match for data
|
||||
* transmission commands */
|
||||
if (t_c_id!=lpdu_tcid) {
|
||||
|
@ -4208,9 +4152,7 @@ dissect_dvbci_tpdu_status(tvbuff_t *tvb, gint offset,
|
|||
|
||||
pi = proto_tree_add_text(tree, tvb, offset_new, 1,
|
||||
"Transport Connection ID mismatch");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"tcid is %d in the transport layer and %d in the link layer",
|
||||
t_c_id, lpdu_tcid);
|
||||
expert_add_info_format_text(pinfo, pi, &ei_dvbci_t_c_id, "Transport Connection ID mismatch, tcid is %d in the transport layer and %d in the link layer", t_c_id, lpdu_tcid);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -4219,16 +4161,15 @@ dissect_dvbci_tpdu_status(tvbuff_t *tvb, gint offset,
|
|||
|
||||
sb_value = tvb_get_guint8(tvb, offset_new);
|
||||
sb_str = try_val_to_str(sb_value, dvbci_sb_value);
|
||||
pi = proto_tree_add_item(tree, hf_dvbci_sb_value, tvb,
|
||||
offset_new, 1, ENC_BIG_ENDIAN);
|
||||
if (sb_str) {
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ", "%s", sb_str);
|
||||
proto_tree_add_item(tree, hf_dvbci_sb_value, tvb,
|
||||
offset_new, 1, ENC_BIG_ENDIAN);
|
||||
}
|
||||
else {
|
||||
pi = proto_tree_add_text(tree, tvb, offset_new, 1,
|
||||
proto_tree_add_text(tree, tvb, offset_new, 1,
|
||||
"Invalid SB_value");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Must be 0x00 or 0x80");
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_sb_value);
|
||||
}
|
||||
offset_new++;
|
||||
|
||||
|
@ -4254,17 +4195,14 @@ dissect_dvbci_tpdu_hdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
c_tpdu_tag = tvb_get_guint8(tvb, 0);
|
||||
tag = &c_tpdu_tag;
|
||||
c_tpdu_str = try_val_to_str(c_tpdu_tag, dvbci_c_tpdu);
|
||||
pi = proto_tree_add_item(tree, hf_dvbci_c_tpdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN);
|
||||
if (c_tpdu_str) {
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%s", c_tpdu_str);
|
||||
proto_tree_add_item(tree, hf_dvbci_c_tpdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN);
|
||||
}
|
||||
else {
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL,
|
||||
"Invalid Command-TPDU tag");
|
||||
pi = proto_tree_add_text(
|
||||
tree, tvb, 0, 1, "Invalid Command-TPDU tag");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"see DVB-CI specification, table A.16 for valid values");
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_c_tpdu_tag);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -4272,9 +4210,9 @@ dissect_dvbci_tpdu_hdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
r_tpdu_tag = tvb_get_guint8(tvb, 0);
|
||||
tag = &r_tpdu_tag;
|
||||
r_tpdu_str = try_val_to_str(r_tpdu_tag, dvbci_r_tpdu);
|
||||
pi = proto_tree_add_item(tree, hf_dvbci_r_tpdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN);
|
||||
if (r_tpdu_str) {
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL, "%s", r_tpdu_str);
|
||||
proto_tree_add_item(tree, hf_dvbci_r_tpdu_tag, tvb, 0, 1, ENC_BIG_ENDIAN);
|
||||
}
|
||||
else {
|
||||
if (r_tpdu_tag == T_SB) {
|
||||
|
@ -4289,10 +4227,7 @@ dissect_dvbci_tpdu_hdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
else {
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, NULL,
|
||||
"Invalid Response-TPDU tag");
|
||||
pi = proto_tree_add_text(
|
||||
tree, tvb, 0, 1, "Invalid Response-TPDU tag");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"see DVB-CI specification, table A.16 for valid values");
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_r_tpdu_tag);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
@ -4306,23 +4241,19 @@ dissect_dvbci_tpdu_hdr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
((direction==DATA_HOST_TO_CAM) && ((offset+len_field)!=tpdu_len)) ||
|
||||
((direction==DATA_CAM_TO_HOST) && ((offset+len_field)>tpdu_len))) {
|
||||
/* offset points to 1st byte after the length field */
|
||||
pi = proto_tree_add_text(tree, tvb, 1, offset-1, "Invalid length field");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
len_field==0 ? "Length field must be at least 1" :
|
||||
"Length field mismatch");
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_bad_length, tvb, 1, offset-1,
|
||||
len_field==0 ? "Invalid length field, length field must be at least 1" :
|
||||
"Invalid length field, length field mismatch");
|
||||
return -1;
|
||||
}
|
||||
|
||||
t_c_id = tvb_get_guint8(tvb, offset);
|
||||
proto_tree_add_item(tree, hf_dvbci_t_c_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
pi = proto_tree_add_item(tree, hf_dvbci_t_c_id, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
/* tcid in transport header and link layer must only match for
|
||||
* data transmission commands */
|
||||
if (t_c_id!=lpdu_tcid) {
|
||||
if (tag && (*tag==T_RCV || *tag==T_DATA_MORE || *tag==T_DATA_LAST)) {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, 1,
|
||||
"Transport Connection ID mismatch");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"tcid is %d in the transport layer and %d in the link layer",
|
||||
expert_add_info_format_text(pinfo, pi, &ei_dvbci_t_c_id, "Transport Connection ID mismatch, tcid is %d in the transport layer and %d in the link layer",
|
||||
t_c_id, lpdu_tcid);
|
||||
}
|
||||
}
|
||||
|
@ -4348,7 +4279,6 @@ dissect_dvbci_tpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
gint offset, status_len;
|
||||
guint8 hdr_tag = NO_TAG;
|
||||
tvbuff_t *body_tvb, *payload_tvb = NULL;
|
||||
proto_item *pi;
|
||||
fragment_head *frag_msg = NULL;
|
||||
|
||||
|
||||
|
@ -4396,10 +4326,7 @@ dissect_dvbci_tpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
if (direction==DATA_CAM_TO_HOST) {
|
||||
/* minimum length of an rtpdu status is 4 bytes */
|
||||
if (tpdu_len-offset < 4) {
|
||||
pi = proto_tree_add_text(trans_tree, tvb, 0, 0,
|
||||
"Response TPDU's status part is missing");
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"RTPDU status is mandatory");
|
||||
proto_tree_add_expert(trans_tree, pinfo, &ei_dvbci_r_tpdu_status_mandatory, tvb, 0, 0);
|
||||
return;
|
||||
}
|
||||
status_len = dissect_dvbci_tpdu_status(
|
||||
|
@ -4439,23 +4366,15 @@ dissect_dvbci_lpdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
proto_tree_add_item(link_tree, hf_dvbci_tcid, tvb, 0, 1, ENC_BIG_ENDIAN);
|
||||
|
||||
more_last = tvb_get_guint8(tvb, 1);
|
||||
if (try_val_to_str(more_last, dvbci_ml)) {
|
||||
proto_tree_add_item(link_tree, hf_dvbci_ml, tvb, 1, 1, ENC_BIG_ENDIAN);
|
||||
}
|
||||
else {
|
||||
pi = proto_tree_add_text(
|
||||
link_tree, tvb, 1, 1, "Invalid More/Last indicator");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Second byte of an LPDU must be 0x80 or 0x00");
|
||||
pi = proto_tree_add_item(link_tree, hf_dvbci_ml, tvb, 1, 1, ENC_BIG_ENDIAN);
|
||||
if (try_val_to_str(more_last, dvbci_ml) == NULL) {
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_ml);
|
||||
}
|
||||
|
||||
/* buf_size_host==0 -> we did not capture the buffer size negotiation */
|
||||
if (buf_size_host!=0 && payload_len>buf_size_host) {
|
||||
pi = proto_tree_add_text(
|
||||
link_tree, tvb, 2, payload_len, "Payload too large");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Maximum payload length is the negotiated buffer size (%d bytes)",
|
||||
buf_size_host);
|
||||
proto_tree_add_expert_format(link_tree, pinfo, &ei_dvbci_bad_length, tvb, 2, payload_len,
|
||||
"Payload too large, maximum payload length is the negotiated buffer size (%d bytes)", buf_size_host);
|
||||
}
|
||||
|
||||
frag_msg = fragment_add_seq_next(&tpdu_reassembly_table,
|
||||
|
@ -4494,7 +4413,7 @@ dissect_dvbci_buf_neg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
|
||||
if (direction == DATA_HOST_TO_CAM) {
|
||||
buf_size_host = buf_size;
|
||||
proto_tree_add_uint_format(tree, hf_dvbci_buf_size, tvb,
|
||||
pi = proto_tree_add_uint_format(tree, hf_dvbci_buf_size, tvb,
|
||||
0, 2, buf_size,
|
||||
"Negotiated buffer size: %u bytes", buf_size);
|
||||
if (buf_size_host > buf_size_cam) {
|
||||
|
@ -4503,10 +4422,7 @@ dissect_dvbci_buf_neg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
if we didn't check the direction, we'd get the error when
|
||||
wireshark runs through the initial CAM packet for the 2nd time
|
||||
*/
|
||||
pi = proto_tree_add_text(tree, tvb, 0, 2,
|
||||
"Illegal buffer size command");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Host shall not request a buffer size larger than the CAM proposal");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_dvbci_buf_size, "Illegal buffer size command. Host shall not request a buffer size larger than the CAM proposal");
|
||||
}
|
||||
}
|
||||
else if (direction == DATA_CAM_TO_HOST) {
|
||||
|
@ -4517,9 +4433,8 @@ dissect_dvbci_buf_neg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
}
|
||||
|
||||
if (buf_size < 16) {
|
||||
pi = proto_tree_add_text(tree, tvb, 0, 2, "Illegal buffer size");
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"Minimum buffer size is 16 bytes");
|
||||
proto_tree_add_expert_format(tree, pinfo, &ei_dvbci_buf_size, tvb, 0, 2,
|
||||
"Illegal buffer size, minimum buffer size is 16 bytes");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4842,8 +4757,7 @@ dissect_dvbci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U
|
|||
col_append_sep_str(pinfo->cinfo, COL_INFO, ": ", "unknown address");
|
||||
}
|
||||
else if (cor_addr > 0xFFE) {
|
||||
expert_add_info_format(pinfo, pi, PI_PROTOCOL, PI_WARN,
|
||||
"COR address must not be greater than 0xFFE (DVB-CI spec, A.5.6)");
|
||||
expert_add_info(pinfo, pi, &ei_dvbci_cor_addr);
|
||||
}
|
||||
else {
|
||||
col_append_sep_fstr(pinfo->cinfo, COL_INFO, ": ",
|
||||
|
@ -4876,6 +4790,7 @@ proto_register_dvbci(void)
|
|||
{
|
||||
guint i;
|
||||
module_t *dvbci_module;
|
||||
expert_module_t* expert_dvbci;
|
||||
|
||||
static gint *ett[] = {
|
||||
&ett_dvbci,
|
||||
|
@ -5810,6 +5725,37 @@ proto_register_dvbci(void)
|
|||
}
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_dvbci_dvbci_char_tbl, { "dvb-ci.mmi.char_tbl.not_supported", PI_PROTOCOL, PI_WARN, "Character tables with multi-byte encoding are not supported", EXPFILL }},
|
||||
{ &ei_dvbci_ca_pmt_cmd_id, { "dvb-ci.ca.ca_pmt_cmd_id.ca_pmt", PI_MALFORMED, PI_ERROR, "The ca_pmt shall only contain ca descriptors (tag 0x9)", EXPFILL }},
|
||||
{ &ei_dvbci_bad_length, { "dvb-ci.bad_length", PI_MALFORMED, PI_ERROR, "Invalid APDU length field, %s must be a multiple of 4 bytes", EXPFILL }},
|
||||
{ &ei_dvbci_network_id, { "dvb-ci.hc.nid.ignored", PI_PROTOCOL, PI_NOTE, "Network ID is usually ignored by hosts", EXPFILL }},
|
||||
{ &ei_dvbci_not_text_more_or_text_last, { "dvb-ci.not_text_more_or_text_last", PI_MALFORMED, PI_ERROR, "Items must be text_more() or text_last() objects", EXPFILL }},
|
||||
{ &ei_dvbci_cup_progress, { "dvb-ci.cup.progress.invalid", PI_PROTOCOL, PI_WARN, "progress is in percent, value must be between 0 and 100", EXPFILL }},
|
||||
{ &ei_dvbci_sac_payload_enc, { "dvb-ci.cc.sac.payload_enc.clear", PI_PROTOCOL, PI_NOTE, "The original PDU was encrypted, this exported PDU is in the clear", EXPFILL }},
|
||||
{ &ei_dvbci_pin_evt_cent, { "dvb-ci.cc.pin_event_time_centi.invalid", PI_PROTOCOL, PI_WARN, "Invalid value for event time centiseconds, Value must be between 0 and 100", EXPFILL }},
|
||||
{ &ei_dvbci_cicam_nit_table_id, { "dvb-ci.cicam_nit.table_id.invalid", PI_PROTOCOL, PI_WARN, "CICAM NIT must have table id 0x40 (NIT actual)", EXPFILL }},
|
||||
{ &ei_dvbci_sig_qual, { "dvb-ci.opp.sig_qual.invalid", PI_PROTOCOL, PI_WARN, "Invalid value for signal strength / signal quality, values are in percent (0 to 100)", EXPFILL }},
|
||||
{ &ei_dvbci_apdu_tag, { "dvb-ci.apdu_tag.invalid", PI_MALFORMED, PI_ERROR, "Invalid or unsupported APDU tag", EXPFILL }},
|
||||
{ &ei_dvbci_apdu_not_supported, { "dvb-ci.apdu_not_supported", PI_PROTOCOL, PI_WARN, "Dissection of this APDU is not supported", EXPFILL }},
|
||||
{ &ei_dvbci_apu_host_to_cam, { "dvb-ci.apu.host_to_cam", PI_PROTOCOL, PI_WARN, "Invalid APDU direction, this APDU must be sent from host to CAM", EXPFILL }},
|
||||
{ &ei_dvbci_apu_cam_to_host, { "dvb-ci.apu.cam_to_host", PI_PROTOCOL, PI_WARN, "Invalid APDU direction, this APDU must be sent from CAM to host", EXPFILL }},
|
||||
{ &ei_dvbci_res_class, { "dvb-ci.res.class.invalid", PI_PROTOCOL, PI_WARN, "Invalid resource class for this apdu", EXPFILL }},
|
||||
{ &ei_dvbci_res_ver, { "dvb-ci.res.version.old", PI_PROTOCOL, PI_WARN, "Invalid resource version for this apdu", EXPFILL }},
|
||||
{ &ei_dvbci_spdu_tag, { "dvb-ci.spdu_tag.invalid", PI_MALFORMED, PI_ERROR, "Invalid SPDU tag, See table 14 in the DVB-CI specification", EXPFILL }},
|
||||
{ &ei_dvbci_spdu_host_to_cam, { "dvb-ci.spdu.host_to_cam", PI_PROTOCOL, PI_WARN, "Invalid SPDU direction, this SPDU must be sent from host to CAM", EXPFILL }},
|
||||
{ &ei_dvbci_spdu_cam_to_host, { "dvb-ci.spdu.cam_to_host", PI_PROTOCOL, PI_WARN, "Invalid SPDU direction, this SPDU must be sent from CAM to host", EXPFILL }},
|
||||
{ &ei_dvbci_tpdu_status_tag, { "dvb-ci.tpdu.status_tag.invalid", PI_MALFORMED, PI_ERROR, "Invalid status tag, this must always be T_SB (0x80)", EXPFILL }},
|
||||
{ &ei_dvbci_t_c_id, { "dvb-ci.t_c_id.invalid", PI_PROTOCOL, PI_WARN, "Transport Connection ID mismatch, tcid is %d in the transport layer and %d in the link layer", EXPFILL }},
|
||||
{ &ei_dvbci_sb_value, { "dvb-ci.sb_value.invalid", PI_PROTOCOL, PI_WARN, "Invalid SB_value, must be 0x00 or 0x80", EXPFILL }},
|
||||
{ &ei_dvbci_c_tpdu_tag, { "dvb-ci.c_tpdu_tag.invalid", PI_MALFORMED, PI_ERROR, "Invalid Command-TPDU tag, see DVB-CI specification, table A.16 for valid values", EXPFILL }},
|
||||
{ &ei_dvbci_r_tpdu_tag, { "dvb-ci.r_tpdu_tag.invalid", PI_MALFORMED, PI_ERROR, "Invalid Response-TPDU tag, see DVB-CI specification, table A.16 for valid values", EXPFILL }},
|
||||
{ &ei_dvbci_r_tpdu_status_mandatory, { "dvb-ci.r_tpdu_status.mandatory", PI_MALFORMED, PI_ERROR, "Response TPDU's status part is missing, RTPDU status is mandatory", EXPFILL }},
|
||||
{ &ei_dvbci_ml, { "dvb-ci.more_last.invalid", PI_PROTOCOL, PI_WARN, "Invalid More/Last indicator, second byte of an LPDU must be 0x80 or 0x00", EXPFILL }},
|
||||
{ &ei_dvbci_buf_size, { "dvb-ci.buf_size.invalid", PI_PROTOCOL, PI_WARN, "Illegal buffer size command", EXPFILL }},
|
||||
{ &ei_dvbci_cor_addr, { "dvb-ci.cor_address.invalid", PI_PROTOCOL, PI_WARN, "COR address must not be greater than 0xFFE (DVB-CI spec, A.5.6)", EXPFILL }},
|
||||
};
|
||||
|
||||
spdu_table = g_hash_table_new(g_direct_hash, g_direct_equal);
|
||||
for(i=0; i<array_length(spdu_info); i++) {
|
||||
g_hash_table_insert(spdu_table,
|
||||
|
@ -5824,10 +5770,11 @@ proto_register_dvbci(void)
|
|||
(const gpointer)(&apdu_info[i]));
|
||||
}
|
||||
|
||||
proto_dvbci = proto_register_protocol(
|
||||
"DVB Common Interface", "DVB-CI", "dvb-ci");
|
||||
proto_dvbci = proto_register_protocol("DVB Common Interface", "DVB-CI", "dvb-ci");
|
||||
proto_register_field_array(proto_dvbci, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
expert_dvbci = expert_register_protocol(proto_dvbci);
|
||||
expert_register_field_array(expert_dvbci, ei, array_length(ei));
|
||||
|
||||
dvbci_module = prefs_register_protocol(
|
||||
proto_dvbci, proto_reg_handoff_dvbci);
|
||||
|
|
|
@ -91,6 +91,14 @@ static gint ett_eiss = -1;
|
|||
static gint ett_eiss_platform_id = -1;
|
||||
static gint ett_eiss_desc = -1;
|
||||
|
||||
static expert_field ei_eiss_platform_id_length = EI_INIT;
|
||||
static expert_field ei_eiss_invalid_section_length = EI_INIT;
|
||||
static expert_field ei_eiss_invalid_section_syntax_indicator = EI_INIT;
|
||||
static expert_field ei_eiss_unknown_descriptor = EI_INIT;
|
||||
static expert_field ei_eiss_section_number = EI_INIT;
|
||||
static expert_field ei_eiss_application_type = EI_INIT;
|
||||
static expert_field ei_eiss_invalid_reserved_bits = EI_INIT;
|
||||
|
||||
#define EISS_SECTION_TID 0xe0
|
||||
|
||||
#define MPEG_SECT_SYNTAX_INDICATOR_MASK 0x8000
|
||||
|
@ -244,12 +252,7 @@ dissect_eiss_descriptors(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu
|
|||
|
||||
return (3+tmp);
|
||||
} else {
|
||||
pi = proto_tree_add_text(tree, tvb, offset, -1,
|
||||
"Unknown Descriptor");
|
||||
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Unknown Descriptor");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_eiss_unknown_descriptor, tvb, offset, -1);
|
||||
|
||||
/* skip the rest of the section... for now */
|
||||
return 1000;
|
||||
|
@ -287,8 +290,7 @@ dissect_eiss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
msg_error = items[PACKET_MPEG_SECT_PI__SSI];
|
||||
|
||||
PROTO_ITEM_SET_GENERATED(msg_error);
|
||||
expert_add_info_format(pinfo, msg_error, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid section_syntax_indicator (should be 0)");
|
||||
expert_add_info(pinfo, msg_error, &ei_eiss_invalid_section_syntax_indicator);
|
||||
}
|
||||
|
||||
if (0 != reserved) {
|
||||
|
@ -296,8 +298,7 @@ dissect_eiss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
msg_error = items[PACKET_MPEG_SECT_PI__RESERVED];
|
||||
|
||||
PROTO_ITEM_SET_GENERATED(msg_error);
|
||||
expert_add_info_format(pinfo, msg_error, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid reserved1 bits (should all be 0)");
|
||||
expert_add_info_format_text(pinfo, msg_error, &ei_eiss_invalid_reserved_bits, "Invalid reserved1 bits (should all be 0)");
|
||||
}
|
||||
|
||||
if (1021 < sect_len) {
|
||||
|
@ -305,16 +306,13 @@ dissect_eiss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
msg_error = items[PACKET_MPEG_SECT_PI__LENGTH];
|
||||
|
||||
PROTO_ITEM_SET_GENERATED(msg_error);
|
||||
expert_add_info_format(pinfo, msg_error, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid section_length (must not exceed 1021)");
|
||||
expert_add_info(pinfo, msg_error, &ei_eiss_invalid_section_length);
|
||||
}
|
||||
|
||||
reserved2 = tvb_get_guint8(tvb, offset);
|
||||
pi = proto_tree_add_item(eiss_tree, hf_eiss_reserved2, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
if (0 != reserved2) {
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid reserved2 bits (should all be 0)");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_eiss_invalid_reserved_bits, "Invalid reserved2 bits (should all be 0)");
|
||||
}
|
||||
offset++;
|
||||
|
||||
|
@ -322,9 +320,7 @@ dissect_eiss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
last_sect_num = tvb_get_guint8(tvb, offset + 1);
|
||||
pi = proto_tree_add_item(eiss_tree, hf_eiss_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
if (last_sect_num < sect_num) {
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid section_number (must be <= last_section_number)");
|
||||
expert_add_info(pinfo, pi, &ei_eiss_section_number);
|
||||
}
|
||||
offset++;
|
||||
proto_tree_add_item(eiss_tree, hf_eiss_last_section_number, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
|
@ -337,9 +333,7 @@ dissect_eiss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
eiss_application_type = tvb_get_ntohs(tvb, offset);
|
||||
pi = proto_tree_add_item(eiss_tree, hf_eiss_application_type, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
if (8 != eiss_application_type) {
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid application_type (must be 0x0008)");
|
||||
expert_add_info(pinfo, pi, &ei_eiss_application_type);
|
||||
}
|
||||
offset += 2;
|
||||
proto_tree_add_item(eiss_tree, hf_eiss_organisation_id, tvb, offset, 4, ENC_BIG_ENDIAN);
|
||||
|
@ -350,9 +344,7 @@ dissect_eiss(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
platform_id_length = tvb_get_guint8(tvb, offset);
|
||||
pi = proto_tree_add_item(eiss_tree, hf_eiss_platform_id_length, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
if (0 != platform_id_length % 15) {
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid platform_id_length (must be a multiple of sizeof(etv_bif_platform_ids) == 15)");
|
||||
expert_add_info(pinfo, pi, &ei_eiss_platform_id_length);
|
||||
}
|
||||
offset++;
|
||||
|
||||
|
@ -572,10 +564,24 @@ proto_register_eiss(void)
|
|||
&ett_eiss_desc,
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_eiss_unknown_descriptor, { "eiss.unknown_descriptor", PI_MALFORMED, PI_ERROR, "Unknown Descriptor", EXPFILL }},
|
||||
{ &ei_eiss_invalid_section_syntax_indicator, { "eiss.invalid_section_syntax_indicator", PI_MALFORMED, PI_ERROR, "Invalid section_syntax_indicator (should be 0)", EXPFILL }},
|
||||
{ &ei_eiss_invalid_reserved_bits, { "eiss.invalid_reserved_bits", PI_MALFORMED, PI_ERROR, "Invalid reserved bits", EXPFILL }},
|
||||
{ &ei_eiss_invalid_section_length, { "eiss.invalid_section_length", PI_MALFORMED, PI_ERROR, "Invalid section_length (must not exceed 1021)", EXPFILL }},
|
||||
{ &ei_eiss_section_number, { "eiss.sect_num.invalid", PI_MALFORMED, PI_ERROR, "Invalid section_number (must be <= last_section_number)", EXPFILL }},
|
||||
{ &ei_eiss_application_type, { "eiss.app_type.invalid", PI_MALFORMED, PI_ERROR, "Invalid application_type (must be 0x0008)", EXPFILL }},
|
||||
{ &ei_eiss_platform_id_length, { "eiss.platform_id_length.invalid", PI_MALFORMED, PI_ERROR, "Invalid platform_id_length (must be a multiple of sizeof(etv_bif_platform_ids) == 15)", EXPFILL }},
|
||||
};
|
||||
|
||||
expert_module_t* expert_eiss;
|
||||
|
||||
proto_eiss = proto_register_protocol("ETV-AM EISS Section", "ETV-AM EISS", "eiss");
|
||||
|
||||
proto_register_field_array(proto_eiss, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
expert_eiss = expert_register_protocol(proto_eiss);
|
||||
expert_register_field_array(expert_eiss, ei, array_length(ei));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -273,6 +273,10 @@ static gint ett_erf_mc_aal2 = -1;
|
|||
static gint ett_erf_aal2 = -1;
|
||||
static gint ett_erf_eth = -1;
|
||||
|
||||
static expert_field ei_erf_extension_headers_not_shown = EI_INIT;
|
||||
static expert_field ei_erf_packet_loss = EI_INIT;
|
||||
static expert_field ei_erf_checksum_error = EI_INIT;
|
||||
|
||||
/* Default subdissector, display raw hex data */
|
||||
static dissector_handle_t data_handle;
|
||||
|
||||
|
@ -849,27 +853,27 @@ dissect_mc_hdlc_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_res2, tvb, 0, 0, mc_hdlc->byte2);
|
||||
pi=proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_fcse, tvb, 0, 0, mc_hdlc->byte3);
|
||||
if (mc_hdlc->byte3 & MC_HDLC_FCSE_MASK)
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF MC FCS Error");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF MC FCS Error");
|
||||
|
||||
pi=proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_sre, tvb, 0, 0, mc_hdlc->byte3);
|
||||
if (mc_hdlc->byte3 & MC_HDLC_SRE_MASK)
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF MC Short Record Error, <5 bytes");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF MC Short Record Error, <5 bytes");
|
||||
|
||||
pi=proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_lre, tvb, 0, 0, mc_hdlc->byte3);
|
||||
if (mc_hdlc->byte3 & MC_HDLC_LRE_MASK)
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF MC Long Record Error, >2047 bytes");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF MC Long Record Error, >2047 bytes");
|
||||
|
||||
pi=proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_afe, tvb, 0, 0, mc_hdlc->byte3);
|
||||
if (mc_hdlc->byte3 & MC_HDLC_AFE_MASK)
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF MC Aborted Frame Error");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF MC Aborted Frame Error");
|
||||
|
||||
pi=proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_oe, tvb, 0, 0, mc_hdlc->byte3);
|
||||
if (mc_hdlc->byte3 & MC_HDLC_OE_MASK)
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF MC Octet Error, the closing flag was not octet aligned after bit unstuffing");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF MC Octet Error, the closing flag was not octet aligned after bit unstuffing");
|
||||
|
||||
pi=proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_lbe, tvb, 0, 0, mc_hdlc->byte3);
|
||||
if (mc_hdlc->byte3 & MC_HDLC_LBE_MASK)
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF MC Lost Byte Error");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF MC Lost Byte Error");
|
||||
|
||||
proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_first, tvb, 0, 0, mc_hdlc->byte3);
|
||||
proto_tree_add_uint(mc_hdlc_tree, hf_erf_mc_hdlc_res3, tvb, 0, 0, mc_hdlc->byte3);
|
||||
|
@ -1081,19 +1085,19 @@ dissect_erf_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
pi=proto_tree_add_uint(flags_tree, hf_erf_flags_trunc, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.flags);
|
||||
if (pinfo->pseudo_header->erf.phdr.flags & ERF_HDR_TRUNC_MASK) {
|
||||
proto_item_append_text(flags_item, "; ERF Truncation Error");
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF Truncation Error");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF Truncation Error");
|
||||
}
|
||||
|
||||
pi=proto_tree_add_uint(flags_tree, hf_erf_flags_rxe, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.flags);
|
||||
if (pinfo->pseudo_header->erf.phdr.flags & ERF_HDR_RXE_MASK) {
|
||||
proto_item_append_text(flags_item, "; ERF Rx Error");
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF Rx Error");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF Rx Error");
|
||||
}
|
||||
|
||||
pi=proto_tree_add_uint(flags_tree, hf_erf_flags_dse, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.flags);
|
||||
if (pinfo->pseudo_header->erf.phdr.flags & ERF_HDR_DSE_MASK) {
|
||||
proto_item_append_text(flags_item, "; ERF DS Error");
|
||||
expert_add_info_format(pinfo, pi, PI_CHECKSUM, PI_ERROR, "ERF DS Error");
|
||||
expert_add_info_format_text(pinfo, pi, &ei_erf_checksum_error, "ERF DS Error");
|
||||
}
|
||||
proto_item_append_text(flags_item, ")");
|
||||
|
||||
|
@ -1102,7 +1106,7 @@ dissect_erf_pseudo_header(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
proto_tree_add_uint(tree, hf_erf_rlen, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.rlen);
|
||||
pi=proto_tree_add_uint(tree, hf_erf_lctr, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.lctr);
|
||||
if (pinfo->pseudo_header->erf.phdr.lctr > 0)
|
||||
expert_add_info_format(pinfo, pi, PI_SEQUENCE, PI_WARN, "Packet loss occurred between previous and current packet");
|
||||
expert_add_info(pinfo, pi, &ei_erf_packet_loss);
|
||||
|
||||
proto_tree_add_uint(tree, hf_erf_wlen, tvb, 0, 0, pinfo->pseudo_header->erf.phdr.wlen);
|
||||
}
|
||||
|
@ -1150,8 +1154,7 @@ dissect_erf_pseudo_extension_header(tvbuff_t *tvb, packet_info *pinfo, proto_tre
|
|||
i += 1;
|
||||
}
|
||||
if (has_more) {
|
||||
pi = proto_tree_add_text(tree, tvb, 0, 0, "More extension headers were present, not shown");
|
||||
expert_add_info_format(pinfo, pi, PI_SEQUENCE, PI_WARN, "Some of the extension headers are not shown");
|
||||
proto_tree_add_expert(tree, pinfo, &ei_erf_extension_headers_not_shown, tvb, 0, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1917,13 +1920,22 @@ proto_register_erf(void)
|
|||
{ NULL, NULL, 0 }
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_erf_checksum_error, { "erf.checksum.error", PI_CHECKSUM, PI_ERROR, "ERF MC FCS Error", EXPFILL }},
|
||||
{ &ei_erf_packet_loss, { "erf.packet_loss", PI_SEQUENCE, PI_WARN, "Packet loss occurred between previous and current packet", EXPFILL }},
|
||||
{ &ei_erf_extension_headers_not_shown, { "erf.ehdr.more_not_shown", PI_SEQUENCE, PI_WARN, "More extension headers were present, not shown", EXPFILL }},
|
||||
};
|
||||
|
||||
module_t *erf_module;
|
||||
expert_module_t* expert_erf;
|
||||
|
||||
proto_erf = proto_register_protocol("Extensible Record Format", "ERF", "erf");
|
||||
register_dissector("erf", dissect_erf, proto_erf);
|
||||
|
||||
proto_register_field_array(proto_erf, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
expert_erf = expert_register_protocol(proto_erf);
|
||||
expert_register_field_array(expert_erf, ei, array_length(ei));
|
||||
|
||||
erf_module = prefs_register_protocol(proto_erf, NULL);
|
||||
|
||||
|
|
|
@ -44,9 +44,19 @@ static dissector_handle_t dsmcc_handle;
|
|||
static int hf_etv_dii_filter_info = -1;
|
||||
static int hf_etv_dii_reserved = -1;
|
||||
|
||||
static expert_field ei_etv_dii_invalid_section_syntax_indicator = EI_INIT;
|
||||
static expert_field ei_etv_dii_invalid_section_length = EI_INIT;
|
||||
static expert_field ei_etv_dii_invalid_reserved_bits = EI_INIT;
|
||||
static expert_field ei_etv_dii_filter_info = EI_INIT;
|
||||
|
||||
static int hf_etv_ddb_filter_info = -1;
|
||||
static int hf_etv_ddb_reserved = -1;
|
||||
|
||||
static expert_field ei_etv_ddb_invalid_section_syntax_indicator = EI_INIT;
|
||||
static expert_field ei_etv_ddb_invalid_section_length = EI_INIT;
|
||||
static expert_field ei_etv_ddb_invalid_reserved_bits = EI_INIT;
|
||||
static expert_field ei_etv_ddb_filter_info = EI_INIT;
|
||||
|
||||
static gint ett_etv = -1;
|
||||
static gint ett_etv_payload = -1;
|
||||
|
||||
|
@ -55,7 +65,9 @@ static gint ett_etv_payload = -1;
|
|||
|
||||
static void
|
||||
dissect_etv_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int proto,
|
||||
int hf_filter_info, int hf_reserved )
|
||||
int hf_filter_info, int hf_reserved,
|
||||
expert_field* ei_section_syntax_indicator, expert_field* ei_reserved,
|
||||
expert_field* ei_section_length, expert_field* ei_filter_info)
|
||||
{
|
||||
tvbuff_t *sub_tvb;
|
||||
guint offset = 0;
|
||||
|
@ -80,8 +92,7 @@ dissect_etv_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int prot
|
|||
msg_error = items[PACKET_MPEG_SECT_PI__SSI];
|
||||
|
||||
PROTO_ITEM_SET_GENERATED(msg_error);
|
||||
expert_add_info_format(pinfo, msg_error, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid section_syntax_indicator (should be 0)");
|
||||
expert_add_info(pinfo, msg_error, ei_section_syntax_indicator);
|
||||
}
|
||||
|
||||
if (4 != reserved) {
|
||||
|
@ -89,8 +100,7 @@ dissect_etv_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int prot
|
|||
msg_error = items[PACKET_MPEG_SECT_PI__RESERVED];
|
||||
|
||||
PROTO_ITEM_SET_GENERATED(msg_error);
|
||||
expert_add_info_format(pinfo, msg_error, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid reserved1 bits (should all be 100)");
|
||||
expert_add_info(pinfo, msg_error, ei_reserved);
|
||||
}
|
||||
|
||||
col_append_fstr(pinfo->cinfo, COL_INFO, ", Length: %u", sect_len);
|
||||
|
@ -100,8 +110,7 @@ dissect_etv_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int prot
|
|||
msg_error = items[PACKET_MPEG_SECT_PI__LENGTH];
|
||||
|
||||
PROTO_ITEM_SET_GENERATED(msg_error);
|
||||
expert_add_info_format(pinfo, msg_error, PI_MALFORMED, PI_ERROR,
|
||||
"Invalid section_length (must not exceed 1021)");
|
||||
expert_add_info(pinfo, msg_error, ei_section_length);
|
||||
}
|
||||
|
||||
filter_info = tvb_get_ntohs(tvb, offset);
|
||||
|
@ -109,14 +118,12 @@ dissect_etv_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int prot
|
|||
proto_item_append_text(ti, " Filter=0x%x", filter_info);
|
||||
pi = proto_tree_add_item(etv_tree, hf_filter_info, tvb, offset, 2, ENC_BIG_ENDIAN);
|
||||
if ((proto_etv_dii == proto) && (0xFBFB != filter_info)) {
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, ei_filter_info,
|
||||
"Invalid filter_info value (must be 0xFBFB)");
|
||||
} else if ((proto_etv_ddb == proto) &&
|
||||
((filter_info < 1) || (0xfbef < filter_info)))
|
||||
{
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, ei_filter_info,
|
||||
"Invalid filter_info value (must be [0x0001-0xFBEF] inclusive)");
|
||||
}
|
||||
offset += 2;
|
||||
|
@ -124,8 +131,7 @@ dissect_etv_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int prot
|
|||
reserved2 = tvb_get_guint8(tvb, offset);
|
||||
pi = proto_tree_add_item(etv_tree, hf_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
|
||||
if (0 != reserved2) {
|
||||
PROTO_ITEM_SET_GENERATED(pi);
|
||||
expert_add_info_format(pinfo, pi, PI_MALFORMED, PI_ERROR,
|
||||
expert_add_info_format_text(pinfo, pi, ei_reserved,
|
||||
"Invalid reserved2 bits (should all be 0)");
|
||||
}
|
||||
offset += 1;
|
||||
|
@ -144,8 +150,11 @@ dissect_etv_ddb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
{
|
||||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ETV-DDB");
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "ETV DDB");
|
||||
|
||||
dissect_etv_common(tvb, pinfo, tree, proto_etv_ddb, hf_etv_ddb_filter_info,
|
||||
hf_etv_ddb_reserved);
|
||||
hf_etv_ddb_reserved, &ei_etv_ddb_invalid_section_syntax_indicator,
|
||||
&ei_etv_ddb_invalid_reserved_bits, &ei_etv_ddb_invalid_section_length,
|
||||
&ei_etv_ddb_filter_info);
|
||||
}
|
||||
|
||||
|
||||
|
@ -155,7 +164,9 @@ dissect_etv_dii(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
|
|||
col_set_str(pinfo->cinfo, COL_PROTOCOL, "ETV-DII");
|
||||
col_set_str(pinfo->cinfo, COL_INFO, "ETV DII");
|
||||
dissect_etv_common(tvb, pinfo, tree, proto_etv_dii, hf_etv_dii_filter_info,
|
||||
hf_etv_dii_reserved);
|
||||
hf_etv_dii_reserved, &ei_etv_dii_invalid_section_syntax_indicator,
|
||||
&ei_etv_dii_invalid_reserved_bits, &ei_etv_dii_invalid_section_length,
|
||||
&ei_etv_dii_filter_info);
|
||||
}
|
||||
|
||||
|
||||
|
@ -191,12 +202,33 @@ proto_register_etv(void)
|
|||
&ett_etv_payload
|
||||
};
|
||||
|
||||
static ei_register_info ei_ddb[] = {
|
||||
{ &ei_etv_ddb_invalid_section_syntax_indicator, { "etv-ddb.invalid_section_syntax_indicator", PI_MALFORMED, PI_ERROR, "Invalid section_syntax_indicator (should be 0)", EXPFILL }},
|
||||
{ &ei_etv_ddb_invalid_reserved_bits, { "etv-ddb.invalid_reserved_bits", PI_MALFORMED, PI_ERROR, "Invalid reserved bits", EXPFILL }},
|
||||
{ &ei_etv_ddb_invalid_section_length, { "etv-ddb.invalid_section_length", PI_MALFORMED, PI_ERROR, "Invalid section_length (must not exceed 1021)", EXPFILL }},
|
||||
{ &ei_etv_ddb_filter_info, { "etv-ddb.filter_info.invalid", PI_MALFORMED, PI_ERROR, "Invalid filter info", EXPFILL }},
|
||||
};
|
||||
|
||||
static ei_register_info ei_dii[] = {
|
||||
{ &ei_etv_dii_invalid_section_syntax_indicator, { "etv-dii.invalid_section_syntax_indicator", PI_MALFORMED, PI_ERROR, "Invalid section_syntax_indicator (should be 0)", EXPFILL }},
|
||||
{ &ei_etv_dii_invalid_reserved_bits, { "etv-dii.invalid_reserved_bits", PI_MALFORMED, PI_ERROR, "Invalid reserved bits", EXPFILL }},
|
||||
{ &ei_etv_dii_invalid_section_length, { "etv-dii.invalid_section_length", PI_MALFORMED, PI_ERROR, "Invalid section_length (must not exceed 1021)", EXPFILL }},
|
||||
{ &ei_etv_dii_filter_info, { "etv-dii.filter_info.invalid", PI_MALFORMED, PI_ERROR, "Invalid filter info", EXPFILL }},
|
||||
};
|
||||
|
||||
expert_module_t* expert_etv_dii;
|
||||
expert_module_t* expert_etv_ddb;
|
||||
|
||||
proto_etv_dii = proto_register_protocol("ETV-AM DII Section", "ETV-AM DII", "etv-dii");
|
||||
proto_etv_ddb = proto_register_protocol("ETV-AM DDB Section", "ETV-AM DDB", "etv-ddb");
|
||||
|
||||
proto_register_field_array(proto_etv_dii, hf_dii, array_length(hf_dii));
|
||||
proto_register_field_array(proto_etv_ddb, hf_ddb, array_length(hf_ddb));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
expert_etv_dii = expert_register_protocol(proto_etv_dii);
|
||||
expert_register_field_array(expert_etv_dii, ei_dii, array_length(ei_dii));
|
||||
expert_etv_ddb = expert_register_protocol(proto_etv_ddb);
|
||||
expert_register_field_array(expert_etv_ddb, ei_ddb, array_length(ei_ddb));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue