From 0c41c53935d1b37809be95d7cde6032baf7b92cb Mon Sep 17 00:00:00 2001 From: Graham Bloice Date: Wed, 28 Mar 2007 09:03:14 +0000 Subject: Fixed warnings on MS VC 6.0 svn path=/trunk/; revision=21245 --- epan/dissectors/packet-dmp.c | 662 +++++++++++++++++++++---------------------- 1 file changed, 331 insertions(+), 331 deletions(-) diff --git a/epan/dissectors/packet-dmp.c b/epan/dissectors/packet-dmp.c index 7275c86884..f05f6a1032 100644 --- a/epan/dissectors/packet-dmp.c +++ b/epan/dissectors/packet-dmp.c @@ -691,7 +691,7 @@ static const value_string sic_bit_any_vals[] = { { 12, "length:6, bytes:5" }, { 13, "length:6, bytes:5" }, { 14, "length:6, bytes:5" }, - { 15, "length:6, bytes:5" }, + { 15, "length:6, bytes:5" }, { 0, NULL } }; static const value_string body_format_vals[] = { @@ -760,10 +760,10 @@ static enum_val_t struct_id_options[] = { { NULL, NULL, 0 } }; -static const gchar *msg_type_to_str (void) +static const gchar *msg_type_to_str (void) { static gchar *msg_type = NULL; - + if (dmp.msg_type == STANAG) { /* STANAG 4406 Message, also include message type */ msg_type = ep_alloc (MAX_MSG_TYPE_LEN); @@ -826,7 +826,7 @@ static const gchar *discard_reason_str (guint8 value) static time_t dmp_dec_time_diff (guint8 dmp_time_diff) { time_t time_diff = 0; - + if (dmp_time_diff <= 0x01) { /* Reserved - low value */ time_diff = -1; @@ -846,7 +846,7 @@ static time_t dmp_dec_time_diff (guint8 dmp_time_diff) /* Reserved - high value */ time_diff = -2; } - + return time_diff; } @@ -857,7 +857,7 @@ static time_t dmp_dec_time_diff (guint8 dmp_time_diff) static time_t dmp_dec_exp_del_time (guint8 timev, gboolean expiry_time) { time_t time_value = 0; - + if (expiry_time && (timev == 0x00)) { /* No expiry time */ time_value = -1; @@ -880,7 +880,7 @@ static time_t dmp_dec_exp_del_time (guint8 timev, gboolean expiry_time) /* Reserved */ time_value = -2; } - + return time_value; } @@ -898,7 +898,7 @@ static time_t dmp_dec_del_time (guint8 delivery_time) static time_t dmp_dec_dtg (guint8 dtg) { time_t value; - + if (dtg == 0x00) { /* Not present */ return -1; @@ -915,7 +915,7 @@ static time_t dmp_dec_dtg (guint8 dtg) /* Reserved */ return -2; } - + return value; } @@ -933,9 +933,9 @@ static time_t dmp_dec_subm_time (guint16 delta1, time_t start_time) { time_t subm_time = start_time; guint16 delta2; - + delta2 = (guint16) ((subm_time / 2) % 0x7FF8); - + if ((delta1 < 0x01C2) && (delta2 >= delta1 + 0x7E38)) { subm_time += 2 * (0x7FF8 - delta2 + delta1); } else if ((delta1 >= 0x01C2) && (delta2 < delta1 - 0x01C2)) { @@ -943,12 +943,12 @@ static time_t dmp_dec_subm_time (guint16 delta1, time_t start_time) } else { subm_time -= 2 * (delta2 - delta1); } - + return subm_time; } /* Ref chapter 6.3.7.2.12 SIC */ -static gboolean dmp_dec_xbyte_sic (guint64 bin, gchar *sic, +static gboolean dmp_dec_xbyte_sic (guint64 bin, gchar *sic, guint8 no_char, gboolean any) { gboolean failure = FALSE; @@ -967,7 +967,7 @@ static gboolean dmp_dec_xbyte_sic (guint64 bin, gchar *sic, } else { multiplier = 36.0; } - + for (i = 0; i < no_char; i++) { p = (gint) pow (multiplier, no_char - 1 - i); sic[i] = (gchar) (bin / p); @@ -1035,8 +1035,8 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, value = tvb_get_ntohs (tvb, offset); failure = dmp_dec_xbyte_sic (value, sic, 3, FALSE); - sf = proto_tree_add_string_format (message_tree, hf_message_sic, tvb, - offset, 2, sic, + sf = proto_tree_add_string_format (message_tree, hf_message_sic, tvb, + offset, 2, sic, "SIC: %s [A-Z0-9 only]%s", sic, failure ? " (invalid)": ""); if (failure) { @@ -1051,8 +1051,8 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, value = (value >> 8) & 0x48FFFF; failure = dmp_dec_xbyte_sic (value, sic, 3, TRUE); sf = proto_tree_add_string_format (message_tree, hf_message_sic, tvb, - offset, 3, sic, - "SIC: %s [any character]%s", sic, + offset, 3, sic, + "SIC: %s [any character]%s", sic, failure ? " (invalid)": ""); if (failure) { expert_add_info_format (pinfo, sf, PI_UNDECODED, PI_NOTE, "Illegal SIC"); @@ -1075,14 +1075,14 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, 1, FALSE); key_tree = proto_item_add_subtree (kf, ett_message_sic_key); - proto_tree_add_item (key_tree, hf_message_sic_key_type, tvb, offset, + proto_tree_add_item (key_tree, hf_message_sic_key_type, tvb, offset, 1, FALSE); - proto_tree_add_item (key_tree, hf_message_sic_key_chars, tvb, offset, + proto_tree_add_item (key_tree, hf_message_sic_key_chars, tvb, offset, 1, FALSE); - proto_tree_add_item (key_tree, hf_message_sic_key_num, tvb, offset, + proto_tree_add_item (key_tree, hf_message_sic_key_num, tvb, offset, 1, FALSE); offset += 1; - + any = (key & 0x08); no = (key & 0x07) + 1; for (i = 0; i < no; i++) { @@ -1095,7 +1095,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, bytes = 2; } failure = dmp_dec_xbyte_sic (value, sic, 3, any); - bf = proto_tree_add_string_format (sic_tree, hf_message_sic, tvb, + bf = proto_tree_add_string_format (sic_tree, hf_message_sic, tvb, offset, bytes, sic, "SIC %d: %s%s", i + 1, sic, failure ? " (invalid)": ""); @@ -1109,7 +1109,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, } else if (key <= 0xDF) { /* 1 or more 3 to 8 character SICs */ - + sf = proto_tree_add_item (message_tree, hf_message_sic_key, tvb, offset, 1, FALSE); sic_tree = proto_item_add_subtree (sf, ett_message_sic); @@ -1118,11 +1118,11 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, 1, FALSE); key_tree = proto_item_add_subtree (kf, ett_message_sic_key); - proto_tree_add_item (key_tree, hf_message_sic_key_type, tvb, offset, + proto_tree_add_item (key_tree, hf_message_sic_key_type, tvb, offset, 1, FALSE); - proto_tree_add_item (key_tree, hf_message_sic_key_chars, tvb, offset, + proto_tree_add_item (key_tree, hf_message_sic_key_chars, tvb, offset, 1, FALSE); - proto_tree_add_item (key_tree, hf_message_sic_key_num, tvb, offset, + proto_tree_add_item (key_tree, hf_message_sic_key_num, tvb, offset, 1, FALSE); offset += 1; @@ -1155,7 +1155,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, } else if ((key & 0xF0) == 0xB0) { /* bit 7-4: 1011 */ length = 7; bytes = 6; - value = ((guint64)tvb_get_ntohs (tvb, offset) & 0x0FFF) << 32 | + value = ((guint64)tvb_get_ntohs (tvb, offset) & 0x0FFF) << 32 | tvb_get_ntohl (tvb, offset + 2); } else if ((key & 0xF0) == 0x90) { /* bit 7-4: 1001 */ length = 8; @@ -1184,7 +1184,7 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, } else if ((key & 0xF0) == 0xB0) { /* bit 7-4: 1011 */ length = 8; bytes = 6; - value = ((guint64)tvb_get_ntohs (tvb, offset) & 0x0FFF) << 32 | + value = ((guint64)tvb_get_ntohs (tvb, offset) & 0x0FFF) << 32 | tvb_get_ntohl (tvb, offset + 2); } else { /* bit 7-4: 0xxx or 1000 */ length = 6; @@ -1205,19 +1205,19 @@ static gint dissect_dmp_sic (tvbuff_t *tvb, packet_info *pinfo, } } failure = dmp_dec_xbyte_sic (value, sic, length, any); - bf = proto_tree_add_string_format (sic_tree, hf_message_sic, tvb, + bf = proto_tree_add_string_format (sic_tree, hf_message_sic, tvb, offset, bytes, sic, - "SIC %d: %s (%d bytes: %llx)%s", + "SIC %d: %s (%d bytes: %llx)%s", i + 1, sic, bytes, value, failure ? " (invalid)": ""); if (bitmap & (1 << (7 - i))) { /* Only if 4 - 8 character */ bitmap_tree = proto_item_add_subtree (bf, ett_message_sic_bits); if (any) { - proto_tree_add_item (bitmap_tree, hf_message_sic_bits_any, tvb, + proto_tree_add_item (bitmap_tree, hf_message_sic_bits_any, tvb, offset, 1, FALSE); } else { - proto_tree_add_item (bitmap_tree, hf_message_sic_bits, tvb, + proto_tree_add_item (bitmap_tree, hf_message_sic_bits, tvb, offset, 1, FALSE); } } @@ -1266,7 +1266,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, proto_tree *field_tree, dir_addr = (value & 0x7F); en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address, tvb, offset, 1, value & 0x7F, - "%sDirect Address%s: %d", + "%sDirect Address%s: %d", val_to_str (addr_type, addr_type_str, ""), (value & 0x80) ? " (bits 6-0)" : "", value & 0x7F); @@ -1276,7 +1276,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, proto_tree *field_tree, proto_tree_add_item (addr_tree, hf_addr_dir_address, tvb, offset, 1, FALSE); offset += 1; - + if (value & 0x80) { /* Extended 1 */ value = tvb_get_guint8 (tvb, offset); @@ -1294,7 +1294,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, proto_tree *field_tree, proto_tree_add_item (addr_tree, hf_addr_dir_address_ext1, tvb, offset, 1, FALSE); offset += 1; - + if (value & 0x80) { /* Extended 2 */ value = tvb_get_guint8 (tvb, offset); @@ -1312,7 +1312,7 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, proto_tree *field_tree, offset += 1; } } - + if (rec_no != -1) { proto_item_append_text (tf, " %d", rec_no); if (rec_ofs != -1) { @@ -1325,10 +1325,10 @@ static gint dissect_dmp_direct_addr (tvbuff_t *tvb, proto_tree *field_tree, return offset; } -/* Ref 5.3.14 Extended Address */ +/* Ref 5.3.14 Extended Address */ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo _U_, - proto_tree *field_tree, proto_item *tf, - gint offset, gint rec_no, gint rec_ofs, + proto_tree *field_tree, proto_item *tf, + gint offset, gint rec_no, gint rec_ofs, gint addr_type) { proto_tree *addr_tree = NULL, *ext_tree = NULL; @@ -1340,7 +1340,7 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo _U_, value = tvb_get_guint8 (tvb, offset); type = (value & 0xE0) >> 5; length = (value & 0x1F); - ef = proto_tree_add_none_format (field_tree, hf_addr_ext_address, tvb, + ef = proto_tree_add_none_format (field_tree, hf_addr_ext_address, tvb, offset, -1, "%sExtended Address", val_to_str (addr_type, addr_type_str, "")); ext_tree = proto_item_add_subtree (ef, ett_address_extended); @@ -1355,13 +1355,13 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo _U_, en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length, tvb, offset, 1, length, "Address Length%s: %d", - (value & 0x80) ? " (bits 4-0)" : "", + (value & 0x80) ? " (bits 4-0)" : "", length); addr_tree = proto_item_add_subtree (en, ett_address_ext_length); proto_tree_add_item (addr_tree, hf_addr_ext_length, tvb, offset, 1, FALSE); offset += 1; - + if (value & 0x80) { /* Extended */ value = tvb_get_guint8 (tvb, offset); @@ -1375,10 +1375,10 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo _U_, addr_tree = proto_item_add_subtree (en, ett_address_ext_type); proto_tree_add_item (addr_tree, hf_addr_ext_type, tvb, offset, 1, FALSE); - + en = proto_tree_add_uint_format (ext_tree, hf_addr_ext_length_ext, tvb, - offset, 1, value & 0x1F, - "Address Length (bits 9-5): %d", + offset, 1, value & 0x1F, + "Address Length (bits 9-5): %d", value & 0x1F); addr_tree = proto_item_add_subtree (en, ett_address_ext_length); proto_tree_add_item (addr_tree, hf_addr_ext_length_ext, tvb, offset, @@ -1387,7 +1387,7 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo _U_, } if (type == ASN1_BER) { - dissect_x411_ORName (FALSE, tvb, offset, pinfo, ext_tree, + dissect_x411_ORName (FALSE, tvb, offset, pinfo, ext_tree, hf_addr_ext_asn1_ber); } else if (type == ASN1_PER) { proto_tree_add_item (ext_tree, hf_addr_ext_asn1_per, tvb, offset, @@ -1397,7 +1397,7 @@ static gint dissect_dmp_ext_addr (tvbuff_t *tvb, packet_info *pinfo _U_, length, FALSE); } offset += length; - + proto_item_append_text (ef, ", Type: %s, Length: %d", val_to_str (type, ext_addr_type, "Reserved"), length); @@ -1425,18 +1425,18 @@ static gint dissect_dmp_originator (tvbuff_t *tvb, packet_info *pinfo _U_, proto_item *en = NULL, *tf = NULL; guint8 value, dmp_addr_form; gint boffset = offset; - - tf = proto_tree_add_item (envelope_tree, hf_addr_originator, tvb, offset, + + tf = proto_tree_add_item (envelope_tree, hf_addr_originator, tvb, offset, -1, FALSE); field_tree = proto_item_add_subtree (tf, ett_address); - + if (dmp.addr_enc == DIRECT_ADDR) { offset = dissect_dmp_direct_addr (tvb, field_tree, tf, offset, -1, -1, ORIGINATOR); } else { value = tvb_get_guint8 (tvb, offset); dmp_addr_form = (value & 0xE0) >> 5; - + en = proto_tree_add_uint_format (field_tree, hf_addr_ext_form, tvb, offset, 1, dmp_addr_form, "Address Form: %s", @@ -1448,7 +1448,7 @@ static gint dissect_dmp_originator (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item (rec_tree, hf_reserved_0x1F, tvb, offset, 1, FALSE); offset += 1; - + if (dmp_addr_form == P1_DIRECT) { offset = dissect_dmp_direct_addr (tvb, field_tree, tf, offset, -1, -1, ORIGINATOR); @@ -1459,24 +1459,24 @@ static gint dissect_dmp_originator (tvbuff_t *tvb, packet_info *pinfo _U_, proto_item_append_text (tf, " (invalid address form)"); } } - + proto_item_set_len (tf, offset - boffset); - + return offset; } -static void dmp_add_recipient_info (proto_item *tf, guint8 rep_req, +static void dmp_add_recipient_info (proto_item *tf, guint8 rep_req, guint8 not_req, gboolean action) { if (rep_req || not_req) { proto_item_append_text (tf, ", Request:"); } if (rep_req) { - proto_item_append_text (tf, "%s", + proto_item_append_text (tf, "%s", val_to_str (rep_req, report_vals_short, "")); } if (not_req) { - proto_item_append_text (tf, "%s", + proto_item_append_text (tf, "%s", val_to_str (not_req, notif_vals_short, "")); } if (action) { @@ -1484,19 +1484,19 @@ static void dmp_add_recipient_info (proto_item *tf, guint8 rep_req, proto_item_append_text (tf, " (Action)"); } else if (dmp.msg_type == IPM) { proto_item_append_text (tf, " (To)"); - } + } } else { if (dmp.msg_type == STANAG) { proto_item_append_text (tf, " (Info)"); } else if (dmp.msg_type == IPM) { proto_item_append_text (tf, " (Cc)"); - } + } } } /* Ref chapter 5.2.7 Direct Recipient Encoding */ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, - proto_item *tf, gint offset, + proto_item *tf, gint offset, guint *prev_rec_no) { @@ -1505,12 +1505,12 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, guint8 rep_req = 0, not_req = 0, value; gint rec_no, rec_ofs = -1, dir_addr; gboolean action = FALSE; - + value = tvb_get_guint8 (tvb, offset); rec_no = (value & 0xF0) >> 4; rep_req = (value & 0x0C) >> 2; not_req = (value & 0x03); - + en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no, tvb, offset, 1, (value & 0xF0) >> 4, "Recipient Number%s: %d" @@ -1525,7 +1525,7 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, proto_tree_add_item (rec_tree, hf_addr_dir_not_req1, tvb, offset, 1, FALSE); offset += 1; - + value = tvb_get_guint8 (tvb, offset); dir_addr = (value & 0x7F); action = (value & 0x80); @@ -1540,14 +1540,14 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, proto_tree_add_item (addr_tree, hf_addr_dir_address, tvb, offset, 1, FALSE); offset += 1; - + if (rep_req == 0x03) { /* Extended Recipient Number 1 */ value = tvb_get_guint8 (tvb, offset); rec_no |= ((value & 0x3F) << 4); rec_ofs = rec_no; rep_req = (value & 0xC0) >> 6; - + en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no_ext1, tvb, offset, 1, value & 0x3F, "Recipient Number (bits 9-4): %d" @@ -1558,14 +1558,14 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, proto_tree_add_item (rec_tree, hf_addr_dir_rec_no_ext1, tvb, offset, 1, FALSE); offset += 1; - + if (rep_req == 0x03) { /* Extended Recipient Number 2 */ value = tvb_get_guint8 (tvb, offset); rec_no |= ((value & 0x1F) << 10); rec_ofs = rec_no; rep_req = (value & 0xC0) >> 6; - + en = proto_tree_add_uint_format (field_tree, hf_addr_dir_rec_no_ext1, tvb, offset, 1, value & 0x1F, "Recipient Number (bits 14-10): %d" @@ -1580,13 +1580,13 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, offset += 1; } } - + if (not_req == 0x03) { /* Extended Direct Address 1 */ value = tvb_get_guint8 (tvb, offset); dir_addr |= ((value & 0x3F) << 7); not_req = (value & 0xC0) >> 6; - + en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address, tvb, offset, 1, value & 0x3F, "Direct Address (bits 12-7): %d", @@ -1597,13 +1597,13 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, proto_tree_add_item (addr_tree, hf_addr_dir_address_ext1, tvb, offset, 1, FALSE); offset += 1; - + if (not_req == 0x03) { /* Extended Direct Address 2 */ value = tvb_get_guint8 (tvb, offset); dir_addr |= ((value & 0x3F) << 13); not_req = (value & 0xC0) >> 6; - + en = proto_tree_add_uint_format (field_tree, hf_addr_dir_address, tvb, offset, 1, value & 0x3F, "Direct Address (bits 18-13): %d", @@ -1627,7 +1627,7 @@ static gint dissect_dmp_direct_encoding (tvbuff_t *tvb, proto_tree *field_tree, proto_item_append_text (tf, ", Direct Address: %d", dir_addr); dmp_add_recipient_info (tf, rep_req, not_req, action); - + return offset; } @@ -1666,7 +1666,7 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo _U_, rep_req = (value & 0x0C) >> 2; en = proto_tree_add_uint_format (field_tree, hf_addr_ext_rep_req, tvb, - offset, 1, (value & 0x0C) >> 2, + offset, 1, (value & 0x0C) >> 2, "Report Request: %s", val_to_str ((value & 0x0C) >> 2, report_vals, "Reserved")); @@ -1699,7 +1699,7 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item (addr_tree, hf_addr_ext_rec_no, tvb, offset, 1, FALSE); offset += 1; - + if (value & 0x80) { /* Extended */ value = tvb_get_guint8 (tvb, offset); @@ -1714,7 +1714,7 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo _U_, 1, FALSE); offset += 1; } - + rec_no += (1 + *prev_rec_no); *prev_rec_no = rec_no; @@ -1733,7 +1733,7 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo _U_, offset = dissect_dmp_ext_addr (tvb, pinfo, field_tree, tf, offset, rec_no, rec_ofs, P1_ADDRESS); break; - + } switch (dmp_addr_form) { @@ -1744,7 +1744,7 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo _U_, offset = dissect_dmp_direct_addr (tvb, field_tree, tf, offset, rec_no, rec_ofs, P2_ADDRESS); break; - + case P2_EXTENDED: case P1_DIRECT_P2_EXTENDED: case P1_P2_EXTENDED: @@ -1761,19 +1761,19 @@ static gint dissect_dmp_ext_encoding (tvbuff_t *tvb, packet_info *pinfo _U_, /* Ref chapter 5.2 Address encoding */ static gint dissect_dmp_address (tvbuff_t *tvb, packet_info *pinfo _U_, - proto_tree *envelope_tree, + proto_tree *envelope_tree, gint offset, guint *prev_rec_no, gboolean reporting_name) { proto_tree *field_tree = NULL; proto_item *tf = NULL; gint boffset = offset; - + if (reporting_name) { tf = proto_tree_add_item (envelope_tree, hf_addr_reporting_name, tvb, offset, -1, FALSE); } else { - tf = proto_tree_add_none_format (envelope_tree, hf_addr_recipient, tvb, + tf = proto_tree_add_none_format (envelope_tree, hf_addr_recipient, tvb, offset, -1, "Recipient Number"); } field_tree = proto_item_add_subtree (tf, ett_address); @@ -1782,15 +1782,15 @@ static gint dissect_dmp_address (tvbuff_t *tvb, packet_info *pinfo _U_, offset = dissect_dmp_direct_encoding (tvb, field_tree, tf, offset, prev_rec_no); } else { - offset = dissect_dmp_ext_encoding (tvb, pinfo, field_tree, tf, offset, + offset = dissect_dmp_ext_encoding (tvb, pinfo, field_tree, tf, offset, prev_rec_no); } - + proto_item_set_len (tf, offset - boffset); return offset; } - + /* Ref chapter 6.2.9 Acknowledgement */ static gint dissect_dmp_ack (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *dmp_tree, gint offset) @@ -1801,28 +1801,28 @@ static gint dissect_dmp_ack (tvbuff_t *tvb, packet_info *pinfo _U_, guint prev_rec_no = 0; gint rec_len, rec_no = 0; gint boffset = offset; - + en = proto_tree_add_item (dmp_tree, hf_ack, tvb, offset, 4, FALSE); ack_tree = proto_item_add_subtree (en, ett_ack); - + reason = tvb_get_guint8 (tvb, offset); proto_item_append_text (en, ", Reason: %s", val_to_str (reason, ack_reason, "Reserved")); - + rt = proto_tree_add_item (ack_tree, hf_ack_reason, tvb, offset, 1, FALSE); if (reason != 0) { expert_add_info_format (pinfo, rt, PI_RESPONSE_CODE, PI_NOTE, "ACK reason: %s", val_to_str (reason, ack_reason, "Reserved")); } offset += 1; - + proto_tree_add_item (ack_tree, hf_ack_diagnostic, tvb, offset, 1, FALSE); offset += 1; - + /* Subject Message Identifier */ dmp.subj_id = tvb_get_ntohs (tvb, offset); proto_tree_add_item (ack_tree, hf_message_subj_id, tvb, offset, 2, FALSE); offset += 2; - + if (dmp.ack_rec_present) { /* Recipient List */ rec_len = tvb_length (tvb); @@ -1834,7 +1834,7 @@ static gint dissect_dmp_ack (tvbuff_t *tvb, packet_info *pinfo _U_, FALSE); recip_tree = proto_item_add_subtree (rt, ett_ack_recips); while (offset < rec_len) { - offset = dissect_dmp_address (tvb, pinfo, recip_tree, offset, + offset = dissect_dmp_address (tvb, pinfo, recip_tree, offset, &prev_rec_no, FALSE); rec_no++; } @@ -1843,7 +1843,7 @@ static gint dissect_dmp_ack (tvbuff_t *tvb, packet_info *pinfo _U_, proto_item_set_len (en, offset - boffset); } } - + return offset; } @@ -1860,21 +1860,21 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, gchar *env_flags = NULL; guint prev_rec_no = 0; gint boffset = offset, i; - + en = proto_tree_add_item (dmp_tree, hf_envelope, tvb, offset, 10, FALSE); envelope_tree = proto_item_add_subtree (en, ett_envelope); - + envelope = tvb_get_guint8 (tvb, offset); prot_id = (envelope & 0xF8) >> 3; dmp.version = (envelope & 0x07) + 1; - + /* Protocol Version */ - tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_version, - tvb, offset, 1, dmp.version, + tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_version, + tvb, offset, 1, dmp.version, "Protocol Version: %d", dmp.version); - + field_tree = proto_item_add_subtree (tf, ett_envelope_version); - vf = proto_tree_add_item (field_tree, hf_envelope_protocol_id, tvb, + vf = proto_tree_add_item (field_tree, hf_envelope_protocol_id, tvb, offset, 1, FALSE); if (prot_id == 0x0D) { proto_item_append_text (vf, " (national version of DMP)"); @@ -1882,8 +1882,8 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, proto_item_append_text (vf, " (correct)"); } else { proto_item_append_text (vf, " (incorrect, should be 0x1d)"); - } - vf = proto_tree_add_item (field_tree, hf_envelope_version, tvb, + } + vf = proto_tree_add_item (field_tree, hf_envelope_version, tvb, offset, 1, FALSE); offset += 1; @@ -1891,20 +1891,20 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, /* Unsupported DMP Version */ proto_item_append_text (vf, " (unsupported)"); proto_item_append_text (tf, " (unsupported)"); - expert_add_info_format (pinfo, vf, PI_UNDECODED, PI_ERROR, + expert_add_info_format (pinfo, vf, PI_UNDECODED, PI_ERROR, "Unsupported DMP Version: %d", dmp.version); return offset; } - + envelope = tvb_get_guint8 (tvb, offset); dmp.addr_enc = ((envelope & 0x10) >> 4); dmp.checksum = ((envelope & 0x08) >> 3); dmp.msg_type = (envelope & 0x07); - + if (dmp.msg_type != ACK) { /* Hop count */ tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_hop_count, - tvb, offset, 1, (envelope & 0xE0) >> 5, + tvb, offset, 1, (envelope & 0xE0) >> 5, "Hop Count: %d", (envelope & 0xE0) >> 5); field_tree = proto_item_add_subtree (tf, ett_envelope_hop_count); proto_tree_add_item (field_tree, hf_envelope_hop_count, tvb, @@ -1913,71 +1913,71 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, /* Recipient Present */ dmp.ack_rec_present = (envelope & 0x20); tf = proto_tree_add_boolean_format (envelope_tree,hf_envelope_rec_present, - tvb, offset, 1, envelope & 0x20, - "Recipient Present: %s", - (envelope & 0x20) ? - present_values.true_string : + tvb, offset, 1, envelope & 0x20, + "Recipient Present: %s", + (envelope & 0x20) ? + present_values.true_string : present_values.false_string); field_tree = proto_item_add_subtree (tf, ett_envelope_rec_present); proto_tree_add_item (field_tree, hf_envelope_rec_present, tvb, offset, 1, FALSE); } - + /* Address Encoding */ tf = proto_tree_add_boolean_format (envelope_tree, hf_envelope_addr_enc, - tvb, offset, 1, envelope & 0x10, - "Address Encoding: %s", - (envelope & 0x10) ? - addr_enc.true_string : + tvb, offset, 1, envelope & 0x10, + "Address Encoding: %s", + (envelope & 0x10) ? + addr_enc.true_string : addr_enc.false_string); field_tree = proto_item_add_subtree (tf, ett_envelope_addr_enc); proto_tree_add_item (field_tree, hf_envelope_addr_enc, tvb, offset, 1, FALSE); - + /* Checksum Present */ tf = proto_tree_add_boolean_format (envelope_tree, hf_envelope_checksum, - tvb, offset, 1, envelope & 0x08, - "Checksum: %s", - (envelope & 0x08) ? - checksum.true_string : + tvb, offset, 1, envelope & 0x08, + "Checksum: %s", + (envelope & 0x08) ? + checksum.true_string : checksum.false_string); field_tree = proto_item_add_subtree (tf, ett_envelope_checksum); proto_tree_add_item (field_tree, hf_envelope_checksum, tvb, offset, 1, FALSE); - + /* Content Type */ tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_type, - tvb, offset, 1, envelope & 0x07, - "Content Type: %s (%d)", - val_to_str (envelope & 0x07, + tvb, offset, 1, envelope & 0x07, + "Content Type: %s (%d)", + val_to_str (envelope & 0x07, type_vals, "Unknown"), envelope & 0x07); field_tree = proto_item_add_subtree (tf, ett_envelope_cont_type); proto_tree_add_item (field_tree, hf_envelope_type, tvb, offset, 1, FALSE); - - proto_item_append_text (en, ", %s", (envelope >> 3) & 0x01 ? + + proto_item_append_text (en, ", %s", (envelope >> 3) & 0x01 ? checksum.true_string : checksum.false_string); offset += 1; - + if (dmp.msg_type >= ACK) { proto_item_set_len (en, offset - boffset); return offset; } - + /* Message Identifier */ dmp.msg_id = tvb_get_ntohs (tvb, offset); proto_tree_add_item (envelope_tree, hf_envelope_msg_id, tvb, offset, 2, FALSE); offset += 2; - + /* Submission Time */ subm_time = tvb_get_ntohs (tvb, offset); - dmp.subm_time = dmp_dec_subm_time (subm_time & 0x7FFF, + dmp.subm_time = dmp_dec_subm_time ((guint16)(subm_time & 0x7FFF), pinfo->fd->abs_ts.secs); tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_subm_time, tvb, offset, 2, subm_time & 0x7FFF, - "Submission time: %s", + "Submission time: %s", (subm_time & 0x7FFF) >= 0x7FF8 ? "Reserved" : abs_time_secs_to_str (dmp.subm_time)); @@ -1987,12 +1987,12 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item (field_tree, hf_envelope_subm_time_value, tvb, offset, 2, FALSE); offset += 2; - + if (subm_time & 0x8000) { /* Timed Difference */ time_diff = tvb_get_guint8 (tvb, offset); tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_time_diff, - tvb, offset, 1, time_diff, + tvb, offset, 1, time_diff, "Time Difference: "); field_tree = proto_item_add_subtree (tf, ett_envelope_time_diff); proto_tree_add_item (field_tree, hf_envelope_time_diff_value, tvb, @@ -2005,13 +2005,13 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, } offset += 1; } - + /* Envelope Flags */ envelope = tvb_get_guint8 (tvb, offset); tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_flags, - tvb, offset, 1, envelope, + tvb, offset, 1, envelope, "Envelope Flags"); - + field_tree = proto_item_add_subtree (tf, ett_envelope_flags); proto_tree_add_item (field_tree, hf_envelope_content_id_discarded, tvb, offset, 1, FALSE); @@ -2019,39 +2019,39 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, offset, 1, FALSE); proto_tree_add_item (field_tree, hf_envelope_dl_expansion_prohib, tvb, offset, 1, FALSE); - + if (envelope & 0xE0) { env_flags = ep_alloc (MAX_ENV_FLAGS_LEN); env_flags[0] = 0; - g_snprintf (env_flags, MAX_ENV_FLAGS_LEN, "%s%s%s", + g_snprintf (env_flags, MAX_ENV_FLAGS_LEN, "%s%s%s", (envelope & 0x80) ? ", ContId discarded" : "", - (envelope & 0x40) ? ", Reass prohibited" : "", + (envelope & 0x40) ? ", Reass prohibited" : "", (envelope & 0x20) ? ", DLE prohibited" : ""); proto_item_append_text (tf, ":%s", &env_flags[1]); } else { proto_item_append_text (tf, " (none)"); } - + /* Recipient Count */ no_rec = (envelope & 0x1F); tf = proto_tree_add_uint_format (envelope_tree, hf_envelope_recipients, - tvb, offset, 1, no_rec, + tvb, offset, 1, no_rec, "Recipient Count: %d", no_rec); - + field_tree = proto_item_add_subtree (tf, ett_envelope_recipients); proto_tree_add_item (field_tree, hf_envelope_recipients, tvb, offset, 1, FALSE); offset += 1; - + if (no_rec == 0) { /* Extended Recipient Count */ no_rec = tvb_get_ntohs (tvb, offset) & 0x7FFF; tf = proto_tree_add_uint_format (envelope_tree,hf_envelope_ext_recipients, - tvb, offset, 2, no_rec, + tvb, offset, 2, no_rec, "Extended Recipient Count: %d%s", no_rec, - (no_rec < 32 ? + (no_rec < 32 ? " (incorrect, reserved value)" : "")); - + field_tree = proto_item_add_subtree (tf, ett_envelope_ext_recipients); proto_tree_add_item (field_tree, hf_reserved_0x8000, tvb, offset, 2, FALSE); @@ -2059,23 +2059,23 @@ static gint dissect_dmp_envelope (tvbuff_t *tvb, packet_info *pinfo _U_, offset, 2, FALSE); offset += 2; } - + if (dmp.msg_type != REPORT) { /* Originator - Not present for reports */ offset = dissect_dmp_originator (tvb, pinfo, envelope_tree, offset); } - + for (i = 1; i <= no_rec; i++) { /* Recipient(s) */ - offset = dissect_dmp_address (tvb, pinfo, envelope_tree, offset, + offset = dissect_dmp_address (tvb, pinfo, envelope_tree, offset, &prev_rec_no, FALSE); } proto_item_set_len (en, offset - boffset); - + return offset; } -static void dissect_dmp_structured_id (tvbuff_t *tvb, proto_tree *body_tree, +static void dissect_dmp_structured_id (tvbuff_t *tvb, proto_tree *body_tree, gint offset) { proto_item *tf = NULL; @@ -2085,58 +2085,58 @@ static void dissect_dmp_structured_id (tvbuff_t *tvb, proto_tree *body_tree, guint64 id_guint64; guint8 *id_string = NULL; gint length; - + offset += dmp_struct_offset; switch (dmp_struct_format) { - + case STRUCT_ID_UINT8: id_byte = tvb_get_guint8 (tvb, offset); g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%u", id_byte); - tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint8, tvb, + tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint8, tvb, offset, 1, FALSE); break; - + case STRUCT_ID_UINT16: id_short = tvb_get_ntohs (tvb, offset); g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%u", id_short); - tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint16, tvb, + tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint16, tvb, offset, 2, FALSE); break; - + case STRUCT_ID_UINT32: id_int = tvb_get_ntohl (tvb, offset); g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%u", id_int); - tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint32, tvb, + tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint32, tvb, offset, 4, FALSE); break; - + case STRUCT_ID_UINT64: id_guint64 = tvb_get_ntoh64 (tvb, offset); g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%" PRIu64, id_guint64); - tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint64, tvb, + tf = proto_tree_add_item (body_tree, hf_message_bodyid_uint64, tvb, offset, 8, FALSE); break; - + case STRUCT_ID_STRING: id_string = tvb_get_string (tvb, offset, (gint) dmp_struct_length); g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%s", id_string); g_free (id_string); - tf = proto_tree_add_item (body_tree, hf_message_bodyid_string, tvb, + tf = proto_tree_add_item (body_tree, hf_message_bodyid_string, tvb, offset, dmp_struct_length, FALSE); break; - + case STRUCT_ID_ZSTRING: id_string = tvb_get_stringz (tvb, offset, &length); g_snprintf (dmp.struct_id, MAX_STRUCT_ID_LEN, "%s", id_string); g_free (id_string); - tf = proto_tree_add_item (body_tree, hf_message_bodyid_zstring, tvb, + tf = proto_tree_add_item (body_tree, hf_message_bodyid_zstring, tvb, offset, length, FALSE); break; } } -/* - * Ref chapter 6.3.7.1 STANAG 4406 message structure +/* + * Ref chapter 6.3.7.1 STANAG 4406 message structure * and chapter 6.3.8.1 IPM 88 message structure */ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, @@ -2152,7 +2152,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, en = proto_tree_add_item (dmp_tree, hf_message, tvb, offset, -1, FALSE); message_tree = proto_item_add_subtree (en, ett_message); - + if (dmp.body_format == FREE_TEXT_SUBJECT) { len = tvb_strsize (tvb, offset); if (dmp_subject_as_id) { @@ -2171,20 +2171,20 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, compr_alg = (message & 0x18) >> 3; /* Encoded Information Type */ tf = proto_tree_add_uint_format (message_tree, hf_message_eit, - tvb, offset, 1, eit, "EIT: %s (%d)", + tvb, offset, 1, eit, "EIT: %s (%d)", val_to_str (eit, eit_vals, "Unknown"), eit); field_tree = proto_item_add_subtree (tf, ett_message_eit); proto_tree_add_item (field_tree, hf_message_eit, tvb, offset, 1, FALSE); - proto_item_append_text (en, ", Type: %s", + proto_item_append_text (en, ", Type: %s", val_to_str (eit, eit_vals, "Unknown")); /* Compression Algorithm */ tf = proto_tree_add_uint_format (message_tree, hf_message_compr, tvb, offset, 1, compr_alg, - "Compression Algorithm: %s (%d)", - val_to_str (compr_alg, compression_vals, + "Compression Algorithm: %s (%d)", + val_to_str (compr_alg, compression_vals, "Unknown"), compr_alg); field_tree = proto_item_add_subtree (tf, ett_message_compr); proto_tree_add_item (field_tree, hf_message_compr, tvb, @@ -2196,7 +2196,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, if (message & 0x07) { /* Reserved */ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x07, - tvb, offset, 1, message & 0x07, + tvb, offset, 1, message & 0x07, "Reserved: %d", message & 0x07); field_tree = proto_item_add_subtree (tf, ett_message_body_reserved); proto_tree_add_item (field_tree, hf_reserved_0x07, tvb, @@ -2204,7 +2204,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, } offset += 1; } - + len = tvb_length_remaining (tvb, offset); if (dmp.checksum) { len -= 2; @@ -2212,11 +2212,11 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, tf = proto_tree_add_uint_format (message_tree, hf_message_body, tvb, offset, len, len, - "%sUser data, Length: %d", - (compr_alg == ALGORITHM_ZLIB) ? + "%sUser data, Length: %d", + (compr_alg == ALGORITHM_ZLIB) ? "Compressed " : "", len); field_tree = proto_item_add_subtree (tf, ett_message_body); - + if (dmp.body_format == STRUCTURED) { /* Structured Message ID */ dissect_dmp_structured_id (tvb, field_tree, offset); @@ -2239,7 +2239,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, } else { tf = proto_tree_add_text (message_tree, tvb, offset, -1, "Error: Unable to uncompress content"); - expert_add_info_format (pinfo, tf, PI_UNDECODED, PI_WARN, + expert_add_info_format (pinfo, tf, PI_UNDECODED, PI_WARN, "Unable to uncompress content"); } } else if (eit != EIT_BILATERAL) { @@ -2254,7 +2254,7 @@ static gint dissect_dmp_message (tvbuff_t *tvb, packet_info *pinfo _U_, } proto_item_set_len (en, offset - boffset); - + return offset; } @@ -2282,7 +2282,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, /* Report Type */ tf = proto_tree_add_boolean_format (report_tree, hf_report_type, - tvb, offset, 1, rep_type, + tvb, offset, 1, rep_type, "Report Type: %s", rep_type ? report_type.true_string : report_type.false_string); @@ -2295,7 +2295,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, /* Info Present */ info_present = (report & 0x40); tf = proto_tree_add_boolean_format (report_tree,hf_report_info_present_dr, - tvb, offset, 1, report & 0x40, + tvb, offset, 1, report & 0x40, "Info Present: %s", (report & 0x40) ? present_values.true_string : present_values.false_string); @@ -2306,10 +2306,10 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, /* Address Encoding */ dmp.addr_enc = ((report & 0x20) >> 5); tf = proto_tree_add_boolean_format (report_tree, hf_report_addr_enc_dr, - tvb, offset, 1, report & 0x20, - "Address Encoding: %s", - (report & 0x20) ? - addr_enc.true_string : + tvb, offset, 1, report & 0x20, + "Address Encoding: %s", + (report & 0x20) ? + addr_enc.true_string : addr_enc.false_string); field_tree = proto_item_add_subtree (tf, ett_report_addr_enc_dr); proto_tree_add_item (field_tree, hf_report_addr_enc_dr, tvb, @@ -2318,7 +2318,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, if (report & 0x1F) { /* Reserved */ tf = proto_tree_add_uint_format (report_tree, hf_reserved_0x1F, - tvb, offset, 1, report & 0x1F, + tvb, offset, 1, report & 0x1F, "Reserved: %d", report & 0x1F); field_tree = proto_item_add_subtree (tf, ett_report_reserved); proto_tree_add_item (field_tree, hf_reserved_0x1F, tvb, offset, @@ -2330,7 +2330,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, report = tvb_get_guint8 (tvb, offset); secs = dmp_dec_del_time (report); tf = proto_tree_add_uint_format (report_tree, hf_report_del_time, - tvb, offset, 1, report, + tvb, offset, 1, report, "Delivery Time: "); field_tree = proto_item_add_subtree (tf, ett_report_del_time); ei = proto_tree_add_item (field_tree, hf_report_del_time, tvb, @@ -2351,10 +2351,10 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, /* Address Encoding */ dmp.addr_enc = ((report & 0x40) >> 6); tf = proto_tree_add_boolean_format (report_tree, hf_report_addr_enc_ndr, - tvb, offset, 1, report & 0x40, - "Address Encoding: %s", - (report & 0x40) ? - addr_enc.true_string : + tvb, offset, 1, report & 0x40, + "Address Encoding: %s", + (report & 0x40) ? + addr_enc.true_string : addr_enc.false_string); field_tree = proto_item_add_subtree (tf, ett_report_addr_enc_ndr); proto_tree_add_item (field_tree, hf_report_addr_enc_ndr, tvb, @@ -2362,10 +2362,10 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, /* Reason */ tf = proto_tree_add_uint_format (report_tree, hf_report_reason, - tvb, offset, 1, report, + tvb, offset, 1, report, "Reason%s: %s (%d)", ((report & 0x3F) < 0x3D) ? " (X.411)":"", - non_del_reason_str (report & 0x3F), + non_del_reason_str ((guint8)(report & 0x3F)), report & 0x3F); field_tree = proto_item_add_subtree (tf, ett_report_reason); proto_tree_add_item (field_tree, hf_report_reason, tvb, @@ -2377,7 +2377,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, info_present = (report & 0x80); tf = proto_tree_add_boolean_format (report_tree, hf_report_info_present_ndr, - tvb, offset, 1, report & 0x80, + tvb, offset, 1, report & 0x80, "Info Present: %s", (report & 0x80) ? present_values.true_string : present_values.false_string); @@ -2390,7 +2390,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, tvb, offset, 1, report, "Diagnostic%s: %s (%d)", ((report & 0x7F) < 0x7C) ? " (X.411)":"", - non_del_diagn_str (report & 0x7F), + non_del_diagn_str ((guint8)(report & 0x7F)), report & 0x7F); field_tree = proto_item_add_subtree (tf, ett_report_diagn); proto_tree_add_item (field_tree, hf_report_diagn, tvb, @@ -2398,7 +2398,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, } offset += 1; - offset = dissect_dmp_address (tvb, pinfo, report_tree, offset, + offset = dissect_dmp_address (tvb, pinfo, report_tree, offset, prev_rec_no, TRUE); if (info_present) { @@ -2406,7 +2406,7 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, len = tvb_strsize (tvb, offset); tf = proto_tree_add_uint_format (report_tree, hf_report_suppl_info_len, tvb, offset, len, len, - "Supplementary Information, Length: %d", + "Supplementary Information, Length: %d", len - 1); if (len > 1) { if ((offset - boffset + len) > 128) { @@ -2419,9 +2419,9 @@ static gint dissect_dmp_report (tvbuff_t *tvb, packet_info *pinfo _U_, } offset += len; } - + proto_item_set_len (en, offset - boffset); - + return offset; } @@ -2445,7 +2445,7 @@ static gint dissect_dmp_notification (tvbuff_t *tvb, packet_info *pinfo _U_, /* Receipt Time */ rec_time = tvb_get_guint8 (tvb, offset); tf = proto_tree_add_uint_format (notif_tree, hf_notif_rec_time, - tvb, offset, 1, rec_time, + tvb, offset, 1, rec_time, "Receipt Time: "); field_tree = proto_item_add_subtree (tf, ett_notif_rec_time); proto_tree_add_item (field_tree, hf_notif_rec_time_val, tvb, @@ -2485,20 +2485,20 @@ static gint dissect_dmp_notification (tvbuff_t *tvb, packet_info *pinfo _U_, len, FALSE); } offset += len; - + if ((dmp.notif_type == ON) && (on_type < 0x03)) { /* ACP127 Receipient */ len = tvb_strsize (tvb, offset); tf = proto_tree_add_uint_format (notif_tree, hf_notif_acp127, tvb, offset, len, len, - "ACP127 Recipient, Length: %d", + "ACP127 Recipient, Length: %d", len - 1); if (len > 1) { if (len > 64) { proto_item_append_text (tf, " (incorrect, must be less than 64)"); } field_tree = proto_item_add_subtree (tf, ett_notif_acp127recip); - proto_tree_add_item (field_tree, hf_notif_acp127recip, tvb, + proto_tree_add_item (field_tree, hf_notif_acp127recip, tvb, offset, len, FALSE); } offset += len; @@ -2506,7 +2506,7 @@ static gint dissect_dmp_notification (tvbuff_t *tvb, packet_info *pinfo _U_, } else if (dmp.notif_type == NRN) { /* Non-Recipient Reason */ notif = tvb_get_guint8 (tvb, offset); - proto_tree_add_uint_format (notif_tree, hf_notif_non_rec_reason, + proto_tree_add_uint_format (notif_tree, hf_notif_non_rec_reason, tvb, offset, 1, notif, "Non-Receipt Reason%s: %s (%d)", (notif < 0x10) ? " (X.420)" : "", @@ -2515,21 +2515,21 @@ static gint dissect_dmp_notification (tvbuff_t *tvb, packet_info *pinfo _U_, /* Discard Reason */ notif = tvb_get_guint8 (tvb, offset); - proto_tree_add_uint_format (notif_tree, hf_notif_discard_reason, + proto_tree_add_uint_format (notif_tree, hf_notif_discard_reason, tvb, offset, 1, notif, "Discard Reason%s: %s (%d)", (notif < 0x10) ? " (X.420)" : "", discard_reason_str (notif), notif); offset += 1; } - + proto_item_set_len (en, offset - boffset); - + return offset; } -/* - * Ref chapter 6.3.7.1 STANAG 4406 message structure +/* + * Ref chapter 6.3.7.1 STANAG 4406 message structure * and chapter 6.3.8.1 IPM 88 message structure * and chapter 6.3.9.1 Report structure * and chapter 6.3.10.1 Notification structure @@ -2546,15 +2546,15 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, guint prev_rec_no = 0; gint rep_len, rep_no = 1; gint boffset = offset; - + if (dmp.msg_type == REPORT) { - en = proto_tree_add_item (dmp_tree, hf_content_report, tvb, offset, + en = proto_tree_add_item (dmp_tree, hf_content_report, tvb, offset, 7, FALSE); } else { en = proto_tree_add_item (dmp_tree, hf_content, tvb, offset, 7, FALSE); } message_tree = proto_item_add_subtree (en, ett_content); - + if (dmp.msg_type == STANAG || dmp.msg_type == IPM) { message = tvb_get_guint8 (tvb, offset); dmp.body_format = (message & 0x03); @@ -2563,7 +2563,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, /* Message Type */ dmp.st_type = (message & 0xC0) >> 6; tf = proto_tree_add_uint_format (message_tree, hf_message_st_type, - tvb, offset, 1, dmp.st_type, + tvb, offset, 1, dmp.st_type, "Message Type: %s (%d)", val_to_str (dmp.st_type, message_type_vals, ""), @@ -2575,7 +2575,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, if ((message & 0x20) >> 5) { /* Reserved */ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x20, - tvb, offset, 1, (message & 0x20)>>5, + tvb, offset, 1, (message & 0x20)>>5, "Reserved: %d", (message & 0x20)>>5); field_tree = proto_item_add_subtree (tf, ett_message_reserved); proto_tree_add_item (field_tree, hf_reserved_0x20, tvb, offset, @@ -2585,8 +2585,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, /* Precedence */ dmp_prec = (message & 0x1C) >> 2; tf = proto_tree_add_uint_format (message_tree, hf_message_precedence, - tvb, offset, 1, dmp_prec, - "Precedence: %s (%d)", + tvb, offset, 1, dmp_prec, + "Precedence: %s (%d)", val_to_str (dmp_prec, precedence, ""), dmp_prec); field_tree = proto_item_add_subtree (tf, ett_message_precedence); @@ -2597,29 +2597,29 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, if ((message & 0xE0) >> 5) { /* Reserved */ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0xE0, - tvb, offset, 1, (message & 0xE0)>>5, + tvb, offset, 1, (message & 0xE0)>>5, "Reserved: %d", (message & 0xE0)>>5); field_tree = proto_item_add_subtree (tf, ett_message_reserved); proto_tree_add_item (field_tree, hf_reserved_0xE0, tvb, offset, 1, FALSE); } - + /* Importance */ dmp_prec = (message & 0x1C) >> 2; tf = proto_tree_add_uint_format (message_tree, hf_message_importance, - tvb, offset, 1, dmp_prec, - "Importance: %s (%d)", + tvb, offset, 1, dmp_prec, + "Importance: %s (%d)", val_to_str (dmp_prec, importance, ""), dmp_prec); field_tree = proto_item_add_subtree (tf, ett_message_importance); proto_tree_add_item (field_tree, hf_message_importance, tvb, offset, 1, FALSE); } - + /* Body Format */ tf = proto_tree_add_uint_format (message_tree, hf_message_body_format, - tvb, offset, 1, message & 0x03, - "Body Format: %s (%d)", + tvb, offset, 1, message & 0x03, + "Body Format: %s (%d)", val_to_str (message & 0x03, body_format_vals, ""), message & 0x03); @@ -2637,8 +2637,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, if (dmp_sec_pol == NATO || dmp_sec_pol == NATIONAL) { /* NATO or National security policy */ tf = proto_tree_add_uint_format (message_tree, hf_message_sec_class_nat, - tvb, offset, 1, dmp_sec_class, - "Security Classification: %s (%d)", + tvb, offset, 1, dmp_sec_class, + "Security Classification: %s (%d)", val_to_str (dmp_sec_class, sec_class, "Unknown"), dmp_sec_class); @@ -2646,11 +2646,11 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item (field_tree, hf_message_sec_class_nat, tvb, offset, 1, FALSE); - proto_item_append_text (en, ", Security Label: %s", + proto_item_append_text (en, ", Security Label: %s", val_to_str (dmp_sec_class, sec_class, "Unknown")); } else { tf = proto_tree_add_uint_format (message_tree, hf_message_sec_class_val, - tvb, offset, 1, dmp_sec_class, + tvb, offset, 1, dmp_sec_class, "Security Classification: %d", dmp_sec_class); field_tree = proto_item_add_subtree (tf, ett_message_sec_class); @@ -2660,8 +2660,8 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, /* Security Policy */ tf = proto_tree_add_uint_format (message_tree, hf_message_sec_pol, - tvb, offset, 1, dmp_sec_pol, - "Security Policy: %s (%d)", + tvb, offset, 1, dmp_sec_pol, + "Security Policy: %s (%d)", val_to_str (dmp_sec_pol, sec_pol, ""), dmp_sec_pol); field_tree = proto_item_add_subtree (tf, ett_message_sec_pol); @@ -2678,9 +2678,9 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree_add_item (field_tree, hf_message_subject_disc, tvb, offset, 1, FALSE); if (message & 0x03) { - proto_item_append_text (tf, ": %s%s%s discarded", + proto_item_append_text (tf, ": %s%s%s discarded", (message & 0x02) ? "Authorizing users" : "", - (message & 0x03) == 0x03 ? " and " : "", + (message & 0x03) == 0x03 ? " and " : "", (message & 0x01) ? "Subject" : ""); } else { proto_item_append_text (tf, " (none)"); @@ -2699,7 +2699,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, } else if (message & 0x02) { /* Reserved */ tf = proto_tree_add_uint_format (message_tree, hf_reserved_0x02, - tvb, offset, 1, message & 0x02, + tvb, offset, 1, message & 0x02, "Reserved: %d", message & 0x02); field_tree = proto_item_add_subtree (tf, ett_message_reserved); proto_tree_add_item (field_tree, hf_reserved_0x02, tvb, offset, @@ -2717,7 +2717,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, message = tvb_get_guint8 (tvb, offset); if (message == 0xFF) { proto_tree_add_uint_format (message_tree, hf_message_mission_policy_id, - tvb, offset, 1, message, + tvb, offset, 1, message, "Mission Policy Identifier: Reserved"); } else { proto_tree_add_item (message_tree, hf_message_mission_policy_id, @@ -2753,9 +2753,9 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, if (message & 0xF0) { sec_cat = ep_alloc (MAX_SEC_CAT_LEN); sec_cat[0] = 0; - g_snprintf (sec_cat, 32 + 1, "%s%s%s%s", + g_snprintf (sec_cat, 32 + 1, "%s%s%s%s", (message & 0x80) ? ",cl" : "", - (message & 0x40) ? ",cs" : "", + (message & 0x40) ? ",cs" : "", (message & 0x20) ? ",ex" : "", (message & 0x10) ? ",ne" : ""); proto_item_append_text (tf, ": %s", &sec_cat[1]); @@ -2788,7 +2788,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, if (dmp.msg_type == STANAG || dmp.msg_type == IPM) { exp_time = tvb_get_guint8 (tvb, offset); tf = proto_tree_add_uint_format (message_tree, hf_message_exp_time, - tvb, offset, 1, exp_time, + tvb, offset, 1, exp_time, "Expiry Time: "); field_tree = proto_item_add_subtree (tf, ett_message_exp_time); proto_tree_add_item (field_tree, hf_message_exp_time_val, tvb, @@ -2814,19 +2814,19 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, 1, FALSE); proto_tree_add_item (field_tree, hf_message_dtg_val, tvb, offset, 1, FALSE); - secs = dmp_dec_dtg (dtg & 0x7F); + secs = dmp_dec_dtg ((guint8)(dtg & 0x7F)); if (dtg == 0) { proto_item_append_text (tf, "Not present"); } else if (secs == -1 || secs == -2) { proto_item_append_text (tf, "Reserved (0x%2.2x)", dtg & 0x7F); } else if (secs == 0) { proto_item_append_text (tf, "0 minutes in the %s (%s)", - (dtg & 0x80) ? dtg_sign.true_string : + (dtg & 0x80) ? dtg_sign.true_string : dtg_sign.false_string, abs_time_secs_to_str (dmp.subm_time)); } else { proto_item_append_text (tf, "%s in the %s (%s)", time_secs_to_str((gint32) secs), - (dtg & 0x80) ? dtg_sign.true_string : + (dtg & 0x80) ? dtg_sign.true_string : dtg_sign.false_string, (dtg & 0x80) ? abs_time_secs_to_str (dmp.subm_time + secs) : abs_time_secs_to_str (dmp.subm_time - secs)); @@ -2857,7 +2857,7 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, rep_len -= 2; } while (offset < rep_len) { - offset = dissect_dmp_report (tvb, pinfo, dmp_tree, offset, + offset = dissect_dmp_report (tvb, pinfo, dmp_tree, offset, &prev_rec_no, rep_no++); } } else if (dmp.msg_type == NOTIF) { @@ -2868,17 +2868,17 @@ static gint dissect_dmp_content (tvbuff_t *tvb, packet_info *pinfo _U_, return offset; } -static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo _U_ , +static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo _U_ , proto_tree *tree) { proto_tree *dmp_tree = NULL; proto_item *ti = NULL, *en = NULL; guint16 checksum1 = 0, checksum2 = 1; gint length, offset = 0; - + if (check_col (pinfo->cinfo, COL_PROTOCOL)) col_set_str (pinfo->cinfo, COL_PROTOCOL, "DMP"); - + if (check_col (pinfo->cinfo, COL_INFO)) col_clear (pinfo->cinfo, COL_INFO); @@ -2889,9 +2889,9 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo _U_ , ti = proto_tree_add_item (tree, proto_dmp, tvb, offset, -1, FALSE); dmp_tree = proto_item_add_subtree (ti, ett_dmp); - + offset = dissect_dmp_envelope (tvb, pinfo, dmp_tree, offset); - + if (dmp.version > DMP_VERSION) { /* Unsupported DMP Version, no point to continue */ if (check_col (pinfo->cinfo, COL_INFO)) { @@ -2908,12 +2908,12 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo _U_ , } else if (dmp.msg_type == ACK) { offset = dissect_dmp_ack (tvb, pinfo, dmp_tree, offset); } - + if (dmp.checksum) { length = tvb_length (tvb); checksum1 = crc16_x25_ccitt_tvb (tvb, length - 2); checksum2 = tvb_get_ntohs (tvb, offset); - + en = proto_tree_add_item (dmp_tree, hf_checksum, tvb, offset, 2, FALSE); if (checksum1 == checksum2) { @@ -2924,7 +2924,7 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo _U_ , expert_add_info_format (pinfo, en, PI_CHECKSUM, PI_WARN, "Bad checksum"); } } - + if (check_col (pinfo->cinfo, COL_INFO)) { if (dmp_align) { col_add_fstr (pinfo->cinfo, COL_INFO, "%-30.30s", msg_type_to_str ()); @@ -2957,10 +2957,10 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo _U_ , } } else if (dmp.struct_id[0] != 0) { if (dmp_align) { - col_append_fstr (pinfo->cinfo, COL_INFO, " Body Id: %s", + col_append_fstr (pinfo->cinfo, COL_INFO, " Body Id: %s", dmp.struct_id); } else { - col_append_fstr (pinfo->cinfo, COL_INFO, ", Body Id: %s", + col_append_fstr (pinfo->cinfo, COL_INFO, ", Body Id: %s", dmp.struct_id); } } @@ -2968,8 +2968,8 @@ static void dissect_dmp (tvbuff_t *tvb, packet_info *pinfo _U_ , col_append_fstr (pinfo->cinfo, COL_INFO, ", Checksum incorrect"); } } - - proto_item_append_text (ti, ", Version: %d, %s", dmp.version, + + proto_item_append_text (ti, ", Version: %d, %s", dmp.version, msg_type_to_str()); } @@ -2980,14 +2980,14 @@ void proto_register_dmp (void) ** Envelope */ { &hf_envelope, - { "Envelope", "dmp.envelope", FT_NONE, BASE_DEC, + { "Envelope", "dmp.envelope", FT_NONE, BASE_DEC, NULL, 0x0, "Envelope", HFILL}}, /* Protocol data */ { &hf_envelope_protocol_id, { "Protocol Identifier", "dmp.envelope.protocol.id", FT_UINT8, BASE_HEX, NULL, 0xF8, "Protocol Identifier", HFILL}}, - { &hf_envelope_version, + { &hf_envelope_version, { "Protocol Version", "dmp.envelope.version", FT_UINT8, BASE_DEC, VALS(version_vals), 0x07, "Protocol Version", HFILL } }, @@ -3010,7 +3010,7 @@ void proto_register_dmp (void) /* Message identifier */ { &hf_envelope_msg_id, - { "Message Identifier", "dmp.envelope.msg_id", FT_UINT16, BASE_DEC, + { "Message Identifier", "dmp.envelope.msg_id", FT_UINT16, BASE_DEC, NULL, 0x0, "Message identifier", HFILL}}, /* Submission time */ @@ -3027,24 +3027,24 @@ void proto_register_dmp (void) { "Time Difference", "dmp.envelope.time_diff", FT_UINT8, BASE_HEX, NULL, 0xFF, "Time Difference", HFILL } }, { &hf_envelope_time_diff_value, - { "Time Difference Value", "dmp.envelope.time_diff.current", FT_UINT8, + { "Time Difference Value", "dmp.envelope.time_diff.current", FT_UINT8, BASE_HEX, NULL, 0xFF, "Time Difference Value", HFILL } }, /* Envelope flags */ { &hf_envelope_flags, - { "Flags", "dmp.envelope.flags", FT_UINT8, BASE_DEC, + { "Flags", "dmp.envelope.flags", FT_UINT8, BASE_DEC, NULL, 0x0, "Envelope Flags", HFILL}}, { &hf_envelope_content_id_discarded, - { "Content Identifier discarded", "dmp.envelope.cont_id_discarded", - FT_BOOLEAN, 8, TFS(&yes_no), 0x80, + { "Content Identifier discarded", "dmp.envelope.cont_id_discarded", + FT_BOOLEAN, 8, TFS(&yes_no), 0x80, "Content identifier discarded", HFILL } }, { &hf_envelope_recip_reassign_prohib, { "Recipient reassign prohibited","dmp.envelope.recip_reassign_prohib", - FT_BOOLEAN, 8, TFS(&yes_no), 0x40, + FT_BOOLEAN, 8, TFS(&yes_no), 0x40, "Recipient Reassign prohibited", HFILL }}, { &hf_envelope_dl_expansion_prohib, { "DL expansion prohibited", "dmp.envelope.dl_expansion_prohib", - FT_BOOLEAN, 8, TFS(&yes_no), 0x20, "DL expansion prohibited", + FT_BOOLEAN, 8, TFS(&yes_no), 0x20, "DL expansion prohibited", HFILL } }, /* Recipient Count */ @@ -3059,13 +3059,13 @@ void proto_register_dmp (void) ** Address */ { &hf_addr_recipient, - { "Recipient Number", "dmp.envelope.recipient", FT_NONE, BASE_NONE, + { "Recipient Number", "dmp.envelope.recipient", FT_NONE, BASE_NONE, NULL, 0x0, "Recipient", HFILL } }, { &hf_addr_originator, - { "Originator", "dmp.envelope.originator", FT_NONE, BASE_NONE, + { "Originator", "dmp.envelope.originator", FT_NONE, BASE_NONE, NULL, 0x0, "Originator", HFILL } }, { &hf_addr_reporting_name, - { "Reporting Name Number", "dmp.envelope.reporting_name", FT_NONE, + { "Reporting Name Number", "dmp.envelope.reporting_name", FT_NONE, BASE_NONE, NULL, 0x0, "Reporting Name", HFILL } }, /* @@ -3074,13 +3074,13 @@ void proto_register_dmp (void) { &hf_addr_dir_addr_ext, { "Address Extended", "dmp.address.addr_ext", FT_BOOLEAN, 8, NULL, 0x80, "Address Extended", HFILL } }, - { &hf_addr_dir_rec_no, - { "Recipient Number (bits 3-0)", "dmp.address.rec_no1", FT_UINT8, + { &hf_addr_dir_rec_no, + { "Recipient Number (bits 3-0)", "dmp.address.rec_no1", FT_UINT8, BASE_DEC, NULL, 0xF0, "Recipient Number (bits 3-0) Offset", HFILL } }, - { &hf_addr_dir_rec_no_ext1, - { "Recipient Number (bits 9-4)", "dmp.address.rec_no2", FT_UINT8, + { &hf_addr_dir_rec_no_ext1, + { "Recipient Number (bits 9-4)", "dmp.address.rec_no2", FT_UINT8, BASE_DEC, NULL, 0x3F, "Recipient Number (bits 9-4) Offset", HFILL } }, - { &hf_addr_dir_rec_no_ext2, + { &hf_addr_dir_rec_no_ext2, { "Recipient Number (bits 14-10)", "dmp.address.rec_no3", FT_UINT8, BASE_DEC, NULL, 0x1F, "Recipient Number (bits 14-10) Offset",HFILL } }, { &hf_addr_dir_rep_req1, @@ -3101,11 +3101,11 @@ void proto_register_dmp (void) { &hf_addr_dir_not_req3, { "Notification Request 3", "dmp.address.not_req3", FT_UINT8, BASE_HEX, VALS (notif_vals), 0xC0, "Notification Request 3", HFILL } }, - { &hf_addr_dir_action, - { "Action", "dmp.address.action", FT_BOOLEAN, 8, + { &hf_addr_dir_action, + { "Action", "dmp.address.action", FT_BOOLEAN, 8, TFS (&yes_no), 0x80, "Action", HFILL } }, { &hf_addr_dir_address, - { "Direct Address (bits 6-0)", "dmp.address.direct1", FT_UINT8, + { "Direct Address (bits 6-0)", "dmp.address.direct1", FT_UINT8, BASE_DEC, NULL, 0x7F, "Direct Address (bits 6-0)", HFILL } }, { &hf_addr_dir_address_ext1, { "Direct Address (bits 12-7)", "dmp.address.direct2", FT_UINT8, @@ -3120,8 +3120,8 @@ void proto_register_dmp (void) { &hf_addr_ext_form, { "Address Form", "dmp.address.addr_form", FT_UINT8, BASE_DEC, VALS (&addr_form), 0xE0, "Address Form", HFILL } }, - { &hf_addr_ext_action, - { "Action", "dmp.address.action", FT_BOOLEAN, 8, + { &hf_addr_ext_action, + { "Action", "dmp.address.action", FT_BOOLEAN, 8, TFS (&yes_no), 0x10, "Action", HFILL } }, { &hf_addr_ext_rep_req, { "Report Request", "dmp.address.rep_rec3", FT_UINT8, BASE_HEX, @@ -3132,11 +3132,11 @@ void proto_register_dmp (void) { &hf_addr_ext_rec_ext, { "Recipient Number Extended", "dmp.address.rec_no_ext", FT_BOOLEAN, 8, NULL, 0x80, "Recipient Number Extended", HFILL } }, - { &hf_addr_ext_rec_no, - { "Recipient Number (bits 6-0)", "dmp.address.rec_no1", FT_UINT8, + { &hf_addr_ext_rec_no, + { "Recipient Number (bits 6-0)", "dmp.address.rec_no1", FT_UINT8, BASE_DEC, NULL, 0x7F, "Recipient Number (bits 6-0) Offset", HFILL } }, - { &hf_addr_ext_rec_no_ext1, - { "Recipient Number (bits 14-7)", "dmp.address.rec_no2", FT_UINT8, + { &hf_addr_ext_rec_no_ext1, + { "Recipient Number (bits 14-7)", "dmp.address.rec_no2", FT_UINT8, BASE_DEC, NULL, 0xFF, "Recipient Number (bits 14-7) Offset", HFILL } }, { &hf_addr_ext_address, { "Extended Address", "dmp.address.addr_form", FT_NONE, BASE_NONE, @@ -3145,33 +3145,33 @@ void proto_register_dmp (void) { "Address Type", "dmp.address.addr_type", FT_UINT8, BASE_DEC, VALS (&ext_addr_type), 0xE0, "Address Type", HFILL } }, { &hf_addr_ext_type_ext, - { "Address Type Extended", "dmp.address.addr_type_ext", FT_UINT8, - BASE_DEC, VALS (&ext_addr_type_ext), 0xE0, "Address Type Extended", + { "Address Type Extended", "dmp.address.addr_type_ext", FT_UINT8, + BASE_DEC, VALS (&ext_addr_type_ext), 0xE0, "Address Type Extended", HFILL } }, { &hf_addr_ext_length, - { "Address Length (bits 4-0)", "dmp.address.addr_length", FT_UINT8, + { "Address Length (bits 4-0)", "dmp.address.addr_length", FT_UINT8, BASE_DEC, NULL, 0x1F, "Address Length (bits 4-0)", HFILL } }, { &hf_addr_ext_length_ext, - { "Address Length (bits 9-5)", "dmp.address.addr_length_ext", FT_UINT8, + { "Address Length (bits 9-5)", "dmp.address.addr_length_ext", FT_UINT8, BASE_DEC, NULL, 0x1F, "Address Length (bits 9-5)", HFILL } }, { &hf_addr_ext_asn1_ber, - { "ASN.1 BER-encoded OR-name", "dmp.message.or_name", FT_NONE, + { "ASN.1 BER-encoded OR-name", "dmp.message.or_name", FT_NONE, BASE_NONE, NULL, 0x0, "ASN.1 BER-encoded OR-name", HFILL } }, { &hf_addr_ext_asn1_per, - { "ASN.1 PER-encoded OR-name", "dmp.message.asn1_per", FT_BYTES, + { "ASN.1 PER-encoded OR-name", "dmp.message.asn1_per", FT_BYTES, BASE_DEC, NULL, 0x0, "ASN.1 PER-encoded OR-name", HFILL } }, { &hf_addr_ext_unknown, - { "Unknown encoded address", "dmp.message.unknown", FT_BYTES, + { "Unknown encoded address", "dmp.message.unknown", FT_BYTES, BASE_DEC, NULL, 0x0, "Unknown encoded address", HFILL } }, /* ** Message content */ { &hf_content, - { "Message Content", "dmp.message", FT_NONE, BASE_DEC, + { "Message Content", "dmp.message", FT_NONE, BASE_DEC, NULL, 0x0, "Message Content", HFILL } }, { &hf_content_report, - { "Report Content", "dmp.message", FT_NONE, BASE_DEC, + { "Report Content", "dmp.message", FT_NONE, BASE_DEC, NULL, 0x0, "Report Content", HFILL } }, { &hf_message_st_type, @@ -3201,8 +3201,8 @@ void proto_register_dmp (void) { "Heading Flags", "dmp.message.heading_flags", FT_NONE, BASE_NONE, NULL, 0x0, "Heading Flags", HFILL } }, { &hf_message_auth_users, - { "Authorizing users discarded", "dmp.message.auth_discarded", - FT_BOOLEAN, 8, TFS (&yes_no), 0x02, + { "Authorizing users discarded", "dmp.message.auth_discarded", + FT_BOOLEAN, 8, TFS (&yes_no), 0x02, "Authorizing users discarded", HFILL }}, { &hf_message_subject_disc, { "Subject discarded", "dmp.message.subject_discarded", FT_BOOLEAN, 8, @@ -3210,14 +3210,14 @@ void proto_register_dmp (void) /* National Policy Identifier */ { &hf_message_national_policy_id, - { "National Policy Identifier", "dmp.message.nat_pol_id", FT_UINT8, - BASE_DEC, VALS(nat_pol_id), 0x0, "National Policy Identifier", + { "National Policy Identifier", "dmp.message.nat_pol_id", FT_UINT8, + BASE_DEC, VALS(nat_pol_id), 0x0, "National Policy Identifier", HFILL } }, /* Mission Policy Identifier */ { &hf_message_mission_policy_id, - { "Mission Policy Identifier", "dmp.message.mission_pol_id", FT_UINT8, - BASE_DEC, NULL, 0x0, "Mission Policy Identifier", + { "Mission Policy Identifier", "dmp.message.mission_pol_id", FT_UINT8, + BASE_DEC, NULL, 0x0, "Mission Policy Identifier", HFILL } }, /* Security Categories */ @@ -3263,7 +3263,7 @@ void proto_register_dmp (void) { &hf_message_sec_cat_bit7, { "Bit 7", "dmp.message.sec_cat.bit7", FT_BOOLEAN, 8, TFS (&set_notset), 0x80, "Bit 7", HFILL } }, - + /* Expiry Time */ { &hf_message_exp_time, { "Expiry Time", "dmp.message.expiry_time", FT_UINT8, BASE_HEX, @@ -3282,7 +3282,7 @@ void proto_register_dmp (void) { &hf_message_dtg_val, { "DTG Value", "dmp.message.dtg.val", FT_UINT8, BASE_HEX, NULL, 0x7F, "DTG Value", HFILL } }, - + /* SIC */ { &hf_message_sic, { "SIC", "dmp.message.sic", FT_STRING, BASE_DEC, @@ -3306,17 +3306,17 @@ void proto_register_dmp (void) { "Length Bitmap (0 = 3 bytes, 1 = 4-8 bytes)", "dmp.message.sic_bitmap", FT_UINT8, BASE_HEX, NULL, 0xFF, "SIC Length Bitmap", HFILL } }, { &hf_message_sic_bits, - { "Bit 7-4", "dmp.message.sic_bits", FT_UINT8, BASE_HEX, - VALS(sic_bit_vals), 0xF0, "SIC Bit 7-4, Characters [A-Z0-9] only", + { "Bit 7-4", "dmp.message.sic_bits", FT_UINT8, BASE_HEX, + VALS(sic_bit_vals), 0xF0, "SIC Bit 7-4, Characters [A-Z0-9] only", HFILL } }, { &hf_message_sic_bits_any, - { "Bit 7-4", "dmp.message.sic_bits_any", FT_UINT8, BASE_HEX, - VALS(sic_bit_any_vals), 0xF0, "SIC Bit 7-4, Any valid characters", + { "Bit 7-4", "dmp.message.sic_bits_any", FT_UINT8, BASE_HEX, + VALS(sic_bit_any_vals), 0xF0, "SIC Bit 7-4, Any valid characters", HFILL } }, /* Subject Message Id */ { &hf_message_subj_id, - { "Subject Message Identifier", "dmp.message.subj_id", FT_UINT16, + { "Subject Message Identifier", "dmp.message.subj_id", FT_UINT16, BASE_DEC, NULL, 0x0, "Subject Message Identifier", HFILL } }, /* @@ -3336,7 +3336,7 @@ void proto_register_dmp (void) /* Subject */ { &hf_message_subject, - { "Subject", "dmp.message.subject", FT_STRINGZ, BASE_DEC, + { "Subject", "dmp.message.subject", FT_STRINGZ, BASE_DEC, NULL, 0x0, "Subject", HFILL } }, /* Message Body */ @@ -3363,7 +3363,7 @@ void proto_register_dmp (void) NULL, 0x0, "Structured Body Id (fixed text string)", HFILL } }, { &hf_message_bodyid_zstring, { "Structured Id", "dmp.message.body.id", FT_STRINGZ, BASE_DEC, - NULL, 0x0, "Structured Body Id (zero terminated text string)", + NULL, 0x0, "Structured Body Id (zero terminated text string)", HFILL } }, { &hf_message_body_structured, { "Structured Body", "dmp.message.body.structured", FT_BYTES, BASE_DEC, @@ -3372,8 +3372,8 @@ void proto_register_dmp (void) { "Uncompressed User data", "dmp.message.body.uncompressed", FT_UINT8, BASE_DEC, NULL, 0x0, "Uncompressed User data", HFILL } }, { &hf_message_body_uncompressed, - { "Uncompressed Message Body", "dmp.message.body.uncompressed", - FT_STRING, BASE_DEC, NULL, 0x0, "Uncompressed Message Body", + { "Uncompressed Message Body", "dmp.message.body.uncompressed", + FT_STRING, BASE_DEC, NULL, 0x0, "Uncompressed Message Body", HFILL } }, /* @@ -3400,29 +3400,29 @@ void proto_register_dmp (void) TFS (&addr_enc), 0x40, "Address Encoding", HFILL } }, { &hf_report_reason, { "Reason (X.411)", "dmp.report.reason", FT_UINT8, BASE_DEC, - VALS (x411_NonDeliveryReasonCode_vals), 0x3F, + VALS (x411_NonDeliveryReasonCode_vals), 0x3F, "Reason", HFILL } }, { &hf_report_info_present_ndr, { "Info Present", "dmp.report.info_present", FT_BOOLEAN, 8, TFS (&present_values), 0x80, "Info Present", HFILL } }, { &hf_report_diagn, { "Diagnostic (X.411)", "dmp.report.diagnostic", FT_UINT8, BASE_DEC, - VALS (x411_NonDeliveryDiagnosticCode_vals), 0x7F, + VALS (x411_NonDeliveryDiagnosticCode_vals), 0x7F, "Diagnostic", HFILL } }, { &hf_report_suppl_info_len, - { "Supplementary Information", "dmp.message.suppl_info_len", FT_UINT8, + { "Supplementary Information", "dmp.message.suppl_info_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Supplementary Information Length", HFILL } }, { &hf_report_suppl_info, - { "Supplementary Information", "dmp.message.suppl_info", FT_STRINGZ, + { "Supplementary Information", "dmp.message.suppl_info", FT_STRINGZ, BASE_DEC, NULL, 0x0, "Supplementary Information", HFILL } }, - + /* ** Notification */ { &hf_notif, - { "Notification", "dmp.notification", FT_UINT8, BASE_DEC, + { "Notification", "dmp.notification", FT_UINT8, BASE_DEC, NULL, 0x0, "Notification", HFILL} }, - + { &hf_notif_type, { "Notification Type", "dmp.notification.type", FT_UINT8, BASE_DEC, VALS (notif_type), 0x03, "Notification Type", HFILL } }, @@ -3430,23 +3430,23 @@ void proto_register_dmp (void) { "Receipt Time", "dmp.notification.receipt_time", FT_UINT8, BASE_HEX, NULL, 0x0, "Receipt time", HFILL } }, { &hf_notif_rec_time_val, - { "Receipt Time Value", "dmp.notification.receipt_time_val", FT_UINT8, + { "Receipt Time Value", "dmp.notification.receipt_time_val", FT_UINT8, BASE_HEX, NULL, 0xFF, "Receipt Time Value", HFILL } }, { &hf_notif_suppl_info_len, - { "Supplementary Information", "dmp.notification.suppl_info_len", + { "Supplementary Information", "dmp.notification.suppl_info_len", FT_UINT8, BASE_DEC, NULL, 0x0, "Supplementary Information Length", HFILL } }, { &hf_notif_suppl_info, - { "Supplementary Information", "dmp.notification.suppl_info", - FT_STRINGZ, BASE_DEC, NULL, 0x0, "Supplementary Information", + { "Supplementary Information", "dmp.notification.suppl_info", + FT_STRINGZ, BASE_DEC, NULL, 0x0, "Supplementary Information", HFILL } }, { &hf_notif_non_rec_reason, - { "Non-Receipt Reason", "dmp.notification.non_rec_reason", - FT_UINT8, BASE_DEC, VALS (x420_NonReceiptReasonField_vals), 0x0, + { "Non-Receipt Reason", "dmp.notification.non_rec_reason", + FT_UINT8, BASE_DEC, VALS (x420_NonReceiptReasonField_vals), 0x0, "Non-Receipt Reason", HFILL } }, { &hf_notif_discard_reason, { "Discard Reason", "dmp.notification.discard_reason", FT_UINT8, - BASE_DEC, VALS (x420_DiscardReasonField_vals), 0x0, + BASE_DEC, VALS (x420_DiscardReasonField_vals), 0x0, "Discard Reason", HFILL } }, { &hf_notif_on_type, { "ON Type", "dmp.notification.on_type", FT_UINT8, BASE_DEC, @@ -3455,7 +3455,7 @@ void proto_register_dmp (void) { "ACP127 Recipient", "dmp.notification.acp127recip_len", FT_UINT8, BASE_DEC, NULL, 0x0, "ACP 127 Recipient Length", HFILL } }, { &hf_notif_acp127recip, - { "ACP127 Recipient", "dmp.notification.acp127recip", FT_STRINGZ, + { "ACP127 Recipient", "dmp.notification.acp127recip", FT_STRINGZ, BASE_DEC, NULL, 0x0, "ACP 127 Recipient", HFILL } }, /* @@ -3480,7 +3480,7 @@ void proto_register_dmp (void) { &hf_checksum, { "Checksum", "dmp.checksum", FT_UINT16, BASE_HEX, NULL, 0x0, "Checksum", HFILL } }, - + /* ** Reserved values */ @@ -3502,17 +3502,17 @@ void proto_register_dmp (void) { &hf_reserved_0x0F, { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, NULL, 0x0F, "Reserved", HFILL } }, - { &hf_reserved_0x1F, - { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, + { &hf_reserved_0x1F, + { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, NULL, 0x1F, "Reserved", HFILL } }, - { &hf_reserved_0x20, - { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, + { &hf_reserved_0x20, + { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, NULL, 0x20, "Reserved", HFILL } }, - { &hf_reserved_0x40, - { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, + { &hf_reserved_0x40, + { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, NULL, 0x40, "Reserved", HFILL } }, - { &hf_reserved_0xC0, - { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, + { &hf_reserved_0xC0, + { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, NULL, 0xC0, "Reserved", HFILL } }, { &hf_reserved_0xE0, { "Reserved", "dmp.reserved", FT_UINT8, BASE_DEC, @@ -3521,7 +3521,7 @@ void proto_register_dmp (void) { "Reserved", "dmp.reserved", FT_UINT16, BASE_DEC, NULL, 0x8000, "Reserved", HFILL } }, }; - + static gint *ett[] = { &ett_dmp, &ett_envelope, @@ -3591,20 +3591,20 @@ void proto_register_dmp (void) }; module_t *dmp_module; - + proto_dmp = proto_register_protocol (PNAME, PSNAME, PFNAME); - + proto_register_field_array (proto_dmp, hf, array_length (hf)); proto_register_subtree_array (ett, array_length (ett)); /* Register our configuration options */ dmp_module = prefs_register_protocol (proto_dmp, proto_reg_handoff_dmp); - prefs_register_uint_preference (dmp_module, "udp_port", + prefs_register_uint_preference (dmp_module, "udp_port", "Primary DMP port number", "Primary port number used for DMP traffic", 10, &global_dmp_port); - prefs_register_uint_preference (dmp_module, "udp_port_second", + prefs_register_uint_preference (dmp_module, "udp_port_second", "Secondary DMP port number", "Second port number used for DMP traffic " "(0 to disable)", -- cgit v1.2.1