Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-ppi-geolocation-common.c
blobd77c12850d22a2785bb8e207ab5387dae863d30b
1 /* packet-ppi-geolocation-common.c
2 * Routines for PPI-GEOLOCATION dissection
3 * Copyright 2010, Harris Corp, jellch@harris.com
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
9 * SPDX-License-Identifier: GPL-2.0-or-later
12 #include "config.h"
14 #include <glib.h>
15 #include "packet-ppi-geolocation-common.h"
18 * input: a unsigned 32-bit (native endian) value between 0 and 3600000000 (inclusive)
19 * output: a signed floating point value between -180.0000000 and + 180.0000000, inclusive)
21 double ppi_fixed3_7_to_double(uint32_t in) {
22 int32_t remapped_in = in - (180 * 10000000);
23 double ret = (double) ((double) remapped_in / 10000000);
24 return ret;
27 * input: a native 32 bit unsigned value between 0 and 999999999
28 * output: a positive floating point value between 000.0000000 and 999.9999999
31 double ppi_fixed3_6_to_double(uint32_t in) {
32 double ret = (double) in / 1000000.0;
33 return ret;
37 * input: a native 32 bit unsigned value between 0 and 3600000000
38 * output: a signed floating point value between -180000.0000 and +180000.0000
40 double ppi_fixed6_4_to_double(uint32_t in) {
41 int32_t remapped_in = in - (180000 * 10000);
42 double ret = (double) ((double) remapped_in / 10000);
43 return ret;
46 double ppi_ns_counter_to_double(uint32_t in) {
47 double ret;
48 ret = (double) in / 1000000000;
49 return ret;
53 * Editor modelines
55 * Local Variables:
56 * c-basic-offset: 4
57 * tab-width: 8
58 * indent-tabs-mode: nil
59 * End:
61 * ex: set shiftwidth=4 tabstop=8 expandtab:
62 * :indentSize=4:tabSize=8:noTabs=true: