diff options
author | Stephen Fisher <steve@stephen-fisher.com> | 2010-11-18 20:54:14 +0000 |
---|---|---|
committer | Stephen Fisher <steve@stephen-fisher.com> | 2010-11-18 20:54:14 +0000 |
commit | dbf10b1dc8f1f98c42f9500769dcec9f9633b7d9 (patch) | |
tree | f13ac99fb8bcf68ace7cf3c95a2db4a6faa1de5e /epan/dissectors/packet-ppi-geolocation-common.h | |
parent | 1d42ee3ebba160fc76352ddbf9e7ef3da1d17879 (diff) |
From Jon Ellch via bug #5175: Add PPI-GPS protocol dissector patch
Minor changes by me as detailed in the bug's comment #8.
svn path=/trunk/; revision=34956
Diffstat (limited to 'epan/dissectors/packet-ppi-geolocation-common.h')
-rw-r--r-- | epan/dissectors/packet-ppi-geolocation-common.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ppi-geolocation-common.h b/epan/dissectors/packet-ppi-geolocation-common.h new file mode 100644 index 0000000000..d92a855569 --- /dev/null +++ b/epan/dissectors/packet-ppi-geolocation-common.h @@ -0,0 +1,92 @@ +/* packet-ppi-geolocation-common.h + * Routines for PPI-GEOLOCATION dissection + * Copyright 2010, Harris Corp, jellch@harris.com + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef __PPI_GEOLOCATION_COMMON_H +#define __PPI_GEOLOCATION_COMMON_H +#include <glib.h> + +/* + * Declarations from shared PPI-GEOLOCATION functions. + * + */ + +/* + * these constants are offsets into base_geotag header, which is bitwise-compatible + * with a radiotap header + */ +#define PPI_GEOBASE_MIN_HEADER_LEN 8 /* minimum header length */ +#define PPI_GEOBASE_VERSION_OFFSET 0 /* offset of version field */ +#define PPI_GEOBASE_LENGTH_OFFSET 2 /* offset of length field */ +#define PPI_GEOBASE_PRESENT_OFFSET 4 /* offset of "present" field */ +/* + * These BITNO macros were accquired from the radiotap parser. maybe we can share them + * eventually + */ +#define BITNO_32(x) (((x) >> 16) ? 16 + BITNO_16((x) >> 16) : BITNO_16((x))) +#define BITNO_16(x) (((x) >> 8) ? 8 + BITNO_8((x) >> 8) : BITNO_8((x))) +#define BITNO_8(x) (((x) >> 4) ? 4 + BITNO_4((x) >> 4) : BITNO_4((x))) +#define BITNO_4(x) (((x) >> 2) ? 2 + BITNO_2((x) >> 2) : BITNO_2((x))) +#define BITNO_2(x) (((x) & 2) ? 1 : 0) +#define BIT(n) (1 << n) + + + +/* + * Floating point numbers are stored on disk in a handful of fixed-point formats (fixedX_Y) + * designed to preserve the appropriate amount of precision vs range. These functions convert + * the fixedX_Y fixed point values into 'native' gdoubles for displaying. + * Documentation on these formats can be found in the PPI-GEOLOCATION specification + */ +gdouble fixed3_7_to_gdouble(guint32 in); +gdouble fixed3_6_to_gdouble(guint32 in); +gdouble fixed6_4_to_gdouble(guint32 in); +/* + * Some values are encoded as 32-bit unsigned nano-second counters. + * Usually we want to display these values as doubles. + */ +gdouble ns_counter_to_gdouble(guint32 in); + + +typedef enum { + PPI_GEOLOCATION_HARRIS = 0x00485253 /* 00SRH */ +} ppi_geolocation_appstr_num; + + +#endif + +/* + * Editor modelines + * + * Local Variables: + * c-basic-offset: 4 + * tab-width: 8 + * indent-tabs-mode: nil + * End: + * + * ex: set shiftwidth=4 tabstop=8 expandtab + * :indentSize=4:tabSize=8:noTabs=true: + */ + + |