aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2011-09-26 17:50:54 +0000
committerAnders Broman <anders.broman@ericsson.com>2011-09-26 17:50:54 +0000
commit14fbabcb26b922d35d153ec8af8162649db41275 (patch)
tree70baaec7f49a0bc7032c6754a088812f38d7f5a3 /epan/dissectors
parent75b86a9cd453c39889b27b3701135f64062f41f9 (diff)
Get rid of check_col() and use ENC.
svn path=/trunk/; revision=39153
Diffstat (limited to 'epan/dissectors')
-rw-r--r--epan/dissectors/packet-mtp2.c3
-rw-r--r--epan/dissectors/packet-mtp3.c27
-rw-r--r--epan/dissectors/packet-mtp3mg.c38
-rw-r--r--epan/dissectors/packet-multipart.c7
-rw-r--r--epan/dissectors/packet-sccp.c71
-rw-r--r--epan/dissectors/packet-sccpmg.c36
-rw-r--r--epan/dissectors/packet-sigcomp.c64
-rw-r--r--epan/dissectors/packet-stun.c231
-rw-r--r--epan/dissectors/packet-sua.c20
-rw-r--r--epan/dissectors/packet-zrtp.c96
10 files changed, 270 insertions, 323 deletions
diff --git a/epan/dissectors/packet-mtp2.c b/epan/dissectors/packet-mtp2.c
index f44bcc45ef..82fe409eaa 100644
--- a/epan/dissectors/packet-mtp2.c
+++ b/epan/dissectors/packet-mtp2.c
@@ -266,8 +266,7 @@ dissect_mtp2_lssu(tvbuff_t *su_tvb, packet_info *pinfo, proto_item *mtp2_tree)
if ((tvb_get_guint8(su_tvb, LI_OFFSET) & LI_MASK) == 2)
proto_tree_add_item(mtp2_tree, hf_mtp2_sf_extra, su_tvb, sf_extra_offset, SF_EXTRA_LENGTH, ENC_LITTLE_ENDIAN);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(sf, status_field_acro_vals, "Unknown"));
+ col_set_str(pinfo->cinfo, COL_INFO, val_to_str_const(sf, status_field_acro_vals, "Unknown"));
}
static void
diff --git a/epan/dissectors/packet-mtp3.c b/epan/dissectors/packet-mtp3.c
index dfa3116ae6..bdc2962ef2 100644
--- a/epan/dissectors/packet-mtp3.c
+++ b/epan/dissectors/packet-mtp3.c
@@ -656,20 +656,19 @@ dissect_mtp3(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *mtp3_tree = NULL;
/* Make entries in Protocol column on summary display */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- switch(mtp3_standard) {
- case ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Int. ITU)");
- break;
- case ANSI_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (ANSI)");
- break;
- case CHINESE_ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Chin. ITU)");
- break;
- case JAPAN_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Japan)");
- break;
+ switch(mtp3_standard) {
+ case ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Int. ITU)");
+ break;
+ case ANSI_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (ANSI)");
+ break;
+ case CHINESE_ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Chin. ITU)");
+ break;
+ case JAPAN_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3 (Japan)");
+ break;
};
if (tree) {
diff --git a/epan/dissectors/packet-mtp3mg.c b/epan/dissectors/packet-mtp3mg.c
index 922e456dee..4585f760e4 100644
--- a/epan/dissectors/packet-mtp3mg.c
+++ b/epan/dissectors/packet-mtp3mg.c
@@ -466,7 +466,6 @@ static void
dissect_mtp3mg_chm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, chm_h1_message_type_acro_values, "Unknown"));
@@ -526,7 +525,6 @@ static void
dissect_mtp3mg_ecm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, ecm_h1_message_type_acro_values, "Unknown"));
@@ -553,7 +551,6 @@ dissect_mtp3mg_fcm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_item *apc_item;
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, fcm_h1_message_type_acro_values, "Unknown"));
@@ -644,7 +641,6 @@ dissect_mtp3mg_tfm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_item *apc_item;
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, tfm_h1_message_type_acro_values, "Unknown"));
@@ -730,7 +726,6 @@ dissect_mtp3mg_rsm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_item *apc_item;
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, rsm_h1_message_type_acro_values, "Unknown"));
@@ -821,7 +816,6 @@ static void
dissect_mtp3mg_mim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, mim_h1_message_type_acro_values, "Unknown"));
@@ -852,7 +846,6 @@ static void
dissect_mtp3mg_trm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, trm_h1_message_type_acro_values, "Unknown"));
@@ -876,7 +869,6 @@ static void
dissect_mtp3mg_dlm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
guint8 h1)
{
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, dlm_h1_message_type_acro_values, "Unknown"));
@@ -911,7 +903,6 @@ dissect_mtp3mg_ufc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
proto_item *apc_item;
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, ufc_h1_message_type_acro_values, "Unknown"));
@@ -984,7 +975,6 @@ dissect_mtp3mg_test(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
{
guint8 length;
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h1, test_h1_message_type_acro_values, "Unknown"));
@@ -1024,20 +1014,19 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *mtp3mg_tree = NULL;
/* Make entries in Protocol column on summary display */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- switch(mtp3_standard) {
- case ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Int. ITU)");
- break;
- case ANSI_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (ANSI)");
- break;
- case CHINESE_ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Chin. ITU)");
- break;
- case JAPAN_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Japan)");
- break;
+ switch(mtp3_standard) {
+ case ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Int. ITU)");
+ break;
+ case ANSI_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (ANSI)");
+ break;
+ case CHINESE_ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Chin. ITU)");
+ break;
+ case JAPAN_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "MTP3MG (Japan)");
+ break;
};
if (tree) {
@@ -1067,7 +1056,6 @@ dissect_mtp3mg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_item(mtp3mg_tree, hf_mtp3mg_japan_test, tvb,
JAPAN_SPARE_LENGTH, H0H1_LENGTH, ENC_NA);
- if (check_col(pinfo->cinfo, COL_INFO))
col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
val_to_str(h0h1, japan_test_message_type_acro_values, "Unknown"));
diff --git a/epan/dissectors/packet-multipart.c b/epan/dissectors/packet-multipart.c
index 7a9e5ebc1b..91552bb1e4 100644
--- a/epan/dissectors/packet-multipart.c
+++ b/epan/dissectors/packet-multipart.c
@@ -601,7 +601,7 @@ process_body_part(proto_tree *tree, tvbuff_t *tvb, const guint8 *boundary,
gboolean last_field = FALSE;
if (tree) {
- ti = proto_tree_add_item(tree, hf_multipart_part, tvb, start, 0, FALSE);
+ ti = proto_tree_add_item(tree, hf_multipart_part, tvb, start, 0, ENC_BIG_ENDIAN);
subtree = proto_item_add_subtree(ti, ett_multipart_body);
}
/*
@@ -833,7 +833,7 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
if (tree) {
proto_item *type_ti;
ti = proto_tree_add_item(tree, proto_multipart,
- tvb, 0, -1, FALSE);
+ tvb, 0, -1, ENC_BIG_ENDIAN);
subtree = proto_item_add_subtree(ti, ett_multipart);
proto_item_append_text(ti, ", Type: %s, Boundary: \"%s\"",
m_info->type, m_info->boundary);
@@ -848,8 +848,7 @@ static void dissect_multipart(tvbuff_t *tvb, packet_info *pinfo,
* Make no entries in Protocol column and Info column on summary display,
* but stop sub-dissectors from clearing entered text in summary display.
*/
- if (check_col(pinfo->cinfo, COL_INFO))
- col_set_fence(pinfo->cinfo, COL_INFO);
+ col_set_fence(pinfo->cinfo, COL_INFO);
/*
* Process the multipart preamble
diff --git a/epan/dissectors/packet-sccp.c b/epan/dissectors/packet-sccp.c
index 92da1f7143..373ec0afd0 100644
--- a/epan/dissectors/packet-sccp.c
+++ b/epan/dissectors/packet-sccp.c
@@ -1042,7 +1042,7 @@ dissect_sccp_dlr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin
lr_item = proto_tree_add_uint(tree, hf_sccp_lr, tvb, 0, length, dlr);
PROTO_ITEM_SET_HIDDEN(lr_item);
- if (show_key_params && check_col(pinfo->cinfo, COL_INFO))
+ if (show_key_params)
col_append_fstr(pinfo->cinfo, COL_INFO, "DLR=%d ", dlr);
}
@@ -1063,7 +1063,7 @@ dissect_sccp_slr_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, guin
lr_item = proto_tree_add_uint(tree, hf_sccp_lr, tvb, 0, length, slr);
PROTO_ITEM_SET_HIDDEN(lr_item);
- if (show_key_params && check_col(pinfo->cinfo, COL_INFO))
+ if (show_key_params)
col_append_fstr(pinfo->cinfo, COL_INFO, "SLR=%d ", slr);
}
@@ -1365,7 +1365,7 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, packet_info *
}
proto_tree_add_item(call_tree, called ? hf_sccp_called_itu_pc
: hf_sccp_calling_itu_pc,
- tvb, offset, ITU_PC_LENGTH, TRUE);
+ tvb, offset, ITU_PC_LENGTH, ENC_LITTLE_ENDIAN);
offset += ITU_PC_LENGTH;
} else if (decode_mtp3_standard == JAPAN_STANDARD) {
@@ -1378,7 +1378,7 @@ dissect_sccp_called_calling_param(tvbuff_t *tvb, proto_tree *tree, packet_info *
}
proto_tree_add_item(call_tree, called ? hf_sccp_called_japan_pc
: hf_sccp_calling_japan_pc,
- tvb, offset, JAPAN_PC_LENGTH, TRUE);
+ tvb, offset, JAPAN_PC_LENGTH, ENC_LITTLE_ENDIAN);
offset += JAPAN_PC_LENGTH;
@@ -1621,7 +1621,7 @@ dissect_sccp_segmenting_reassembling_param(tvbuff_t *tvb, packet_info *pinfo, pr
return;
}
- proto_tree_add_item(tree, hf_sccp_more, tvb, 0, length, FALSE);
+ proto_tree_add_item(tree, hf_sccp_more, tvb, 0, length, ENC_BIG_ENDIAN);
}
static void
@@ -1697,7 +1697,7 @@ dissect_sccp_release_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
cause = tvb_get_guint8(tvb, 0);
proto_tree_add_uint(tree, hf_sccp_release_cause, tvb, 0, length, cause);
- if (show_key_params && check_col(pinfo->cinfo, COL_INFO))
+ if (show_key_params)
col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause);
}
@@ -1717,7 +1717,7 @@ dissect_sccp_return_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
cause = tvb_get_guint8(tvb, 0);
proto_tree_add_uint(tree, hf_sccp_return_cause, tvb, 0, length, cause);
- if (show_key_params && check_col(pinfo->cinfo, COL_INFO))
+ if (show_key_params)
col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause);
}
@@ -1737,7 +1737,7 @@ dissect_sccp_reset_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
cause = tvb_get_guint8(tvb, 0);
proto_tree_add_uint(tree, hf_sccp_reset_cause, tvb, 0, length, cause);
- if (show_key_params && check_col(pinfo->cinfo, COL_INFO))
+ if (show_key_params)
col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause);
}
@@ -1757,7 +1757,7 @@ dissect_sccp_error_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tr
cause = tvb_get_guint8(tvb, 0);
proto_tree_add_uint(tree, hf_sccp_error_cause, tvb, 0, length, cause);
- if (show_key_params && check_col(pinfo->cinfo, COL_INFO))
+ if (show_key_params)
col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause);
}
@@ -1777,7 +1777,7 @@ dissect_sccp_refusal_cause_param(tvbuff_t *tvb, packet_info *pinfo, proto_tree *
cause = tvb_get_guint8(tvb, 0);
proto_tree_add_uint(tree, hf_sccp_refusal_cause, tvb, 0, length, cause);
- if (show_key_params && check_col(pinfo->cinfo, COL_INFO))
+ if (show_key_params)
col_append_fstr(pinfo->cinfo, COL_INFO, "Cause=%d ", cause);
}
@@ -2245,17 +2245,15 @@ dissect_sccp_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccp_tree,
message_type = tvb_get_guint8(tvb, SCCP_MSG_TYPE_OFFSET);
offset = SCCP_MSG_TYPE_LENGTH;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- /* Do not change col_add_fstr() to col_append_fstr() here: we _want_
- * this call to overwrite whatever's currently in the INFO column (e.g.,
- * "DATA" from the SCTP dissector).
- *
- * If there's something there that should not be overwritten, whoever
- * put that info there should call col_set_fence() to protect it.
- */
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
- val_to_str(message_type, sccp_message_type_acro_values, "Unknown: %d"));
- };
+ /* Do not change col_add_fstr() to col_append_fstr() here: we _want_
+ * this call to overwrite whatever's currently in the INFO column (e.g.,
+ * "DATA" from the SCTP dissector).
+ *
+ * If there's something there that should not be overwritten, whoever
+ * put that info there should call col_set_fence() to protect it.
+ */
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ",
+ val_to_str(message_type, sccp_message_type_acro_values, "Unknown: %d"));
if (sccp_tree) {
/* add the message type to the protocol tree */
@@ -2868,27 +2866,26 @@ dissect_sccp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
}
/* Make entry in the Protocol column on summary display */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- switch(decode_mtp3_standard) {
- case ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Int. ITU)");
- break;
- case ANSI_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (ANSI)");
- break;
- case CHINESE_ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Chin. ITU)");
- break;
- case JAPAN_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Japan)");
- break;
- };
+ switch(decode_mtp3_standard) {
+ case ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Int. ITU)");
+ break;
+ case ANSI_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (ANSI)");
+ break;
+ case CHINESE_ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Chin. ITU)");
+ break;
+ case JAPAN_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCP (Japan)");
+ break;
+ };
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
if (tree) {
/* create the sccp protocol tree */
- sccp_item = proto_tree_add_item(tree, proto_sccp, tvb, 0, -1, FALSE);
+ sccp_item = proto_tree_add_item(tree, proto_sccp, tvb, 0, -1, ENC_BIG_ENDIAN);
sccp_tree = proto_item_add_subtree(sccp_item, ett_sccp);
}
diff --git a/epan/dissectors/packet-sccpmg.c b/epan/dissectors/packet-sccpmg.c
index e8617c7a35..a95b15b29f 100644
--- a/epan/dissectors/packet-sccpmg.c
+++ b/epan/dissectors/packet-sccpmg.c
@@ -142,7 +142,7 @@ dissect_sccpmg_affected_ssn(tvbuff_t *tvb, proto_tree *sccpmg_tree)
{
proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_ssn, tvb,
SCCPMG_AFFECTED_SSN_OFFSET, SCCPMG_SSN_LENGTH,
- FALSE);
+ ENC_BIG_ENDIAN);
}
static void
@@ -152,10 +152,10 @@ dissect_sccpmg_affected_pc(tvbuff_t *tvb, proto_tree *sccpmg_tree)
if (mtp3_standard == ITU_STANDARD) {
proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_itu_pc, tvb,
- offset, ITU_PC_LENGTH, TRUE);
+ offset, ITU_PC_LENGTH, ENC_LITTLE_ENDIAN);
} else if (mtp3_standard == JAPAN_STANDARD) {
proto_tree_add_item(sccpmg_tree, hf_sccpmg_affected_japan_pc,
- tvb, offset, JAPAN_PC_LENGTH, TRUE);
+ tvb, offset, JAPAN_PC_LENGTH, ENC_LITTLE_ENDIAN);
} else /* ANSI_STANDARD and CHINESE_ITU_STANDARD */ {
int *hf_affected_pc;
@@ -188,7 +188,7 @@ dissect_sccpmg_smi(tvbuff_t *tvb, proto_tree *sccpmg_tree)
offset = ANSI_SCCPMG_SMI_OFFSET;
proto_tree_add_item(sccpmg_tree, hf_sccpmg_smi, tvb, offset,
- SCCPMG_SMI_LENGTH, FALSE);
+ SCCPMG_SMI_LENGTH, ENC_BIG_ENDIAN);
}
static void
@@ -202,7 +202,7 @@ dissect_sccpmg_congestion_level(tvbuff_t *tvb, proto_tree *sccpmg_tree)
offset = ITU_SCCPMG_CONGESTION_OFFSET;
proto_tree_add_item(sccpmg_tree, hf_sccpmg_congestion_level, tvb,
- offset, ITU_SCCPMG_CONGESTION_LENGTH, FALSE);
+ offset, ITU_SCCPMG_CONGESTION_LENGTH, ENC_BIG_ENDIAN);
}
static void
@@ -213,8 +213,7 @@ dissect_sccpmg_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sccpmg_tre
/* Extract the message type; all other processing is based on this */
message_type = tvb_get_guint8(tvb, SCCPMG_MESSAGE_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, sccpmg_message_type_acro_values, "Unknown"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_type, sccpmg_message_type_acro_values, "Unknown"));
if (sccpmg_tree) {
/* add the message type to the protocol tree */
@@ -265,18 +264,17 @@ dissect_sccpmg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *sccpmg_tree = NULL;
/* Make entry in the Protocol column on summary display */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- switch(mtp3_standard) {
- case ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (Int. ITU)");
- break;
- case ANSI_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (ANSI)");
- break;
- case CHINESE_ITU_STANDARD:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (Chin. ITU)");
- break;
- };
+ switch(mtp3_standard) {
+ case ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (Int. ITU)");
+ break;
+ case ANSI_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (ANSI)");
+ break;
+ case CHINESE_ITU_STANDARD:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SCCPMG (Chin. ITU)");
+ break;
+ };
/* In the interest of speed, if "tree" is NULL, don't do any work not
necessary to generate protocol tree items. */
diff --git a/epan/dissectors/packet-sigcomp.c b/epan/dissectors/packet-sigcomp.c
index 670c9a3675..4640e26b0f 100644
--- a/epan/dissectors/packet-sigcomp.c
+++ b/epan/dissectors/packet-sigcomp.c
@@ -415,7 +415,7 @@ dissect_sigcomp_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
try_again:
/* create display subtree for the protocol */
- ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, FALSE);
+ ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, ENC_BIG_ENDIAN);
sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp);
i=0;
end_off_message = FALSE;
@@ -531,7 +531,7 @@ dissect_sigcomp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
top_tree = tree;
/* create display subtree for the protocol */
- ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, FALSE);
+ ti = proto_tree_add_item(tree, proto_sigcomp, tvb, 0, -1, ENC_BIG_ENDIAN);
sigcomp_tree = proto_item_add_subtree(ti, ett_sigcomp);
return dissect_sigcomp_common(tvb, pinfo, sigcomp_tree);
@@ -634,8 +634,8 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
* Figure 1: SigComp NACK Message Format
*/
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_t_bit, tvb, offset, 1, FALSE);
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_len, tvb, offset, 1, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_t_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
tbit = ( octet & 0x04)>>2;
partial_state_len = octet & 0x03;
offset ++;
@@ -677,7 +677,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
if ( (octet & 0x80) != 0 ){
len = octet & 0x7f;
proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
tvb_memcpy(tvb,returned_feedback_field,offset, len);
} else {
@@ -762,7 +762,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
/* TODO Check if buff needs to be free'd */
udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace,
udvm2_tvb, 0, state_length,
- FALSE);
+ ENC_BIG_ENDIAN);
sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe);
decomp_tvb = decompress_sigcomp_message(udvm2_tvb, msg_tvb, pinfo,
@@ -784,10 +784,9 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
if ( display_raw_txt )
tvb_raw_text_add(decomp_tvb, top_tree);
- if (check_col(pinfo->cinfo, COL_PROTOCOL)){
- col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");
- col_set_fence(pinfo->cinfo,COL_PROTOCOL);
- }
+
+ col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");
+ col_set_fence(pinfo->cinfo,COL_PROTOCOL);
call_dissector(sip_handle, decomp_tvb, pinfo, top_tree);
}
}/* if decompress */
@@ -807,7 +806,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
if ( (octet & 0x80) != 0 ){
len = octet & 0x7f;
proto_tree_add_item(sigcomp_tree,hf_sigcomp_returned_feedback_item_len,
- tvb, offset, 1, FALSE);
+ tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
}
tvb_memcpy(tvb,returned_feedback_field,offset, len);
@@ -822,13 +821,13 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
proto_item *reason_ti;
guint8 opcode;
offset++;
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_ver, tvb, offset, 1, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
octet = tvb_get_guint8(tvb, offset);
- reason_ti = proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_reason_code, tvb, offset, 1, FALSE);
+ reason_ti = proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_reason_code, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
opcode = tvb_get_guint8(tvb, offset);
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_failed_op_code, tvb, offset, 1, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_failed_op_code, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
/* Add expert item for NACK */
@@ -837,32 +836,30 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"),
val_to_str(opcode, udvm_instruction_code_vals, "Unknown"));
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_pc, tvb, offset, 2, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_pc, tvb, offset, 2, ENC_BIG_ENDIAN);
offset = offset +2;
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_sha1, tvb, offset, 20, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_sha1, tvb, offset, 20, ENC_BIG_ENDIAN);
offset = offset +20;
/* Add NACK info to info column */
- if (check_col(pinfo->cinfo, COL_INFO)){
- col_append_fstr(pinfo->cinfo, COL_INFO, " NACK reason=%s, opcode=%s",
- val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"),
- val_to_str(opcode, udvm_instruction_code_vals, "Unknown"));
- }
+ col_append_fstr(pinfo->cinfo, COL_INFO, " NACK reason=%s, opcode=%s",
+ val_to_str(octet, sigcomp_nack_reason_code_vals, "Unknown"),
+ val_to_str(opcode, udvm_instruction_code_vals, "Unknown"));
switch ( octet){
case SIGCOMP_NACK_STATE_NOT_FOUND:
case SIGCOMP_NACK_ID_NOT_UNIQUE:
case SIGCOMP_NACK_STATE_TOO_SHORT:
/* State ID (6 - 20 bytes) */
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_state_id, tvb, offset, -1, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_state_id, tvb, offset, -1, ENC_BIG_ENDIAN);
break;
case SIGCOMP_NACK_CYCLES_EXHAUSTED:
/* Cycles Per Bit (1 byte) */
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_cycles_per_bit, tvb, offset, 1, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_cycles_per_bit, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case SIGCOMP_NACK_BYTECODES_TOO_LARGE:
/* Memory size (2 bytes) */
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_memory_size, tvb, offset, 2, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_nack_memory_size, tvb, offset, 2, ENC_BIG_ENDIAN);
break;
default:
break;
@@ -872,14 +869,14 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
destination = (octet & 0x0f);
if ( destination != 0 )
destination = 64 + ( destination * 64 );
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_code_len, tvb, offset, 2, FALSE);
- proto_tree_add_item(sigcomp_tree,hf_sigcomp_destination, tvb, (offset+ 1), 1, FALSE);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_code_len, tvb, offset, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(sigcomp_tree,hf_sigcomp_destination, tvb, (offset+ 1), 1, ENC_BIG_ENDIAN);
offset = offset +2;
bytecode_len = len;
bytecode_offset = offset;
udvm_bytecode_item = proto_tree_add_item(sigcomp_tree, hf_sigcomp_udvm_bytecode, tvb,
- bytecode_offset, bytecode_len, FALSE);
+ bytecode_offset, bytecode_len, ENC_BIG_ENDIAN);
proto_item_append_text(udvm_bytecode_item,
" %u (0x%x) bytes", bytecode_len, bytecode_len);
sigcomp_udvm_tree = proto_item_add_subtree( udvm_bytecode_item, ett_sigcomp_udvm);
@@ -902,7 +899,7 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
udvm_exe_item = proto_tree_add_item(sigcomp_tree, hf_udvm_execution_trace,
tvb, bytecode_offset, bytecode_len,
- FALSE);
+ ENC_BIG_ENDIAN);
sigcomp_udvm_exe_tree = proto_item_add_subtree( udvm_exe_item, ett_sigcomp_udvm_exe);
decomp_tvb = decompress_sigcomp_message(udvm_tvb, msg_tvb, pinfo,
sigcomp_udvm_exe_tree, destination,
@@ -921,10 +918,9 @@ dissect_sigcomp_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *sigcomp_tr
if ( display_raw_txt )
tvb_raw_text_add(decomp_tvb, top_tree);
- if (check_col(pinfo->cinfo, COL_PROTOCOL)){
- col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");
- col_set_fence(pinfo->cinfo,COL_PROTOCOL);
- }
+
+ col_append_str(pinfo->cinfo, COL_PROTOCOL, "/");
+ col_set_fence(pinfo->cinfo,COL_PROTOCOL);
call_dissector(sip_handle, decomp_tvb, pinfo, top_tree);
}
} /* if decompress */
@@ -999,7 +995,7 @@ dissect_udvm_bytecode(tvbuff_t *udvm_tvb, proto_tree *sigcomp_udvm_tree,guint st
"######### UDVM instruction %u at UDVM-address %u (0x%x) #########",
instruction_no,UDVM_address,UDVM_address);
PROTO_ITEM_SET_GENERATED(item);
- proto_tree_add_item(sigcomp_udvm_tree, hf_sigcomp_udvm_instr, udvm_tvb, offset, 1, FALSE);
+ proto_tree_add_item(sigcomp_udvm_tree, hf_sigcomp_udvm_instr, udvm_tvb, offset, 1, ENC_BIG_ENDIAN);
offset ++;
switch ( instruction ) {
@@ -2232,7 +2228,7 @@ tvb_raw_text_add(tvbuff_t *tvb, proto_tree *tree)
int offset, next_offset, linelen;
if(tree) {
- ti = proto_tree_add_item(tree, proto_raw_sigcomp, tvb, 0, -1, FALSE);
+ ti = proto_tree_add_item(tree, proto_raw_sigcomp, tvb, 0, -1, ENC_BIG_ENDIAN);
raw_tree = proto_item_add_subtree(ti, ett_raw_text);
}
diff --git a/epan/dissectors/packet-stun.c b/epan/dissectors/packet-stun.c
index cddd0f5e4e..06f1a60241 100644
--- a/epan/dissectors/packet-stun.c
+++ b/epan/dissectors/packet-stun.c
@@ -360,11 +360,11 @@ dissect_stun_message_channel_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree
ti = proto_tree_add_item(
tree, proto_stun, tvb, 0,
CHANNEL_DATA_HDR_LEN,
- FALSE);
+ ENC_BIG_ENDIAN);
proto_item_append_text(ti, ", TURN ChannelData Message");
stun_tree = proto_item_add_subtree(ti, ett_stun);
- proto_tree_add_item(stun_tree, hf_stun_channel, tvb, 0, 2, FALSE);
- proto_tree_add_item(stun_tree, hf_stun_length, tvb, 2, 2, FALSE);
+ proto_tree_add_item(stun_tree, hf_stun_channel, tvb, 0, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(stun_tree, hf_stun_length, tvb, 2, 2, ENC_BIG_ENDIAN);
}
next_tvb = tvb_new_subset_remaining(tvb, CHANNEL_DATA_HDR_LEN);
@@ -508,12 +508,10 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
msg_class_str = val_to_str_const(msg_type_class, classes, "Unknown");
msg_method_str = val_to_str_const(msg_type_method, methods, "Unknown");
- if(check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
- msg_method_str, msg_class_str);
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s %s",
+ msg_method_str, msg_class_str);
- ti = proto_tree_add_item(tree, proto_stun, tvb, 0, -1, FALSE);
+ ti = proto_tree_add_item(tree, proto_stun, tvb, 0, -1, ENC_BIG_ENDIAN);
stun_tree = proto_item_add_subtree(ti, ett_stun);
@@ -576,9 +574,9 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
(msg_type & 0x2000) >> 13);
PROTO_ITEM_SET_GENERATED(ti);
- proto_tree_add_item(stun_tree, hf_stun_length, tvb, 2, 2, FALSE);
- proto_tree_add_item(stun_tree, hf_stun_cookie, tvb, 4, 4, FALSE);
- proto_tree_add_item(stun_tree, hf_stun_id, tvb, 8, 12, FALSE);
+ proto_tree_add_item(stun_tree, hf_stun_length, tvb, 2, 2, ENC_BIG_ENDIAN);
+ proto_tree_add_item(stun_tree, hf_stun_cookie, tvb, 4, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(stun_tree, hf_stun_id, tvb, 8, 12, ENC_BIG_ENDIAN);
/* Remember this (in host order) so we can show clear xor'd addresses */
magic_cookie_first_word = tvb_get_ntohl(tvb, 4);
@@ -586,7 +584,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
if (msg_length != 0) {
guint offset;
- ti = proto_tree_add_item(stun_tree, hf_stun_attributes, tvb, STUN_HDR_LEN, msg_length, FALSE);
+ ti = proto_tree_add_item(stun_tree, hf_stun_attributes, tvb, STUN_HDR_LEN, msg_length, ENC_BIG_ENDIAN);
att_all_tree = proto_item_add_subtree(ti, ett_stun_att_all);
offset = STUN_HDR_LEN;
@@ -638,37 +636,35 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(att_tree, stun_att_reserved, tvb, offset, 1, 1);
if (att_length < 2)
break;
- proto_tree_add_item(att_tree, stun_att_family, tvb, offset+1, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_family, tvb, offset+1, 1, ENC_BIG_ENDIAN);
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_port, tvb, offset+2, 2, FALSE);
+ proto_tree_add_item(att_tree, stun_att_port, tvb, offset+2, 2, ENC_BIG_ENDIAN);
switch (tvb_get_guint8(tvb, offset+1)) {
case 1:
if (att_length < 8)
break;
- proto_tree_add_item(att_tree, stun_att_ipv4, tvb, offset+4, 4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_ipv4, tvb, offset+4, 4, ENC_BIG_ENDIAN);
{
const gchar *ipstr;
guint32 ip;
ip = tvb_get_ipv4(tvb,offset+4);
ipstr = ip_to_str((guint8*)&ip);
proto_item_append_text(att_tree, ": %s:%d", ipstr,tvb_get_ntohs(tvb,offset+2));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " %s: %s:%d",
- val_to_str(att_type, attributes, "Unknown"),
- ipstr,
- tvb_get_ntohs(tvb,offset+2)
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " %s: %s:%d",
+ val_to_str(att_type, attributes, "Unknown"),
+ ipstr,
+ tvb_get_ntohs(tvb,offset+2)
+ );
}
break;
case 2:
if (att_length < 20)
break;
- proto_tree_add_item(att_tree, stun_att_ipv6, tvb, offset+4, 16, FALSE);
+ proto_tree_add_item(att_tree, stun_att_ipv6, tvb, offset+4, 16, ENC_BIG_ENDIAN);
break;
}
break;
@@ -676,20 +672,18 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case CHANGE_REQUEST:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_change_ip, tvb, offset, 4, FALSE);
- proto_tree_add_item(att_tree, stun_att_change_port, tvb, offset, 4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_change_ip, tvb, offset, 4, ENC_BIG_ENDIAN);
+ proto_tree_add_item(att_tree, stun_att_change_port, tvb, offset, 4, ENC_BIG_ENDIAN);
break;
case USERNAME:
- proto_tree_add_item(att_tree, stun_att_username, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_username, tvb, offset, att_length, ENC_BIG_ENDIAN);
proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " user: %s",
- tvb_get_ephemeral_string(tvb,offset, att_length)
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " user: %s",
+ tvb_get_ephemeral_string(tvb,offset, att_length)
+ );
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding,
tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
@@ -698,7 +692,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case MESSAGE_INTEGRITY:
if (att_length < 20)
break;
- proto_tree_add_item(att_tree, stun_att_hmac, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_hmac, tvb, offset, att_length, ENC_BIG_ENDIAN);
break;
case ERROR_CODE:
@@ -707,10 +701,10 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(att_tree, stun_att_reserved, tvb, offset, 2, 2);
if (att_length < 3)
break;
- proto_tree_add_item(att_tree, stun_att_error_class, tvb, offset+2, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_error_class, tvb, offset+2, 1, ENC_BIG_ENDIAN);
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_error_number, tvb, offset+3, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_error_number, tvb, offset+3, 1, ENC_BIG_ENDIAN);
{
int human_error_num = tvb_get_guint8(tvb, offset+2) * 100 + tvb_get_guint8(tvb, offset+3);
proto_item_append_text(
@@ -719,27 +713,24 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
human_error_num, /* human readable error code */
val_to_str(human_error_num, error_code, "*Unknown error code*")
);
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " error-code: %d (%s)",
- human_error_num,
- val_to_str(human_error_num, error_code, "*Unknown error code*")
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " error-code: %d (%s)",
+ human_error_num,
+ val_to_str(human_error_num, error_code, "*Unknown error code*")
+ );
}
if (att_length < 5)
break;
- proto_tree_add_item(att_tree, stun_att_error_reason, tvb, offset+4, att_length-4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_error_reason, tvb, offset+4, att_length-4, ENC_BIG_ENDIAN);
proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset+4, att_length-4));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " %s",
- tvb_get_ephemeral_string(tvb, offset+4, att_length-4)
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " %s",
+ tvb_get_ephemeral_string(tvb, offset+4, att_length-4)
+ );
+
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
@@ -747,34 +738,30 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case UNKNOWN_ATTRIBUTES:
for (i = 0; i < att_length; i += 2)
- proto_tree_add_item(att_tree, stun_att_unknown, tvb, offset+i, 2, FALSE);
+ proto_tree_add_item(att_tree, stun_att_unknown, tvb, offset+i, 2, ENC_BIG_ENDIAN);
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
break;
case REALM:
- proto_tree_add_item(att_tree, stun_att_realm, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_realm, tvb, offset, att_length, ENC_BIG_ENDIAN);
proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " realm: %s",
- tvb_get_ephemeral_string(tvb,offset, att_length)
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " realm: %s",
+ tvb_get_ephemeral_string(tvb,offset, att_length)
+ );
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
break;
case NONCE:
- proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_nonce, tvb, offset, att_length, ENC_BIG_ENDIAN);
proto_item_append_text(att_tree, ": %s", tvb_get_ephemeral_string(tvb, offset, att_length));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " with nonce"
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " with nonce"
+ );
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
break;
@@ -789,10 +776,10 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_uint(att_tree, stun_att_reserved, tvb, offset, 1, 1);
if (att_length < 2)
break;
- proto_tree_add_item(att_tree, stun_att_family, tvb, offset+1, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_family, tvb, offset+1, 1, ENC_BIG_ENDIAN);
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_xor_port, tvb, offset+2, 2, FALSE);
+ proto_tree_add_item(att_tree, stun_att_xor_port, tvb, offset+2, 2, ENC_BIG_ENDIAN);
/* Show the port 'in the clear'
XOR (host order) transid with (host order) xor-port.
@@ -805,7 +792,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
switch (tvb_get_guint8(tvb, offset+1)) {
case 1:
- proto_tree_add_item(att_tree, stun_att_xor_ipv4, tvb, offset+4, 4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_xor_ipv4, tvb, offset+4, 4, ENC_BIG_ENDIAN);
/* Show the address 'in the clear'.
XOR (host order) transid with (host order) xor-address.
@@ -823,22 +810,20 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ipstr = ip_to_str((guint8*)&ip);
port = tvb_get_ntohs(tvb, offset+2) ^ (magic_cookie_first_word >> 16);
proto_item_append_text(att_tree, ": %s:%d", ipstr, port);
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " %s: %s:%d",
- val_to_str(att_type, attributes, "Unknown"),
- ipstr,
- port
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " %s: %s:%d",
+ val_to_str(att_type, attributes, "Unknown"),
+ ipstr,
+ port
+ );
}
break;
case 2:
if (att_length < 20)
break;
- proto_tree_add_item(att_tree, stun_att_xor_ipv6, tvb, offset+4, 16, FALSE);
+ proto_tree_add_item(att_tree, stun_att_xor_ipv6, tvb, offset+4, 16, ENC_BIG_ENDIAN);
{
guint32 IPv6[4];
IPv6[0] = g_htonl(tvb_get_ntohl(tvb, offset+4) ^ magic_cookie_first_word);
@@ -857,7 +842,7 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case REQUESTED_ADDRESS_TYPE:
if (att_length < 1)
break;
- proto_tree_add_item(att_tree, stun_att_family, tvb, offset, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_family, tvb, offset, 1, ENC_BIG_ENDIAN);
if (att_length < 4)
break;
proto_tree_add_uint(att_tree, stun_att_reserved, tvb, offset+1, 3, 3);
@@ -865,19 +850,19 @@ dissect_stun_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
case EVEN_PORT:
if (att_length < 1)
break;
- proto_tree_add_item(att_tree, stun_att_reserve_next, tvb, offset, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_reserve_next, tvb, offset, 1, ENC_BIG_ENDIAN);
break;
case RESERVATION_TOKEN:
if (att_length < 8)
break;
- proto_tree_add_item(att_tree, stun_att_token, tvb, offset, 8, FALSE);
+ proto_tree_add_item(att_tree, stun_att_token, tvb, offset, 8, ENC_BIG_ENDIAN);
break;
case PRIORITY:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_priority, tvb, offset, 4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_priority, tvb, offset, 4, ENC_BIG_ENDIAN);
break;
case PADDING:
@@ -887,12 +872,12 @@ case EVEN_PORT:
case ICMP:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_icmp_type, tvb, offset, 1, FALSE);
- proto_tree_add_item(att_tree, stun_att_icmp_code, tvb, offset+1, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_icmp_type, tvb, offset, 1, ENC_BIG_ENDIAN);
+ proto_tree_add_item(att_tree, stun_att_icmp_code, tvb, offset+1, 1, ENC_BIG_ENDIAN);
break;
case SOFTWARE:
- proto_tree_add_item(att_tree, stun_att_software, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_software, tvb, offset, att_length, ENC_BIG_ENDIAN);
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb, offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
break;
@@ -900,26 +885,26 @@ case EVEN_PORT:
case CACHE_TIMEOUT:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_cache_timeout, tvb, offset, 4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_cache_timeout, tvb, offset, 4, ENC_BIG_ENDIAN);
break;
case FINGERPRINT:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_crc32, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_crc32, tvb, offset, att_length, ENC_BIG_ENDIAN);
break;
case ICE_CONTROLLED:
case ICE_CONTROLLING:
if (att_length < 8)
break;
- proto_tree_add_item(att_tree, stun_att_tie_breaker, tvb, offset, 8, FALSE);
+ proto_tree_add_item(att_tree, stun_att_tie_breaker, tvb, offset, 8, ENC_BIG_ENDIAN);
break;
case DATA:
if (att_length > 0) {
tvbuff_t *next_tvb;
- proto_tree_add_item(att_tree, stun_att_value, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_value, tvb, offset, att_length, ENC_BIG_ENDIAN);
if (att_length % 4 != 0) {
guint pad;
pad = 4-(att_length % 4);
@@ -938,20 +923,18 @@ case EVEN_PORT:
case REQUESTED_TRANSPORT:
if (att_length < 1)
break;
- proto_tree_add_item(att_tree, stun_att_transp, tvb, offset, 1, FALSE);
+ proto_tree_add_item(att_tree, stun_att_transp, tvb, offset, 1, ENC_BIG_ENDIAN);
if (att_length < 4)
break;
{
guint8 protoCode = tvb_get_guint8(tvb, offset);
proto_item_append_text(att_tree, ": %s", val_to_str(protoCode, transportnames, "Unknown (0x%8x)"));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " %s",
- val_to_str(protoCode, transportnames, "Unknown (0x%8x)")
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " %s",
+ val_to_str(protoCode, transportnames, "Unknown (0x%8x)")
+ );
}
proto_tree_add_uint(att_tree, stun_att_reserved, tvb, offset+1, 3, 3);
break;
@@ -959,17 +942,15 @@ case EVEN_PORT:
case CHANNEL_NUMBER:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_channelnum, tvb, offset, 2, FALSE);
+ proto_tree_add_item(att_tree, stun_att_channelnum, tvb, offset, 2, ENC_BIG_ENDIAN);
{
guint16 chan = tvb_get_ntohs(tvb, offset);
proto_item_append_text(att_tree, ": 0x%x", chan);
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " ChannelNumber=0x%x",
- chan
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " ChannelNumber=0x%x",
+ chan
+ );
}
proto_tree_add_uint(att_tree, stun_att_reserved, tvb, offset+2, 2, 2);
break;
@@ -977,33 +958,29 @@ case EVEN_PORT:
case BANDWIDTH:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_bandwidth, tvb, offset, 4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_bandwidth, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_item_append_text(att_tree, " %d", tvb_get_ntohl(tvb, offset));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " bandwidth: %d",
- tvb_get_ntohl(tvb, offset)
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " bandwidth: %d",
+ tvb_get_ntohl(tvb, offset)
+ );
break;
case LIFETIME:
if (att_length < 4)
break;
- proto_tree_add_item(att_tree, stun_att_lifetime, tvb, offset, 4, FALSE);
+ proto_tree_add_item(att_tree, stun_att_lifetime, tvb, offset, 4, ENC_BIG_ENDIAN);
proto_item_append_text(att_tree, " %d", tvb_get_ntohl(tvb, offset));
- if(check_col(pinfo->cinfo,COL_INFO)) {
- col_append_fstr(
- pinfo->cinfo, COL_INFO,
- " lifetime: %d",
- tvb_get_ntohl(tvb, offset)
- );
- }
+ col_append_fstr(
+ pinfo->cinfo, COL_INFO,
+ " lifetime: %d",
+ tvb_get_ntohl(tvb, offset)
+ );
break;
default:
if (att_length > 0)
- proto_tree_add_item(att_tree, stun_att_value, tvb, offset, att_length, FALSE);
+ proto_tree_add_item(att_tree, stun_att_value, tvb, offset, att_length, ENC_BIG_ENDIAN);
if (att_length % 4 != 0)
proto_tree_add_uint(att_tree, stun_att_padding, tvb,
offset+att_length, 4-(att_length % 4), 4-(att_length % 4));
diff --git a/epan/dissectors/packet-sua.c b/epan/dissectors/packet-sua.c
index 81e012ef5d..4ca66b0392 100644
--- a/epan/dissectors/packet-sua.c
+++ b/epan/dissectors/packet-sua.c
@@ -520,8 +520,7 @@ dissect_common_header(tvbuff_t *common_header_tvb, packet_info *pinfo, proto_tre
message_class = tvb_get_guint8(common_header_tvb, MESSAGE_CLASS_OFFSET);
message_type = tvb_get_guint8(common_header_tvb, MESSAGE_TYPE_OFFSET);
- if (check_col(pinfo->cinfo, COL_INFO))
- col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
+ col_add_fstr(pinfo->cinfo, COL_INFO, "%s ", val_to_str(message_class * 256 + message_type, message_class_type_acro_values, "reserved"));
if (sua_tree) {
/* add the components of the common header to the protocol tree */
@@ -2216,15 +2215,14 @@ dissect_sua(tvbuff_t *message_tvb, packet_info *pinfo, proto_tree *tree)
proto_tree *sua_tree;
/* make entry in the Protocol column on summary display */
- if (check_col(pinfo->cinfo, COL_PROTOCOL))
- switch (version) {
- case SUA_V08:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SUA (ID 08)");
- break;
- case SUA_RFC:
- col_set_str(pinfo->cinfo, COL_PROTOCOL, "SUA (RFC 3868)");
- break;
- }
+
+ switch (version) {
+ case SUA_V08:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SUA (ID 08)");
+ break;
+ case SUA_RFC:
+ col_set_str(pinfo->cinfo, COL_PROTOCOL, "SUA (RFC 3868)");
+ break;
/* Clear entries in Info column on summary display */
col_clear(pinfo->cinfo, COL_INFO);
diff --git a/epan/dissectors/packet-zrtp.c b/epan/dissectors/packet-zrtp.c
index 5ce53ceddb..f8c71c8fb9 100644
--- a/epan/dissectors/packet-zrtp.c
+++ b/epan/dissectors/packet-zrtp.c
@@ -337,15 +337,15 @@ dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_protocol_format(tree,proto_zrtp,tvb,0,-1,"ZRTP protocol");
zrtp_tree = proto_item_add_subtree(ti,ett_zrtp);
- proto_tree_add_item(zrtp_tree,hf_zrtp_rtpversion,tvb,prime_offset+0,1,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_rtppadding,tvb,prime_offset+0,1,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_rtpextension,tvb,prime_offset+0,1,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_rtpversion,tvb,prime_offset+0,1,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_rtppadding,tvb,prime_offset+0,1,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_rtpextension,tvb,prime_offset+0,1,ENC_BIG_ENDIAN);
- proto_tree_add_item(zrtp_tree,hf_zrtp_sequence,tvb,prime_offset+2,2,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_sequence,tvb,prime_offset+2,2,ENC_BIG_ENDIAN);
- proto_tree_add_item(zrtp_tree,hf_zrtp_cookie,tvb,prime_offset+4,4,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_cookie,tvb,prime_offset+4,4,ENC_BIG_ENDIAN);
- proto_tree_add_item(zrtp_tree,hf_zrtp_source_id,tvb,prime_offset+8,4,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_source_id,tvb,prime_offset+8,4,ENC_BIG_ENDIAN);
linelen = tvb_reported_length_remaining(tvb,msg_offset);
checksum_offset = linelen-4;
@@ -353,13 +353,13 @@ dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
ti = proto_tree_add_protocol_format(zrtp_tree,proto_zrtp,tvb,msg_offset,linelen-4,"Message");
zrtp_msg_tree = proto_item_add_subtree(ti,ett_zrtp_msg);
- proto_tree_add_item(zrtp_msg_tree,hf_zrtp_signature,tvb,msg_offset+0,2,FALSE);
+ proto_tree_add_item(zrtp_msg_tree,hf_zrtp_signature,tvb,msg_offset+0,2,ENC_BIG_ENDIAN);
- proto_tree_add_item(zrtp_msg_tree,hf_zrtp_msg_length,tvb,msg_offset+2,2,FALSE);
+ proto_tree_add_item(zrtp_msg_tree,hf_zrtp_msg_length,tvb,msg_offset+2,2,ENC_BIG_ENDIAN);
tvb_memcpy(tvb,(void *)message_type,msg_offset+4,8);
message_type[8] = '\0';
- proto_tree_add_item(zrtp_msg_tree,hf_zrtp_msg_type,tvb,msg_offset+4,8,FALSE);
+ proto_tree_add_item(zrtp_msg_tree,hf_zrtp_msg_type,tvb,msg_offset+4,8,ENC_BIG_ENDIAN);
linelen = tvb_reported_length_remaining(tvb,msg_offset+12);
@@ -428,13 +428,13 @@ dissect_zrtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
checksum_tree = proto_item_add_subtree(ti, ett_zrtp_checksum);
ti = proto_tree_add_boolean(checksum_tree, hf_zrtp_checksum_good, tvb, msg_offset+checksum_offset, 4, TRUE);
PROTO_ITEM_SET_GENERATED(ti);
- ti = proto_tree_add_boolean(checksum_tree, hf_zrtp_checksum_bad, tvb, msg_offset+checksum_offset, 4, FALSE);
+ ti = proto_tree_add_boolean(checksum_tree, hf_zrtp_checksum_bad, tvb, msg_offset+checksum_offset, 4, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_GENERATED(ti);
} else {
ti = proto_tree_add_uint_format_value(zrtp_tree, hf_zrtp_checksum, tvb, msg_offset+checksum_offset, 4, sent_crc,
"0x%04x [incorrect, should be 0x%04x]", sent_crc, calc_crc);
checksum_tree = proto_item_add_subtree(ti, ett_zrtp_checksum);
- ti = proto_tree_add_boolean(checksum_tree, hf_zrtp_checksum_good, tvb, msg_offset+checksum_offset, 4, FALSE);
+ ti = proto_tree_add_boolean(checksum_tree, hf_zrtp_checksum_good, tvb, msg_offset+checksum_offset, 4, ENC_BIG_ENDIAN);
PROTO_ITEM_SET_GENERATED(ti);
ti = proto_tree_add_boolean(checksum_tree, hf_zrtp_checksum_bad, tvb, msg_offset+checksum_offset, 4, TRUE);
PROTO_ITEM_SET_GENERATED(ti);
@@ -494,8 +494,8 @@ dissect_Ping(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
col_set_str(pinfo->cinfo, COL_INFO, "Ping Packet");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_version,tvb,data_offset,4,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_endpointhash,tvb,data_offset+4,8,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_version,tvb,data_offset,4,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_endpointhash,tvb,data_offset+4,8,ENC_BIG_ENDIAN);
}
static void
@@ -504,10 +504,10 @@ dissect_PingACK(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
col_set_str(pinfo->cinfo, COL_INFO, "PingACK Packet");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_version,tvb,data_offset,4,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_pingack_endpointhash,tvb,data_offset+4,8,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_endpointhash,tvb,data_offset+12,8,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_ssrc,tvb,data_offset+20,4,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_version,tvb,data_offset,4,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_pingack_endpointhash,tvb,data_offset+4,8,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_endpointhash,tvb,data_offset+12,8,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_ping_ssrc,tvb,data_offset+20,4,ENC_BIG_ENDIAN);
}
static void
@@ -518,7 +518,7 @@ dissect_GoClear(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
/* Now we should clear the SRT(C)P session... */
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,ENC_BIG_ENDIAN);
}
static void
@@ -527,7 +527,7 @@ dissect_Error(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
col_set_str(pinfo->cinfo, COL_INFO, "Error Packet");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_error,tvb,data_offset,4,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_error,tvb,data_offset,4,ENC_BIG_ENDIAN);
}
static void
@@ -535,12 +535,10 @@ dissect_Confirm(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree,int par
unsigned int data_offset=24;
int linelen;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, (part == 1) ? "Confirm1 Packet" : "Confirm2 Packet");
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, (part == 1) ? "Confirm1 Packet" : "Confirm2 Packet");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_cfb,tvb,data_offset+8,16,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_cfb,tvb,data_offset+8,16,ENC_BIG_ENDIAN);
linelen = tvb_reported_length_remaining(tvb,data_offset+24);
proto_tree_add_protocol_format(zrtp_tree,proto_zrtp,tvb,data_offset+24,linelen-4,"Encrypted Data");
}
@@ -552,8 +550,8 @@ dissect_SASrelay(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
col_set_str(pinfo->cinfo, COL_INFO, "SASrelay Packet");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_cfb,tvb,data_offset+8,16,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+0,8,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_cfb,tvb,data_offset+8,16,ENC_BIG_ENDIAN);
linelen = tvb_reported_length_remaining(tvb,data_offset+24);
proto_tree_add_protocol_format(zrtp_tree,proto_zrtp,tvb,data_offset+24,linelen-4,"Encrypted Data");
}
@@ -564,19 +562,17 @@ dissect_DHPart(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree,int part
unsigned int data_offset=56;
int linelen, pvr_len;
- if (check_col(pinfo->cinfo, COL_INFO)) {
- col_add_fstr(pinfo->cinfo, COL_INFO, (part == 1) ? "DHPart1 Packet" : "DHPart2 Packet");
- }
+ col_add_fstr(pinfo->cinfo, COL_INFO, (part == 1) ? "DHPart1 Packet" : "DHPart2 Packet");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hash_image,tvb,msg_offset+12,32,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_rs1ID,tvb,data_offset+0,8,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_rs2ID,tvb,data_offset+8,8,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_auxs,tvb,data_offset+16,8,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_pbxs,tvb,data_offset+24,8,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hash_image,tvb,msg_offset+12,32,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_rs1ID,tvb,data_offset+0,8,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_rs2ID,tvb,data_offset+8,8,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_auxs,tvb,data_offset+16,8,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_pbxs,tvb,data_offset+24,8,ENC_BIG_ENDIAN);
linelen = tvb_reported_length_remaining(tvb,data_offset+32);
pvr_len = linelen-8-4;
proto_tree_add_protocol_format(zrtp_tree,proto_zrtp,tvb,data_offset+32,pvr_len,(part==1)?"pvr Data":"pvi Data");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+32+pvr_len,8,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+32+pvr_len,8,ENC_BIG_ENDIAN);
}
static void
@@ -594,9 +590,9 @@ dissect_Commit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
col_set_str(pinfo->cinfo, COL_INFO, "Commit Packet");
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hash_image,tvb,msg_offset+12,32,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hash_image,tvb,msg_offset+12,32,ENC_BIG_ENDIAN);
/* ZID */
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_zid,tvb,data_offset+0,12,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_zid,tvb,data_offset+0,12,ENC_BIG_ENDIAN);
tvb_memcpy(tvb,(void *)value,data_offset+12,4);
value[4]='\0';
proto_tree_add_string_format(zrtp_tree,hf_zrtp_msg_hash,tvb,data_offset+12,4,value,
@@ -628,25 +624,25 @@ dissect_Commit(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
case 1: /*
Mult
*/
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_nonce,tvb,data_offset+32,16,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_nonce,tvb,data_offset+32,16,ENC_BIG_ENDIAN);
offset = 48;
break;
case 2: /*
Prsh
*/
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_nonce,tvb,data_offset+32,16,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_key_id,tvb,data_offset+48,8,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_nonce,tvb,data_offset+32,16,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_key_id,tvb,data_offset+48,8,ENC_BIG_ENDIAN);
offset = 56;
break;
default: /*
other
*/
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hvi,tvb,data_offset+32, 32, FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hvi,tvb,data_offset+32, 32, ENC_BIG_ENDIAN);
offset = 64;
break;
}
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+offset,8,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,data_offset+offset,8,ENC_BIG_ENDIAN);
}
static void
@@ -670,13 +666,13 @@ dissect_Hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
if (check_valid_version(version_str) == NULL){
col_set_str(pinfo->cinfo, COL_INFO, "Unsupported version of ZRTP protocol");
}
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_version,tvb,msg_offset+12,4,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_client_id,tvb,msg_offset+16,16,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hash_image,tvb,msg_offset+32,32,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_zid,tvb,msg_offset+64,12,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_sigcap,tvb,data_offset+0,1,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_mitm,tvb,data_offset+0,1,FALSE);
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_passive,tvb,data_offset+0,1,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_version,tvb,msg_offset+12,4,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_client_id,tvb,msg_offset+16,16,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hash_image,tvb,msg_offset+32,32,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_zid,tvb,msg_offset+64,12,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_sigcap,tvb,data_offset+0,1,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_mitm,tvb,data_offset+0,1,ENC_BIG_ENDIAN);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_passive,tvb,data_offset+0,1,ENC_BIG_ENDIAN);
val_b = tvb_get_guint8(tvb,data_offset+1);
hc = val_b & 0x0F;
@@ -741,7 +737,7 @@ dissect_Hello(tvbuff_t *tvb, packet_info *pinfo, proto_tree *zrtp_tree) {
run_offset+=4;
}
- proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,run_offset,8,FALSE);
+ proto_tree_add_item(zrtp_tree,hf_zrtp_msg_hmac,tvb,run_offset,8,ENC_BIG_ENDIAN);
}
void