diff options
author | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-07-29 16:07:00 +0000 |
---|---|---|
committer | wmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7> | 2011-07-29 16:07:00 +0000 |
commit | 80775972c833bfba3fadcb1da3f99b18a137a4cf (patch) | |
tree | 679b6824e52658ba926daa9e01ce2a57aacbcf55 /epan | |
parent | 706a5b215300f6e653c77259371f6e67a6897470 (diff) |
Remove unneeded #includes and do other minor cleanup.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@38259 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ppi-antenna.c | 101 | ||||
-rw-r--r-- | epan/dissectors/packet-ppi-geolocation-common.c | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-ppi-geolocation-common.h | 9 | ||||
-rw-r--r-- | epan/dissectors/packet-ppi-gps.c | 94 | ||||
-rw-r--r-- | epan/dissectors/packet-ppi-sensor.c | 42 | ||||
-rw-r--r-- | epan/dissectors/packet-ppi-vector.c | 245 | ||||
-rw-r--r-- | epan/dissectors/packet-ppi.c | 16 |
7 files changed, 267 insertions, 249 deletions
diff --git a/epan/dissectors/packet-ppi-antenna.c b/epan/dissectors/packet-ppi-antenna.c index 6782021ff4..268e47bfbc 100644 --- a/epan/dissectors/packet-ppi-antenna.c +++ b/epan/dissectors/packet-ppi-antenna.c @@ -30,13 +30,9 @@ #endif #include <glib.h> -#include <string.h> #include <epan/packet.h> -#include <epan/ptvcursor.h> -#include <epan/prefs.h> -#include <epan/reassemble.h> -#include <epan/dissectors/packet-ppi-geolocation-common.h> +#include "packet-ppi-geolocation-common.h" enum ppi_antenna_type { PPI_ANTENNA_ANTFLAGS = 0, /* Various flags about the antenna in use, Polarity, etc */ @@ -57,9 +53,6 @@ enum ppi_antenna_type { #define PPI_ANTENNA_MAXTAGLEN 187 /* increase as fields are added */ - - - /* protocol */ static int proto_ppi_antenna = -1; @@ -111,13 +104,11 @@ static gint ett_ppi_antennaflags= -1; static void -dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - -void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { +dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* The fixed values up front */ guint32 version; guint length; - guint length_remaining; + gint length_remaining; proto_tree *ppi_antenna_tree = NULL; proto_tree *present_tree = NULL; @@ -140,12 +131,11 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { int offset = 0; /* Clear out stuff in the info column */ - if (check_col(pinfo->cinfo,COL_INFO)) { col_clear(pinfo->cinfo,COL_INFO); - } + /* pull out the first three fields of the BASE-GEOTAG-HEADER */ version = tvb_get_guint8(tvb, offset); - length = tvb_get_letohs(tvb, offset+2); + length = tvb_get_letohs(tvb, offset+2); present = tvb_get_letohl(tvb, offset+4); /* Setup basic column info */ @@ -164,7 +154,7 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree_add_uint(ppi_antenna_tree, hf_ppi_antenna_version, tvb, offset, 1, version); proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_pad, - tvb, offset + 1, 1, FALSE); + tvb, offset + 1, 1, ENC_NA); ti = proto_tree_add_uint(ppi_antenna_tree, hf_ppi_antenna_length, tvb, offset + 2, 2, length); } @@ -201,19 +191,19 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { pt = proto_tree_add_uint(ppi_antenna_tree, hf_ppi_antenna_present, tvb, offset + 4, 4, present); present_tree = proto_item_add_subtree(pt, ett_ppi_antenna_present); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_flags, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_gaindb, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_horizbw, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_vertbw, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_pgain, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_beamid, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_serialnum, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_modelname, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_descstr, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_appspecific_num, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_antenna_present_appspecific_data, tvb, 4, 4, TRUE); - - proto_tree_add_item(present_tree, hf_ppi_antenna_present_ext, tvb, 4, 4, TRUE); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_flags, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_gaindb, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_horizbw, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_vertbw, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_pgain, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_beamid, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_serialnum, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_modelname, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_descstr, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_appspecific_num, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_antenna_present_appspecific_data, tvb, 4, 4, ENC_LITTLE_ENDIAN); + + proto_tree_add_item(present_tree, hf_ppi_antenna_present_ext, tvb, 4, 4, ENC_LITTLE_ENDIAN); } offset += PPI_GEOBASE_MIN_HEADER_LEN; length_remaining -= PPI_GEOBASE_MIN_HEADER_LEN; @@ -234,13 +224,13 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /*Add antenna_flags bitfields here */ antennaflags_tree= proto_item_add_subtree(my_pt, ett_ppi_antennaflags); - proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_mimo, tvb, offset, 4, TRUE); - proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_horizpol, tvb, offset, 4, TRUE); - proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_vertpol, tvb, offset, 4, TRUE); - proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_circpol_l, tvb, offset, 4, TRUE); - proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_circpol_r, tvb, offset, 4, TRUE); - proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_steer_elec, tvb, offset, 4, TRUE); - proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_steer_mech, tvb, offset, 4, TRUE); + proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_mimo, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_horizpol, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_vertpol, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_circpol_l, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_circpol_r, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_steer_elec, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(antennaflags_tree, hf_ppi_antennaflags_steer_mech, tvb, offset, 4, ENC_LITTLE_ENDIAN); } offset+=4; length_remaining-=4; @@ -261,7 +251,7 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_hbw = tvb_get_letohl(tvb, offset); - horizbw = fixed3_6_to_gdouble(t_hbw); + horizbw = ppi_fixed3_6_to_gdouble(t_hbw); if (tree) { proto_tree_add_double(ppi_antenna_tree, hf_ppi_antenna_horizbw, tvb, offset, 4, horizbw); proto_item_append_text(antenna_line, " HorizBw: %f", horizbw); @@ -273,7 +263,7 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_vbw = tvb_get_letohl(tvb, offset); - vertbw = fixed3_6_to_gdouble(t_vbw); + vertbw = ppi_fixed3_6_to_gdouble(t_vbw); if (tree) { proto_tree_add_double(ppi_antenna_tree, hf_ppi_antenna_vertbw, tvb, offset, 4, vertbw); } @@ -284,7 +274,7 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_pgain = tvb_get_letohl(tvb, offset); - pgain = fixed3_6_to_gdouble(t_pgain); + pgain = ppi_fixed3_6_to_gdouble(t_pgain); if (tree) { proto_tree_add_double(ppi_antenna_tree, hf_ppi_antenna_pgain, tvb, offset, 4, pgain); } @@ -349,7 +339,7 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 60) break; if (tree) { - proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_appspecific_data, tvb, offset, 60, FALSE); + proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_appspecific_data, tvb, offset, 60, ENC_NA); } offset+=60; length_remaining-=60; @@ -359,7 +349,8 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { * This indicates a field whose size we do not * know, so we cannot proceed. */ - proto_tree_add_text(ppi_antenna_tree, tvb, offset, 0, "Error: PPI-ANTENNA: unknown bit (%d) set in present field.\n", bit); + proto_tree_add_text(ppi_antenna_tree, tvb, offset, 0, + "Error: PPI-ANTENNA: unknown bit (%d) set in present field.\n", bit); next_present = 0; continue; } @@ -370,7 +361,6 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { void proto_register_ppi_antenna(void) { - /* The following array initializes those header fields declared above to the values displayed */ static hf_register_info hf[] = { { &hf_ppi_antenna_version, { "Header revision", "ppi_antenna.version", @@ -404,7 +394,7 @@ proto_register_ppi_antenna(void) { #define PPI_ANTENNA_MASK_MODELSTR 0x08000000 /* 27 */ #define PPI_ANTENNA_MASK_DESCSTR 0x10000000 /* 28 */ #define PPI_ANTENNA_MASK_APPID 0x20000000 /* 29 */ -#define PPI_ANTENNA_MASK_APPDATA 0x40000000 /* 30 */ +#define PPI_ANTENNA_MASK_APPDATA 0x40000000 /* 30 */ #define PPI_ANTENNA_MASK_EXT 0x80000000 /* 31 */ /*This second set is for the AntennaFlags bitfield. */ @@ -522,20 +512,20 @@ proto_register_ppi_antenna(void) { { &hf_ppi_antenna_pgain, { "Precision Gain (dBi)", "ppi_antenna.pgain", FT_DOUBLE, BASE_NONE, NULL, 0x0, - "Precision Gain", HFILL } }, + NULL, HFILL } }, { &hf_ppi_antenna_beamid, { "BeamID", "ppi_antenna.beamid", FT_UINT16, BASE_HEX, NULL, 0x0, - "Beam ID", HFILL } }, + NULL, HFILL } }, { &hf_ppi_antenna_serialnum, { "SerialNumber", "ppi_antenna.serialnum", FT_STRING, BASE_NONE, NULL, 0x0, - "Serial number", HFILL } } , + NULL, HFILL } } , { &hf_ppi_antenna_modelname, { "ModelName", "ppi_antenna.modelname", FT_STRING, BASE_NONE, NULL, 0x0, - "Model name", HFILL } } , + NULL, HFILL } } , { &hf_ppi_antenna_descstr, { "Description", "ppi_antenna.descr", FT_STRING, BASE_NONE, NULL, 0x0, @@ -543,11 +533,11 @@ proto_register_ppi_antenna(void) { { &hf_ppi_antenna_appspecific_num, { "Application Specific id", "ppi_antenna.appid", FT_UINT32, BASE_HEX, NULL, 0x0, - "Application-specific identifier", HFILL } }, + NULL, HFILL } }, { &hf_ppi_antenna_appspecific_data, { "Application specific data", "ppi_antenna.appdata", FT_BYTES, BASE_NONE, NULL, 0x0, - "Application-specific data", HFILL } }, + NULL, HFILL } }, }; static gint *ett[] = { &ett_ppi_antenna, @@ -561,3 +551,16 @@ proto_register_ppi_antenna(void) { register_dissector("ppi_antenna", dissect_ppi_antenna, proto_ppi_antenna); } + +/* + * 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: + */ diff --git a/epan/dissectors/packet-ppi-geolocation-common.c b/epan/dissectors/packet-ppi-geolocation-common.c index 094c8fc5c9..cd4d8784be 100644 --- a/epan/dissectors/packet-ppi-geolocation-common.c +++ b/epan/dissectors/packet-ppi-geolocation-common.c @@ -23,13 +23,14 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include <glib.h> #include "packet-ppi-geolocation-common.h" /* * input: a unsigned 32-bit (native endian) value between 0 and 3600000000 (inclusive) * output: a signed floating point value betwen -180.0000000 and + 180.0000000, inclusive) */ -gdouble fixed3_7_to_gdouble(guint32 in) { +gdouble ppi_fixed3_7_to_gdouble(guint32 in) { gint32 remapped_in = in - (180 * 10000000); gdouble ret = (gdouble) ((gdouble) remapped_in / 10000000); return ret; @@ -39,7 +40,7 @@ gdouble fixed3_7_to_gdouble(guint32 in) { * output: a positive floating point value between 000.0000000 and 999.9999999 */ -gdouble fixed3_6_to_gdouble(guint32 in) { +gdouble ppi_fixed3_6_to_gdouble(guint32 in) { gdouble ret = (gdouble) in / 1000000.0; return ret; @@ -48,13 +49,13 @@ gdouble fixed3_6_to_gdouble(guint32 in) { * input: a native 32 bit unsigned value between 0 and 3600000000 * output: a signed floating point value between -180000.0000 and +180000.0000 */ -gdouble fixed6_4_to_gdouble(guint32 in) { +gdouble ppi_fixed6_4_to_gdouble(guint32 in) { gint32 remapped_in = in - (180000 * 10000); gdouble ret = (gdouble) ((gdouble) remapped_in / 10000); return ret; } -gdouble ns_counter_to_gdouble(guint32 in) { +gdouble ppi_ns_counter_to_gdouble(guint32 in) { gdouble ret; ret = (gdouble) in / 1000000000; return ret; diff --git a/epan/dissectors/packet-ppi-geolocation-common.h b/epan/dissectors/packet-ppi-geolocation-common.h index d92a855569..77176de3a3 100644 --- a/epan/dissectors/packet-ppi-geolocation-common.h +++ b/epan/dissectors/packet-ppi-geolocation-common.h @@ -25,7 +25,6 @@ #ifndef __PPI_GEOLOCATION_COMMON_H #define __PPI_GEOLOCATION_COMMON_H -#include <glib.h> /* * Declarations from shared PPI-GEOLOCATION functions. @@ -59,14 +58,14 @@ * 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); +gdouble ppi_fixed3_7_to_gdouble(guint32 in); +gdouble ppi_fixed3_6_to_gdouble(guint32 in); +gdouble ppi_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); +gdouble ppi_ns_counter_to_gdouble(guint32 in); typedef enum { diff --git a/epan/dissectors/packet-ppi-gps.c b/epan/dissectors/packet-ppi-gps.c index 056a2eb0fa..3b20245ec1 100644 --- a/epan/dissectors/packet-ppi-gps.c +++ b/epan/dissectors/packet-ppi-gps.c @@ -30,12 +30,8 @@ #endif #include <glib.h> -#include <string.h> #include <epan/packet.h> -#include <epan/ptvcursor.h> -#include <epan/prefs.h> -#include <epan/reassemble.h> -#include <epan/dissectors/packet-ppi-geolocation-common.h> +#include "packet-ppi-geolocation-common.h" enum ppi_geotagging_type { PPI_GEOTAG_GPSFLAGS = 0, @@ -126,12 +122,10 @@ static gint ett_ppi_gps_present = -1; static gint ett_ppi_gps_gpsflags_flags= -1; static void -dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - -void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { +dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* These are locals used for processing the current tvb */ guint length; - guint length_remaining; + gint length_remaining; int offset = 0; proto_tree *ppi_gps_tree = NULL; @@ -162,11 +156,11 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gps_timestamp.secs = gps_timestamp.nsecs = already_processed_fractime = 0; /* Clear out stuff in the info column */ - if (check_col(pinfo->cinfo,COL_INFO)) - col_clear(pinfo->cinfo,COL_INFO); + col_clear(pinfo->cinfo,COL_INFO); + /* pull out the first three fields of the BASE-GEOTAG-HEADER */ version = tvb_get_guint8(tvb, offset); - length = tvb_get_letohs(tvb, offset+2); + length = tvb_get_letohs(tvb, offset+2); present = tvb_get_letohl(tvb, offset+4); /* Setup basic column info */ @@ -179,7 +173,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gps_line = ti; /*we will make this more useful if we hit lon/lat later */ ppi_gps_tree= proto_item_add_subtree(ti, ett_ppi_gps); proto_tree_add_uint(ppi_gps_tree, hf_ppi_gps_version, tvb, offset, 1, version); - proto_tree_add_item(ppi_gps_tree, hf_ppi_gps_pad, tvb, offset + 1, 1, FALSE); + proto_tree_add_item(ppi_gps_tree, hf_ppi_gps_pad, tvb, offset + 1, 1, ENC_NA); ti = proto_tree_add_uint(ppi_gps_tree, hf_ppi_gps_length, tvb, offset + 2, 2, length); } @@ -215,20 +209,20 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { pt = proto_tree_add_uint(ppi_gps_tree, hf_ppi_gps_present, tvb, offset + 4, 4, present); present_tree = proto_item_add_subtree(pt, ett_ppi_gps_present); - proto_tree_add_item(present_tree, hf_ppi_gps_present_gpsflags_flags, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_lat, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_lon, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_alt, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_alt_gnd, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_gpstime, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_fractime, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_eph, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_epv, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_ept, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_descr, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_appspecific_num, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_appspecific_data, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_gps_present_ext, tvb, 4, 4, TRUE); + proto_tree_add_item(present_tree, hf_ppi_gps_present_gpsflags_flags, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_lat, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_lon, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_alt, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_alt_gnd, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_gpstime, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_fractime, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_eph, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_epv, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_ept, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_descr, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_appspecific_num, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_appspecific_data, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_gps_present_ext, tvb, 4, 4, ENC_LITTLE_ENDIAN); } offset += PPI_GEOBASE_MIN_HEADER_LEN; length_remaining -= PPI_GEOBASE_MIN_HEADER_LEN; @@ -250,15 +244,15 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* then we add a subtree */ gpsflags_flags_tree = proto_item_add_subtree(my_pt, ett_ppi_gps_gpsflags_flags); /* to pin the individual bits on */ - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag0_nofix, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag1_gpsfix, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag2_diffgps, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag3_PPS, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag4_RTK, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag5_floatRTK, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag6_dead_reck, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag7_manual, tvb, offset, 4, TRUE); - proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag8_sim, tvb, offset, 4, TRUE); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag0_nofix, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag1_gpsfix, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag2_diffgps, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag3_PPS, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag4_RTK, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag5_floatRTK, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag6_dead_reck, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag7_manual, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(gpsflags_flags_tree, hf_ppi_gps_gpsflags_flag8_sim, tvb, offset, 4, ENC_LITTLE_ENDIAN); } offset+=4; length_remaining-=4; @@ -267,7 +261,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_lat = tvb_get_letohl(tvb, offset); - lat = fixed3_7_to_gdouble(t_lat); + lat = ppi_fixed3_7_to_gdouble(t_lat); if (tree) { proto_tree_add_double(ppi_gps_tree, hf_ppi_gps_lat, tvb, offset, 4, lat); @@ -280,7 +274,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_lon = tvb_get_letohl(tvb, offset); - lon = fixed3_7_to_gdouble(t_lon); + lon = ppi_fixed3_7_to_gdouble(t_lon); if (tree) { proto_tree_add_double(ppi_gps_tree, hf_ppi_gps_lon, tvb, offset, 4, lon); @@ -293,7 +287,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_alt = tvb_get_letohl(tvb, offset); - alt = fixed6_4_to_gdouble(t_alt); + alt = ppi_fixed6_4_to_gdouble(t_alt); if (tree) { proto_tree_add_double(ppi_gps_tree, hf_ppi_gps_alt, tvb, offset, 4, alt); @@ -306,7 +300,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_alt_gnd = tvb_get_letohl(tvb, offset); - alt_gnd = fixed6_4_to_gdouble(t_alt_gnd); + alt_gnd = ppi_fixed6_4_to_gdouble(t_alt_gnd); if (tree) { proto_tree_add_double(ppi_gps_tree, hf_ppi_gps_alt_gnd, tvb, offset, 4, alt_gnd); @@ -347,7 +341,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_herr = tvb_get_letohl(tvb, offset); - eph = fixed3_6_to_gdouble(t_herr); + eph = ppi_fixed3_6_to_gdouble(t_herr); if (tree) proto_tree_add_double(ppi_gps_tree, hf_ppi_gps_eph, tvb, offset, 4, eph); offset+=4; @@ -357,7 +351,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_verr = tvb_get_letohl(tvb, offset); - epv = fixed3_6_to_gdouble(t_verr); + epv = ppi_fixed3_6_to_gdouble(t_verr); if (tree) proto_tree_add_double(ppi_gps_tree, hf_ppi_gps_epv, tvb, offset, 4, epv); offset+=4; @@ -367,7 +361,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; t_terr = tvb_get_letohl(tvb, offset); - ept = ns_counter_to_gdouble(t_terr); + ept = ppi_ns_counter_to_gdouble(t_terr); if (tree) proto_tree_add_double(ppi_gps_tree, hf_ppi_gps_ept, tvb, offset, 4, ept); offset+=4; @@ -378,7 +372,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { break; if (tree) { - /* proto_tree_add_item(ppi_gps_tree, hf_ppi_gps_descstr, tvb, offset, 32, FALSE); */ + /* proto_tree_add_item(ppi_gps_tree, hf_ppi_gps_descstr, tvb, offset, 32, ENC_NA); */ curr_str = tvb_format_stringzpad(tvb, offset, 32); /* need to append_text this */ proto_tree_add_string(ppi_gps_tree, hf_ppi_gps_descstr, tvb, offset, 32, curr_str); proto_item_append_text(gps_line, " (%s)", curr_str); @@ -400,7 +394,7 @@ void dissect_ppi_gps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 60) break; if (tree) { - proto_tree_add_item(ppi_gps_tree, hf_ppi_gps_appspecific_data, tvb, offset, 60, FALSE); + proto_tree_add_item(ppi_gps_tree, hf_ppi_gps_appspecific_data, tvb, offset, 60, ENC_NA); } offset+=60; length_remaining-=60; @@ -426,9 +420,9 @@ proto_register_ppi_gps(void) { /* The following array initializes those header fields declared above to the values displayed */ static hf_register_info hf[] = { { &hf_ppi_gps_version, - { "Header revision", "ppi_gps.version", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Version of ppi_gps header format", HFILL } }, + { "Header revision", "ppi_gps.version", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Version of ppi_gps header format", HFILL } }, { &hf_ppi_gps_pad, { "Header pad", "ppi_gps.pad", FT_UINT8, BASE_DEC, NULL, 0x0, @@ -564,7 +558,7 @@ proto_register_ppi_gps(void) { { &hf_ppi_gps_appspecific_num, { "Application Specific id", "ppi_gps.appid", FT_UINT32, BASE_HEX, NULL, 0x0, - "Application-specific identifier", HFILL } }, + NULL, HFILL } }, { &hf_ppi_gps_appspecific_data, { "Application specific data", "ppi_gps.appdata", FT_BYTES, BASE_NONE, NULL, 0x0, @@ -591,7 +585,7 @@ proto_register_ppi_gps(void) { { &hf_ppi_gps_gpsflags_flag2_diffgps, /* Differential GPS fix available */ { "Differential GPS provided fix", "ppi_gps.gpsflagss.diffgps", FT_BOOLEAN, 32, NULL, PPI_GPS_GPSFLAGS_FLAG2_DIFFGPS, - "DGPS provided fix", HFILL } }, + NULL, HFILL } }, { &hf_ppi_gps_gpsflags_flag3_PPS, /* PPS fix */ { "PPS fix", "ppi_gps.gpsflagss.pps", FT_BOOLEAN, 32, NULL, PPI_GPS_GPSFLAGS_FLAG3_PPS, diff --git a/epan/dissectors/packet-ppi-sensor.c b/epan/dissectors/packet-ppi-sensor.c index 640a1bf738..a47dde5207 100644 --- a/epan/dissectors/packet-ppi-sensor.c +++ b/epan/dissectors/packet-ppi-sensor.c @@ -30,13 +30,9 @@ #endif #include <glib.h> -#include <string.h> #include <epan/packet.h> -#include <epan/ptvcursor.h> -#include <epan/prefs.h> -#include <epan/reassemble.h> -#include <epan/dissectors/packet-ppi-geolocation-common.h> +#include "packet-ppi-geolocation-common.h" enum ppi_sensor_type { PPI_SENSOR_SENSORTYPE = 0, /* Velocity, Acceleration, etc */ @@ -136,12 +132,9 @@ static int hf_ppi_sensor_present_ext = -1; static gint ett_ppi_sensor = -1; static gint ett_ppi_sensor_present = -1; - -static void -dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - /* used with ScaleFactor */ -gdouble base_10_expt(int power) +static gdouble +base_10_expt(int power) { gdouble ret = 1; int provide_frac = 0; @@ -165,7 +158,9 @@ gdouble base_10_expt(int power) else return (1.0/ret); } -void dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { + +static void +dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* The fixed values up front */ guint32 version; guint length; @@ -311,7 +306,7 @@ void dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; val_t = tvb_get_letohl(tvb, offset); - c_val = fixed6_4_to_gdouble(val_t); + c_val = ppi_fixed6_4_to_gdouble(val_t); if (tree) { my_pt = proto_tree_add_double(ppi_sensor_tree, hf_ppi_sensor_val_x, tvb, offset, 4, c_val); proto_item_append_text (my_pt, " %s", unit_str); @@ -325,7 +320,7 @@ void dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; val_t = tvb_get_letohl(tvb, offset); - c_val = fixed6_4_to_gdouble(val_t); + c_val = ppi_fixed6_4_to_gdouble(val_t); if (tree) { my_pt = proto_tree_add_double(ppi_sensor_tree, hf_ppi_sensor_val_y, tvb, offset, 4, c_val); proto_item_append_text (my_pt, " %s", unit_str); @@ -340,7 +335,7 @@ void dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; val_t = tvb_get_letohl(tvb, offset); - c_val = fixed6_4_to_gdouble(val_t); + c_val = ppi_fixed6_4_to_gdouble(val_t); if (tree) { my_pt = proto_tree_add_double(ppi_sensor_tree, hf_ppi_sensor_val_z, tvb, offset, 4, c_val); proto_item_append_text (my_pt, " %s", unit_str); @@ -354,7 +349,7 @@ void dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; val_t = tvb_get_letohl(tvb, offset); - c_val = fixed6_4_to_gdouble(val_t); + c_val = ppi_fixed6_4_to_gdouble(val_t); if (tree) { my_pt = proto_tree_add_double(ppi_sensor_tree, hf_ppi_sensor_val_t, tvb, offset, 4, c_val); proto_item_append_text (my_pt, " %s", unit_str); @@ -368,7 +363,7 @@ void dissect_ppi_sensor(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { if (length_remaining < 4) break; val_t = tvb_get_letohl(tvb, offset); - c_val = fixed6_4_to_gdouble(val_t); + c_val = ppi_fixed6_4_to_gdouble(val_t); if (tree) { my_pt = proto_tree_add_double(ppi_sensor_tree, hf_ppi_sensor_val_e, tvb, offset, 4, c_val); proto_item_append_text (my_pt, " %s", unit_str); @@ -563,3 +558,18 @@ proto_register_ppi_sensor(void) { register_dissector("ppi_sensor", dissect_ppi_sensor, proto_ppi_sensor); } + +/* + * 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: + */ + + diff --git a/epan/dissectors/packet-ppi-vector.c b/epan/dissectors/packet-ppi-vector.c index 06210cabe1..c988005cae 100644 --- a/epan/dissectors/packet-ppi-vector.c +++ b/epan/dissectors/packet-ppi-vector.c @@ -36,12 +36,8 @@ #endif #include <glib.h> -#include <string.h> #include <epan/packet.h> -#include <epan/ptvcursor.h> -#include <epan/prefs.h> -#include <epan/reassemble.h> #include "packet-ppi-geolocation-common.h" enum ppi_vector_type { @@ -148,11 +144,11 @@ enum ppi_vector_type { /* Values for the two-bit RelativeTo subfield of vflags */ static const value_string relativeto_string[] = { -{ 0x00, "Forward"}, -{ 0x01, "Earth"}, -{ 0x02, "Current"}, -{ 0x03, "Reserved"}, -{ 0x00, NULL} + { 0x00, "Forward"}, + { 0x01, "Earth"}, + { 0x02, "Current"}, + { 0x03, "Reserved"}, + { 0x00, NULL} }; @@ -272,8 +268,6 @@ static gint ett_ppi_vector_present = -1; static gint ett_ppi_vectorflags= -1; static gint ett_ppi_vectorchars= -1; -static void dissect_ppi_vector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - /* We want to abbreviate this field into a single line. Does so without any string maniuplation */ static void @@ -292,7 +286,7 @@ annotate_vector_chars(guint32 chars, proto_tree *my_pt) } static void -dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_tree *ppi_vector_tree) +dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, gint length_remaining, proto_tree *ppi_vector_tree) { proto_tree *vectorflags_tree = NULL; proto_tree *vectorchars_tree = NULL; @@ -308,7 +302,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t gdouble vel_r, vel_f, vel_u, vel_t; gdouble acc_r, acc_f, acc_u, acc_t = 0; gdouble err_rot, err_off, err_vel, err_acc; - guint32 appsecific_num; /* appdata parser should add a subtree based on this value */ + guint32 appsecific_num; /* appdata parser should add a subtree based on this value */ guint32 flags=0, chars=0; /* temporary, conversion values */ @@ -321,30 +315,30 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t tvb, offset + 4, 4, present); present_tree = proto_item_add_subtree(pt, ett_ppi_vector_present); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vflags, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vchars, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_val_x, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_val_y, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_val_z, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_off_r, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_off_f, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_off_u, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_r, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_f, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_u, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_t, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_r, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_f, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_u, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_t, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_err_rot, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_err_off, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_err_vel, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_err_acc, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_descstr, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_presenappsecific_num, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_appspecific_data, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_ext, tvb, 4, 4, TRUE); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vflags, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vchars, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_val_x, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_val_y, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_val_z, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_off_r, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_off_f, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_off_u, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_r, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_f, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_u, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vel_t, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_r, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_f, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_u, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_acc_t, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_err_rot, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_err_off, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_err_vel, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_err_acc, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_descstr, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_presenappsecific_num, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_appspecific_data, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_ext, tvb, 4, 4, ENC_LITTLE_ENDIAN); } offset += PPI_GEOBASE_MIN_HEADER_LEN; length_remaining -= PPI_GEOBASE_MIN_HEADER_LEN; @@ -365,9 +359,9 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t my_pt = proto_tree_add_uint(ppi_vector_tree, hf_ppi_vector_vflags, tvb, offset , 4, flags); vectorflags_tree= proto_item_add_subtree(my_pt, ett_ppi_vectorflags); - proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_defines_forward, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_rots_absolute, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_offsets_from_gps, tvb, offset, 4, TRUE); + proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_defines_forward, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_rots_absolute, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_offsets_from_gps, tvb, offset, 4, ENC_LITTLE_ENDIAN); } offset+=4; length_remaining-=4; @@ -380,14 +374,14 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t my_pt = proto_tree_add_uint(ppi_vector_tree, hf_ppi_vector_vchars, tvb, offset , 4, chars); vectorchars_tree= proto_item_add_subtree(my_pt, ett_ppi_vectorchars); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_antenna, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_dir_of_travel, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_front_of_veh, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_gps_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_ins_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_compass_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_accelerometer_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_human_derived, tvb, offset, 4, TRUE); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_antenna, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_dir_of_travel, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_front_of_veh, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_gps_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_ins_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_compass_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_accelerometer_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_human_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); } offset+=4; length_remaining-=4; @@ -396,7 +390,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - rot_x = fixed3_6_to_gdouble(t_val); + rot_x = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_rot_x, tvb, offset, 4, rot_x); if (flags & PPI_VECTOR_VFLAGS_ROTS_ABSOLUTE) @@ -411,7 +405,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - rot_y = fixed3_6_to_gdouble(t_val); + rot_y = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_rot_y, tvb, offset, 4, rot_y); if (flags & PPI_VECTOR_VFLAGS_ROTS_ABSOLUTE) @@ -426,7 +420,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - rot_z = fixed3_6_to_gdouble(t_val); + rot_z = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_rot_z, tvb, offset, 4, rot_z); if (flags & PPI_VECTOR_VFLAGS_ROTS_ABSOLUTE) @@ -441,7 +435,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - off_r = fixed6_4_to_gdouble(t_val); + off_r = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_off_r, tvb, offset, 4, off_r); if (flags & PPI_VECTOR_VFLAGS_OFFSETS_FROM_GPS) @@ -456,7 +450,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - off_f = fixed6_4_to_gdouble(t_val); + off_f = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_off_f, tvb, offset, 4, off_f); if (flags & PPI_VECTOR_VFLAGS_OFFSETS_FROM_GPS) @@ -471,7 +465,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - off_u = fixed6_4_to_gdouble(t_val); + off_u = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_off_u, tvb, offset, 4, off_u); if (flags & PPI_VECTOR_VFLAGS_OFFSETS_FROM_GPS) @@ -486,7 +480,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - vel_r = fixed6_4_to_gdouble(t_val); + vel_r = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_vel_r, tvb, offset, 4, vel_r); proto_item_append_text(ti, " m/s"); @@ -498,7 +492,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - vel_f = fixed6_4_to_gdouble(t_val); + vel_f = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_vel_f, tvb, offset, 4, vel_f); proto_item_append_text(ti, " m/s"); @@ -510,7 +504,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - vel_u = fixed6_4_to_gdouble(t_val); + vel_u = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_vel_u, tvb, offset, 4, vel_u); proto_item_append_text(ti, " m/s"); @@ -522,7 +516,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - vel_t = fixed6_4_to_gdouble(t_val); + vel_t = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_vel_t, tvb, offset, 4, vel_t); proto_item_append_text(ti, " m/s"); @@ -534,7 +528,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - acc_r = fixed6_4_to_gdouble(t_val); + acc_r = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_acc_r, tvb, offset, 4, acc_r); proto_item_append_text(ti, " (m/s)/s"); @@ -546,7 +540,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - acc_f = fixed6_4_to_gdouble(t_val); + acc_f = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_acc_f, tvb, offset, 4, acc_f); proto_item_append_text(ti, " (m/s)/s"); @@ -558,7 +552,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - acc_u = fixed6_4_to_gdouble(t_val); + acc_u = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_acc_u, tvb, offset, 4, acc_u); proto_item_append_text(ti, " (m/s)/s"); @@ -570,7 +564,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - acc_t = fixed6_4_to_gdouble(t_val); + acc_t = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_acc_t, tvb, offset, 4, acc_t); proto_item_append_text(ti, " (m/s)/s"); @@ -581,8 +575,8 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t case PPI_VECTOR_ERR_ROT: if (length_remaining < 4) break; - t_val = tvb_get_letohl(tvb, offset); - err_rot = fixed3_6_to_gdouble(t_val); + t_val = tvb_get_letohl(tvb, offset); + err_rot = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_err_rot, tvb, offset, 4, err_rot); proto_item_append_text(ti, " degrees"); @@ -593,8 +587,8 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t case PPI_VECTOR_ERR_OFF: if (length_remaining < 4) break; - t_val = tvb_get_letohl(tvb, offset); - err_off = fixed6_4_to_gdouble(t_val); + t_val = tvb_get_letohl(tvb, offset); + err_off = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_err_off, tvb, offset, 4, err_off); proto_item_append_text(ti, " meters"); @@ -605,8 +599,8 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t case PPI_VECTOR_ERR_VEL: if (length_remaining < 4) break; - t_val = tvb_get_letohl(tvb, offset); - err_vel = fixed6_4_to_gdouble(t_val); + t_val = tvb_get_letohl(tvb, offset); + err_vel = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_err_vel, tvb, offset, 4, err_vel); proto_item_append_text(ti, "m/s"); @@ -617,8 +611,8 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t case PPI_VECTOR_ERR_ACC: if (length_remaining < 4) break; - t_val = tvb_get_letohl(tvb, offset); - err_acc = fixed6_4_to_gdouble(t_val); + t_val = tvb_get_letohl(tvb, offset); + err_acc = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_err_acc, tvb, offset, 4, err_acc); proto_item_append_text(ti, " (m/s)/s"); @@ -647,7 +641,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 60) break; if (ppi_vector_tree) { - proto_tree_add_item(ppi_vector_tree, hf_ppi_vector_appspecific_data, tvb, offset, 60, FALSE); + proto_tree_add_item(ppi_vector_tree, hf_ppi_vector_appspecific_data, tvb, offset, 60, ENC_NA); } offset+=60; length_remaining-=60; @@ -667,7 +661,7 @@ dissect_ppi_vector_v1(tvbuff_t *tvb, int offset, guint length_remaining, proto_t } static void -dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_tree *ppi_vector_tree, proto_item *vector_line) +dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, gint length_remaining, proto_tree *ppi_vector_tree, proto_item *vector_line) { proto_tree *vectorflags_tree = NULL; proto_tree *vectorchars_tree = NULL; @@ -702,20 +696,20 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t tvb, offset + 4, 4, present); present_tree = proto_item_add_subtree(pt, ett_ppi_vector_present); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vflags, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_vchars, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_val_x, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_val_y, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_val_z, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_off_x, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_off_y, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_off_z, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_err_rot, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_err_off, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_descstr, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_presenappsecific_num, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_appspecific_data, tvb, 4, 4, TRUE); - proto_tree_add_item(present_tree, hf_ppi_vector_present_ext, tvb, 4, 4, TRUE); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vflags, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_vchars, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_val_x, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_val_y, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_val_z, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_off_x, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_off_y, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_off_z, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_err_rot, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_err_off, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_descstr, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_presenappsecific_num, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_appspecific_data, tvb, 4, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(present_tree, hf_ppi_vector_present_ext, tvb, 4, 4, ENC_LITTLE_ENDIAN); } offset += PPI_GEOBASE_MIN_HEADER_LEN; length_remaining -= PPI_GEOBASE_MIN_HEADER_LEN; @@ -774,8 +768,8 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t my_pt = proto_tree_add_uint(ppi_vector_tree, hf_ppi_vector_vflags, tvb, offset , 4, flags); vectorflags_tree= proto_item_add_subtree(my_pt, ett_ppi_vectorflags); - proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_defines_forward, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_relative_to, tvb, offset, 4, TRUE); + proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_defines_forward, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorflags_tree, hf_ppi_vector_vflags_relative_to, tvb, offset, 4, ENC_LITTLE_ENDIAN); if (flags & PPI_VECTOR_VFLAGS_DEFINES_FORWARD) proto_item_append_text(vectorflags_tree, " (Forward)"); @@ -793,16 +787,16 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t my_pt = proto_tree_add_uint(ppi_vector_tree, hf_ppi_vector_vchars, tvb, offset , 4, chars); vectorchars_tree= proto_item_add_subtree(my_pt, ett_ppi_vectorchars); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_antenna, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_dir_of_travel, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_front_of_veh, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_angle_of_arrival, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_transmitter_pos, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_gps_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_ins_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_compass_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_accelerometer_derived, tvb, offset, 4, TRUE); - proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_human_derived, tvb, offset, 4, TRUE); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_antenna, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_dir_of_travel, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_front_of_veh, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_angle_of_arrival, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_transmitter_pos, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_gps_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_ins_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_compass_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_accelerometer_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vectorchars_tree, hf_ppi_vector_vchars_human_derived, tvb, offset, 4, ENC_LITTLE_ENDIAN); annotate_vector_chars(chars, my_pt); } @@ -813,7 +807,7 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - rot_x = fixed3_6_to_gdouble(t_val); + rot_x = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_rot_x, tvb, offset, 4, rot_x); proto_item_append_text(ti, " Degrees RelativeTo: %s", relativeto_str); @@ -826,7 +820,7 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - rot_y = fixed3_6_to_gdouble(t_val); + rot_y = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_rot_y, tvb, offset, 4, rot_y); proto_item_append_text(ti, " Degrees RelativeTo: %s", relativeto_str); @@ -839,7 +833,7 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - rot_z = fixed3_6_to_gdouble(t_val); + rot_z = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_rot_z, tvb, offset, 4, rot_z); proto_item_append_text(ti, " Degrees RelativeTo: %s", relativeto_str); @@ -852,7 +846,7 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - off_x = fixed6_4_to_gdouble(t_val); + off_x = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_off_x, tvb, offset, 4, off_x); proto_item_append_text(ti, " Meters RelativeTo: %s", relativeto_str); @@ -865,7 +859,7 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - off_y = fixed6_4_to_gdouble(t_val); + off_y = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_off_y, tvb, offset, 4, off_y); proto_item_append_text(ti, " Meters RelativeTo: %s", relativeto_str); @@ -878,7 +872,7 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 4) break; t_val = tvb_get_letohl(tvb, offset); - off_z = fixed6_4_to_gdouble(t_val); + off_z = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_off_z, tvb, offset, 4, off_z); proto_item_append_text(ti, " Meters RelativeTo: %s", relativeto_str); @@ -890,8 +884,8 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t case PPI_VECTOR_ERR_ROT: if (length_remaining < 4) break; - t_val = tvb_get_letohl(tvb, offset); - err_rot = fixed3_6_to_gdouble(t_val); + t_val = tvb_get_letohl(tvb, offset); + err_rot = ppi_fixed3_6_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_err_rot, tvb, offset, 4, err_rot); proto_item_append_text(ti, " Degrees"); @@ -902,8 +896,8 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t case PPI_VECTOR_ERR_OFF: if (length_remaining < 4) break; - t_val = tvb_get_letohl(tvb, offset); - err_off = fixed6_4_to_gdouble(t_val); + t_val = tvb_get_letohl(tvb, offset); + err_off = ppi_fixed6_4_to_gdouble(t_val); if (ppi_vector_tree) { ti = proto_tree_add_double(ppi_vector_tree, hf_ppi_vector_err_off, tvb, offset, 4, err_off); proto_item_append_text(ti, " Meters"); @@ -939,7 +933,7 @@ dissect_ppi_vector_v2(tvbuff_t *tvb, int offset, guint length_remaining, proto_t if (length_remaining < 60) break; if (ppi_vector_tree) { - proto_tree_add_item(ppi_vector_tree, hf_ppi_vector_appspecific_data, tvb, offset, 60, FALSE); + proto_tree_add_item(ppi_vector_tree, hf_ppi_vector_appspecific_data, tvb, offset, 60, ENC_NA); } offset+=60; length_remaining-=60; @@ -965,7 +959,7 @@ dissect_ppi_vector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree *ppi_vector_tree = NULL; proto_item *ti = NULL; proto_item *vector_line = NULL; - guint length_remaining; + gint length_remaining; int offset = 0; /* values actually read out, for displaying */ @@ -973,12 +967,11 @@ dissect_ppi_vector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) guint length; /* Clear out stuff in the info column */ - if (check_col(pinfo->cinfo,COL_INFO)) { col_clear(pinfo->cinfo,COL_INFO); - } + /* pull out the first three fields of the BASE-GEOTAG-HEADER */ version = tvb_get_guint8(tvb, offset); - length = tvb_get_letohs(tvb, offset+2); + length = tvb_get_letohs(tvb, offset+2); /* Setup basic column info */ if (check_col(pinfo->cinfo, COL_INFO)) @@ -993,7 +986,7 @@ dissect_ppi_vector(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) proto_tree_add_uint(ppi_vector_tree, hf_ppi_vector_version, tvb, offset, 1, version); proto_tree_add_item(ppi_vector_tree, hf_ppi_vector_pad, - tvb, offset + 1, 1, FALSE); + tvb, offset + 1, 1, ENC_NA); ti = proto_tree_add_uint(ppi_vector_tree, hf_ppi_vector_length, tvb, offset + 2, 2, length); } @@ -1055,7 +1048,8 @@ proto_register_ppi_vector(void) "Length of header including version, pad, length and data fields", HFILL } }, { &hf_ppi_vector_present, { "Present", "ppi_vector.present", - FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating which fields are present", HFILL } }, + FT_UINT32, BASE_HEX, NULL, 0x0, + "Bitmask indicating which fields are present", HFILL } }, /* Boolean 'present' flags */ { &hf_ppi_vector_present_vflags, @@ -1202,10 +1196,12 @@ proto_register_ppi_vector(void) /* This setups the "Vector fflags" hex dropydown thing */ { &hf_ppi_vector_vflags, { "Vector flags", "ppi_vector.vector_flags", - FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating coordinate sys, among others, etc", HFILL } }, + FT_UINT32, BASE_HEX, NULL, 0x0, + "Bitmask indicating coordinate sys, among others, etc", HFILL } }, { &hf_ppi_vector_vchars, { "Vector chars", "ppi_vector.vector_chars", - FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating if vector tracks antenna, vehicle, motion, etc", HFILL } }, + FT_UINT32, BASE_HEX, NULL, 0x0, + "Bitmask indicating if vector tracks antenna, vehicle, motion, etc", HFILL } }, { &hf_ppi_vector_rot_x, { "Pitch ", "ppi_vector.pitch", /*extra spaces intentional. casuses field values to align*/ FT_DOUBLE, BASE_NONE, NULL, 0x0, @@ -1398,3 +1394,18 @@ proto_register_ppi_vector(void) register_dissector("ppi_vector", dissect_ppi_vector, proto_ppi_vector); } + +/* + * 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: + */ + + diff --git a/epan/dissectors/packet-ppi.c b/epan/dissectors/packet-ppi.c index bca7835ebc..0c5b977977 100644 --- a/epan/dissectors/packet-ppi.c +++ b/epan/dissectors/packet-ppi.c @@ -55,7 +55,6 @@ #include <epan/ptvcursor.h> #include <epan/prefs.h> #include <epan/reassemble.h> -#include <epan/range.h> #include <epan/frequency-utils.h> /* Needed for wtap_pcap_encap_to_wtap_encap(). */ @@ -372,9 +371,6 @@ static GHashTable *ampdu_reassembled_table = NULL; static gboolean ppi_ampdu_reassemble = TRUE; -static void -dissect_ppi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree); - void capture_ppi(const guchar *pd, int len, packet_counts *ld) { @@ -421,7 +417,8 @@ capture_ppi(const guchar *pd, int len, packet_counts *ld) ld->other++; } -static void ptvcursor_add_invalid_check(ptvcursor_t *csr, int hf, gint len, guint64 invalid_val) { +static void +ptvcursor_add_invalid_check(ptvcursor_t *csr, int hf, gint len, guint64 invalid_val) { proto_item *ti; guint64 val = invalid_val; @@ -596,7 +593,8 @@ dissect_80211n_mac(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int ptvcursor_free(csr); } -static void dissect_80211n_mac_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int data_len, guint32 *n_mac_flags, guint32 *ampdu_id) +static void +dissect_80211n_mac_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, int data_len, guint32 *n_mac_flags, guint32 *ampdu_id) { proto_tree *ftree = NULL; proto_item *ti = NULL; @@ -669,7 +667,8 @@ static void dissect_80211n_mac_phy(tvbuff_t *tvb, packet_info *pinfo, proto_tree ptvcursor_free(csr); } -static void dissect_aggregation_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int data_len) +static void +dissect_aggregation_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int data_len) { proto_tree *ftree = tree; proto_item *ti = NULL; @@ -691,7 +690,8 @@ static void dissect_aggregation_extension(tvbuff_t *tvb, packet_info *pinfo _U_, ptvcursor_free(csr); } -static void dissect_8023_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int data_len) +static void +dissect_8023_extension(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, int data_len) { proto_tree *ftree = tree; proto_item *ti = NULL; |