From c08fa6f3cf2ded7ff34393739c7b26c953f74ddb Mon Sep 17 00:00:00 2001 From: Gerasimos Dimitriadis Date: Tue, 26 Jan 2010 18:21:17 +0000 Subject: Move underscore escaping/unscaping function to strutil.c; Update decoding of IS-801 Request GPS Acquisition Assistance svn path=/trunk/; revision=31685 --- epan/dissectors/packet-ansi_801.c | 64 +++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 33 deletions(-) (limited to 'epan/dissectors/packet-ansi_801.c') diff --git a/epan/dissectors/packet-ansi_801.c b/epan/dissectors/packet-ansi_801.c index e82d3fa7b8..06f7812409 100644 --- a/epan/dissectors/packet-ansi_801.c +++ b/epan/dissectors/packet-ansi_801.c @@ -97,6 +97,10 @@ static int hf_ansi_801_spare_bits = -1; static int hf_ansi_801_bad_sv_present = -1; static int hf_ansi_801_num_bad_sv = -1; static int hf_ansi_801_bad_sv_prn_num = -1; +static int hf_ansi_801_dopp_req = -1; +static int hf_ansi_801_add_dopp_req = -1; +static int hf_ansi_801_code_ph_par_req = -1; +static int hf_ansi_801_az_el_req = -1; static char bigbuf[1024]; static dissector_handle_t data_handle; @@ -970,44 +974,18 @@ for_pr_gps_sat_health(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset static void rev_req_gps_acq_ass(tvbuff_t *tvb, proto_tree *tree, guint len, guint32 offset) { - guint8 oct; guint32 saved_offset; + guint32 bit_offset; SHORT_DATA_CHECK(len, 1); - saved_offset = offset; + bit_offset = offset << 3; - oct = tvb_get_guint8(tvb, offset); - - other_decode_bitfield_value(bigbuf, oct, 0x80, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Doppler (0th order) term %srequested", - bigbuf, - (oct & 0x80) ? "" : "not "); - - other_decode_bitfield_value(bigbuf, oct, 0x40, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Additional Doppler terms %srequested", - bigbuf, - (oct & 0x40) ? "" : "not "); - - other_decode_bitfield_value(bigbuf, oct, 0x20, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Code phase parameters %srequested", - bigbuf, - (oct & 0x20) ? "" : "not "); - - other_decode_bitfield_value(bigbuf, oct, 0x10, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Azimuth and elevation angle %srequested", - bigbuf, - (oct & 0x10) ? "" : "not "); - - other_decode_bitfield_value(bigbuf, oct, 0x0f, 8); - proto_tree_add_text(tree, tvb, offset, 1, - "%s : Reserved", - bigbuf); - + proto_tree_add_bits_item(tree, hf_ansi_801_dopp_req, tvb, bit_offset++, 1, FALSE); + proto_tree_add_bits_item(tree, hf_ansi_801_add_dopp_req, tvb, bit_offset++, 1, FALSE); + proto_tree_add_bits_item(tree, hf_ansi_801_code_ph_par_req, tvb, bit_offset++, 1, FALSE); + proto_tree_add_bits_item(tree, hf_ansi_801_az_el_req, tvb, bit_offset++, 1, FALSE); + proto_tree_add_bits_item(tree, hf_ansi_801_spare_bits, tvb, bit_offset, 4, FALSE); offset++; EXTRANEOUS_DATA_CHECK(len, offset - saved_offset); @@ -2351,6 +2329,26 @@ proto_register_ansi_801(void) FT_UINT8, BASE_DEC, NULL, 0x00, NULL, HFILL } }, + { &hf_ansi_801_dopp_req, + { "Doppler (0th order) term requested (DOPP_REQ)", "ansi_801.dopp_req", + FT_BOOLEAN, 8, NULL, 0x00, + NULL, HFILL } + }, + { &hf_ansi_801_add_dopp_req, + { "Additional Doppler terms requested (ADD_DOPP_REQ)", "ansi_801.add_dopp_req", + FT_BOOLEAN, 8, NULL, 0x00, + NULL, HFILL } + }, + { &hf_ansi_801_code_ph_par_req, + { "Code phase parameters requested (CODE_PH_PAR_REQ)", "ansi_801.code_ph_par_req", + FT_BOOLEAN, 8, NULL, 0x00, + NULL, HFILL } + }, + { &hf_ansi_801_az_el_req, + { "Azimuth and elevation angle requested (AZ_EL_REQ)", "ansi_801.az_el_req", + FT_BOOLEAN, 8, NULL, 0x00, + NULL, HFILL } + }, }; -- cgit v1.2.3