diff options
Diffstat (limited to 'epan/dissectors/packet-ubx-gps_l1_lnav.c')
-rw-r--r-- | epan/dissectors/packet-ubx-gps_l1_lnav.c | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/epan/dissectors/packet-ubx-gps_l1_lnav.c b/epan/dissectors/packet-ubx-gps_l1_lnav.c index 0758175e..a6e9dfc2 100644 --- a/epan/dissectors/packet-ubx-gps_l1_lnav.c +++ b/epan/dissectors/packet-ubx-gps_l1_lnav.c @@ -120,84 +120,84 @@ static const value_string SV_HEALTH_CODE[] = { }; // Initialize the protocol and registered fields -static int proto_ubx_gps_l1 = -1; +static int proto_ubx_gps_l1; // Telemetry Word (see IS-GPS-200N, Section 20.3.3.1) -static int hf_ubx_gps_l1_tlm_preamble = -1; -static int hf_ubx_gps_l1_tlm_message = -1; -static int hf_ubx_gps_l1_tlm_integrity = -1; -static int hf_ubx_gps_l1_tlm_reserved = -1; -static int hf_ubx_gps_l1_tlm_parity = -1; +static int hf_ubx_gps_l1_tlm_preamble; +static int hf_ubx_gps_l1_tlm_message; +static int hf_ubx_gps_l1_tlm_integrity; +static int hf_ubx_gps_l1_tlm_reserved; +static int hf_ubx_gps_l1_tlm_parity; // Handover Word (see IS-GPS-200N, Section 20.3.3.2) -static int hf_ubx_gps_l1_how_tow_count = -1; -static int hf_ubx_gps_l1_how_alert = -1; -static int hf_ubx_gps_l1_how_anti_spoof = -1; -static int hf_ubx_gps_l1_how_subframe_id = -1; -static int hf_ubx_gps_l1_how_parity_sol = -1; -static int hf_ubx_gps_l1_how_parity = -1; +static int hf_ubx_gps_l1_how_tow_count; +static int hf_ubx_gps_l1_how_alert; +static int hf_ubx_gps_l1_how_anti_spoof; +static int hf_ubx_gps_l1_how_subframe_id; +static int hf_ubx_gps_l1_how_parity_sol; +static int hf_ubx_gps_l1_how_parity; // Subframe 1 (see IS-GPS-200N, Section 20.3.3.3) -static int hf_ubx_gps_l1_sf1 = -1; -static int hf_ubx_gps_l1_sf1_week_no = -1; -static int hf_ubx_gps_l1_sf1_l2_channel_code = -1; -static int hf_ubx_gps_l1_sf1_ura_index = -1; -static int hf_ubx_gps_l1_sf1_sv_health_summary = -1; -static int hf_ubx_gps_l1_sf1_sv_health = -1; -static int hf_ubx_gps_l1_sf1_iodc_msbs = -1; -static int hf_ubx_gps_l1_sf1_w3_parity = -1; -static int hf_ubx_gps_l1_sf1_w4_l2_p_data_flag = -1; -static int hf_ubx_gps_l1_sf1_w4_reserved = -1; -static int hf_ubx_gps_l1_sf1_w4_parity = -1; -static int hf_ubx_gps_l1_sf1_w5_reserved = -1; -static int hf_ubx_gps_l1_sf1_w5_parity = -1; -static int hf_ubx_gps_l1_sf1_w6_reserved = -1; -static int hf_ubx_gps_l1_sf1_w6_parity = -1; -static int hf_ubx_gps_l1_sf1_w7_reserved = -1; -static int hf_ubx_gps_l1_sf1_w7_tgd = -1; -static int hf_ubx_gps_l1_sf1_w7_parity = -1; -static int hf_ubx_gps_l1_sf1_w8_iodc_lsbs = -1; -static int hf_ubx_gps_l1_sf1_w8_toc = -1; -static int hf_ubx_gps_l1_sf1_w8_parity = -1; -static int hf_ubx_gps_l1_sf1_w9_af2 = -1; -static int hf_ubx_gps_l1_sf1_w9_af1 = -1; -static int hf_ubx_gps_l1_sf1_w9_parity = -1; -static int hf_ubx_gps_l1_sf1_w10_af0 = -1; -static int hf_ubx_gps_l1_sf1_w10_parity = -1; +static int hf_ubx_gps_l1_sf1; +static int hf_ubx_gps_l1_sf1_week_no; +static int hf_ubx_gps_l1_sf1_l2_channel_code; +static int hf_ubx_gps_l1_sf1_ura_index; +static int hf_ubx_gps_l1_sf1_sv_health_summary; +static int hf_ubx_gps_l1_sf1_sv_health; +static int hf_ubx_gps_l1_sf1_iodc_msbs; +static int hf_ubx_gps_l1_sf1_w3_parity; +static int hf_ubx_gps_l1_sf1_w4_l2_p_data_flag; +static int hf_ubx_gps_l1_sf1_w4_reserved; +static int hf_ubx_gps_l1_sf1_w4_parity; +static int hf_ubx_gps_l1_sf1_w5_reserved; +static int hf_ubx_gps_l1_sf1_w5_parity; +static int hf_ubx_gps_l1_sf1_w6_reserved; +static int hf_ubx_gps_l1_sf1_w6_parity; +static int hf_ubx_gps_l1_sf1_w7_reserved; +static int hf_ubx_gps_l1_sf1_w7_tgd; +static int hf_ubx_gps_l1_sf1_w7_parity; +static int hf_ubx_gps_l1_sf1_w8_iodc_lsbs; +static int hf_ubx_gps_l1_sf1_w8_toc; +static int hf_ubx_gps_l1_sf1_w8_parity; +static int hf_ubx_gps_l1_sf1_w9_af2; +static int hf_ubx_gps_l1_sf1_w9_af1; +static int hf_ubx_gps_l1_sf1_w9_parity; +static int hf_ubx_gps_l1_sf1_w10_af0; +static int hf_ubx_gps_l1_sf1_w10_parity; static dissector_table_t ubx_gps_l1_sf_dissector_table; -static expert_field ei_ubx_gps_l1_tlm_preamble = EI_INIT; -static expert_field ei_ubx_gps_l1_how_tow_count = EI_INIT; -static expert_field ei_ubx_gps_l1_how_subframe_id = EI_INIT; - -static int ett_ubx_gps_l1 = -1; -static int ett_ubx_gps_l1_tlm = -1; -static int ett_ubx_gps_l1_how = -1; -static int ett_ubx_gps_l1_sf1_w3 = -1; -static int ett_ubx_gps_l1_sf1_w4 = -1; -static int ett_ubx_gps_l1_sf1_w5 = -1; -static int ett_ubx_gps_l1_sf1_w6 = -1; -static int ett_ubx_gps_l1_sf1_w7 = -1; -static int ett_ubx_gps_l1_sf1_w8 = -1; -static int ett_ubx_gps_l1_sf1_w9 = -1; -static int ett_ubx_gps_l1_sf1_w10 = -1; +static expert_field ei_ubx_gps_l1_tlm_preamble; +static expert_field ei_ubx_gps_l1_how_tow_count; +static expert_field ei_ubx_gps_l1_how_subframe_id; + +static int ett_ubx_gps_l1; +static int ett_ubx_gps_l1_tlm; +static int ett_ubx_gps_l1_how; +static int ett_ubx_gps_l1_sf1_w3; +static int ett_ubx_gps_l1_sf1_w4; +static int ett_ubx_gps_l1_sf1_w5; +static int ett_ubx_gps_l1_sf1_w6; +static int ett_ubx_gps_l1_sf1_w7; +static int ett_ubx_gps_l1_sf1_w8; +static int ett_ubx_gps_l1_sf1_w9; +static int ett_ubx_gps_l1_sf1_w10; /* Format TOW count */ -static void fmt_tow_count(gchar *label, gint32 c) { - guint tow = c << 2; +static void fmt_tow_count(char *label, int32_t c) { + unsigned tow = c << 2; snprintf(label, ITEM_LABEL_LENGTH, "%d (TOW: %.1fs)", c, tow * 1.5); } /* Format Clock Data Reference Time t_OC */ -static void fmt_t_oc(gchar *label, gint32 i) { - guint t_oc = i << 4; +static void fmt_t_oc(char *label, int32_t i) { + unsigned t_oc = i << 4; snprintf(label, ITEM_LABEL_LENGTH, "%ds", t_oc); } /* Dissect GPS L1 C/A LNAV navigation message */ static int dissect_ubx_gps_l1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) { - guint32 subframe_id = (tvb_get_guint32(tvb, 4, ENC_LITTLE_ENDIAN) & 0x00000700) >> 8; + uint32_t subframe_id = (tvb_get_uint32(tvb, 4, ENC_LITTLE_ENDIAN) & 0x00000700) >> 8; col_set_str(pinfo->cinfo, COL_PROTOCOL, "GPS L1 LNAV"); col_clear(pinfo->cinfo, COL_INFO); @@ -217,7 +217,7 @@ static int dissect_ubx_gps_l1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre static void dissect_ubx_gps_l1_tlm(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_tree *tlm_tree = proto_tree_add_subtree_format(tree, tvb, 0, 4, ett_ubx_gps_l1_tlm, NULL, "Word 1: Telemetry"); - guint32 tlm_preamble; + uint32_t tlm_preamble; proto_item* pi_tlm_preamble = proto_tree_add_item_ret_uint(tlm_tree, hf_ubx_gps_l1_tlm_preamble, tvb, 0, 4, ENC_LITTLE_ENDIAN, &tlm_preamble); if (tlm_preamble != 0x8b) { expert_add_info_format(pinfo, pi_tlm_preamble, &ei_ubx_gps_l1_tlm_preamble, "Invalid preamble"); @@ -231,11 +231,11 @@ static void dissect_ubx_gps_l1_tlm(tvbuff_t *tvb, packet_info *pinfo _U_, proto_ // Dissect the handover word (HOW) static void dissect_ubx_gps_l1_how(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { - guint32 subframe_id; + uint32_t subframe_id; proto_tree *how_tree = proto_tree_add_subtree_format(tree, tvb, 4, 4, ett_ubx_gps_l1_how, NULL, "Word 2: Handover"); - guint32 tow_count; + uint32_t tow_count; proto_item* pi_how_tow_count = proto_tree_add_item_ret_uint(how_tree, hf_ubx_gps_l1_how_tow_count, tvb, 4, 4, ENC_LITTLE_ENDIAN, &tow_count); if (tow_count > 100799) { expert_add_info_format(pinfo, pi_how_tow_count, &ei_ubx_gps_l1_how_tow_count, "Invalid TOW count"); @@ -366,7 +366,7 @@ void proto_register_ubx_gps_l1(void) { {&ei_ubx_gps_l1_how_subframe_id, {"gps_l1.how.subframe_id", PI_PROTOCOL, PI_WARN, "Illegal subframe ID", EXPFILL}}, }; - static gint *ett[] = { + static int *ett[] = { &ett_ubx_gps_l1, &ett_ubx_gps_l1_tlm, &ett_ubx_gps_l1_how, |