diff options
Diffstat (limited to 'epan/dissectors/packet-ppi-antenna.c')
-rw-r--r-- | epan/dissectors/packet-ppi-antenna.c | 448 |
1 files changed, 243 insertions, 205 deletions
diff --git a/epan/dissectors/packet-ppi-antenna.c b/epan/dissectors/packet-ppi-antenna.c index 6473983c2c..94ce407607 100644 --- a/epan/dissectors/packet-ppi-antenna.c +++ b/epan/dissectors/packet-ppi-antenna.c @@ -54,6 +54,9 @@ enum ppi_antenna_type { PPI_ANTENNA_APPDATA = 30, /* 60-byte app-id specific data*/ PPI_ANTENNA_EXT = 31 /* Indicates n extended bitmap follows */ }; +#define PPI_ANTENNA_MAXTAGLEN 187 /* increase as fields are added */ + + @@ -110,199 +113,6 @@ static gint ett_ppi_antennaflags= -1; static 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", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Version of ppi_antenna header format", HFILL } }, - { &hf_ppi_antenna_pad, - { "Header pad", "ppi_antenna.pad", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Padding", HFILL } }, - { &hf_ppi_antenna_length, - { "Header length", "ppi_antenna.length", - FT_UINT16, BASE_DEC, NULL, 0x0, - "Length of header including version, pad, length and data fields", HFILL } }, - /* This setups the "Antenna flags" hex dropydown thing */ - { &hf_ppi_antenna_flags, - { "Antenna flags", "ppi_antenna.antenna_flags", - FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating polarity, etc", HFILL } }, - { &hf_ppi_antenna_present, - { "Present", "ppi_antenna.present", - FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating which fields are present", HFILL } }, - - /* This first set is for the base_tag_header.it_present bitfield */ -#define PPI_ANTENNA_MASK_FLAGS 0x00000001 /* 0 */ -#define PPI_ANTENNA_MASK_GAINDB 0x00000002 /* 1 */ -#define PPI_ANTENNA_MASK_HORIZBW 0x00000004 /* 2 */ -#define PPI_ANTENNA_MASK_VERTBW 0x00000008 /* 3 */ -#define PPI_ANTENNA_MASK_PGAIN 0x00000020 /* 5 */ -#define PPI_ANTENNA_MASK_BEAMID 0x00000040 /* 6 */ -#define PPI_ANTENNA_MASK_RES7 0x00000080 /* 7 */ -#define PPI_ANTENNA_MASK_SERIALNUM 0x04000000 /* 26 */ -#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_EXT 0x80000000 /* 31 */ - - /*This second set is for the AntennaFlags bitfield. */ -#define PPI_ANTENNAFLAGS_MASK_MIMO 0x00000001 /* 0 */ -#define PPI_ANTENNAFLAGS_MASK_HPOL 0x00000002 /* 1 */ -#define PPI_ANTENNAFLAGS_MASK_VPOL 0x00000004 /* 2 */ -#define PPI_ANTENNAFLAGS_MASK_CPOL_L 0x00000008 /* 3 */ -#define PPI_ANTENNAFLAGS_MASK_CPOL_R 0x00000010 /* 4 */ -#define PPI_ANTENNAFLAGS_MASK_STEER_ELEC 0x00010000 /* 16 */ -#define PPI_ANTENNAFLAGS_MASK_STEER_MECH 0x00020000 /* 17 */ - - - /* Boolean 'present' flags */ - { &hf_ppi_antenna_present_flags, - { "flags", "ppi_antenna.present.flags", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_FLAGS, - "Specifies if the flags bitfield is present", HFILL } }, - { &hf_ppi_antenna_present_gaindb, - { "gaindb", "ppi_antenna.present.gaindb", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_GAINDB, - "Specifies if the antenna gain field is present", HFILL } }, - { &hf_ppi_antenna_present_horizbw, - { "horizbw", "ppi_antenna.present.horizbw", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_HORIZBW, - "Specifies if the horizontal beamwidth field is present", HFILL } }, - { &hf_ppi_antenna_present_vertbw, - { "vertbw", "ppi_antenna.present.vertbw", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_VERTBW, - "Specifies if the vertical beamwidth field is present", HFILL } }, - { &hf_ppi_antenna_present_pgain, - { "pgain", "ppi_antenna.present.pgain", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_PGAIN, - "Specifies if the precision gain field is present", HFILL } }, - { &hf_ppi_antenna_present_beamid, - { "beamid", "ppi_antenna.present.beamid", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_BEAMID, - "Specifies if the BeamID field is present", HFILL } }, - { &hf_ppi_antenna_present_serialnum, - { "serialnum", "ppi_antenna.present.serialnum", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_SERIALNUM, - "Specifies if the serial num is present", HFILL } }, - { &hf_ppi_antenna_present_modelname, - { "modelname", "ppi_antenna.present.modelname", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_MODELSTR, - "Specifies if the model name is present", HFILL } }, - { &hf_ppi_antenna_present_descstr, - { "Description", "ppi_antenna.present.descr", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_DESCSTR, - "Specifies if the description string is present", HFILL } }, - - { &hf_ppi_antenna_present_appspecific_num, - { "appid", "ppi_antenna.present.appid", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_APPID, - "Specifies if the application specific field id is present", HFILL } }, - - { &hf_ppi_antenna_present_appspecific_data, - { "appdata", "ppi_antenna.present.appdata", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_APPDATA, - "Specifies if the application specific data field is present", HFILL } }, - - { &hf_ppi_antenna_present_ext, - { "ext", "ppi_antenna.present.ext", - FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_EXT, - "Specifies if there are any extensions to the header present", HFILL } }, - - /*Here we switch to the antennflags bits*/ - /* Boolean AntennaFlags' flags */ - { &hf_ppi_antennaflags_mimo, - { "mimo", "ppi_antenna.antennaflags.mimo", - FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_MIMO, - "Antena is part of MIMO system", HFILL } }, - { &hf_ppi_antennaflags_horizpol, - { "horizontally polarized", "ppi_antenna.antennaflags.horizpol", - FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_HPOL, - "Specifies if the antenna is horizontally polarized", HFILL } }, - - { &hf_ppi_antennaflags_vertpol, - { "vertically polarized", "ppi_antenna.antennaflags.vertpol", - FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_VPOL, - "Specifies if the antenna is vertically polarized", HFILL } }, - - { &hf_ppi_antennaflags_circpol_l, - { "circularly polarized left", "ppi_antenna.antennaflags.circpol_l", - FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_CPOL_L, - "Specifies if the antenna is circularly polarized, left handed", HFILL } }, - - { &hf_ppi_antennaflags_circpol_r, - { "circularly polarized right", "ppi_antenna.antennaflags.circpol_r", - FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_CPOL_R, - "Specifies if the antenna is circularly polarized, right handed", HFILL } }, - - { &hf_ppi_antennaflags_steer_elec, - { "electrically steerable", "ppi_antenna.antennaflags.steer_elec", - FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_STEER_ELEC, - "Specifies if the antenna is electrically steerable", HFILL } }, - - { &hf_ppi_antennaflags_steer_mech, - { "mechanically steerable", "ppi_antenna.antennaflags.steer_mech", - FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_STEER_MECH, - "Specifies if the antenna is mechanically steerable", HFILL } }, - - /* Now we get to the actual data fields */ - { &hf_ppi_antenna_gaindb, - { "Gain (dBi)", "ppi_antenna.gaindb", - FT_UINT8, BASE_DEC, NULL, 0x0, - "Gain of antenna (dBi)", HFILL } }, - { &hf_ppi_antenna_horizbw, - { "HorizBw", "ppi_antenna.horizbw", - FT_DOUBLE, BASE_NONE, NULL, 0x0, - "Horizontal beamwidth", HFILL } }, - { &hf_ppi_antenna_vertbw, - { "VertBw", "ppi_antenna.vertbw", - FT_DOUBLE, BASE_NONE, NULL, 0x0, - "Vertical beamwidth", HFILL } }, - { &hf_ppi_antenna_pgain, - { "Precision Gain (dBi)", "ppi_antenna.pgain", - FT_DOUBLE, BASE_NONE, NULL, 0x0, - "Precision Gain", HFILL } }, - { &hf_ppi_antenna_beamid, - { "BeamID", "ppi_antenna.beamid", - FT_UINT16, BASE_HEX, NULL, 0x0, - "Beam ID", HFILL } }, - - { &hf_ppi_antenna_serialnum, - { "SerialNumber", "ppi_antenna.serialnum", - FT_STRING, BASE_NONE, NULL, 0x0, - "Serial number", HFILL } } , - { &hf_ppi_antenna_modelname, - { "ModelName", "ppi_antenna.modelname", - FT_STRING, BASE_NONE, NULL, 0x0, - "Model name", HFILL } } , - { &hf_ppi_antenna_descstr, - { "Description", "ppi_antenna.descr", - FT_STRING, BASE_NONE, NULL, 0x0, - NULL, HFILL } } , - { &hf_ppi_antenna_appspecific_num, - { "Application Specific id", "ppi_antenna.appid", - FT_UINT32, BASE_HEX, NULL, 0x0, - "Application-specific identifier", HFILL } }, - { &hf_ppi_antenna_appspecific_data, - { "Application specific data", "ppi_antenna.appdata", - FT_BYTES, BASE_NONE, NULL, 0x0, - "Application-specific data", HFILL } }, - }; - static gint *ett[] = { - &ett_ppi_antenna, - &ett_ppi_antenna_present, - &ett_ppi_antennaflags - }; - - proto_ppi_antenna = proto_register_protocol("PPI antenna decoder", "PPI antenna Decoder", "ppi_antenna"); - proto_register_field_array(proto_ppi_antenna, hf, array_length(hf)); - proto_register_subtree_array(ett, array_length(ett)); - register_dissector("ppi_antenna", dissect_ppi_antenna, proto_ppi_antenna); - -} void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { /* The fixed values up front */ guint32 version; @@ -314,6 +124,7 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { proto_tree *antennaflags_tree = NULL; proto_tree *pt, *my_pt; proto_item *ti = NULL; + proto_item *antenna_line = NULL; /* bits */ @@ -325,24 +136,30 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { guint32 t_hbw, t_vbw, t_pgain, t_appspecific_num; /* temporary conversions */ gdouble horizbw, vertbw, pgain; guint32 flags; - + gchar *curr_str; 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); present = tvb_get_letohl(tvb, offset+4); + + /* Setup basic column info */ if (check_col(pinfo->cinfo, COL_INFO)) col_add_fstr(pinfo->cinfo, COL_INFO, "PPI Antenna info v%u, Length %u", version, length); - /* Dissect the packet */ + + /* Create the basic dissection tree*/ if (tree) { ti = proto_tree_add_protocol_format(tree, proto_ppi_antenna, - tvb, 0, length, "PPI Antenna Header v%u, Length %u", version, length); + tvb, 0, length, "Antenna: "); + antenna_line = ti; /* save this for later, we will fill it in with more detail */ + ppi_antenna_tree= proto_item_add_subtree(ti, ett_ppi_antenna); proto_tree_add_uint(ppi_antenna_tree, hf_ppi_antenna_version, tvb, offset, 1, version); @@ -351,20 +168,34 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { ti = proto_tree_add_uint(ppi_antenna_tree, hf_ppi_antenna_length, tvb, offset + 2, 2, length); } + /* We support v1 and v2 of Antenna tags (identical) */ + if (! (version == 1 || version == 2) ) { + if (tree) + proto_item_append_text(ti, "invalid version (got %d, expected 1 or 2)", version); + return; + } + length_remaining = length; - /* - * FIXME: This only works if there is exactly 1 it_present - * field in the header - */ + /* minimum length check, should atleast be a fixed-size geotagging-base header*/ if (length_remaining < PPI_GEOBASE_MIN_HEADER_LEN) { /* - * Radiotap header is shorter than the fixed-length portion + * Base-geotag-header (Radiotap lookalike) is shorter than the fixed-length portion * plus one "present" bitset. */ if (tree) - proto_item_append_text(ti, " (bogus - minimum length is 8)"); + proto_item_append_text(ti, " (invalid - minimum length is 8)"); return; } + + + /* perform max length sanity checking */ + if (length > PPI_ANTENNA_MAXTAGLEN ) { + if (tree) + proto_item_append_text(ti, "Invalid PPI-Antenna length (got %d, %d max\n)", length, PPI_ANTENNA_MAXTAGLEN); + return; + } + + /* Subtree for the "present flags" bitfield. */ if (tree) { pt = proto_tree_add_uint(ppi_antenna_tree, hf_ppi_antenna_present, tvb, offset + 4, 4, present); @@ -420,6 +251,8 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { gaindb= tvb_get_guint8(tvb, offset); if (tree) { proto_tree_add_uint(ppi_antenna_tree, hf_ppi_antenna_gaindb, tvb, offset, 1, gaindb); + proto_item_append_text(antenna_line, " Gain: %d", gaindb); + } offset+=1; length_remaining-=1; @@ -431,6 +264,7 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { horizbw = 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); } offset+=4; length_remaining-=4; @@ -470,7 +304,9 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case PPI_ANTENNA_SERIALNUM: if (length_remaining < 32) break; - proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_serialnum, tvb, offset, 32, ENC_NA);; + if (tree) { + proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_serialnum, tvb, offset, 32, ENC_NA); + } offset+=32; length_remaining-=32; break; @@ -478,14 +314,24 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { case PPI_ANTENNA_MODELSTR: if (length_remaining < 32) break; - proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_modelname, tvb, offset, 32, ENC_NA); + if (tree) { + /* proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_modelname, tvb, offset, 32, ENC_NA); */ + curr_str = tvb_format_text(tvb, offset, 32); + proto_tree_add_string(ppi_antenna_tree, hf_ppi_antenna_modelname, tvb, offset, 32, curr_str); + proto_item_append_text(antenna_line, " (%s)", curr_str); + } offset+=32; length_remaining-=32; break; case PPI_ANTENNA_DESCSTR: if (length_remaining < 32) break; - proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_descstr, tvb, offset, 32, ENC_NA); + if (tree) { + /*proto_tree_add_item(ppi_antenna_tree, hf_ppi_antenna_descstr, tvb, offset, 32, ENC_NA);*/ + curr_str = tvb_format_text(tvb, offset, 32); + proto_tree_add_string(ppi_antenna_tree, hf_ppi_antenna_descstr, tvb, offset, 32, curr_str); + proto_item_append_text(antenna_line, " (%s)", curr_str); + } offset+=32; length_remaining-=32; break; @@ -522,4 +368,196 @@ void dissect_ppi_antenna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { return; } +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", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Version of ppi_antenna header format", HFILL } }, + { &hf_ppi_antenna_pad, + { "Header pad", "ppi_antenna.pad", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Padding", HFILL } }, + { &hf_ppi_antenna_length, + { "Header length", "ppi_antenna.length", + FT_UINT16, BASE_DEC, NULL, 0x0, + "Length of header including version, pad, length and data fields", HFILL } }, + /* This setups the "Antenna flags" hex dropydown thing */ + { &hf_ppi_antenna_flags, + { "Antenna flags", "ppi_antenna.antenna_flags", + FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating polarity, etc", HFILL } }, + { &hf_ppi_antenna_present, + { "Present", "ppi_antenna.present", + FT_UINT32, BASE_HEX, NULL, 0x0, "Bitmask indicating which fields are present", HFILL } }, + + /* This first set is for the base_tag_header.it_present bitfield */ +#define PPI_ANTENNA_MASK_FLAGS 0x00000001 /* 0 */ +#define PPI_ANTENNA_MASK_GAINDB 0x00000002 /* 1 */ +#define PPI_ANTENNA_MASK_HORIZBW 0x00000004 /* 2 */ +#define PPI_ANTENNA_MASK_VERTBW 0x00000008 /* 3 */ +#define PPI_ANTENNA_MASK_PGAIN 0x00000010 /* 4 */ +#define PPI_ANTENNA_MASK_BEAMID 0x00000020 /* 5 */ +#define PPI_ANTENNA_MASK_RES7 0x00000080 /* 7 */ +#define PPI_ANTENNA_MASK_SERIALNUM 0x04000000 /* 26 */ +#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_EXT 0x80000000 /* 31 */ + + /*This second set is for the AntennaFlags bitfield. */ +#define PPI_ANTENNAFLAGS_MASK_MIMO 0x00000001 /* 0 */ +#define PPI_ANTENNAFLAGS_MASK_HPOL 0x00000002 /* 1 */ +#define PPI_ANTENNAFLAGS_MASK_VPOL 0x00000004 /* 2 */ +#define PPI_ANTENNAFLAGS_MASK_CPOL_L 0x00000008 /* 3 */ +#define PPI_ANTENNAFLAGS_MASK_CPOL_R 0x00000010 /* 4 */ +#define PPI_ANTENNAFLAGS_MASK_STEER_ELEC 0x00010000 /* 16 */ +#define PPI_ANTENNAFLAGS_MASK_STEER_MECH 0x00020000 /* 17 */ + + + /* Boolean 'present' flags */ + { &hf_ppi_antenna_present_flags, + { "flags", "ppi_antenna.present.flags", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_FLAGS, + "Specifies if the flags bitfield is present", HFILL } }, + { &hf_ppi_antenna_present_gaindb, + { "gaindb", "ppi_antenna.present.gaindb", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_GAINDB, + "Specifies if the antenna gain field is present", HFILL } }, + { &hf_ppi_antenna_present_horizbw, + { "horizbw", "ppi_antenna.present.horizbw", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_HORIZBW, + "Specifies if the horizontal beamwidth field is present", HFILL } }, + { &hf_ppi_antenna_present_vertbw, + { "vertbw", "ppi_antenna.present.vertbw", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_VERTBW, + "Specifies if the vertical beamwidth field is present", HFILL } }, + { &hf_ppi_antenna_present_pgain, + { "pgain", "ppi_antenna.present.pgain", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_PGAIN, + "Specifies if the precision gain field is present", HFILL } }, + { &hf_ppi_antenna_present_beamid, + { "beamid", "ppi_antenna.present.beamid", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_BEAMID, + "Specifies if the BeamID field is present", HFILL } }, + { &hf_ppi_antenna_present_serialnum, + { "serialnum", "ppi_antenna.present.serialnum", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_SERIALNUM, + "Specifies if the serial num is present", HFILL } }, + { &hf_ppi_antenna_present_modelname, + { "modelname", "ppi_antenna.present.modelname", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_MODELSTR, + "Specifies if the model name is present", HFILL } }, + { &hf_ppi_antenna_present_descstr, + { "Description", "ppi_antenna.present.descr", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_DESCSTR, + "Specifies if the description string is present", HFILL } }, + + { &hf_ppi_antenna_present_appspecific_num, + { "appid", "ppi_antenna.present.appid", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_APPID, + "Specifies if the application specific field id is present", HFILL } }, + + { &hf_ppi_antenna_present_appspecific_data, + { "appdata", "ppi_antenna.present.appdata", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_APPDATA, + "Specifies if the application specific data field is present", HFILL } }, + + { &hf_ppi_antenna_present_ext, + { "ext", "ppi_antenna.present.ext", + FT_BOOLEAN, 32, NULL, PPI_ANTENNA_MASK_EXT, + "Specifies if there are any extensions to the header present", HFILL } }, + + /*Here we switch to the antennflags bits*/ + /* Boolean AntennaFlags' flags */ + { &hf_ppi_antennaflags_mimo, + { "mimo", "ppi_antenna.antennaflags.mimo", + FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_MIMO, + "Antena is part of MIMO system", HFILL } }, + { &hf_ppi_antennaflags_horizpol, + { "horizontally polarized", "ppi_antenna.antennaflags.horizpol", + FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_HPOL, + "Specifies if the antenna is horizontally polarized", HFILL } }, + + { &hf_ppi_antennaflags_vertpol, + { "vertically polarized", "ppi_antenna.antennaflags.vertpol", + FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_VPOL, + "Specifies if the antenna is vertically polarized", HFILL } }, + { &hf_ppi_antennaflags_circpol_l, + { "circularly polarized left", "ppi_antenna.antennaflags.circpol_l", + FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_CPOL_L, + "Specifies if the antenna is circularly polarized, left handed", HFILL } }, + + { &hf_ppi_antennaflags_circpol_r, + { "circularly polarized right", "ppi_antenna.antennaflags.circpol_r", + FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_CPOL_R, + "Specifies if the antenna is circularly polarized, right handed", HFILL } }, + + { &hf_ppi_antennaflags_steer_elec, + { "electrically steerable", "ppi_antenna.antennaflags.steer_elec", + FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_STEER_ELEC, + "Specifies if the antenna is electrically steerable", HFILL } }, + + { &hf_ppi_antennaflags_steer_mech, + { "mechanically steerable", "ppi_antenna.antennaflags.steer_mech", + FT_BOOLEAN, 32, NULL, PPI_ANTENNAFLAGS_MASK_STEER_MECH, + "Specifies if the antenna is mechanically steerable", HFILL } }, + + /* Now we get to the actual data fields */ + { &hf_ppi_antenna_gaindb, + { "Gain (dBi)", "ppi_antenna.gaindb", + FT_UINT8, BASE_DEC, NULL, 0x0, + "Gain of antenna (dBi)", HFILL } }, + { &hf_ppi_antenna_horizbw, + { "HorizBw", "ppi_antenna.horizbw", + FT_DOUBLE, BASE_NONE, NULL, 0x0, + "Horizontal beamwidth", HFILL } }, + { &hf_ppi_antenna_vertbw, + { "VertBw", "ppi_antenna.vertbw", + FT_DOUBLE, BASE_NONE, NULL, 0x0, + "Vertical beamwidth", HFILL } }, + { &hf_ppi_antenna_pgain, + { "Precision Gain (dBi)", "ppi_antenna.pgain", + FT_DOUBLE, BASE_NONE, NULL, 0x0, + "Precision Gain", HFILL } }, + { &hf_ppi_antenna_beamid, + { "BeamID", "ppi_antenna.beamid", + FT_UINT16, BASE_HEX, NULL, 0x0, + "Beam ID", HFILL } }, + + { &hf_ppi_antenna_serialnum, + { "SerialNumber", "ppi_antenna.serialnum", + FT_STRING, BASE_NONE, NULL, 0x0, + "Serial number", HFILL } } , + { &hf_ppi_antenna_modelname, + { "ModelName", "ppi_antenna.modelname", + FT_STRING, BASE_NONE, NULL, 0x0, + "Model name", HFILL } } , + { &hf_ppi_antenna_descstr, + { "Description", "ppi_antenna.descr", + FT_STRING, BASE_NONE, NULL, 0x0, + NULL, HFILL } } , + { &hf_ppi_antenna_appspecific_num, + { "Application Specific id", "ppi_antenna.appid", + FT_UINT32, BASE_HEX, NULL, 0x0, + "Application-specific identifier", HFILL } }, + { &hf_ppi_antenna_appspecific_data, + { "Application specific data", "ppi_antenna.appdata", + FT_BYTES, BASE_NONE, NULL, 0x0, + "Application-specific data", HFILL } }, + }; + static gint *ett[] = { + &ett_ppi_antenna, + &ett_ppi_antenna_present, + &ett_ppi_antennaflags + }; + + proto_ppi_antenna = proto_register_protocol("PPI antenna decoder", "PPI antenna Decoder", "ppi_antenna"); + proto_register_field_array(proto_ppi_antenna, hf, array_length(hf)); + proto_register_subtree_array(ett, array_length(ett)); + register_dissector("ppi_antenna", dissect_ppi_antenna, proto_ppi_antenna); + +} |