Skip to content

Commit

Permalink
Convert proto_item_set_expert_flags into filterable items.
Browse files Browse the repository at this point in the history
svn path=/trunk/; revision=51140
  • Loading branch information
mmann78 committed Aug 4, 2013
1 parent 1f9b980 commit af134c2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 15 deletions.
23 changes: 18 additions & 5 deletions asn1/h248/packet-h248-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ static int hf_h248_no_evt = -1;
static int hf_h248_param = -1;

static int hf_h248_serviceChangeReasonStr = -1;
static int hf_h248_transactionId64 = -1;
static int hf_h248_context_id64 = -1;

/* h248v1 support */
static int hf_h248_auditValueReplyV1 = -1;
Expand All @@ -89,6 +91,8 @@ static gcp_hf_ett_t h248_arrel = {{-1,-1,-1,-1,-1,-1},{-1,-1,-1,-1}};
#include "packet-h248-ett.c"

static expert_field ei_h248_errored_command = EI_INIT;
static expert_field ei_h248_transactionId64 = EI_INIT;
static expert_field ei_h248_context_id64 = EI_INIT;

static dissector_table_t subdissector_table;

Expand Down Expand Up @@ -813,8 +817,8 @@ static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset++;
}
if (trx_id > 0xffffffff) {
proto_item* pi = proto_tree_add_text(tree, tvb, offset-len, len,"transactionId %" G_GINT64_MODIFIER "u", trx_id);
proto_item_set_expert_flags(pi, PI_MALFORMED, PI_WARN);
proto_item* pi = proto_tree_add_uint64(tree, hf_h248_transactionId64, tvb, offset-len, len, trx_id);
expert_add_info(pinfo, pi, &ei_h248_transactionId64);

*trx_id_p = 0;

Expand Down Expand Up @@ -852,9 +856,8 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_
}

if (ctx_id > 0xffffffff) {
proto_item* pi = proto_tree_add_text(tree, tvb, offset-len, len,
"contextId: %" G_GINT64_MODIFIER "u", ctx_id);
proto_item_set_expert_flags(pi, PI_MALFORMED, PI_WARN);
proto_item* pi = proto_tree_add_uint64(tree, hf_h248_context_id64, tvb, offset-len, len, ctx_id);
expert_add_info(pinfo, pi, &ei_h248_context_id64);

*ctx_id_p = 0xfffffffd;

Expand Down Expand Up @@ -1561,6 +1564,14 @@ void proto_register_h248(void) {
{ "ServiceChangeReasonStr", "h248.serviceChangeReasonstr",
FT_STRING, BASE_NONE, NULL, 0,
"h248.IA5String", HFILL }},
{ &hf_h248_context_id64,
{ "contextId", "h248.contextId",
FT_UINT64, BASE_HEX, NULL, 0,
"Context ID", HFILL }},
{ &hf_h248_transactionId64,
{ "transactionId", "h248.transactionId",
FT_UINT64, BASE_DEC, NULL, 0,
NULL, HFILL }},

/* h248v1 support */
{ &hf_h248_auditValueReplyV1,
Expand Down Expand Up @@ -1591,6 +1602,8 @@ void proto_register_h248(void) {

static ei_register_info ei[] = {
{ &ei_h248_errored_command, { "h248.errored_command", PI_RESPONSE_CODE, PI_WARN, "Errored Command", EXPFILL }},
{ &ei_h248_transactionId64, { "h248.transactionId.error", PI_MALFORMED, PI_WARN, "Transaction ID invalid", EXPFILL }},
{ &ei_h248_context_id64, { "h248.contextId.error", PI_MALFORMED, PI_WARN, "Context ID invalid", EXPFILL }},
};

expert_module_t* expert_h248;
Expand Down
33 changes: 23 additions & 10 deletions epan/dissectors/packet-h248.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ static int hf_h248_no_evt = -1;
static int hf_h248_param = -1;

static int hf_h248_serviceChangeReasonStr = -1;
static int hf_h248_transactionId64 = -1;
static int hf_h248_context_id64 = -1;

/* h248v1 support */
static int hf_h248_auditValueReplyV1 = -1;
Expand Down Expand Up @@ -396,7 +398,7 @@ static int hf_h248_NotifyCompletion_otherReason = -1;
static int hf_h248_NotifyCompletion_onIteration = -1;

/*--- End of included file: packet-h248-hf.c ---*/
#line 73 "../../asn1/h248/packet-h248-template.c"
#line 75 "../../asn1/h248/packet-h248-template.c"

/* Initialize the subtree pointers */
static gint ett_h248 = -1;
Expand Down Expand Up @@ -561,9 +563,11 @@ static gint ett_h248_EventParameterV1 = -1;
static gint ett_h248_SigParameterV1 = -1;

/*--- End of included file: packet-h248-ett.c ---*/
#line 90 "../../asn1/h248/packet-h248-template.c"
#line 92 "../../asn1/h248/packet-h248-template.c"

static expert_field ei_h248_errored_command = EI_INIT;
static expert_field ei_h248_transactionId64 = EI_INIT;
static expert_field ei_h248_context_id64 = EI_INIT;

static dissector_table_t subdissector_table;

Expand Down Expand Up @@ -1288,8 +1292,8 @@ static int dissect_h248_trx_id(gboolean implicit_tag, packet_info *pinfo, proto_
offset++;
}
if (trx_id > 0xffffffff) {
proto_item* pi = proto_tree_add_text(tree, tvb, offset-len, len,"transactionId %" G_GINT64_MODIFIER "u", trx_id);
proto_item_set_expert_flags(pi, PI_MALFORMED, PI_WARN);
proto_item* pi = proto_tree_add_uint64(tree, hf_h248_transactionId64, tvb, offset-len, len, trx_id);
expert_add_info(pinfo, pi, &ei_h248_transactionId64);

*trx_id_p = 0;

Expand Down Expand Up @@ -1327,9 +1331,8 @@ static int dissect_h248_ctx_id(gboolean implicit_tag, packet_info *pinfo, proto_
}

if (ctx_id > 0xffffffff) {
proto_item* pi = proto_tree_add_text(tree, tvb, offset-len, len,
"contextId: %" G_GINT64_MODIFIER "u", ctx_id);
proto_item_set_expert_flags(pi, PI_MALFORMED, PI_WARN);
proto_item* pi = proto_tree_add_uint64(tree, hf_h248_context_id64, tvb, offset-len, len, ctx_id);
expert_add_info(pinfo, pi, &ei_h248_context_id64);

*ctx_id_p = 0xfffffffd;

Expand Down Expand Up @@ -5367,7 +5370,7 @@ dissect_h248_ValueV1(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U


/*--- End of included file: packet-h248-fn.c ---*/
#line 1410 "../../asn1/h248/packet-h248-template.c"
#line 1413 "../../asn1/h248/packet-h248-template.c"

static void dissect_h248_tpkt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
dissect_tpkt_encap(tvb, pinfo, tree, h248_desegment, h248_handle);
Expand Down Expand Up @@ -5522,6 +5525,14 @@ void proto_register_h248(void) {
{ "ServiceChangeReasonStr", "h248.serviceChangeReasonstr",
FT_STRING, BASE_NONE, NULL, 0,
"h248.IA5String", HFILL }},
{ &hf_h248_context_id64,
{ "contextId", "h248.contextId",
FT_UINT64, BASE_HEX, NULL, 0,
"Context ID", HFILL }},
{ &hf_h248_transactionId64,
{ "transactionId", "h248.transactionId",
FT_UINT64, BASE_DEC, NULL, 0,
NULL, HFILL }},

/* h248v1 support */
{ &hf_h248_auditValueReplyV1,
Expand Down Expand Up @@ -6786,7 +6797,7 @@ void proto_register_h248(void) {
NULL, HFILL }},

/*--- End of included file: packet-h248-hfarr.c ---*/
#line 1572 "../../asn1/h248/packet-h248-template.c"
#line 1583 "../../asn1/h248/packet-h248-template.c"

GCP_HF_ARR_ELEMS("h248",h248_arrel)

Expand Down Expand Up @@ -6952,11 +6963,13 @@ void proto_register_h248(void) {
&ett_h248_SigParameterV1,

/*--- End of included file: packet-h248-ettarr.c ---*/
#line 1590 "../../asn1/h248/packet-h248-template.c"
#line 1601 "../../asn1/h248/packet-h248-template.c"
};

static ei_register_info ei[] = {
{ &ei_h248_errored_command, { "h248.errored_command", PI_RESPONSE_CODE, PI_WARN, "Errored Command", EXPFILL }},
{ &ei_h248_transactionId64, { "h248.transactionId.error", PI_MALFORMED, PI_WARN, "Transaction ID invalid", EXPFILL }},
{ &ei_h248_context_id64, { "h248.contextId.error", PI_MALFORMED, PI_WARN, "Context ID invalid", EXPFILL }},
};

expert_module_t* expert_h248;
Expand Down

0 comments on commit af134c2

Please sign in to comment.