FIXUP: WIP: verification_trailer
[wireshark-wip.git] / epan / dissectors / packet-ppi-geolocation-common.h
blobefe60d9e72d2e20a4b21ffb1677862c78eb6d58b
1 /* packet-ppi-geolocation-common.h
2 * Routines for PPI-GEOLOCATION dissection
3 * Copyright 2010, Harris Corp, jellch@harris.com
5 * $Id$
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 #ifndef __PPI_GEOLOCATION_COMMON_H
27 #define __PPI_GEOLOCATION_COMMON_H
30 * Declarations from shared PPI-GEOLOCATION functions.
35 * these constants are offsets into base_geotag header, which is bitwise-compatible
36 * with a radiotap header
38 #define PPI_GEOBASE_MIN_HEADER_LEN 8 /* minimum header length */
39 #define PPI_GEOBASE_VERSION_OFFSET 0 /* offset of version field */
40 #define PPI_GEOBASE_LENGTH_OFFSET 2 /* offset of length field */
41 #define PPI_GEOBASE_PRESENT_OFFSET 4 /* offset of "present" field */
43 * These BITNO macros were accquired from the radiotap parser. maybe we can share them
44 * eventually
46 #define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x)))
47 #define BITNO_16(x) (((x) >> 8) ? 8 + BITNO_8((x) >> 8) : BITNO_8((x)))
48 #define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x)))
49 #define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x)))
50 #define BITNO_2(x) (((x) & 2) ? 1 : 0)
51 #define BIT(n) (1 << n)
56 * Floating point numbers are stored on disk in a handful of fixed-point formats (fixedX_Y)
57 * designed to preserve the appropriate amount of precision vs range. These functions convert
58 * the fixedX_Y fixed point values into 'native' gdoubles for displaying.
59 * Documentation on these formats can be found in the PPI-GEOLOCATION specification
61 gdouble ppi_fixed3_7_to_gdouble(guint32 in);
62 gdouble ppi_fixed3_6_to_gdouble(guint32 in);
63 gdouble ppi_fixed6_4_to_gdouble(guint32 in);
65 * Some values are encoded as 32-bit unsigned nano-second counters.
66 * Usually we want to display these values as doubles.
68 gdouble ppi_ns_counter_to_gdouble(guint32 in);
71 typedef enum {
72 PPI_GEOLOCATION_HARRIS = 0x00485253 /* 00SRH */
73 } ppi_geolocation_appstr_num;
76 #endif
79 * Editor modelines
81 * Local Variables:
82 * c-basic-offset: 4
83 * tab-width: 8
84 * indent-tabs-mode: nil
85 * End:
87 * ex: set shiftwidth=4 tabstop=8 expandtab:
88 * :indentSize=4:tabSize=8:noTabs=true: