1 /* packet-ppi-geolocation-common.c
2 * Routines for PPI-GEOLOCATION dissection
3 * Copyright 2010, Harris Corp, jellch@harris.com
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License along
22 * with this program; if not, write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include "packet-ppi-geolocation-common.h"
29 * input: a unsigned 32-bit (native endian) value between 0 and 3600000000 (inclusive)
30 * output: a signed floating point value betwen -180.0000000 and + 180.0000000, inclusive)
32 gdouble fixed3_7_to_gdouble(guint32 in) {
33 gint32 remapped_in = in - (180 * 10000000);
34 gdouble ret = (gdouble) ((gdouble) remapped_in / 10000000);
38 * input: a native 32 bit unsigned value between 0 and 999999999
39 * output: a positive floating point value between 000.0000000 and 999.9999999
42 gdouble fixed3_6_to_gdouble(guint32 in) {
43 gdouble ret = (gdouble) in / 1000000.0;
48 * input: a native 32 bit unsigned value between 0 and 3600000000
49 * output: a signed floating point value between -180000.0000 and +180000.0000
51 gdouble fixed6_4_to_gdouble(guint32 in) {
52 gint32 remapped_in = in - (180000 * 10000);
53 gdouble ret = (gdouble) ((gdouble) remapped_in / 10000);
57 gdouble ns_counter_to_gdouble(guint32 in) {
59 ret = (gdouble) in / 1000000000;
69 * indent-tabs-mode: nil
72 * ex: set shiftwidth=4 tabstop=8 expandtab
73 * :indentSize=4:tabSize=8:noTabs=true: