| Wireshark 4.7.0 The Wireshark network protocol analyzer

Loading...
Searching...
No Matches
packet-ppi-geolocation-common.h
1/* packet-ppi-geolocation-common.h
2 * Routines for PPI-GEOLOCATION dissection
3 * Copyright 2010, Harris Corp, jellch@harris.com
4 *
5 * Wireshark - Network traffic analyzer
6 * By Gerald Combs <gerald@wireshark.org>
7 * Copyright 1998 Gerald Combs
8 *
9 * SPDX-License-Identifier: GPL-2.0-or-later
10 */
11
12#ifndef __PPI_GEOLOCATION_COMMON_H
13#define __PPI_GEOLOCATION_COMMON_H
14
15#include <inttypes.h>
16
17/*
18 * Declarations from shared PPI-GEOLOCATION functions.
19 *
20 */
21
22/*
23 * these constants are offsets into base_geotag header, which is bitwise-compatible
24 * with a radiotap header
25 */
26#define PPI_GEOBASE_MIN_HEADER_LEN 8 /* minimum header length */
27#define PPI_GEOBASE_VERSION_OFFSET 0 /* offset of version field */
28#define PPI_GEOBASE_LENGTH_OFFSET 2 /* offset of length field */
29#define PPI_GEOBASE_PRESENT_OFFSET 4 /* offset of "present" field */
30/*
31 * These BITNO macros were acquired from the radiotap parser. maybe we can share them
32 * eventually
33 */
34#define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x)))
35#define BITNO_16(x) (((x) >> 8) ? 8 + BITNO_8((x) >> 8) : BITNO_8((x)))
36#define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x)))
37#define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x)))
38#define BITNO_2(x) (((x) & 2) ? 1 : 0)
39#define BIT(n) (1 << n)
40
41
42
43/*
44 * Floating point numbers are stored on disk in a handful of fixed-point formats (fixedX_Y)
45 * designed to preserve the appropriate amount of precision vs range. These functions convert
46 * the fixedX_Y fixed point values into 'native' doubles for displaying.
47 * Documentation on these formats can be found in the PPI-GEOLOCATION specification
48 */
49double ppi_fixed3_7_to_double(uint32_t in);
50double ppi_fixed3_6_to_double(uint32_t in);
51double ppi_fixed6_4_to_double(uint32_t in);
52/*
53 * Some values are encoded as 32-bit unsigned nano-second counters.
54 * Usually we want to display these values as doubles.
55 */
56double ppi_ns_counter_to_double(uint32_t in);
57
58
59typedef enum {
60 PPI_GEOLOCATION_HARRIS = 0x00485253 /* 00SRH */
61} ppi_geolocation_appstr_num;
62
63
64#endif
65
66/*
67 * Editor modelines
68 *
69 * Local Variables:
70 * c-basic-offset: 4
71 * tab-width: 8
72 * indent-tabs-mode: nil
73 * End:
74 *
75 * ex: set shiftwidth=4 tabstop=8 expandtab:
76 * :indentSize=4:tabSize=8:noTabs=true:
77 */
78
79