2 * Routines for ANSI IS-801 (Location Services (PLD)) dissection
4 * Location Services (Position Determination Service)
5 * 3GPP2 C.S0022-0 v1.0 IS-801
7 * Location Services (Position Determination Service)
8 * 3GPP2 C.S0022-0-1 v1.0 IS-801 Addendum
10 * Copyright 2004, Michael Lum <mlum [AT] telostech.com>
11 * In association with Telos Technology Inc.
12 * Copyright 2007, Michael Lum <michael.lum [AT] utstar.com>
13 * In association with UTStarcom Inc.
17 * Wireshark - Network traffic analyzer
18 * By Gerald Combs <gerald@wireshark.org>
19 * Copyright 1998 Gerald Combs
21 * This program is free software; you can redistribute it and/or
22 * modify it under the terms of the GNU General Public License
23 * as published by the Free Software Foundation; either version 2
24 * of the License, or (at your option) any later version.
26 * This program is distributed in the hope that it will be useful,
27 * but WITHOUT ANY WARRANTY; without even the implied warranty of
28 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 * GNU General Public License for more details.
31 * You should have received a copy of the GNU General Public License
32 * along with this program; if not, write to the Free Software
33 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
43 #include <epan/packet.h>
44 #include <epan/wmem/wmem.h>
45 #include <epan/to_str.h>
47 void proto_register_ansi_801(void);
48 void proto_reg_handoff_ansi_801(void);
50 static const char *ansi_proto_name
= "ANSI IS-801 (Location Services (PLD))";
51 static const char *ansi_proto_name_short
= "IS-801";
53 #define ANSI_801_FORWARD 0
54 #define ANSI_801_REVERSE 1
57 /* Initialize the subtree pointers */
58 static gint ett_ansi_801
= -1;
60 /* Initialize the protocol and registered fields */
61 static int proto_ansi_801
= -1;
62 static int hf_ansi_801_for_req_type
= -1;
63 static int hf_ansi_801_for_rsp_type
= -1;
64 static int hf_ansi_801_rev_req_type
= -1;
65 static int hf_ansi_801_rev_rsp_type
= -1;
66 static int hf_ansi_801_for_sess_tag
= -1;
67 static int hf_ansi_801_rev_sess_tag
= -1;
68 static int hf_ansi_801_sess_tag
= -1;
70 static int hf_ansi_801_time_ref_cdma
= -1;
71 static int hf_ansi_801_lat
= -1;
72 static int hf_ansi_801_long
= -1;
73 static int hf_ansi_801_loc_uncrtnty_ang
= -1;
74 static int hf_ansi_801_loc_uncrtnty_a
= -1;
75 static int hf_ansi_801_loc_uncrtnty_p
= -1;
76 static int hf_ansi_801_fix_type
= -1;
77 static int hf_ansi_801_velocity_incl
= -1;
78 static int hf_ansi_801_velocity_hor
= -1;
79 static int hf_ansi_801_heading
= -1;
80 static int hf_ansi_801_velocity_ver
= -1;
81 static int hf_ansi_801_clock_incl
= -1;
82 static int hf_ansi_801_clock_bias
= -1;
83 static int hf_ansi_801_clock_drift
= -1;
84 static int hf_ansi_801_height_incl
= -1;
85 static int hf_ansi_801_height
= -1;
86 static int hf_ansi_801_loc_uncrtnty_v
= -1;
87 static int hf_ansi_801_reserved_bits
= -1;
89 static int hf_ansi_801_bad_sv_present
= -1;
90 static int hf_ansi_801_num_bad_sv
= -1;
91 static int hf_ansi_801_bad_sv_prn_num
= -1;
92 static int hf_ansi_801_dopp_req
= -1;
93 static int hf_ansi_801_add_dopp_req
= -1;
94 static int hf_ansi_801_code_ph_par_req
= -1;
95 static int hf_ansi_801_az_el_req
= -1;
97 static int hf_ansi_801_pref_resp_qual
= -1;
98 static int hf_ansi_801_num_fixes
= -1;
99 static int hf_ansi_801_t_betw_fixes
= -1;
100 static int hf_ansi_801_offset_req
= -1;
102 static dissector_handle_t ansi_801_handle
;
104 static char bigbuf
[1024];
107 /* PARAM FUNCTIONS */
109 #define EXTRANEOUS_DATA_CHECK(edc_len, edc_max_len) \
110 if ((edc_len) > (edc_max_len)) \
112 proto_tree_add_text(tree, tvb, \
113 offset, (edc_len) - (edc_max_len), "Extraneous Data"); \
116 #define SHORT_DATA_CHECK(sdc_len, sdc_min_len) \
117 if ((sdc_len) < (sdc_min_len)) \
119 proto_tree_add_text(tree, tvb, \
120 offset, (sdc_len), "Short Data (?)"); \
124 #define EXACT_DATA_CHECK(edc_len, edc_eq_len) \
125 if ((edc_len) != (edc_eq_len)) \
127 proto_tree_add_text(tree, tvb, \
128 offset, (edc_len), "Unexpected Data Length"); \
134 * Table 3.2-4 for PD_MSG_TYPE = '0000000'
136 static const value_string for_req_type_strings
[] = {
138 { 2, "Request MS Information" },
139 { 3, "Request Autonomous Measurement Weighting Factors" },
140 { 4, "Request Pseudorange Measurement" },
141 { 5, "Request Pilot Phase Measurement" },
142 { 1, "Request Location Response" },
143 { 6, "Request Time Offset Measurement" },
144 { 7, "Request Cancellation" },
147 #define NUM_FOR_REQ_TYPE (sizeof(for_req_type_strings)/sizeof(value_string))
148 static gint ett_for_req_type
[NUM_FOR_REQ_TYPE
];
150 static const value_string for_rsp_type_strings
[] = {
152 { 2, "Provide BS Capabilities" },
153 { 4, "Provide GPS Acquisition Assistance" },
154 { 6, "Provide GPS Location Assistance Spherical Coordinates" },
155 { 7, "Provide GPS Location Assistance Cartesian Coordinates" },
156 { 5, "Provide GPS Sensitivity Assistance" },
157 { 3, "Provide Base Station Almanac" },
158 { 8, "Provide GPS Almanac" },
159 { 9, "Provide GPS Ephemeris" },
160 { 10, "Provide GPS Navigation Message Bits" },
161 { 1, "Provide Location Response" },
162 { 11, "Provide GPS Almanac Correction" },
163 { 12, "Provide GPS Satellite Health Information" },
166 #define NUM_FOR_RSP_TYPE (sizeof(for_rsp_type_strings)/sizeof(value_string))
167 static gint ett_for_rsp_type
[NUM_FOR_RSP_TYPE
];
170 static const value_string rev_rsp_type_strings
[] = {
172 { 2, "Provide MS Information" },
173 { 3, "Provide Autonomous Measurement Weighting Factors" },
174 { 4, "Provide Pseudorange Measurement" },
175 { 5, "Provide Pilot Phase Measurement" },
176 { 1, "Provide Location Response" },
177 { 6, "Provide Time Offset Measurement" },
178 { 7, "Provide Cancellation Acknowledgement" },
181 #define NUM_REV_RSP_TYPE (sizeof(rev_rsp_type_strings)/sizeof(value_string))
182 static gint ett_rev_rsp_type
[NUM_REV_RSP_TYPE
];
185 * Table 2.2-5 for PD_MSG_TYPE = '0000000'
187 static const value_string rev_req_type_strings
[] = {
189 { 2, "Request BS Capabilities" },
190 { 4, "Request GPS Acquisition Assistance" },
191 { 6, "Request GPS Location Assistance" },
193 { 5, "Request GPS Sensitivity Assistance" },
194 { 3, "Request Base Station Almanac" },
195 { 8, "Request GPS Almanac" },
196 { 9, "Request GPS Ephemeris" },
197 { 10, "Request GPS Navigation Message Bits" },
198 { 1, "Request Location Response" },
199 { 11, "Request GPS Almanac Correction" },
200 { 12, "Request GPS Satellite Health Information" },
203 #define NUM_REV_REQ_TYPE (sizeof(rev_req_type_strings)/sizeof(value_string))
204 static gint ett_rev_req_type
[NUM_REV_REQ_TYPE
];
207 for_req_pseudo_meas(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
209 guint32 bit_offset
, spare_bits
;
210 guint32 saved_offset
, value
;
212 SHORT_DATA_CHECK(len
, 3);
213 saved_offset
= offset
;
214 bit_offset
= offset
<< 3;
217 proto_tree_add_bits_item(tree
, hf_ansi_801_pref_resp_qual
, tvb
, bit_offset
, 3, ENC_BIG_ENDIAN
);
221 value
= tvb_get_bits8(tvb
, bit_offset
, 8) + 1;
222 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_num_fixes
, tvb
, bit_offset
, 8, value
, "%u", value
);
226 value
= tvb_get_bits8(tvb
, bit_offset
, 8);
227 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_t_betw_fixes
, tvb
, bit_offset
, 8, value
, "%u seconds", value
);
231 proto_tree_add_bits_item(tree
, hf_ansi_801_offset_req
, tvb
, bit_offset
++, 1, ENC_BIG_ENDIAN
);
233 if(bit_offset
& 0x07)
235 spare_bits
= 8 - (bit_offset
& 0x07);
236 proto_tree_add_bits_item(tree
, hf_ansi_801_reserved_bits
, tvb
, bit_offset
, spare_bits
, ENC_BIG_ENDIAN
);
237 bit_offset
+= spare_bits
;
240 offset
= bit_offset
>> 3;
242 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
247 for_req_pilot_ph_meas(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
250 guint32 saved_offset
;
252 SHORT_DATA_CHECK(len
, 3);
254 saved_offset
= offset
;
256 value
= tvb_get_ntoh24(tvb
, offset
);
258 other_decode_bitfield_value(bigbuf
, value
>> 16, 0xe0, 8);
259 proto_tree_add_text(tree
, tvb
, offset
, 1,
260 "%s : Preferred response quality, %u",
262 (value
& 0xe00000) >> 21);
264 other_decode_bitfield_value(bigbuf
, value
>> 16, 0x1f, 8);
265 proto_tree_add_text(tree
, tvb
, offset
, 1,
266 "%s : Number of fixes (MSB), %u",
268 (value
& 0x1fe000) >> 13);
270 other_decode_bitfield_value(bigbuf
, value
>> 8, 0xe0, 8);
271 proto_tree_add_text(tree
, tvb
, offset
, 1,
272 "%s : Number of fixes (LSB)",
275 other_decode_bitfield_value(bigbuf
, value
>> 8, 0x1f, 8);
276 proto_tree_add_text(tree
, tvb
, offset
, 1,
277 "%s : Time between fixes (MSB), %u",
279 (value
& 0x001fe0) >> 5);
281 other_decode_bitfield_value(bigbuf
, value
, 0xe0, 8);
282 proto_tree_add_text(tree
, tvb
, offset
, 1,
283 "%s : Time between fixes (LSB)",
286 other_decode_bitfield_value(bigbuf
, value
, 0x10, 8);
287 proto_tree_add_text(tree
, tvb
, offset
, 1,
288 "%s : Offset %srequested",
290 (value
& 0x10) ? "" : "not ");
292 other_decode_bitfield_value(bigbuf
, value
, 0x08, 8);
293 proto_tree_add_text(tree
, tvb
, offset
, 1,
294 "%s : Desired pilot phase resolution: at least %s PN chip resolution",
296 (value
& 0x08) ? "1/8th" : "1");
298 other_decode_bitfield_value(bigbuf
, value
, 0x07, 8);
299 proto_tree_add_text(tree
, tvb
, offset
, 1,
305 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
309 for_req_loc_response(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
312 guint32 saved_offset
;
314 SHORT_DATA_CHECK(len
, 3);
316 saved_offset
= offset
;
318 value
= tvb_get_ntoh24(tvb
, offset
);
320 other_decode_bitfield_value(bigbuf
, value
>> 16, 0xe0, 8);
321 proto_tree_add_text(tree
, tvb
, offset
, 1,
322 "%s : Preferred response quality, %u",
324 (value
& 0xe00000) >> 21);
326 other_decode_bitfield_value(bigbuf
, value
>> 16, 0x1f, 8);
327 proto_tree_add_text(tree
, tvb
, offset
, 1,
328 "%s : Number of fixes (MSB), %u",
330 (value
& 0x1fe000) >> 13);
332 other_decode_bitfield_value(bigbuf
, value
>> 8, 0xe0, 8);
333 proto_tree_add_text(tree
, tvb
, offset
, 1,
334 "%s : Number of fixes (LSB)",
337 other_decode_bitfield_value(bigbuf
, value
>> 8, 0x1f, 8);
338 proto_tree_add_text(tree
, tvb
, offset
, 1,
339 "%s : Time between fixes (MSB), %u",
341 (value
& 0x001fe0) >> 5);
343 other_decode_bitfield_value(bigbuf
, value
, 0xe0, 8);
344 proto_tree_add_text(tree
, tvb
, offset
, 1,
345 "%s : Time between fixes (LSB)",
348 other_decode_bitfield_value(bigbuf
, value
, 0x10, 8);
349 proto_tree_add_text(tree
, tvb
, offset
, 1,
350 "%s : Height information %srequested",
352 (value
& 0x10) ? "" : "not ");
354 other_decode_bitfield_value(bigbuf
, value
, 0x08, 8);
355 proto_tree_add_text(tree
, tvb
, offset
, 1,
356 "%s : Clock correction for GPS time %srequested",
358 (value
& 0x08) ? "" : "not ");
360 other_decode_bitfield_value(bigbuf
, value
, 0x04, 8);
361 proto_tree_add_text(tree
, tvb
, offset
, 1,
362 "%s : Velocity information %srequested",
364 (value
& 0x04) ? "" : "not ");
366 other_decode_bitfield_value(bigbuf
, value
, 0x03, 8);
367 proto_tree_add_text(tree
, tvb
, offset
, 1,
373 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
377 for_req_time_off_meas(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
381 guint32 saved_offset
;
383 SHORT_DATA_CHECK(len
, 1);
385 saved_offset
= offset
;
387 oct
= tvb_get_guint8(tvb
, offset
);
389 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
390 proto_tree_add_text(tree
, tvb
, offset
, 1,
391 "%s : Use action time indicator",
396 other_decode_bitfield_value(bigbuf
, oct
, 0x7e, 8);
397 proto_tree_add_text(tree
, tvb
, offset
, 1,
398 "%s : Action time, %u",
409 other_decode_bitfield_value(bigbuf
, oct
, bit_mask
, 8);
410 proto_tree_add_text(tree
, tvb
, offset
, 1,
416 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
420 for_req_cancel(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
423 guint32 saved_offset
;
424 const gchar
*str
= NULL
;
427 SHORT_DATA_CHECK(len
, 1);
429 saved_offset
= offset
;
431 oct
= tvb_get_guint8(tvb
, offset
);
433 str
= try_val_to_str_idx((oct
& 0xf0) >> 4, for_req_type_strings
, &idx
);
439 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
440 proto_tree_add_text(tree
, tvb
, offset
, 1,
441 "%s : Cancellation Type: (%u) %s",
446 other_decode_bitfield_value(bigbuf
, oct
, 0x0f, 8);
447 proto_tree_add_text(tree
, tvb
, offset
, 1,
453 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
457 for_reject(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
460 guint32 saved_offset
;
461 const gchar
*str
= NULL
;
464 saved_offset
= offset
;
466 SHORT_DATA_CHECK(len
, 1);
468 oct
= tvb_get_guint8(tvb
, offset
);
470 str
= try_val_to_str_idx((oct
& 0xf0) >> 4, rev_req_type_strings
, &idx
);
476 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
477 proto_tree_add_text(tree
, tvb
, offset
, 1,
478 "%s : Reject request type: (%u) %s",
483 switch ((oct
& 0x0e) >> 1)
485 case 0x00: str
= "Capability not supported by the base station"; break;
486 case 0x01: str
= "Capability normally supported by the base station but temporarily not available or not enabled"; break;
487 default: str
= "Reserved"; break;
490 other_decode_bitfield_value(bigbuf
, oct
, 0x0e, 8);
491 proto_tree_add_text(tree
, tvb
, offset
, 1,
492 "%s : Reject reason: %s",
496 other_decode_bitfield_value(bigbuf
, oct
, 0x01, 8);
497 proto_tree_add_text(tree
, tvb
, offset
, 1,
503 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
507 for_pr_bs_cap(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
510 guint32 saved_offset
;
512 saved_offset
= offset
;
514 SHORT_DATA_CHECK(len
, 2);
516 oct
= tvb_get_guint8(tvb
, offset
);
518 other_decode_bitfield_value(bigbuf
, oct
, 0xfc, 8);
519 proto_tree_add_text(tree
, tvb
, offset
, 1,
523 other_decode_bitfield_value(bigbuf
, oct
, 0x02, 8);
524 proto_tree_add_text(tree
, tvb
, offset
, 1,
525 "%s : GPSC_ID: GPS capability indicator",
528 other_decode_bitfield_value(bigbuf
, oct
, 0x01, 8);
529 proto_tree_add_text(tree
, tvb
, offset
, 1,
530 "%s : AFLTC_ID: Advanced forward link trilateration capability indicator",
535 oct
= tvb_get_guint8(tvb
, offset
);
538 proto_tree_add_text(tree
, tvb
, offset
, 1,
539 "APDC_ID: Autonomous position determination capability indicator: None");
543 proto_tree_add_text(tree
, tvb
, offset
, 1,
544 "APDC_ID: Autonomous position determination capability indicator: Autonomous Location Technology Identifier %u",
550 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
554 for_pr_gps_sense_ass(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
559 guint32 saved_offset
;
561 saved_offset
= offset
;
563 SHORT_DATA_CHECK(len
, 4);
565 value
= tvb_get_ntohs(tvb
, offset
);
567 other_decode_bitfield_value(bigbuf
, value
, 0xffe0, 16);
568 proto_tree_add_text(tree
, tvb
, offset
, 2,
569 "%s : REF_BIT_NUM: %u",
571 (value
& 0xffe0) >> 5);
573 num_dr_p
= (value
& 0x001e) >> 1;
575 other_decode_bitfield_value(bigbuf
, value
, 0x001e, 16);
576 proto_tree_add_text(tree
, tvb
, offset
, 2,
577 "%s : NUM_DR_P: Number of data records in this part: %u",
582 oct
= tvb_get_guint8(tvb
, offset
);
584 other_decode_bitfield_value(bigbuf
, value
, 0x0001, 16);
585 value
= ((value
& 0x0001) << 7) | ((oct
& 0xfe) >> 1);
587 proto_tree_add_text(tree
, tvb
, offset
- 2, 2,
588 "%s : DR_SIZE: Data record size in 2-bit units (MSB): %u",
592 other_decode_bitfield_value(bigbuf
, oct
, 0xfe, 8);
593 proto_tree_add_text(tree
, tvb
, offset
, 1,
594 "%s : DR_SIZE: (LSB)",
600 oct
= tvb_get_guint8(tvb
, offset
);
602 other_decode_bitfield_value(bigbuf
, value
, 0x01, 8);
603 value
= ((value
& 0x0001) << 2) | ((oct
& 0xc0) >> 6);
605 proto_tree_add_text(tree
, tvb
, offset
- 1, 1,
606 "%s : PART_NUM: The part number (MSB): %u",
610 other_decode_bitfield_value(bigbuf
, oct
, 0xc0, 8);
611 proto_tree_add_text(tree
, tvb
, offset
, 1,
612 "%s : PART_NUM: (LSB)",
615 other_decode_bitfield_value(bigbuf
, oct
, 0x38, 8);
616 proto_tree_add_text(tree
, tvb
, offset
, 1,
617 "%s : TOTAL_PARTS: Total number of parts: %u",
621 other_decode_bitfield_value(bigbuf
, oct
, 0x07, 8);
622 proto_tree_add_text(tree
, tvb
, offset
, 1,
623 "%s : Data records (MSB)",
628 proto_tree_add_text(tree
, tvb
, offset
, (len
- (offset
- saved_offset
)),
629 "%s : Data records (LSB) + Reserved",
632 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
636 for_pr_gps_almanac(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
640 guint32 saved_offset
;
642 saved_offset
= offset
;
644 SHORT_DATA_CHECK(len
, 4);
646 value
= tvb_get_ntohl(tvb
, offset
);
647 num_sv
= (value
& 0xfc000000) >> 26;
649 other_decode_bitfield_value(bigbuf
, value
, 0xfc000000, 32);
650 proto_tree_add_text(tree
, tvb
, offset
, 4,
651 "%s : NUM_SV_P: Number of satellites in this part: %u",
655 other_decode_bitfield_value(bigbuf
, value
, 0x03fc0000, 32);
656 proto_tree_add_text(tree
, tvb
, offset
, 4,
657 "%s : WEEK_NUM: The GPS week number of the almanac: %u",
659 (value
& 0x03fc0000) >> 18);
661 other_decode_bitfield_value(bigbuf
, value
, 0x0003fc00, 32);
662 proto_tree_add_text(tree
, tvb
, offset
, 4,
663 "%s : TOA: The reference time of the almanac: %u",
665 (value
& 0x0003fc00) >> 10);
667 other_decode_bitfield_value(bigbuf
, value
, 0x000003e0, 32);
668 proto_tree_add_text(tree
, tvb
, offset
, 4,
669 "%s : PART_NUM: The part number: %u",
671 (value
& 0x000003e0) >> 5);
673 other_decode_bitfield_value(bigbuf
, value
, 0x0000001f, 32);
674 proto_tree_add_text(tree
, tvb
, offset
, 4,
675 "%s : TOTAL_PARTS: The total number of parts: %u",
677 (value
& 0x0000001f));
681 proto_tree_add_text(tree
, tvb
, offset
, (len
- (offset
- saved_offset
)),
682 "%u Data records + Reserved",
685 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
689 for_pr_gps_nav_msg_bits(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
693 guint32 saved_offset
;
695 saved_offset
= offset
;
697 SHORT_DATA_CHECK(len
, 2);
699 value
= tvb_get_ntohs(tvb
, offset
);
700 num_sv
= (value
& 0xfc00) >> 10;
702 other_decode_bitfield_value(bigbuf
, value
, 0xfc00, 16);
703 proto_tree_add_text(tree
, tvb
, offset
, 2,
704 "%s : NUM_SV_P: Number of satellites in this part: %u",
708 other_decode_bitfield_value(bigbuf
, value
, 0x03e0, 16);
709 proto_tree_add_text(tree
, tvb
, offset
, 2,
710 "%s : PART_NUM: The part number: %u",
712 (value
& 0x03e0) >> 5);
714 other_decode_bitfield_value(bigbuf
, value
, 0x001f, 16);
715 proto_tree_add_text(tree
, tvb
, offset
, 2,
716 "%s : TOTAL_PARTS: The total number of parts: %u",
722 proto_tree_add_text(tree
, tvb
, offset
, (len
- (offset
- saved_offset
)),
723 "%u SUBF_4_5_INCL ... Data records + Reserved",
726 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
730 * shared for both forward/reverse directions
732 static const true_false_string ansi_801_fix_type_vals
= {
738 pr_loc_response(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
740 guint32 bit_offset
, spare_bits
;
743 guint32 saved_offset
;
744 guint64 fix_type
, velocity_incl
, clock_incl
, height_incl
;
745 const gchar
*str
= NULL
;
747 SHORT_DATA_CHECK(len
, 11);
748 saved_offset
= offset
;
749 bit_offset
= offset
<< 3;
752 value
= tvb_get_bits16(tvb
, bit_offset
, 14, ENC_BIG_ENDIAN
);
753 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_time_ref_cdma
, tvb
, bit_offset
, 14, value
* 50,
754 "%u frames (0x%04x)", value
* 50, value
);
758 value
= tvb_get_bits32(tvb
, bit_offset
, 25, ENC_BIG_ENDIAN
);
759 fl_value
= (float)(-90.0 + ((float)value
* 180 / 33554432));
760 proto_tree_add_float_bits_format_value(tree
, hf_ansi_801_lat
, tvb
, bit_offset
, 25, fl_value
,
761 "%.5f degrees %s (0x%08x)", fabs(fl_value
), fl_value
< 0 ? "South" : "North", value
);
765 value
= tvb_get_bits32(tvb
, bit_offset
, 26, ENC_BIG_ENDIAN
);
766 fl_value
= (float)(-180.0 + ((float)value
* 180 / 33554432));
767 proto_tree_add_float_bits_format_value(tree
, hf_ansi_801_long
, tvb
, bit_offset
, 26, fl_value
,
768 "%.5f degrees %s (0x%08x)", fabs(fl_value
), fl_value
< 0 ? "West" : "East", value
);
771 /* LOC_UNCRTNTY_ANG */
772 value
= tvb_get_bits8(tvb
, bit_offset
, 4);
773 fl_value
= (float)(5.625 * value
);
774 proto_tree_add_float_bits_format_value(tree
, hf_ansi_801_loc_uncrtnty_ang
, tvb
, bit_offset
, 4, fl_value
,
775 "%.5f degrees (0x%02x)", fl_value
, value
);
779 value
= tvb_get_bits8(tvb
, bit_offset
, 5);
782 case 0x1e: str
= "> 12288.00 meters"; break;
783 case 0x1f: str
= "Not computable"; break;
785 fl_value
= (float)(0.5 * (1 << (value
>> 1)));
788 str
= wmem_strdup_printf(wmem_packet_scope(), "%.2f meters", fl_value
);
790 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_loc_uncrtnty_a
, tvb
, bit_offset
, 5, value
,
791 "%s (0x%02x)", str
, value
);
795 value
= tvb_get_bits8(tvb
, bit_offset
, 5);
798 case 0x1e: str
= "> 12288.00 meters"; break;
799 case 0x1f: str
= "Not computable"; break;
801 fl_value
= (float)(0.5 * (1 << (value
>> 1)));
804 str
= wmem_strdup_printf(wmem_packet_scope(), "%.2f meters", fl_value
);
806 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_loc_uncrtnty_p
, tvb
, bit_offset
, 5, value
,
807 "%s (0x%02x)", str
, value
);
811 proto_tree_add_bits_ret_val(tree
, hf_ansi_801_fix_type
, tvb
, bit_offset
++, 1, &fix_type
, ENC_BIG_ENDIAN
);
814 proto_tree_add_bits_ret_val(tree
, hf_ansi_801_velocity_incl
, tvb
, bit_offset
++, 1, &velocity_incl
, ENC_BIG_ENDIAN
);
820 value
= tvb_get_bits16(tvb
, bit_offset
, 9, ENC_BIG_ENDIAN
);
821 fl_value
= (float)(0.25 * value
);
822 proto_tree_add_float_bits_format_value(tree
, hf_ansi_801_velocity_hor
, tvb
, bit_offset
, 9, fl_value
,
823 "%.2f m/s (0x%04x)", fl_value
, value
);
827 value
= tvb_get_bits16(tvb
, bit_offset
, 10, ENC_BIG_ENDIAN
);
828 fl_value
= (float)value
* 360 / 1024;
829 proto_tree_add_float_bits_format_value(tree
, hf_ansi_801_heading
, tvb
, bit_offset
, 10, fl_value
,
830 "%.3f degrees (0x%04x)", fl_value
, value
);
836 value
= tvb_get_bits8(tvb
, bit_offset
, 8);
837 fl_value
= (float)(-64 + 0.5 * value
);
838 proto_tree_add_float_bits_format_value(tree
, hf_ansi_801_velocity_ver
, tvb
, bit_offset
, 8, fl_value
,
839 "%.1f m/s (0x%02x)", fl_value
, value
);
845 proto_tree_add_bits_ret_val(tree
, hf_ansi_801_clock_incl
, tvb
, bit_offset
++, 1, &clock_incl
, ENC_BIG_ENDIAN
);
850 value
= tvb_get_bits32(tvb
, bit_offset
, 18, ENC_BIG_ENDIAN
);
851 proto_tree_add_int_bits_format_value(tree
, hf_ansi_801_clock_bias
, tvb
, bit_offset
, 18, (gint32
)value
- 13000,
852 "%d ns (0x%06x)", (gint32
)value
- 13000, value
);
856 value
= tvb_get_bits16(tvb
, bit_offset
, 16, ENC_BIG_ENDIAN
);
857 proto_tree_add_int_bits_format_value(tree
, hf_ansi_801_clock_drift
, tvb
, bit_offset
, 16, (gint16
)value
,
858 "%d ppb (ns/s) (0x%04x)", (gint16
)value
, value
);
863 proto_tree_add_bits_ret_val(tree
, hf_ansi_801_height_incl
, tvb
, bit_offset
++, 1, &height_incl
, ENC_BIG_ENDIAN
);
868 value
= tvb_get_bits16(tvb
, bit_offset
, 14, ENC_BIG_ENDIAN
);
869 proto_tree_add_int_bits_format_value(tree
, hf_ansi_801_height
, tvb
, bit_offset
, 14, (gint32
)value
- 500,
870 "%d m (0x%04x)", (gint32
)value
- 500, value
);
874 value
= tvb_get_bits8(tvb
, bit_offset
, 5);
877 case 0x1e: str
= "> 12288.00 meters"; break;
878 case 0x1f: str
= "Not computable"; break;
880 fl_value
= (float)(0.5 * (1 << (value
>> 1)));
883 str
= wmem_strdup_printf(wmem_packet_scope(), "%.2f meters", fl_value
);
885 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_loc_uncrtnty_v
, tvb
, bit_offset
, 5, value
,
886 "%s (0x%02x)", str
, value
);
890 if(bit_offset
& 0x07)
892 spare_bits
= 8 - (bit_offset
& 0x07);
893 proto_tree_add_bits_item(tree
, hf_ansi_801_reserved_bits
, tvb
, bit_offset
, spare_bits
, ENC_BIG_ENDIAN
);
894 bit_offset
+= spare_bits
;
897 offset
= bit_offset
>> 3;
899 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
903 for_pr_loc_response(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
905 pr_loc_response(tvb
, tree
, len
, offset
);
909 for_pr_gps_sat_health(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
911 guint32 bit_offset
, spare_bits
;
913 guint32 saved_offset
, num_bad_sv
, bad_sv_prn_num
;
914 guint64 bad_sv_present
;
916 SHORT_DATA_CHECK(len
, 1);
917 saved_offset
= offset
;
918 bit_offset
= offset
<< 3;
921 proto_tree_add_bits_ret_val(tree
, hf_ansi_801_bad_sv_present
, tvb
, bit_offset
++, 1, &bad_sv_present
, ENC_BIG_ENDIAN
);
926 num_bad_sv
= tvb_get_bits8(tvb
, bit_offset
, 4) + 1;
927 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_num_bad_sv
, tvb
, bit_offset
, 4, num_bad_sv
,
931 for (i
=0; i
< num_bad_sv
; i
++)
934 bad_sv_prn_num
= tvb_get_bits8(tvb
, bit_offset
, 5) + 1;
935 proto_tree_add_uint_bits_format_value(tree
, hf_ansi_801_bad_sv_prn_num
, tvb
, bit_offset
, 5, bad_sv_prn_num
,
936 "%u", bad_sv_prn_num
);
941 if(bit_offset
& 0x07)
943 spare_bits
= 8 - (bit_offset
& 0x07);
944 proto_tree_add_bits_item(tree
, hf_ansi_801_reserved_bits
, tvb
, bit_offset
, spare_bits
, ENC_BIG_ENDIAN
);
945 bit_offset
+= spare_bits
;
948 offset
= bit_offset
>> 3;
950 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
954 rev_req_gps_acq_ass(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
956 guint32 saved_offset
;
959 SHORT_DATA_CHECK(len
, 1);
960 saved_offset
= offset
;
961 bit_offset
= offset
<< 3;
963 proto_tree_add_bits_item(tree
, hf_ansi_801_dopp_req
, tvb
, bit_offset
++, 1, ENC_BIG_ENDIAN
);
964 proto_tree_add_bits_item(tree
, hf_ansi_801_add_dopp_req
, tvb
, bit_offset
++, 1, ENC_BIG_ENDIAN
);
965 proto_tree_add_bits_item(tree
, hf_ansi_801_code_ph_par_req
, tvb
, bit_offset
++, 1, ENC_BIG_ENDIAN
);
966 proto_tree_add_bits_item(tree
, hf_ansi_801_az_el_req
, tvb
, bit_offset
++, 1, ENC_BIG_ENDIAN
);
967 proto_tree_add_bits_item(tree
, hf_ansi_801_reserved_bits
, tvb
, bit_offset
, 4, ENC_BIG_ENDIAN
);
970 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
974 rev_req_gps_loc_ass(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
977 guint32 saved_offset
;
979 SHORT_DATA_CHECK(len
, 1);
981 saved_offset
= offset
;
983 oct
= tvb_get_guint8(tvb
, offset
);
985 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
986 proto_tree_add_text(tree
, tvb
, offset
, 1,
987 "%s : Coordinate type requested: %s coordinates",
989 (oct
& 0x80) ? "Spherical" : "Cartesian");
991 other_decode_bitfield_value(bigbuf
, oct
, 0x7f, 8);
992 proto_tree_add_text(tree
, tvb
, offset
, 1,
998 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1002 rev_req_bs_alm(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1005 guint32 saved_offset
;
1007 SHORT_DATA_CHECK(len
, 1);
1009 saved_offset
= offset
;
1011 oct
= tvb_get_guint8(tvb
, offset
);
1013 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
1014 proto_tree_add_text(tree
, tvb
, offset
, 1,
1015 "%s : Extended base station almanac %srequested",
1017 (oct
& 0x80) ? "" : "not ");
1019 other_decode_bitfield_value(bigbuf
, oct
, 0x7f, 8);
1020 proto_tree_add_text(tree
, tvb
, offset
, 1,
1026 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1030 rev_req_gps_ephemeris(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1033 guint32 saved_offset
;
1035 SHORT_DATA_CHECK(len
, 1);
1037 saved_offset
= offset
;
1039 oct
= tvb_get_guint8(tvb
, offset
);
1041 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
1042 proto_tree_add_text(tree
, tvb
, offset
, 1,
1043 "%s : Alpha and Beta parameters %srequested",
1045 (oct
& 0x80) ? "" : "not ");
1047 other_decode_bitfield_value(bigbuf
, oct
, 0x7f, 8);
1048 proto_tree_add_text(tree
, tvb
, offset
, 1,
1054 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1058 rev_req_gps_nav_msg_bits(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1061 guint32 saved_offset
;
1063 SHORT_DATA_CHECK(len
, 1);
1065 saved_offset
= offset
;
1067 oct
= tvb_get_guint8(tvb
, offset
);
1069 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
1070 proto_tree_add_text(tree
, tvb
, offset
, 1,
1071 "%s : Subframes 4 and 5 %srequested",
1073 (oct
& 0x80) ? "" : "not ");
1075 other_decode_bitfield_value(bigbuf
, oct
, 0x7f, 8);
1076 proto_tree_add_text(tree
, tvb
, offset
, 1,
1082 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1086 rev_req_loc_response(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1089 guint32 saved_offset
;
1091 SHORT_DATA_CHECK(len
, 1);
1093 saved_offset
= offset
;
1095 oct
= tvb_get_guint8(tvb
, offset
);
1097 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
1098 proto_tree_add_text(tree
, tvb
, offset
, 1,
1099 "%s : Height information %srequested",
1101 (oct
& 0x80) ? "" : "not ");
1103 other_decode_bitfield_value(bigbuf
, oct
, 0x40, 8);
1104 proto_tree_add_text(tree
, tvb
, offset
, 1,
1105 "%s : Clock correction for GPS time %srequested",
1107 (oct
& 0x40) ? "" : "not ");
1109 other_decode_bitfield_value(bigbuf
, oct
, 0x20, 8);
1110 proto_tree_add_text(tree
, tvb
, offset
, 1,
1111 "%s : Velocity information %srequested",
1113 (oct
& 0x20) ? "" : "not ");
1115 other_decode_bitfield_value(bigbuf
, oct
, 0x1f, 8);
1116 proto_tree_add_text(tree
, tvb
, offset
, 1,
1122 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1126 rev_req_gps_alm_correction(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1128 guint32 saved_offset
;
1130 SHORT_DATA_CHECK(len
, 2);
1132 saved_offset
= offset
;
1134 proto_tree_add_text(tree
, tvb
, offset
, 1,
1135 "Time of almanac (in units of 4096 seconds)");
1138 proto_tree_add_text(tree
, tvb
, offset
, 1,
1139 "GPS week number (8 least significant bits)");
1143 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1147 rev_reject(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1150 guint32 saved_offset
;
1151 const gchar
*str
= NULL
;
1154 saved_offset
= offset
;
1156 SHORT_DATA_CHECK(len
, 1);
1158 oct
= tvb_get_guint8(tvb
, offset
);
1160 str
= try_val_to_str_idx((oct
& 0xf0) >> 4, for_req_type_strings
, &idx
);
1166 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
1167 proto_tree_add_text(tree
, tvb
, offset
, 1,
1168 "%s : Reject request type: (%u) %s",
1173 switch ((oct
& 0x0e) >> 1)
1175 case 0x00: str
= "Capability not supported by the mobile station"; break;
1176 case 0x01: str
= "Capability normally supported by the mobile station but temporarily not available or not enabled"; break;
1177 default: str
= "Reserved"; break;
1180 other_decode_bitfield_value(bigbuf
, oct
, 0x0e, 8);
1181 proto_tree_add_text(tree
, tvb
, offset
, 1,
1182 "%s : Reject reason: %s",
1186 other_decode_bitfield_value(bigbuf
, oct
, 0x01, 8);
1187 proto_tree_add_text(tree
, tvb
, offset
, 1,
1193 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1197 rev_pr_ms_information(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1200 guint32 saved_offset
;
1201 const gchar
*str
= NULL
;
1203 saved_offset
= offset
;
1205 SHORT_DATA_CHECK(len
, 5);
1207 value
= tvb_get_ntohs(tvb
, offset
);
1209 other_decode_bitfield_value(bigbuf
, value
, 0xfc00, 16);
1210 proto_tree_add_text(tree
, tvb
, offset
, 2,
1214 other_decode_bitfield_value(bigbuf
, value
, 0x03c0, 16);
1215 proto_tree_add_text(tree
, tvb
, offset
, 2,
1219 switch (value
& 0x003f)
1221 case 0x00: str
= "Full Chip Measurement Capability"; break;
1222 case 0x01: str
= "Half Chip Measurement Capability"; break;
1223 case 0x02: str
= "Quarter Chip Measurement Capability"; break;
1224 case 0x03: str
= "Eighth Chip Measurement Capability"; break;
1225 case 0x04: str
= "One Sixteenth Chip Measurement Capability"; break;
1226 default: str
= "Reserved"; break;
1229 other_decode_bitfield_value(bigbuf
, value
, 0x003f, 16);
1230 proto_tree_add_text(tree
, tvb
, offset
, 2,
1231 "%s : PILOT_PH_CAP: (%u) %s",
1237 value
= tvb_get_ntoh24(tvb
, offset
);
1239 other_decode_bitfield_value(bigbuf
, value
, 0xf80000, 24);
1240 proto_tree_add_text(tree
, tvb
, offset
, 3,
1241 "%s : GPS_ACQ_CAP: Reserved",
1244 other_decode_bitfield_value(bigbuf
, value
, 0x040000, 24);
1245 proto_tree_add_text(tree
, tvb
, offset
, 3,
1246 "%s : GPS_ACQ_CAP: GPS Autonomous Acquisition Capable",
1249 other_decode_bitfield_value(bigbuf
, value
, 0x020000, 24);
1250 proto_tree_add_text(tree
, tvb
, offset
, 3,
1251 "%s : GPS_ACQ_CAP: GPS Almanac Correction",
1254 other_decode_bitfield_value(bigbuf
, value
, 0x010000, 24);
1255 proto_tree_add_text(tree
, tvb
, offset
, 3,
1256 "%s : GPS_ACQ_CAP: GPS Navigation Message Bits",
1259 other_decode_bitfield_value(bigbuf
, value
, 0x008000, 24);
1260 proto_tree_add_text(tree
, tvb
, offset
, 3,
1261 "%s : GPS_ACQ_CAP: GPS Ephemeris",
1264 other_decode_bitfield_value(bigbuf
, value
, 0x004000, 24);
1265 proto_tree_add_text(tree
, tvb
, offset
, 3,
1266 "%s : GPS_ACQ_CAP: GPS Almanac",
1269 other_decode_bitfield_value(bigbuf
, value
, 0x002000, 24);
1270 proto_tree_add_text(tree
, tvb
, offset
, 3,
1271 "%s : GPS_ACQ_CAP: GPS Sensitivity Assistance",
1274 other_decode_bitfield_value(bigbuf
, value
, 0x001000, 24);
1275 proto_tree_add_text(tree
, tvb
, offset
, 3,
1276 "%s : GPS_ACQ_CAP: GPS Acquisition Assistance",
1279 other_decode_bitfield_value(bigbuf
, value
, 0x000800, 24);
1280 proto_tree_add_text(tree
, tvb
, offset
, 3,
1281 "%s : LOC_CALC_CAP: Pre-programmed Location",
1284 other_decode_bitfield_value(bigbuf
, value
, 0x000700, 24);
1285 proto_tree_add_text(tree
, tvb
, offset
, 3,
1286 "%s : LOC_CALC_CAP: Reserved",
1289 other_decode_bitfield_value(bigbuf
, value
, 0x000080, 24);
1290 proto_tree_add_text(tree
, tvb
, offset
, 3,
1291 "%s : LOC_CALC_CAP: Hybrid GPS and AFLT Location Calculation Capable",
1294 other_decode_bitfield_value(bigbuf
, value
, 0x000040, 24);
1295 proto_tree_add_text(tree
, tvb
, offset
, 3,
1296 "%s : LOC_CALC_CAP: Autonomous Location Calculation Capable",
1299 other_decode_bitfield_value(bigbuf
, value
, 0x000020, 24);
1300 proto_tree_add_text(tree
, tvb
, offset
, 3,
1301 "%s : LOC_CALC_CAP: Location Calculation Capable using GPS Almanac Correction",
1304 other_decode_bitfield_value(bigbuf
, value
, 0x000010, 24);
1305 proto_tree_add_text(tree
, tvb
, offset
, 3,
1306 "%s : LOC_CALC_CAP: Location Calculation Capable using GPS Ephemeris Assistance",
1309 other_decode_bitfield_value(bigbuf
, value
, 0x000008, 24);
1310 proto_tree_add_text(tree
, tvb
, offset
, 3,
1311 "%s : LOC_CALC_CAP: Location Calculation Capable using GPS Almanac Assistance",
1314 other_decode_bitfield_value(bigbuf
, value
, 0x000004, 24);
1315 proto_tree_add_text(tree
, tvb
, offset
, 3,
1316 "%s : LOC_CALC_CAP: Advanced Forward Link Trilateration (AFLT) Location Calculation Capable",
1319 other_decode_bitfield_value(bigbuf
, value
, 0x000002, 24);
1320 proto_tree_add_text(tree
, tvb
, offset
, 3,
1321 "%s : LOC_CALC_CAP: Location Calculation Capable using Location Assistance - Cartesian",
1324 other_decode_bitfield_value(bigbuf
, value
, 0x000001, 24);
1325 proto_tree_add_text(tree
, tvb
, offset
, 3,
1326 "%s : LOC_CALC_CAP: Location Calculation Capable using Location Assistance - Spherical",
1331 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1335 rev_pr_loc_response(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1337 pr_loc_response(tvb
, tree
, len
, offset
);
1341 rev_pr_time_off_meas(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1344 guint32 saved_offset
;
1346 saved_offset
= offset
;
1348 SHORT_DATA_CHECK(len
, 6);
1350 proto_tree_add_text(tree
, tvb
, offset
, 3,
1351 "TIME_REF_MS: The time of validity of the parameters reported in this response element.");
1354 value
= tvb_get_ntoh24(tvb
, offset
);
1356 other_decode_bitfield_value(bigbuf
, value
, 0xff8000, 24);
1357 proto_tree_add_text(tree
, tvb
, offset
, 3,
1358 "%s : REF_PN: (%u)",
1360 (value
& 0xff8000) >> 15);
1362 other_decode_bitfield_value(bigbuf
, value
, 0x007ffe, 24);
1363 proto_tree_add_text(tree
, tvb
, offset
, 3,
1364 "%s : MOB_SYS_T_OFFSET: (%u)",
1366 (value
& 0x007ffe) >> 1);
1368 other_decode_bitfield_value(bigbuf
, value
, 0x000001, 24);
1369 proto_tree_add_text(tree
, tvb
, offset
, 3,
1375 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1379 rev_pr_can_ack(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
)
1382 guint32 saved_offset
;
1383 const gchar
*str
= NULL
;
1386 saved_offset
= offset
;
1388 SHORT_DATA_CHECK(len
, 1);
1390 oct
= tvb_get_guint8(tvb
, offset
);
1392 str
= try_val_to_str_idx((oct
& 0xf0) >> 4, for_req_type_strings
, &idx
);
1398 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
1399 proto_tree_add_text(tree
, tvb
, offset
, 1,
1400 "%s : Cancellation Type: (%u) %s",
1405 other_decode_bitfield_value(bigbuf
, oct
, 0x08, 8);
1406 proto_tree_add_text(tree
, tvb
, offset
, 1,
1407 "%s : No outstanding request element",
1410 other_decode_bitfield_value(bigbuf
, oct
, 0x07, 8);
1411 proto_tree_add_text(tree
, tvb
, offset
, 1,
1417 EXTRANEOUS_DATA_CHECK(len
, offset
- saved_offset
);
1420 static void (*for_req_type_fcn
[])(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
) = {
1421 NULL
, /* Reserved */
1422 NULL
, /* no data */ /* Request MS Information */
1423 NULL
, /* no data */ /* Request Autonomous Measurement Weighting Factors */
1424 for_req_pseudo_meas
, /* Request Pseudorange Measurement */
1425 for_req_pilot_ph_meas
, /* Request Pilot Phase Measurement */
1426 for_req_loc_response
, /* Request Location Response */
1427 for_req_time_off_meas
, /* Request Time Offset Measurement */
1428 for_req_cancel
, /* Request Cancellation */
1432 static void (*for_rsp_type_fcn
[])(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
) = {
1433 for_reject
, /* Reject */
1434 for_pr_bs_cap
, /* Provide BS Capabilities */
1435 NULL
, /* Provide GPS Acquisition Assistance */
1436 NULL
, /* Provide GPS Location Assistance Spherical Coordinates */
1437 NULL
, /* Provide GPS Location Assistance Cartesian Coordinates */
1438 for_pr_gps_sense_ass
, /* Provide GPS Sensitivity Assistance */
1439 NULL
, /* Provide Base Station Almanac */
1440 for_pr_gps_almanac
, /* Provide GPS Almanac */
1441 NULL
, /* Provide GPS Ephemeris */
1442 for_pr_gps_nav_msg_bits
, /* Provide GPS Navigation Message Bits */
1443 for_pr_loc_response
, /* Provide Location Response */
1444 NULL
, /* Provide GPS Almanac Correction */
1445 for_pr_gps_sat_health
, /* Provide GPS Satellite Health Information */
1449 static void (*rev_req_type_fcn
[])(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
) = {
1450 NULL
, /* Reserved */
1451 NULL
, /* no data */ /* Request BS Capabilities */
1452 rev_req_gps_acq_ass
, /* Request GPS Acquisition Assistance */
1453 rev_req_gps_loc_ass
, /* Request GPS Location Assistance */
1454 NULL
, /* Reserved */
1455 NULL
, /* no data */ /* Request GPS Sensitivity Assistance */
1456 rev_req_bs_alm
, /* Request Base Station Almanac */
1457 NULL
, /* no data */ /* Request GPS Almanac */
1458 rev_req_gps_ephemeris
, /* Request GPS Ephemeris */
1459 rev_req_gps_nav_msg_bits
, /* Request GPS Navigation Message Bits */
1460 rev_req_loc_response
, /* Request Location Response */
1461 rev_req_gps_alm_correction
, /* Request GPS Almanac Correction */
1462 NULL
, /* no data */ /* Request GPS Satellite Health Information */
1466 static void (*rev_rsp_type_fcn
[])(tvbuff_t
*tvb
, proto_tree
*tree
, guint len
, guint32 offset
) = {
1467 rev_reject
, /* Reject */
1468 rev_pr_ms_information
, /* Provide MS Information */
1469 NULL
, /* Provide Autonomous Measurement Weighting Factors */
1470 NULL
, /* Provide Pseudorange Measurement */
1471 NULL
, /* Provide Pilot Phase Measurement */
1472 rev_pr_loc_response
, /* Provide Location Response */
1473 rev_pr_time_off_meas
, /* Provide Time Offset Measurement */
1474 rev_pr_can_ack
, /* Provide Cancellation Acknowledgement */
1479 for_request(tvbuff_t
*tvb
, proto_tree
*tree
, guint32
*offset_p
, guint8 pd_msg_type
)
1483 const gchar
*str
= NULL
;
1485 proto_tree
*subtree
;
1489 oct
= tvb_get_guint8(tvb
, offset
);
1491 if (pd_msg_type
== 0x00)
1493 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
1494 proto_tree_add_text(tree
, tvb
, offset
, 1,
1498 str
= try_val_to_str_idx(oct
& 0x0f, for_req_type_strings
, &idx
);
1504 other_decode_bitfield_value(bigbuf
, oct
, 0x0f, 8);
1506 proto_tree_add_uint_format(tree
, hf_ansi_801_for_req_type
, tvb
, offset
,
1508 "%s : Request Type, %s (%u)",
1517 * It is unclear from TIA-801-A how this was meant to be decoded.
1518 * Are the elements supposed to be byte aligned?
1523 subtree
= proto_item_add_subtree(item
, ett_for_req_type
[idx
]);
1526 oct
= tvb_get_guint8(tvb
, offset
);
1528 proto_tree_add_text(subtree
, tvb
, offset
, 1,
1536 if (for_req_type_fcn
[idx
] != NULL
)
1538 (*for_req_type_fcn
[idx
])(tvb
, subtree
, oct
, offset
);
1542 proto_tree_add_text(subtree
, tvb
, offset
, oct
,
1547 *offset_p
= offset
+ oct
;
1551 for_response(tvbuff_t
*tvb
, proto_tree
*tree
, guint32
*offset_p
)
1555 const gchar
*str
= NULL
;
1557 proto_tree
*subtree
;
1561 oct
= tvb_get_guint8(tvb
, offset
);
1563 other_decode_bitfield_value(bigbuf
, oct
, 0xe0, 8);
1564 proto_tree_add_text(tree
, tvb
, offset
, 1,
1568 other_decode_bitfield_value(bigbuf
, oct
, 0x10, 8);
1569 proto_tree_add_text(tree
, tvb
, offset
, 1,
1570 "%s : Unsolicited response indicator",
1573 str
= try_val_to_str_idx(oct
& 0x0f, for_rsp_type_strings
, &idx
);
1580 other_decode_bitfield_value(bigbuf
, oct
, 0x0f, 8);
1582 proto_tree_add_uint_format(tree
, hf_ansi_801_for_rsp_type
, tvb
, offset
,
1584 "%s : Response Type, %s (%u)",
1589 subtree
= proto_item_add_subtree(item
, ett_for_rsp_type
[idx
]);
1592 oct
= tvb_get_guint8(tvb
, offset
);
1594 proto_tree_add_text(subtree
, tvb
, offset
, 1,
1600 if (for_rsp_type_fcn
[idx
] != NULL
)
1602 (*for_rsp_type_fcn
[idx
])(tvb
, subtree
, oct
, offset
);
1606 proto_tree_add_text(subtree
, tvb
, offset
, oct
,
1610 *offset_p
= offset
+ oct
;
1614 rev_request(tvbuff_t
*tvb
, proto_tree
*tree
, guint32
*offset_p
, guint8 pd_msg_type
)
1618 const gchar
*str
= NULL
;
1620 proto_tree
*subtree
;
1624 oct
= tvb_get_guint8(tvb
, offset
);
1626 if (pd_msg_type
== 0x00)
1628 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
1629 proto_tree_add_text(tree
, tvb
, offset
, 1,
1633 str
= try_val_to_str_idx(oct
& 0x0f, rev_req_type_strings
, &idx
);
1639 other_decode_bitfield_value(bigbuf
, oct
, 0x0f, 8);
1641 proto_tree_add_uint_format(tree
, hf_ansi_801_rev_req_type
, tvb
, offset
,
1643 "%s : Request Type, %s (%u)",
1652 * It is unclear from TIA-801-A how this was meant to be decoded.
1653 * Are the elements supposed to be byte aligned?
1658 subtree
= proto_item_add_subtree(item
, ett_rev_req_type
[idx
]);
1661 oct
= tvb_get_guint8(tvb
, offset
);
1663 proto_tree_add_text(subtree
, tvb
, offset
, 1,
1669 if (rev_req_type_fcn
[idx
] != NULL
)
1671 (*rev_req_type_fcn
[idx
])(tvb
, subtree
, oct
, offset
);
1675 proto_tree_add_text(subtree
, tvb
, offset
, oct
,
1679 *offset_p
= offset
+ oct
;
1683 rev_response(tvbuff_t
*tvb
, proto_tree
*tree
, guint32
*offset_p
)
1687 const gchar
*str
= NULL
;
1689 proto_tree
*subtree
;
1693 oct
= tvb_get_guint8(tvb
, offset
);
1695 other_decode_bitfield_value(bigbuf
, oct
, 0xe0, 8);
1696 proto_tree_add_text(tree
, tvb
, offset
, 1,
1700 other_decode_bitfield_value(bigbuf
, oct
, 0x10, 8);
1701 proto_tree_add_text(tree
, tvb
, offset
, 1,
1702 "%s : Unsolicited response indicator",
1705 str
= try_val_to_str_idx(oct
& 0x0f, rev_rsp_type_strings
, &idx
);
1712 other_decode_bitfield_value(bigbuf
, oct
, 0x0f, 8);
1714 proto_tree_add_uint_format(tree
, hf_ansi_801_rev_rsp_type
, tvb
, offset
,
1716 "%s : Response Type, %s (%u)",
1721 subtree
= proto_item_add_subtree(item
, ett_rev_rsp_type
[idx
]);
1724 oct
= tvb_get_guint8(tvb
, offset
);
1726 proto_tree_add_text(subtree
, tvb
, offset
, 1,
1732 if (rev_rsp_type_fcn
[idx
] != NULL
)
1734 (*rev_rsp_type_fcn
[idx
])(tvb
, subtree
, oct
, offset
);
1738 proto_tree_add_text(subtree
, tvb
, offset
, oct
,
1742 *offset_p
= offset
+ oct
;
1746 dissect_ansi_801_for_message(tvbuff_t
*tvb
, proto_tree
*tree
)
1750 guint8 oct
, num_req
, num_rsp
, pd_msg_type
;
1752 const gchar
*str
= NULL
;
1753 proto_item
*hidden_item
;
1756 oct
= tvb_get_guint8(tvb
, offset
);
1758 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
1759 proto_tree_add_text(tree
, tvb
, offset
, 1,
1760 "%s : Session Start",
1763 other_decode_bitfield_value(bigbuf
, oct
, 0x40, 8);
1764 proto_tree_add_text(tree
, tvb
, offset
, 1,
1768 other_decode_bitfield_value(bigbuf
, oct
, 0x20, 8);
1769 proto_tree_add_text(tree
, tvb
, offset
, 1,
1770 "%s : Session Source",
1773 other_decode_bitfield_value(bigbuf
, oct
, 0x1f, 8);
1774 proto_tree_add_uint_format(tree
, hf_ansi_801_for_sess_tag
, tvb
, offset
,
1776 "%s : Session Tag (%u)",
1780 hidden_item
= proto_tree_add_uint(tree
, hf_ansi_801_sess_tag
, tvb
, offset
,
1782 PROTO_ITEM_SET_HIDDEN(hidden_item
);
1785 oct
= tvb_get_guint8(tvb
, offset
);
1788 switch (pd_msg_type
)
1790 case 0x00: str
= "Position Determination Data Message"; break;
1791 case 0x01: str
= "Position Determination Data Message"; break;
1792 case 0xff: str
= "Reserved"; break;
1794 if (pd_msg_type
< 0xc0)
1796 str
= "Reserved for future standardization";
1801 "Available for manufacturer-specific Position Determination "
1802 "Data Message definition as specified in TSB-58";
1807 other_decode_bitfield_value(bigbuf
, pd_msg_type
, 0xff, 8);
1808 proto_tree_add_text(tree
, tvb
, offset
, 1,
1809 "%s : PD Message Type, %s (%u)",
1816 if ((pd_msg_type
!= 0x00) &&
1817 (pd_msg_type
!= 0x01))
1819 proto_tree_add_text(tree
, tvb
, offset
, -1,
1820 "Reserved/Proprietary/Future Data");
1824 if (pd_msg_type
== 0x01)
1826 value
= tvb_get_ntohs(tvb
, offset
);
1828 other_decode_bitfield_value(bigbuf
, value
, 0xffc0, 16);
1829 proto_tree_add_text(tree
, tvb
, offset
, 2,
1830 "%s : PD Message Length, (%u)",
1832 (value
& 0xffc0) >> 6);
1834 switch ((value
& 0x0030) >> 4)
1836 case 0x00: str
= "No Regulatory service"; break;
1837 case 0x01: str
= "Emergency service"; break;
1838 default: str
= "Reserved"; break;
1841 other_decode_bitfield_value(bigbuf
, value
, 0x0030, 16);
1842 proto_tree_add_text(tree
, tvb
, offset
, 2,
1843 "%s : Regulatory Services Indicator - %s (%u)",
1846 (value
& 0x0030) >> 4);
1848 num_req
= value
& 0x000f;
1850 other_decode_bitfield_value(bigbuf
, value
, 0x000f, 16);
1851 proto_tree_add_text(tree
, tvb
, offset
, 2,
1852 "%s : Number Requests (%u)",
1858 oct
= tvb_get_guint8(tvb
, offset
);
1860 num_rsp
= oct
& 0xf0;
1862 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
1863 proto_tree_add_text(tree
, tvb
, offset
, 1,
1864 "%s : Number Responses (%u)",
1872 oct
= tvb_get_guint8(tvb
, offset
);
1874 num_req
= (oct
& 0xf0) >> 4;
1875 num_rsp
= oct
& 0x0f;
1877 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
1878 proto_tree_add_text(tree
, tvb
, offset
, 1,
1879 "%s : Number Requests (%u)",
1883 other_decode_bitfield_value(bigbuf
, oct
, 0x0f, 8);
1884 proto_tree_add_text(tree
, tvb
, offset
, 1,
1885 "%s : Number Responses (%u)",
1891 rem_len
= tvb_length_remaining(tvb
, offset
);
1893 while ((num_req
> 0) &&
1896 for_request(tvb
, tree
, &offset
, pd_msg_type
);
1898 rem_len
= tvb_length_remaining(tvb
, offset
);
1904 proto_tree_add_text(tree
, tvb
,
1905 offset
, -1, "Short Data (?)");
1909 while ((num_rsp
> 0) &&
1912 for_response(tvb
, tree
, &offset
);
1914 rem_len
= tvb_length_remaining(tvb
, offset
);
1920 proto_tree_add_text(tree
, tvb
,
1921 offset
, -1, "Short Data (?)");
1927 proto_tree_add_text(tree
, tvb
, offset
, rem_len
,
1933 dissect_ansi_801_rev_message(tvbuff_t
*tvb
, proto_tree
*tree
)
1937 guint8 oct
, num_req
, num_rsp
, pd_msg_type
;
1939 const gchar
*str
= NULL
;
1940 proto_item
*hidden_item
;
1943 oct
= tvb_get_guint8(tvb
, offset
);
1945 other_decode_bitfield_value(bigbuf
, oct
, 0x80, 8);
1946 proto_tree_add_text(tree
, tvb
, offset
, 1,
1947 "%s : Session Start",
1950 other_decode_bitfield_value(bigbuf
, oct
, 0x40, 8);
1951 proto_tree_add_text(tree
, tvb
, offset
, 1,
1955 other_decode_bitfield_value(bigbuf
, oct
, 0x20, 8);
1956 proto_tree_add_text(tree
, tvb
, offset
, 1,
1957 "%s : Session Source",
1960 other_decode_bitfield_value(bigbuf
, oct
, 0x1f, 8);
1961 proto_tree_add_uint_format(tree
, hf_ansi_801_rev_sess_tag
, tvb
, offset
,
1963 "%s : Session Tag (%u)",
1967 hidden_item
= proto_tree_add_uint(tree
, hf_ansi_801_sess_tag
, tvb
, offset
,
1969 PROTO_ITEM_SET_HIDDEN(hidden_item
);
1972 oct
= tvb_get_guint8(tvb
, offset
);
1975 switch (pd_msg_type
)
1977 case 0x00: str
= "Position Determination Data Message"; break;
1978 case 0x01: str
= "Position Determination Data Message"; break;
1979 case 0xff: str
= "Reserved"; break;
1981 if (pd_msg_type
< 0xc0)
1983 str
= "Reserved for future standardization";
1988 "Available for manufacturer-specific Position Determination "
1989 "Data Message definition as specified in TSB-58";
1994 other_decode_bitfield_value(bigbuf
, pd_msg_type
, 0xff, 8);
1995 proto_tree_add_text(tree
, tvb
, offset
, 1,
1996 "%s : PD Message Type, %s (%u)",
2003 if ((pd_msg_type
!= 0x00) &&
2004 (pd_msg_type
!= 0x01))
2006 proto_tree_add_text(tree
, tvb
, offset
, -1,
2007 "Reserved/Proprietary/Future Data");
2011 if (pd_msg_type
== 0x01)
2013 value
= tvb_get_ntohs(tvb
, offset
);
2015 other_decode_bitfield_value(bigbuf
, value
, 0xffc0, 16);
2016 proto_tree_add_text(tree
, tvb
, offset
, 2,
2017 "%s : PD Message Length, (%u)",
2019 (value
& 0xffc0) >> 6);
2021 switch ((value
& 0x0030) >> 4)
2023 case 0x00: str
= "No Regulatory service"; break;
2024 case 0x01: str
= "Emergency service"; break;
2025 default: str
= "Reserved"; break;
2028 other_decode_bitfield_value(bigbuf
, value
, 0x0030, 16);
2029 proto_tree_add_text(tree
, tvb
, offset
, 2,
2030 "%s : Regulatory Services Indicator - %s (%u)",
2033 (value
& 0x0030) >> 4);
2035 num_req
= value
& 0x000f;
2037 other_decode_bitfield_value(bigbuf
, value
, 0x000f, 16);
2038 proto_tree_add_text(tree
, tvb
, offset
, 2,
2039 "%s : Number Requests (%u)",
2045 oct
= tvb_get_guint8(tvb
, offset
);
2047 num_rsp
= oct
& 0xf0;
2049 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
2050 proto_tree_add_text(tree
, tvb
, offset
, 1,
2051 "%s : Number Responses (%u)",
2059 oct
= tvb_get_guint8(tvb
, offset
);
2061 num_req
= (oct
& 0xf0) >> 4;
2062 num_rsp
= oct
& 0x0f;
2064 other_decode_bitfield_value(bigbuf
, oct
, 0xf0, 8);
2065 proto_tree_add_text(tree
, tvb
, offset
, 1,
2066 "%s : Number Requests (%u)",
2070 other_decode_bitfield_value(bigbuf
, oct
, 0x0f, 8);
2071 proto_tree_add_text(tree
, tvb
, offset
, 1,
2072 "%s : Number Responses (%u)",
2079 rem_len
= tvb_length_remaining(tvb
, offset
);
2081 while ((num_req
> 0) &&
2084 rev_request(tvb
, tree
, &offset
, pd_msg_type
);
2086 rem_len
= tvb_length_remaining(tvb
, offset
);
2092 proto_tree_add_text(tree
, tvb
,
2093 offset
, -1, "Short Data (?)");
2097 while ((num_rsp
> 0) &&
2100 rev_response(tvb
, tree
, &offset
);
2102 rem_len
= tvb_length_remaining(tvb
, offset
);
2108 proto_tree_add_text(tree
, tvb
,
2109 offset
, -1, "Short Data (?)");
2115 proto_tree_add_text(tree
, tvb
, offset
, rem_len
,
2121 dissect_ansi_801(tvbuff_t
*tvb
, packet_info
*pinfo
, proto_tree
*tree
)
2123 proto_item
*ansi_801_item
;
2124 proto_tree
*ansi_801_tree
= NULL
;
2126 col_set_str(pinfo
->cinfo
, COL_PROTOCOL
, ansi_proto_name_short
);
2128 /* In the interest of speed, if "tree" is NULL, don't do any work not
2129 * necessary to generate protocol tree items.
2134 * create the ansi_801 protocol tree
2137 proto_tree_add_protocol_format(tree
, proto_ansi_801
, tvb
, 0, -1,
2140 (pinfo
->match_uint
== ANSI_801_FORWARD
) ? "Forward" : "Reverse");
2143 proto_item_add_subtree(ansi_801_item
, ett_ansi_801
);
2145 if (pinfo
->match_uint
== ANSI_801_FORWARD
)
2147 dissect_ansi_801_for_message(tvb
, ansi_801_tree
);
2151 dissect_ansi_801_rev_message(tvb
, ansi_801_tree
);
2157 /* Register the protocol with Wireshark */
2159 proto_register_ansi_801(void)
2164 /* Setup list of header fields */
2165 static hf_register_info hf
[] =
2167 { &hf_ansi_801_for_req_type
,
2168 { "Forward Request Type", "ansi_801.for_req_type",
2169 FT_UINT8
, BASE_DEC
, NULL
, 0,
2172 { &hf_ansi_801_for_rsp_type
,
2173 { "Forward Response Type", "ansi_801.for_rsp_type",
2174 FT_UINT8
, BASE_DEC
, NULL
, 0,
2177 { &hf_ansi_801_rev_req_type
,
2178 { "Reverse Request Type", "ansi_801.rev_req_type",
2179 FT_UINT8
, BASE_DEC
, NULL
, 0,
2182 { &hf_ansi_801_rev_rsp_type
,
2183 { "Reverse Response Type", "ansi_801.rev_rsp_type",
2184 FT_UINT8
, BASE_DEC
, NULL
, 0,
2187 { &hf_ansi_801_for_sess_tag
,
2188 { "Forward Session Tag", "ansi_801.for_sess_tag",
2189 FT_UINT8
, BASE_DEC
, NULL
, 0,
2192 { &hf_ansi_801_rev_sess_tag
,
2193 { "Reverse Session Tag", "ansi_801.rev_sess_tag",
2194 FT_UINT8
, BASE_DEC
, NULL
, 0,
2197 { &hf_ansi_801_sess_tag
,
2198 { "Session Tag", "ansi_801.sess_tag",
2199 FT_UINT8
, BASE_DEC
, NULL
, 0,
2202 { &hf_ansi_801_time_ref_cdma
,
2203 { "CDMA system time at the time the solution is valid (TIME_REF_CDMA)", "ansi_801.time_ref_cdma",
2204 FT_UINT32
, BASE_DEC
, NULL
, 0x00,
2208 { "Latitude (LAT)", "ansi_801.lat",
2209 FT_FLOAT
, BASE_NONE
, NULL
, 0x00,
2212 { &hf_ansi_801_long
,
2213 { "Longitude (LONG)", "ansi_801.long",
2214 FT_FLOAT
, BASE_NONE
, NULL
, 0x00,
2217 { &hf_ansi_801_loc_uncrtnty_ang
,
2218 { "Angle of axis with respect to True North for pos uncertainty (LOC_UNCRTNTY_ANG)", "ansi_801.loc_uncrtnty_ang",
2219 FT_FLOAT
, BASE_NONE
, NULL
, 0x00,
2222 { &hf_ansi_801_loc_uncrtnty_a
,
2223 { "Std dev of axis along angle specified for pos uncertainty (LOC_UNCRTNTY_A)", "ansi_801.loc_uncrtnty_a",
2224 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2227 { &hf_ansi_801_loc_uncrtnty_p
,
2228 { "Std dev of axis perpendicular to angle specified for pos uncertainty (LOC_UNCRTNTY_P)", "ansi_801.loc_uncrtnty_p",
2229 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2232 { &hf_ansi_801_fix_type
,
2233 { "Fix type (FIX_TYPE)", "ansi_801.fix_type",
2234 FT_BOOLEAN
, BASE_NONE
, TFS(&ansi_801_fix_type_vals
), 0x00,
2237 { &hf_ansi_801_velocity_incl
,
2238 { "Velocity information included (VELOCITY_INCL)", "ansi_801.velocity_incl",
2239 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2242 { &hf_ansi_801_velocity_hor
,
2243 { "Horizontal velocity magnitude (VELOCITY_HOR)", "ansi_801.velocity_hor",
2244 FT_FLOAT
, BASE_NONE
, NULL
, 0x00,
2247 { &hf_ansi_801_heading
,
2248 { "Heading (HEADING)", "ansi_801.heading",
2249 FT_FLOAT
, BASE_NONE
, NULL
, 0x00,
2252 { &hf_ansi_801_velocity_ver
,
2253 { "Vertical velocity (VELOCITY_VER)", "ansi_801.velocity_ver",
2254 FT_FLOAT
, BASE_NONE
, NULL
, 0x00,
2257 { &hf_ansi_801_clock_incl
,
2258 { "Clock information included (CLOCK_INCL)", "ansi_801.clock_incl",
2259 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2262 { &hf_ansi_801_clock_bias
,
2263 { "Clock bias (CLOCK_BIAS)", "ansi_801.clock_bias",
2264 FT_INT24
, BASE_DEC
, NULL
, 0x00,
2267 { &hf_ansi_801_clock_drift
,
2268 { "Clock drift (CLOCK_DRIFT)", "ansi_801.clock_drift",
2269 FT_INT16
, BASE_DEC
, NULL
, 0x00,
2272 { &hf_ansi_801_height_incl
,
2273 { "Height information included (HEIGHT_INCL)", "ansi_801.height_incl",
2274 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2277 { &hf_ansi_801_height
,
2278 { "Height (HEIGHT)", "ansi_801.height",
2279 FT_INT16
, BASE_DEC
, NULL
, 0x00,
2282 { &hf_ansi_801_loc_uncrtnty_v
,
2283 { "Std dev of vertical error for pos uncertainty (LOC_UNCRTNTY_V)", "ansi_801.loc_uncrtnty_v",
2284 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2287 { &hf_ansi_801_reserved_bits
,
2288 { "Reserved bit(s)","ansi_801.reerved_bits",
2289 FT_UINT8
,BASE_DEC
, NULL
, 0x0,
2292 { &hf_ansi_801_bad_sv_present
,
2293 { "Bad GPS satellites present (BAD_SV_PRESENT)", "ansi_801.bad_sv_present",
2294 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2297 { &hf_ansi_801_num_bad_sv
,
2298 { "Number of bad GPS satellites (NUM_BAD_SV)", "ansi_801.num_bad_sv",
2299 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2302 { &hf_ansi_801_bad_sv_prn_num
,
2303 { "Satellite PRN number (SV_PRN_NUM)", "ansi_801.bad_sv_prn_num",
2304 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2307 { &hf_ansi_801_dopp_req
,
2308 { "Doppler (0th order) term requested (DOPP_REQ)", "ansi_801.dopp_req",
2309 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2312 { &hf_ansi_801_add_dopp_req
,
2313 { "Additional Doppler terms requested (ADD_DOPP_REQ)", "ansi_801.add_dopp_req",
2314 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2317 { &hf_ansi_801_code_ph_par_req
,
2318 { "Code phase parameters requested (CODE_PH_PAR_REQ)", "ansi_801.code_ph_par_req",
2319 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2322 { &hf_ansi_801_az_el_req
,
2323 { "Azimuth and elevation angle requested (AZ_EL_REQ)", "ansi_801.az_el_req",
2324 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2327 { &hf_ansi_801_pref_resp_qual
,
2328 { "Preferred response quality (PREF_RESP_QUAL)", "ansi_801.pref_resp_qual",
2329 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2332 { &hf_ansi_801_num_fixes
,
2333 { "Number of fixes (NUM_FIXES)", "ansi_801.num_fixes",
2334 FT_UINT16
, BASE_DEC
, NULL
, 0x00,
2337 { &hf_ansi_801_t_betw_fixes
,
2338 { "Time between fixes (T_BETW_FIXES)", "ansi_801.t_betw_fixes",
2339 FT_UINT8
, BASE_DEC
, NULL
, 0x00,
2342 { &hf_ansi_801_offset_req
,
2343 { "Offset requested (OFFSET_REQ)", "ansi_801.offset_req",
2344 FT_BOOLEAN
, BASE_NONE
, NULL
, 0x00,
2350 /* Setup protocol subtree array */
2351 #define NUM_INDIVIDUAL_PARAMS 1
2352 gint
*ett
[NUM_INDIVIDUAL_PARAMS
+NUM_FOR_REQ_TYPE
+NUM_FOR_RSP_TYPE
+NUM_REV_REQ_TYPE
+NUM_REV_RSP_TYPE
];
2354 ett
[0] = &ett_ansi_801
;
2356 last_offset
= NUM_INDIVIDUAL_PARAMS
;
2358 for (i
=0; i
< NUM_FOR_REQ_TYPE
; i
++, last_offset
++)
2360 ett_for_req_type
[i
] = -1;
2361 ett
[last_offset
] = &ett_for_req_type
[i
];
2364 for (i
=0; i
< NUM_FOR_RSP_TYPE
; i
++, last_offset
++)
2366 ett_for_rsp_type
[i
] = -1;
2367 ett
[last_offset
] = &ett_for_rsp_type
[i
];
2370 for (i
=0; i
< NUM_REV_REQ_TYPE
; i
++, last_offset
++)
2372 ett_rev_req_type
[i
] = -1;
2373 ett
[last_offset
] = &ett_rev_req_type
[i
];
2376 for (i
=0; i
< NUM_REV_RSP_TYPE
; i
++, last_offset
++)
2378 ett_rev_rsp_type
[i
] = -1;
2379 ett
[last_offset
] = &ett_rev_rsp_type
[i
];
2382 /* Register the protocol name and description */
2384 proto_register_protocol(ansi_proto_name
, "ANSI IS-801 (Location Services (PLD))", "ansi_801");
2386 /* Required function calls to register the header fields and subtrees used */
2387 proto_register_field_array(proto_ansi_801
, hf
, array_length(hf
));
2388 proto_register_subtree_array(ett
, array_length(ett
));
2390 /* subdissector code */
2391 ansi_801_handle
= register_dissector("ansi_801", dissect_ansi_801
, proto_ansi_801
);
2396 proto_reg_handoff_ansi_801(void)
2398 dissector_add_uint("ansi_map.pld", ANSI_801_FORWARD
, ansi_801_handle
);
2399 dissector_add_uint("ansi_map.pld", ANSI_801_REVERSE
, ansi_801_handle
);
2400 dissector_add_uint("ansi_a.pld", ANSI_801_FORWARD
, ansi_801_handle
);
2401 dissector_add_uint("ansi_a.pld", ANSI_801_REVERSE
, ansi_801_handle
);