diff options
author | Michael Mann <mmann78@netscape.net> | 2017-04-25 23:26:59 -0400 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-04-29 09:47:28 +0000 |
commit | cc9b38a734ac64603e78fe2dc00ad5bdc214e3ff (patch) | |
tree | 43ab14de0f92988f97e533f6b7076ed2fb01f46f /epan | |
parent | fb1a6320ec67fc30414948b8e7e8c63c37a15983 (diff) |
Improve ixveriwave dissector
Bug: 13652
Bug: 12535
Change-Id: Ie4c140acbe983a585776bc1430cf407cdcd6e07a
Reviewed-on: https://code.wireshark.org/review/21356
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ixveriwave.c | 4015 |
1 files changed, 3327 insertions, 688 deletions
diff --git a/epan/dissectors/packet-ixveriwave.c b/epan/dissectors/packet-ixveriwave.c index d0cd5c1c7e..cde3724ea3 100644 --- a/epan/dissectors/packet-ixveriwave.c +++ b/epan/dissectors/packet-ixveriwave.c @@ -24,16 +24,21 @@ #include "config.h" +#include <math.h> + #include <epan/packet.h> #include <epan/proto_data.h> +#include <epan/expert.h> +#include <epan/crc32-tvb.h> #include <wiretap/wtap.h> + void proto_register_ixveriwave(void); void proto_reg_handoff_ixveriwave(void); static void ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree); -static void wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree, guint16 vw_msdu_length); +static void wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree, guint16 vw_msdu_length, guint8 cmd_type, guint8 mgmt_byte); typedef struct { guint32 previous_frame_num; @@ -68,10 +73,21 @@ static frame_end_data previous_frame_data = {0,0}; #define VW_RADIOTAP_FPGA_VER_vVW510021 0x000C /* vVW510021 version detected */ #define VW_RADIOTAP_FPGA_VER_vVW510021_11n 0x000D +#define FLAGS_CHAN_SHORTGI 0x0100 /* short guard interval */ +#define IEEE80211_RADIOTAP_F_CFP 0x0001 /* sent/received during CFP */ +#define IEEE80211_RADIOTAP_F_DATAPAD 0x0020 /* frame has padding between + * 802.11 header and payload + * (to 32-bit boundary) + */ #define CHAN_CCK 0x00020 /* CCK channel */ #define CHAN_OFDM 0x00040 /* OFDM channel */ - +#define IEEE80211_CHAN_2GHZ 0x00080 /* 2 GHz spectrum channel. */ +#define IEEE80211_CHAN_5GHZ 0x00100 /* 5 GHz spectrum channel */ +#define IEEE80211_RADIOTAP_F_FRAG 0x0008 /* sent/received + * with fragmentation + */ +#define IEEE80211_PLCP_RATE_MASK 0x7f /* parses out the rate or MCS index from the PLCP header(s) */ #define FLAGS_SHORTPRE 0x0002 /* sent/received * with short * preamble @@ -99,8 +115,24 @@ static frame_end_data previous_frame_data = {0,0}; #define PLCP_TYPE_GREENFIELD 0x02 /* HT, greenfield (11n) */ #define PLCP_TYPE_VHT_MIXED 0x03 /* VHT (11ac) */ +/* For RADIOTAP_FLAGS */ +#define RADIOTAP_F_CFP 0x001 /* sent/received during CFP */ +#define RADIOTAP_F_SHORTPRE 0x002 /* sent/received with short preamble */ +#define RADIOTAP_F_WEP 0x004 /* sent/received with WEP encryption */ +#define RADIOTAP_F_FRAG 0x008 /* sent/received with fragmentation */ +#define RADIOTAP_F_FCS 0x010 /* frame includes FCS */ +#define RADIOTAP_F_DATAPAD 0x020 /* padding between 802.11 hdr & payload */ +#define RADIOTAP_F_CHAN_HT 0x040 /* In HT mode */ +#define RADIOTAP_F_CHAN_40MHZ 0x080 /* 40 Mhz CBW */ +#define RADIOTAP_F_CHAN_80MHZ 0x100 /* 80 Mhz CBW */ +#define RADIOTAP_F_CHAN_SHORTGI 0x200 /* Short guard interval */ + #define ETHERNET_PORT 1 #define WLAN_PORT 0 +#define OCTO_TIMESTAMP_FIELDS_LEN 32 /* (4+4+8+8+4+4) */ +#define OCTO_MODIFIED_RF_LEN 76 /* Number of RF bytes to be displayed*/ +#define VW_INFO_OFF 48 +#define IFG_MAX_VAL 0xEE6B2800 static int proto_ixveriwave = -1; static dissector_handle_t ethernet_handle; @@ -119,9 +151,11 @@ static int hf_ixveriwave_vw_mslatency = -1; static int hf_ixveriwave_vw_latency = -1; static int hf_ixveriwave_vw_pktdur = -1; static int hf_ixveriwave_vw_ifg = -1; +static int hf_ixveriwave_vw_ifg_neg = -1; static int hf_ixveriwave = -1; static int hf_ixveriwave_vw_startt = -1; static int hf_ixveriwave_vw_endt = -1; +static int hf_ixveriwave_vw_delay = -1; static gint ett_commontap = -1; static gint ett_commontap_times = -1; @@ -176,14 +210,21 @@ static int hf_radiotap_datarate = -1; static int hf_radiotap_mcsindex = -1; static int hf_radiotap_plcptype = -1; static int hf_radiotap_nss = -1; -static int hf_radiotap_dbm_antsignal = -1; +static int hf_radiotap_dbm_anta = -1; static int hf_radiotap_dbm_antb = -1; static int hf_radiotap_dbm_antc = -1; static int hf_radiotap_dbm_antd = -1; +static int hf_radiotap_dbm_tx_anta = -1; +static int hf_radiotap_dbm_tx_antb = -1; +static int hf_radiotap_dbm_tx_antc = -1; +static int hf_radiotap_dbm_tx_antd = -1; +static int hf_radiotap_flags_cfp = -1; static int hf_radiotap_flags_preamble = -1; static int hf_radiotap_flags_wep = -1; -static int hf_radiotap_flags_fcs_present = -1; +static int hf_radiotap_flags_frag = -1; +static int hf_radiotap_flags_fcs = -1; +static int hf_radiotap_flags_datapad = -1; static int hf_radiotap_flags_ht = -1; static int hf_radiotap_flags_vht = -1; static int hf_radiotap_flags_40mhz = -1; @@ -197,6 +238,7 @@ static int hf_radiotap_vw_ht_length = -1; static int hf_radiotap_vht_grp_id = -1; static int hf_radiotap_vht_su_nsts = -1; static int hf_radiotap_vht_su_partial_aid = -1; +static int hf_radiotap_vht_su_coding_type = -1; static int hf_radiotap_vht_u0_nsts = -1; static int hf_radiotap_vht_u1_nsts = -1; static int hf_radiotap_vht_u2_nsts = -1; @@ -204,17 +246,98 @@ static int hf_radiotap_vht_u3_nsts = -1; static int hf_radiotap_vht_beamformed = -1; static int hf_radiotap_vht_user_pos = -1; static int hf_radiotap_vht_mu_mimo_flg = -1; +static int hf_radiotap_vht_su_mimo_flg = -1; static int hf_radiotap_vht_u0_coding_type = -1; static int hf_radiotap_vht_u1_coding_type = -1; static int hf_radiotap_vht_u2_coding_type = -1; static int hf_radiotap_vht_u3_coding_type = -1; +static int hf_radiotap_vw_info_tx_bit0 = -1; +static int hf_radiotap_vw_info_tx_bit1 = -1; +static int hf_radiotap_vw_info_tx_bit3 = -1; +static int hf_radiotap_vw_info_tx_bit4 = -1; +static int hf_radiotap_vw_info_tx_bit5 = -1; +static int hf_radiotap_vw_info_tx_bit6 = -1; +static int hf_radiotap_vw_info_tx_bit7 = -1; +static int hf_radiotap_vw_info_tx_bit8 = -1; +static int hf_radiotap_vw_info_tx_bit9 = -1; static int hf_radiotap_vw_info_tx_bit10 = -1; static int hf_radiotap_vw_info_tx_bit11 = -1; static int hf_radiotap_vw_info_tx_bit12 = -1; static int hf_radiotap_vw_info_tx_bit13 = -1; static int hf_radiotap_vw_info_tx_bit14 = -1; static int hf_radiotap_vw_info_tx_bit15 = -1; +static const int *radiotap_info_tx_fields[] = { + &hf_radiotap_vw_info_tx_bit0, + &hf_radiotap_vw_info_tx_bit1, + &hf_radiotap_vw_info_tx_bit3, + &hf_radiotap_vw_info_tx_bit4, + &hf_radiotap_vw_info_tx_bit5, + &hf_radiotap_vw_info_tx_bit6, + &hf_radiotap_vw_info_tx_bit7, + &hf_radiotap_vw_info_tx_bit8, + &hf_radiotap_vw_info_tx_bit9, + &hf_radiotap_vw_info_tx_bit10, + &hf_radiotap_vw_info_tx_bit11, + &hf_radiotap_vw_info_tx_bit12, + &hf_radiotap_vw_info_tx_bit13, + &hf_radiotap_vw_info_tx_bit14, + &hf_radiotap_vw_info_tx_bit15, + NULL, +}; + +static int hf_radiotap_vw_info_tx = -1; +static int hf_radiotap_vw_info_rx = -1; +static int hf_radiotap_vw_info_rx_bit0 = -1; +static int hf_radiotap_vw_info_rx_bit1 = -1; +static int hf_radiotap_vw_info_rx_bit3 = -1; +static int hf_radiotap_vw_info_rx_bit4 = -1; +static int hf_radiotap_vw_info_rx_bit5 = -1; +static int hf_radiotap_vw_info_rx_bit6 = -1; +static int hf_radiotap_vw_info_rx_bit7 = -1; +static int hf_radiotap_vw_info_rx_bit8 = -1; +static int hf_radiotap_vw_info_rx_bit9 = -1; +static int hf_radiotap_vw_info_rx_bit10 = -1; +static int hf_radiotap_vw_info_rx_bit11 = -1; +static int hf_radiotap_vw_info_rx_bit12 = -1; +static int hf_radiotap_vw_info_rx_bit13 = -1; +static int hf_radiotap_vw_info_rx_bit14 = -1; +static int hf_radiotap_vw_info_rx_bit15 = -1; +static int hf_radiotap_vw_info_rx_bit16 = -1; +static int hf_radiotap_vw_info_rx_bit17 = -1; +static int hf_radiotap_vw_info_rx_bit18 = -1; +static int hf_radiotap_vw_info_rx_bit19 = -1; +static int hf_radiotap_vw_info_rx_bit20 = -1; +static const int *radiotap_info_rx_fields[] = { + &hf_radiotap_vw_info_rx_bit0, + &hf_radiotap_vw_info_rx_bit1, + &hf_radiotap_vw_info_rx_bit3, + &hf_radiotap_vw_info_rx_bit4, + &hf_radiotap_vw_info_rx_bit5, + &hf_radiotap_vw_info_rx_bit6, + &hf_radiotap_vw_info_rx_bit7, + &hf_radiotap_vw_info_rx_bit8, + &hf_radiotap_vw_info_rx_bit9, + &hf_radiotap_vw_info_rx_bit10, + &hf_radiotap_vw_info_rx_bit11, + &hf_radiotap_vw_info_rx_bit12, + &hf_radiotap_vw_info_rx_bit13, + &hf_radiotap_vw_info_rx_bit14, + &hf_radiotap_vw_info_rx_bit15, + &hf_radiotap_vw_info_rx_bit16, + &hf_radiotap_vw_info_rx_bit17, + &hf_radiotap_vw_info_rx_bit18, + &hf_radiotap_vw_info_rx_bit19, + &hf_radiotap_vw_info_rx_bit20, + NULL, +}; + +static int hf_radiotap_vw_info_tx_2_bit10 = -1; +static int hf_radiotap_vw_info_tx_2_bit11 = -1; +static int hf_radiotap_vw_info_tx_2_bit12 = -1; +static int hf_radiotap_vw_info_tx_2_bit13 = -1; +static int hf_radiotap_vw_info_tx_2_bit14 = -1; +static int hf_radiotap_vw_info_tx_2_bit15 = -1; static int hf_radiotap_vw_info_rx_2_bit8 = -1; static int hf_radiotap_vw_info_rx_2_bit9 = -1; @@ -225,6 +348,44 @@ static int hf_radiotap_vw_info_rx_2_bit13 = -1; static int hf_radiotap_vw_info_rx_2_bit14 = -1; static int hf_radiotap_vw_info_rx_2_bit15 = -1; +static int hf_radiotap_vw_errors_tx_bit01 = -1; +static int hf_radiotap_vw_errors_tx_bit05 = -1; +static int hf_radiotap_vw_errors_tx_bit8 = -1; +static int hf_radiotap_vw_errors_tx_bit9 = -1; +static int hf_radiotap_vw_errors_tx_bit10 = -1; +static int hf_radiotap_vw_errors_tx_bit31 = -1; +static int hf_radiotap_vw_tx_retrycount = -1; +static int hf_radiotap_vw_tx_factorydebug = -1; + +static int hf_radiotap_vw_errors_tx_bit1 = -1; +static int hf_radiotap_vw_errors_tx_bit5 = -1; + +static int hf_radiotap_vw_errors_rx_bit0 = -1; +static int hf_radiotap_vw_errors_rx_bit1 = -1; +static int hf_radiotap_vw_errors_rx_bit2 = -1; +static int hf_radiotap_vw_errors_rx_bit3 = -1; +static int hf_radiotap_vw_errors_rx_bit4 = -1; +static int hf_radiotap_vw_errors_rx_bit5 = -1; +static int hf_radiotap_vw_errors_rx_bit6 = -1; +static int hf_radiotap_vw_errors_rx_bit7 = -1; +static int hf_radiotap_vw_errors_rx_bit8 = -1; +static int hf_radiotap_vw_errors_rx_bit9 = -1; +static int hf_radiotap_vw_errors_rx_bit10 = -1; +static int hf_radiotap_vw_errors_rx_bit11 = -1; +static int hf_radiotap_vw_errors_rx_bit12 = -1; +static int hf_radiotap_vw_errors_rx_bit14 = -1; +static int hf_radiotap_vw_errors_rx_bit15 = -1; +static int hf_radiotap_vw_errors_rx_bit16 = -1; +static int hf_radiotap_vw_errors_rx_bit17 = -1; +static int hf_radiotap_vw_errors_rx_bit18 = -1; +static int hf_radiotap_vw_errors_rx_bit19 = -1; +static int hf_radiotap_vw_errors_rx_bit20 = -1; +static int hf_radiotap_vw_errors_rx_bit21 = -1; +static int hf_radiotap_vw_errors_rx_bit22 = -1; +static int hf_radiotap_vw_errors_rx_bit23 = -1; +static int hf_radiotap_vw_errors_rx_bit24 = -1; +static int hf_radiotap_vw_errors_rx_bit31 = -1; + static int hf_radiotap_vw_errors_rx_2_bit0 = -1; static int hf_radiotap_vw_errors_rx_2_bit1 = -1; static int hf_radiotap_vw_errors_rx_2_bit2 = -1; @@ -236,9 +397,6 @@ static int hf_radiotap_vw_errors_rx_2_bit8 = -1; static int hf_radiotap_vw_errors_rx_2_bit10 = -1; static int hf_radiotap_vw_errors_rx_2_bit11 = -1; -static int hf_radiotap_vw_errors_tx_bit1 = -1; -static int hf_radiotap_vw_errors_tx_bit5 = -1; - static int hf_radiotap_vwf_txf = -1; static int hf_radiotap_vwf_fcserr = -1; static int hf_radiotap_vwf_dcrerr = -1; @@ -248,6 +406,167 @@ static int hf_radiotap_vwf_enctype = -1; static gint ett_radiotap_info = -1; static gint ett_radiotap_errors = -1; static gint ett_radiotap_times = -1; +static gint ett_radiotap_layer1 = -1; +static gint ett_radiotap_layer2to4 = -1; +static gint ett_radiotap_rf = -1; +static gint ett_radiotap_plcp = -1; +static gint ett_radiotap_infoc = -1; +static gint ett_radiotap_contextp = -1; +static gint ett_rf_info = -1; + +static int hf_radiotap_rf_info = -1; +static int hf_radiotap_rx = -1; +static int hf_radiotap_tx = -1; +static int hf_radiotap_modulation = -1; +static int hf_radiotap_preamble = -1; +static int hf_radiotap_sigbandwidth = -1; +/* static int hf_radiotap_rssi = -1; */ +static int hf_radiotap_l1infoc = -1; +static int hf_radiotap_sigbandwidthmask = -1; +static int hf_radiotap_antennaportenergydetect = -1; +static int hf_radiotap_mumask = -1; +static int hf_radiotap_plcp_info = -1; +static int hf_radiotap_l2_l4_info = -1; +/* static int hf_radiotap_rfinfo_tbd = -1; */ +static int hf_radiotap_rfinfo_rfid = -1; +static int hf_radiotap_bssid = -1; +static int hf_radiotap_unicastormulticast = -1; +static int hf_radiotap_clientidvalid = -1; +static int hf_radiotap_bssidvalid = -1; +static int hf_radiotap_flowvalid = -1; +static int hf_radiotap_l4idvalid = -1; +static int hf_radiotap_istypeqos = -1; +static int hf_radiotap_containshtfield = -1; +static int hf_radiotap_tid = -1; +/*static int hf_radiotap_wlantype = -1; */ +static int hf_radiotap_payloaddecode = -1; +static int hf_radiotap_vht_bw = -1; +static int hf_radiotap_vht_stbc = -1; +static int hf_radiotap_vht_txop_ps_notallowd = -1; +static int hf_radiotap_vht_shortgi = -1; +static int hf_radiotap_vht_shortginsymdisa = -1; +static int hf_radiotap_vht_ldpc_ofdmsymbol = -1; +static int hf_radiotap_vht_su_mcs = -1; +static int hf_radiotap_vht_crc = -1; +static int hf_radiotap_vht_tail = -1; +static int hf_radiotap_vht_length = -1; +static int hf_radiotap_rfid = -1; +static int hf_radiotap_vht_mcs = -1; +static int hf_radiotap_parity = -1; +static int hf_radiotap_rate = -1; +static int hf_radiotap_plcp_length = -1; +static int hf_radiotap_feccoding = -1; +static int hf_radiotap_aggregation = -1; +static int hf_radiotap_notsounding = -1; +static int hf_radiotap_smoothing = -1; +static int hf_radiotap_ness = -1; +static int hf_radiotap_plcp_service = -1; +static int hf_radiotap_plcp_signal = -1; +static int hf_radiotap_plcp_default = -1; +static int hf_radiotap_tx_antennaselect = -1; +static int hf_radiotap_tx_stbcselect = -1; +static int hf_radiotap_ac = -1; +static int hf_radiotap_crc16 = -1; +// RF LOGGING +static int hf_radiotap_rfinfo_pfe = -1; +/* +static int hf_radiotap_rfinfo_noise = -1; +static int hf_radiotap_rfinfo_noise_anta = -1; +static int hf_radiotap_rfinfo_noise_antb = -1; +static int hf_radiotap_rfinfo_noise_antc = -1; +static int hf_radiotap_rfinfo_noise_antd = -1; +*/ +static int hf_radiotap_rfinfo_snr = -1; +static int hf_radiotap_rfinfo_snr_anta = -1; +static int hf_radiotap_rfinfo_snr_antb = -1; +static int hf_radiotap_rfinfo_snr_antc = -1; +static int hf_radiotap_rfinfo_snr_antd = -1; +static int hf_radiotap_rfinfo_pfe_anta = -1; +static int hf_radiotap_rfinfo_pfe_antb = -1; +static int hf_radiotap_rfinfo_pfe_antc = -1; +static int hf_radiotap_rfinfo_pfe_antd = -1; +static int hf_radiotap_rfinfo_contextpa = -1; +static int hf_radiotap_rfinfo_contextpb = -1; +static int hf_radiotap_rfinfo_contextpc = -1; +static int hf_radiotap_rfinfo_contextpd = -1; +static int hf_radiotap_rfinfo_contextpA_bit0 = -1; +static int hf_radiotap_rfinfo_contextpA_bit1 = -1; +static int hf_radiotap_rfinfo_contextpA_bit2 = -1; +static int hf_radiotap_rfinfo_contextpA_bit3 = -1; +static int hf_radiotap_rfinfo_contextpA_bit4 = -1; +static int hf_radiotap_rfinfo_contextpA_bit5 = -1; +/* static int hf_radiotap_rfinfo_contextpA_bit8 = -1; */ +/* static int hf_radiotap_rfinfo_contextpA_bit10 = -1; */ +/* static int hf_radiotap_rfinfo_contextpA_bit11 = -1; */ +static int hf_radiotap_rfinfo_contextpA_bit13 = -1; + +static int hf_radiotap_rfinfo_contextpB_bit0 = -1; +static int hf_radiotap_rfinfo_contextpB_bit1 = -1; +static int hf_radiotap_rfinfo_contextpB_bit2 = -1; +static int hf_radiotap_rfinfo_contextpB_bit3 = -1; +static int hf_radiotap_rfinfo_contextpB_bit4 = -1; +static int hf_radiotap_rfinfo_contextpB_bit5 = -1; +static int hf_radiotap_rfinfo_contextpB_bit13 = -1; + +static int hf_radiotap_rfinfo_contextpC_bit0 = -1; +static int hf_radiotap_rfinfo_contextpC_bit1 = -1; +static int hf_radiotap_rfinfo_contextpC_bit2 = -1; +static int hf_radiotap_rfinfo_contextpC_bit3 = -1; +static int hf_radiotap_rfinfo_contextpC_bit4 = -1; +static int hf_radiotap_rfinfo_contextpC_bit5 = -1; +static int hf_radiotap_rfinfo_contextpC_bit13 = -1; + +static int hf_radiotap_rfinfo_contextpD_bit0 = -1; +static int hf_radiotap_rfinfo_contextpD_bit1 = -1; +static int hf_radiotap_rfinfo_contextpD_bit2 = -1; +static int hf_radiotap_rfinfo_contextpD_bit3 = -1; +static int hf_radiotap_rfinfo_contextpD_bit4 = -1; +static int hf_radiotap_rfinfo_contextpD_bit5 = -1; +static int hf_radiotap_rfinfo_contextpD_bit13 = -1; + +static int hf_radiotap_rfinfo_avg_evm_sd_siga = -1; +static int hf_radiotap_rfinfo_avg_evm_sd_sigb = -1; +static int hf_radiotap_rfinfo_avg_evm_sd_sigc = -1; +static int hf_radiotap_rfinfo_avg_evm_sd_sigd = -1; +static int hf_radiotap_rfinfo_avg_evm_sp_siga = -1; +static int hf_radiotap_rfinfo_avg_evm_sp_sigb = -1; +static int hf_radiotap_rfinfo_avg_evm_sp_sigc = -1; +static int hf_radiotap_rfinfo_avg_evm_sp_sigd = -1; +static int hf_radiotap_rfinfo_avg_evm_dd_siga = -1; +static int hf_radiotap_rfinfo_avg_evm_dd_sigb = -1; +static int hf_radiotap_rfinfo_avg_evm_dd_sigc = -1; +static int hf_radiotap_rfinfo_avg_evm_dd_sigd = -1; +static int hf_radiotap_rfinfo_avg_evm_dp_siga = -1; +static int hf_radiotap_rfinfo_avg_evm_dp_sigb = -1; +static int hf_radiotap_rfinfo_avg_evm_dp_sigc = -1; +static int hf_radiotap_rfinfo_avg_evm_dp_sigd = -1; +static int hf_radiotap_rfinfo_avg_evm_ws_siga = -1; +static int hf_radiotap_rfinfo_avg_evm_ws_sigb = -1; +static int hf_radiotap_rfinfo_avg_evm_ws_sigc = -1; +static int hf_radiotap_rfinfo_avg_evm_ws_sigd = -1; +/* static int hf_radiotap_rfinfo_contextp_bits3 = -1; */ +static int hf_radiotap_rfinfo_frameformatA = -1; +static int hf_radiotap_rfinfo_frameformatB = -1; +static int hf_radiotap_rfinfo_frameformatC = -1; +static int hf_radiotap_rfinfo_frameformatD = -1; +static int hf_radiotap_rfinfo_sigbwevmA = -1; +static int hf_radiotap_rfinfo_sigbwevmB = -1; +static int hf_radiotap_rfinfo_sigbwevmC = -1; +static int hf_radiotap_rfinfo_sigbwevmD = -1; +static int hf_radiotap_rfinfo_legacytypeA = -1; +static int hf_radiotap_rfinfo_legacytypeB = -1; +static int hf_radiotap_rfinfo_legacytypeC = -1; +static int hf_radiotap_rfinfo_legacytypeD = -1; + +static int hf_radiotap_rfinfo_avg_ws_symbol = -1; +static int hf_radiotap_rfinfo_sigdata = -1; +static int hf_radiotap_rfinfo_sigpilot = -1; +static int hf_radiotap_rfinfo_datadata = -1; +static int hf_radiotap_rfinfo_datapilot = -1; +static int hf_radiotap_plcp_type = -1; +static int hf_radiotap_vht_ndp_flg = -1; + +static expert_field ei_radiotap_fcs_bad = EI_INIT; static dissector_handle_t ixveriwave_handle; @@ -261,100 +580,165 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da proto_item *ti = NULL; proto_item *vw_times_ti = NULL; proto_tree *vw_times_tree = NULL; - int offset, time_tree_offset = 0; - guint16 version, length; + proto_item *rf_infot = NULL; + proto_tree *rf_info_tree = NULL; + int offset; + guint16 length; guint length_remaining; guint64 vw_startt=0, vw_endt=0; guint32 true_length; - guint32 vw_latency, vw_pktdur, vw_flowid; - guint16 vw_vcid, vw_msdu_length=0, vw_seqnum; + guint32 vw_latency, vw_pktdur; + guint32 vw_msdu_length=0; tvbuff_t *next_tvb; ifg_info *p_ifg_info; + guint8 ver_fpga, ixport_type,cmd_type, mgmt_byte; + guint8 frameformat, rfid, legacy_type; + gint8 noisevalida, noisevalidb, noisevalidc, noisevalidd, pfevalida, pfevalidb, pfevalidc, pfevalidd; + guint16 vw_info_ifg; + int ifg_flag = 0; + proto_tree *vwrft, *vw_rfinfo_tree = NULL, *rfinfo_contextp_tree; + + static const int * context_a_flags[] = { + &hf_radiotap_rfinfo_contextpA_bit0, + &hf_radiotap_rfinfo_contextpA_bit1, + &hf_radiotap_rfinfo_contextpA_bit2, + &hf_radiotap_rfinfo_contextpA_bit3, + &hf_radiotap_rfinfo_contextpA_bit4, + &hf_radiotap_rfinfo_contextpA_bit5, +/* + &hf_radiotap_rfinfo_contextpA_bit8, + &hf_radiotap_rfinfo_contextpA_bit10, + &hf_radiotap_rfinfo_contextpA_bit11, +*/ + &hf_radiotap_rfinfo_contextpA_bit13, + NULL + }; + static const int * context_b_flags[] = { + &hf_radiotap_rfinfo_contextpB_bit0, + &hf_radiotap_rfinfo_contextpB_bit1, + &hf_radiotap_rfinfo_contextpB_bit2, + &hf_radiotap_rfinfo_contextpB_bit3, + &hf_radiotap_rfinfo_contextpB_bit4, + &hf_radiotap_rfinfo_contextpB_bit5, +/* + &hf_radiotap_rfinfo_contextpB_bit8, + &hf_radiotap_rfinfo_contextpB_bit10, + &hf_radiotap_rfinfo_contextpB_bit11, +*/ + &hf_radiotap_rfinfo_contextpB_bit13, + NULL + }; + static const int * context_c_flags[] = { + &hf_radiotap_rfinfo_contextpC_bit0, + &hf_radiotap_rfinfo_contextpC_bit1, + &hf_radiotap_rfinfo_contextpC_bit2, + &hf_radiotap_rfinfo_contextpC_bit3, + &hf_radiotap_rfinfo_contextpC_bit4, + &hf_radiotap_rfinfo_contextpC_bit5, +/* + &hf_radiotap_rfinfo_contextpC_bit8, + &hf_radiotap_rfinfo_contextpC_bit10, + &hf_radiotap_rfinfo_contextpC_bit11, +*/ + &hf_radiotap_rfinfo_contextpC_bit13, + NULL + }; + static const int * context_d_flags[] = { + &hf_radiotap_rfinfo_contextpD_bit0, + &hf_radiotap_rfinfo_contextpD_bit1, + &hf_radiotap_rfinfo_contextpD_bit2, + &hf_radiotap_rfinfo_contextpD_bit3, + &hf_radiotap_rfinfo_contextpD_bit4, + &hf_radiotap_rfinfo_contextpD_bit5, +/* + &hf_radiotap_rfinfo_contextpD_bit8, + &hf_radiotap_rfinfo_contextpD_bit10, + &hf_radiotap_rfinfo_contextpD_bit11, +*/ + &hf_radiotap_rfinfo_contextpD_bit13, + NULL + }; offset = 0; - version = tvb_get_letohs(tvb, offset); + //mgmt_bytes = tvb_get_letohs(tvb, offset); + //1st octet are as command type((7..4 bits)which indicates as Tx, Rx or RF frame) & port type((3..0 bits)ethernet or wlantap). + //Command type Rx = 0, Tx = 1, RF = 3 , RF_RX = 4 + //2nd octet are as Reduce logging(7..4 bits) & fpga version(3..0 bits). + //log mode = 0 is normal capture and 1 is reduced capture + //FPGA version = 1 for OCTO versions + //OCTO version like 48, 61, 83 + ixport_type = tvb_get_guint8(tvb, offset); + cmd_type = (ixport_type & 0xf0) >> 4; + ixport_type &= 0x0f; + mgmt_byte = tvb_get_guint8(tvb, offset+1); + ver_fpga = mgmt_byte & 0x0f; length = tvb_get_letohs(tvb, offset + COMMON_LENGTH_OFFSET); - col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "%s", version ? "ETH" : "WLAN"); + col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "%s", ixport_type ? "ETH" : "WLAN"); col_clear(pinfo->cinfo, COL_INFO); true_length = pinfo->fd->pkt_len - length - tvb_get_letohs(tvb, offset + length) + 4; /* add FCS length into captured length */ col_add_fstr(pinfo->cinfo, COL_INFO, "%s Capture, Length %u", - version ? "IxVeriWave Ethernet Tap" : "IxVeriWave Radio Tap", length); + ixport_type ? "IxVeriWave Ethernet Tap" : "IxVeriWave Radio Tap", length); /* Dissect the packet */ - if (tree) { - ti = proto_tree_add_protocol_format(tree, proto_ixveriwave, - tvb, 0, length, "%s Header, Length %u", - version ? "IxVeriWave Ethernet Tap" : "IxVeriWave Radio Tap", length); - - common_tree = proto_item_add_subtree(ti, ett_commontap); + ti = proto_tree_add_protocol_format(tree, proto_ixveriwave, + tvb, 0, length, "%s Header", + ixport_type ? "IxVeriWave Ethernet Tap" : "IxVeriWave Radio Tap"); + common_tree = proto_item_add_subtree(ti, ett_commontap); - proto_tree_add_uint(common_tree, hf_ixveriwave_frame_length, - tvb, 4, 2, true_length); - } + //checked for only RF frames should be skipped from the other logging details. + if (cmd_type !=3) + { + //checked the fpga version in order to support the legacy version and showing the wireshark logs as it is before in case of fpga version 0 + if (!ver_fpga) { + proto_tree_add_uint(common_tree, hf_ixveriwave_frame_length, + tvb, 4, 2, true_length); + } - length_remaining = length; + length_remaining = length; - offset +=4; - length_remaining -=4; + offset +=4; + length_remaining -=4; - if (length_remaining >= 2) { + if (length_remaining >= 2) { - vw_msdu_length = tvb_get_letohs(tvb, offset); - if (tree) { - proto_tree_add_uint(common_tree, hf_ixveriwave_vw_msdu_length, - tvb, offset, 2, vw_msdu_length); + proto_tree_add_item_ret_uint(common_tree, hf_ixveriwave_vw_msdu_length, tvb, offset, 2, ENC_LITTLE_ENDIAN, &vw_msdu_length); + offset +=2; + length_remaining -=2; } - offset +=2; - length_remaining -=2; - } + /*extract flow id , 4bytes*/ + if (length_remaining >= 4) { + proto_tree_add_item(common_tree, hf_ixveriwave_vw_flowid, tvb, offset, 4, ENC_LITTLE_ENDIAN); - /*extract flow id , 4bytes*/ - if (length_remaining >= 4) { - vw_flowid = tvb_get_letohl(tvb, offset); - if (tree) { - proto_tree_add_uint(common_tree, hf_ixveriwave_vw_flowid, - tvb, offset, 4, vw_flowid); + offset +=4; + length_remaining -=4; } - offset +=4; - length_remaining -=4; - } + /*extract client id, 2bytes*/ + if (length_remaining >= 2) { + proto_tree_add_item(common_tree, hf_ixveriwave_vw_vcid, tvb, offset, 2, ENC_LITTLE_ENDIAN); - /*extract client id, 2bytes*/ - if (length_remaining >= 2) { - vw_vcid = tvb_get_letohs(tvb, offset); - if (tree) { - proto_tree_add_uint(common_tree, hf_ixveriwave_vw_vcid, - tvb, offset, 2, vw_vcid); + offset +=2; + length_remaining -=2; } - offset +=2; - length_remaining -=2; - } + /*extract sequence number , 2bytes*/ + if (length_remaining >= 2) { - /*extract sequence number , 2bytes*/ - if (length_remaining >= 2) { + proto_tree_add_item(common_tree, hf_ixveriwave_vw_seqnum, tvb, offset, 2, ENC_LITTLE_ENDIAN); - vw_seqnum = tvb_get_letohs(tvb, offset); - if (tree) { - proto_tree_add_uint(common_tree, hf_ixveriwave_vw_seqnum, - tvb, offset, 2, vw_seqnum); + offset +=2; + length_remaining -=2; } - offset +=2; - length_remaining -=2; - } - - /*extract latency, 4 bytes*/ - if (length_remaining >= 4) { - vw_latency = tvb_get_letohl(tvb, offset); + /*extract latency, 4 bytes*/ + if (length_remaining >= 4) { + vw_latency = tvb_get_letohl(tvb, offset); - if (tree) { /* start a tree going for the various packet times */ if (vw_latency != 0) { vw_times_ti = proto_tree_add_float_format(common_tree, @@ -364,9 +748,7 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da (float)(vw_latency/1000000.0)); vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times); - proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_latency, - tvb, offset, 4, vw_latency, - "Frame latency: %u nsec", vw_latency); + proto_tree_add_uint(vw_times_tree, hf_ixveriwave_vw_latency, tvb, offset, 4, vw_latency); } else { @@ -376,87 +758,170 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da "Frame timestamp values:"); vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times); - proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_latency, - tvb, offset, 4, vw_latency, - "Frame latency: N/A"); + proto_tree_add_uint_format_value(vw_times_tree, hf_ixveriwave_vw_latency, + tvb, offset, 4, vw_latency, "N/A"); + } + + offset +=4; + length_remaining -=4; + } + + /*extract signature timestamp, 4 bytes (32 LSBs only, nsec)*/ + if (length_remaining >= 4) { + /* TODO: what should this fieldname be? */ + proto_tree_add_item(vw_times_tree, hf_ixveriwave, + tvb, offset, 4, ENC_BIG_ENDIAN); + offset +=4; + length_remaining -=4; + } + + /*extract frame start timestamp, 8 bytes (nsec)*/ + if (length_remaining >= 8) { + proto_tree_add_item_ret_uint64(vw_times_tree, hf_ixveriwave_vw_startt, + tvb, offset, 8, ENC_LITTLE_ENDIAN, &vw_startt); + + offset +=8; + length_remaining -=8; + } + + /* extract frame end timestamp, 8 bytes (nsec)*/ + if (length_remaining >= 8) { + proto_tree_add_item_ret_uint64(vw_times_tree, hf_ixveriwave_vw_endt, + tvb, offset, 8, ENC_LITTLE_ENDIAN, &vw_endt); + + offset +=8; + length_remaining -=8; + } + + /*extract frame duration , 4 bytes*/ + if (length_remaining >= 4) { + vw_pktdur = tvb_get_letohl(tvb, offset); + + if (vw_endt >= vw_startt) { + /* Add to root summary */ + if (ixport_type == ETHERNET_PORT) { + proto_item_append_text(vw_times_ti, " (Frame duration=%u nsecs)", vw_pktdur); + proto_tree_add_uint(vw_times_tree, hf_ixveriwave_vw_pktdur, + tvb, offset-16, 16, vw_pktdur); + } + else { + proto_item_append_text(vw_times_ti, " (Frame duration=%u usecs)", vw_pktdur); + proto_tree_add_uint(vw_times_tree, hf_ixveriwave_vw_pktdur, + tvb, offset-16, 16, vw_pktdur); + } + } + else { + proto_tree_add_uint_format_value(vw_times_tree, hf_ixveriwave_vw_pktdur, + tvb, offset, 0, vw_pktdur, "N/A"); + + /* Add to root summary */ + proto_item_append_text(vw_times_ti, " (Frame duration=N/A)"); } + + offset +=4; } + } else { //Rather then the legacy it takes care to show the Time Header for RadioTapHeader in new format + length_remaining = length; + offset +=4; length_remaining -=4; - } + /*extract latency, 4 bytes*/ + if (length_remaining >= 4) { + vw_latency = tvb_get_letohl(tvb, offset); + /* start a tree going for the various packet times */ + if (vw_latency != 0) { + vw_times_ti = proto_tree_add_float_format(common_tree, + hf_ixveriwave_vw_mslatency, + tvb, offset, 4, (float)(vw_latency/1000000.0), + "Time Header(latency %.3f msec)", + (float)(vw_latency/1000000.0)); + vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times); + proto_tree_add_uint(vw_times_tree, hf_ixveriwave_vw_latency, tvb, offset, 4, vw_latency); + } + else + { + vw_times_ti = proto_tree_add_float_format(common_tree, + hf_ixveriwave_vw_mslatency, + tvb, offset, 4, (float)(vw_latency/1000000.0), + "Time Header"); + vw_times_tree = proto_item_add_subtree(vw_times_ti, ett_commontap_times); - /*extract signature timestamp, 4 bytes (32 LSBs only, nsec)*/ - if (length_remaining >= 4) { - /* TODO: what should this fieldname be? */ - proto_tree_add_item(vw_times_tree, hf_ixveriwave, + if (cmd_type != 1) { + proto_tree_add_uint_format_value(vw_times_tree, hf_ixveriwave_vw_latency, + tvb, offset, 4, vw_latency, "N/A"); + } + } + offset +=4; + length_remaining -=4; + } + + /*extract signature timestamp, 4 bytes (32 LSBs only, nsec)*/ + if (length_remaining >= 4) { + /* TODO: what should this fieldname be? */ + if (cmd_type != 1) + proto_tree_add_item(vw_times_tree, hf_ixveriwave, tvb, offset, 4, ENC_BIG_ENDIAN); - time_tree_offset = offset; - offset +=4; - length_remaining -=4; - } + else + proto_tree_add_item(vw_times_tree, hf_ixveriwave_vw_delay, + tvb, offset, 4, ENC_BIG_ENDIAN); + offset +=4; + length_remaining -=4; + } - /*extract frame start timestamp, 8 bytes (nsec)*/ - if (length_remaining >= 8) { - vw_startt = tvb_get_letoh64(tvb, offset); + /*extract frame start timestamp, 8 bytes (nsec)*/ + if (length_remaining >= 8) { + proto_tree_add_item_ret_uint64(vw_times_tree, hf_ixveriwave_vw_startt, + tvb, offset, 8, ENC_LITTLE_ENDIAN, &vw_startt); - proto_tree_add_uint64(vw_times_tree, hf_ixveriwave_vw_startt, - tvb, offset, 8, vw_startt); + offset +=8; + length_remaining -=8; + } - offset +=8; - length_remaining -=8; - } + /* extract frame end timestamp, 8 bytes (nsec)*/ + if (length_remaining >= 8) { + proto_tree_add_item_ret_uint64(vw_times_tree, hf_ixveriwave_vw_endt, + tvb, offset, 8, ENC_LITTLE_ENDIAN, &vw_endt); - /* extract frame end timestamp, 8 bytes (nsec)*/ - if (length_remaining >= 8) { - vw_endt = tvb_get_letoh64(tvb, offset); + offset +=8; + length_remaining -=8; + } - proto_tree_add_uint64(vw_times_tree, hf_ixveriwave_vw_endt, - tvb, offset, 8, vw_endt); + /*extract frame duration , 4 bytes*/ + if (length_remaining >= 4) { + vw_pktdur = tvb_get_letohl(tvb, offset); - offset +=8; - length_remaining -=8; - } - /*extract frame duration , 4 bytes*/ - if (length_remaining >= 4) { - vw_pktdur = tvb_get_letohl(tvb, offset); - - if (vw_endt >= vw_startt) { - /* Add to root summary */ - if (version == ETHERNET_PORT) { - proto_item_append_text(vw_times_ti, " (Frame duration=%u nsecs)", vw_pktdur); - proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur, - tvb, offset-16, 16, vw_pktdur, - "Frame duration: %u nsec", vw_pktdur); + if (vw_endt >= vw_startt) { + /* Add to root summary */ + if (ixport_type == ETHERNET_PORT) { + proto_item_append_text(vw_times_ti, " (Frame duration=%u nsecs)", vw_pktdur); + proto_tree_add_uint(vw_times_tree, hf_ixveriwave_vw_pktdur, + tvb, offset-16, 16, vw_pktdur); + } + else { + proto_item_append_text(vw_times_ti, " (Frame duration=%u usecs)", vw_pktdur); + proto_tree_add_uint(vw_times_tree, hf_ixveriwave_vw_pktdur, + tvb, offset, 4, vw_pktdur); + } } else { - proto_item_append_text(vw_times_ti, " (Frame duration=%u usecs)", vw_pktdur); - proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur, - tvb, offset-16, 16, vw_pktdur, - "Frame duration: %u usec", vw_pktdur); + proto_tree_add_uint_format_value(vw_times_tree, hf_ixveriwave_vw_pktdur, + tvb, offset, 0, vw_pktdur, "N/A"); + + /* Add to root summary */ + proto_item_append_text(vw_times_ti, " (Frame duration=N/A)"); } - } - else { - proto_tree_add_uint_format(vw_times_tree, hf_ixveriwave_vw_pktdur, - tvb, offset, 0, vw_pktdur, - "Frame duration: N/A"); - /* Add to root summary */ - proto_item_append_text(vw_times_ti, " (Frame duration=N/A)"); + offset += 4; } - - offset +=4; } - if (vw_times_ti) { - proto_item_set_len(vw_times_ti, offset-time_tree_offset); - } - - /* Calculate the IFG */ - - /* Check for an existing ifg value associated with the frame */ + /* + * Calculate the IFG + * Check for an existing ifg value associated with the frame + */ p_ifg_info = (ifg_info *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ixveriwave, 0); if (!p_ifg_info) { @@ -486,14 +951,490 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da p_add_proto_data(wmem_file_scope(), pinfo, proto_ixveriwave, 0, p_ifg_info); } - /* Grab the rest of the frame. */ - next_tvb = tvb_new_subset_remaining(tvb, length); + if (ver_fpga) { + p_ifg_info = (struct ifg_info *) p_get_proto_data(wmem_file_scope(), pinfo, proto_ixveriwave, 0); + switch (cmd_type) { + case 0: + vw_info_ifg = tvb_get_ntohs(tvb, offset+ VW_INFO_OFF ); + if ((vw_info_ifg & 0x0004) && !(vw_info_ifg & 0x0008)) /* If the packet is part of an A-MPDU but not the first MPDU */ + ifg_flag = 1; + else + ifg_flag = 0; + break; + case 1: + vw_info_ifg = tvb_get_letohs(tvb, offset+ VW_INFO_OFF); + if ((vw_info_ifg & 0x0400) && !(vw_info_ifg & 0x0800)) /* If the packet is part of an A-MPDU but not the first MPDU */ + ifg_flag = 1; + else + ifg_flag = 0; + break; + + case 4: + vw_info_ifg = tvb_get_ntohs(tvb, offset+ VW_INFO_OFF + OCTO_MODIFIED_RF_LEN); + if ((vw_info_ifg & 0x0004) && !(vw_info_ifg & 0x0008)) /* If the packet is part of an A-MPDU but not the first MPDU */ + ifg_flag = 1; + else + ifg_flag = 0; + break; + + default: + break; + } + + if (ifg_flag == 1) /* If the packet is part of an A-MPDU but not the first MPDU */ + ti = proto_tree_add_uint(common_tree, hf_ixveriwave_vw_ifg, tvb, 18, 0, 0); + else { + /*** if (p_ifg_info->ifg < IFG_MAX_VAL) ***/ + if ((gint32) p_ifg_info->ifg >= 0) + ti = proto_tree_add_uint(common_tree, hf_ixveriwave_vw_ifg, tvb, 18, 0, p_ifg_info->ifg); + else + ti = proto_tree_add_string(common_tree, hf_ixveriwave_vw_ifg_neg, tvb, 18, 0, "Cannot be determined"); + } + + PROTO_ITEM_SET_GENERATED(ti); + } + + if(cmd_type ==3 || cmd_type ==4) + { + float flttmp; + frameformat = tvb_get_guint8(tvb, offset+33)& 0x03; + legacy_type = tvb_get_guint8(tvb, offset+33)& 0x04 >>2; + + if(cmd_type ==3) + offset += 1; + + // Only RF header implementation + if (tree) { + + rfid = tvb_get_guint8(tvb, offset); + vwrft = proto_tree_add_uint(common_tree, hf_radiotap_rf_info, + tvb, offset, 76, rfid); + proto_item_append_text(vwrft, " (RFID = %u)",rfid); + vw_rfinfo_tree = proto_item_add_subtree(vwrft, ett_radiotap_rf); + + proto_tree_add_uint(vw_rfinfo_tree, + hf_radiotap_rfinfo_rfid, tvb, offset, 1, rfid); + offset += 4; + //Section for Noise + noisevalida = tvb_get_guint8(tvb, offset+65)& 0x01; + noisevalidb = tvb_get_guint8(tvb, offset+67)& 0x01; + noisevalidc = tvb_get_guint8(tvb, offset+69)& 0x01; + noisevalidd = tvb_get_guint8(tvb, offset+71)& 0x01; + + /* + noisea = (gint16) tvb_get_ntohs(tvb, offset); + //noisevalida = tvb_get_guint8(tvb, offset+65)& 0x01; + if (noisevalida == 1) + rf_infot = proto_tree_add_float_format(vw_rfinfo_tree, hf_radiotap_rfinfo_noise, + tvb, offset, 8, (float)(noisea/16.0),"Noise: A:%.2fdBm, ", (float)(noisea/16.0)); + //These are 16-bit signed numbers with four fraction bits representing NOISE in dBm. So 0xFFFF represents -1/16 dBm. + else + rf_infot = proto_tree_add_float_format(vw_rfinfo_tree, hf_radiotap_rfinfo_noise, + tvb, offset, 8, (float)(noisea/16.0),"Noise: A: N/A, ", (float)(noisea/16.0)); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + noiseb = tvb_get_ntohs(tvb, offset+2); + noisevalidb = tvb_get_guint8(tvb, offset+67)& 0x01; + if (noisevalidb == 1) + proto_item_append_text(rf_infot, "B:%.2fdBm, ", (float)(noiseb/16.0)); + else + proto_item_append_text(rf_infot, "B: N/A, ", (float)(noiseb/16.0)); + noisec = tvb_get_ntohs(tvb, offset+4); + noisevalidc = tvb_get_guint8(tvb, offset+69)& 0x01; + if (noisevalidc == 1) + proto_item_append_text(rf_infot, "C:%.2fdBm, ", (float)(noisec/16.0)); + else + proto_item_append_text(rf_infot, "C: N/A, ", (float)(noisec/16.0)); + noised = tvb_get_ntohs(tvb, offset+6); + noisevalidd = tvb_get_guint8(tvb, offset+71)& 0x01; + if (noisevalidd == 1) + proto_item_append_text(rf_infot, "D:%.2fdBm", (float)(noised/16.0)); + else + proto_item_append_text(rf_infot, "D: N/A", (float)(noised/16.0)); + */ + + offset += 8; + //Section for SNR + //These are 16-bit signed numbers with four fraction bits in units of dB . So 0xFFFF represents -1/16 dB. + rf_infot = proto_tree_add_none_format(vw_rfinfo_tree, hf_radiotap_rfinfo_snr, tvb, offset, 8, "SNR: "); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + + flttmp = (float)round(tvb_get_ntohs(tvb, offset) / 16.0f); + if (noisevalida == 1) + { + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_snr_anta, tvb, offset, 2, flttmp); + proto_item_append_text(rf_infot, "A:%.0fdB, ", flttmp); + } + else + { + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_snr_anta, tvb, offset, 2, flttmp, "N/A"); + proto_item_append_text(rf_infot, "A:N/A, "); + } + offset += 2; + flttmp = (float)round(tvb_get_ntohs(tvb, offset) / 16.0f); + if (noisevalidb == 1) + { + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_snr_antb, tvb, offset, 2, flttmp); + proto_item_append_text(rf_infot, "B:%.0fdB, ", flttmp); + } + else + { + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_snr_antb, tvb, offset, 2, flttmp, "N/A"); + proto_item_append_text(rf_infot, "B:N/A, "); + } + offset += 2; + flttmp = (float)round(tvb_get_ntohs(tvb, offset) / 16.0f); + if (noisevalidc == 1) + { + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_snr_antc, tvb, offset, 2, flttmp); + proto_item_append_text(rf_infot, "C:%.0fdB, ", flttmp); + } + else + { + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_snr_antc, tvb, offset, 2, flttmp, "N/A"); + proto_item_append_text(rf_infot, "C:N/A, "); + } + offset += 2; + flttmp = (float)round(tvb_get_ntohs(tvb, offset) / 16.0f); + if (noisevalidd == 1) + { + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_snr_antd, tvb, offset, 2, flttmp); + proto_item_append_text(rf_infot, "D:%.0fdB", flttmp); + } + else + { + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_snr_antd, tvb, offset, 2, flttmp, "N/A"); + proto_item_append_text(rf_infot, "D:N/A"); + } + offset += 2; + //Section for PFE + pfevalida = (tvb_get_guint8(tvb, offset+49)& 0x02) >>1; + pfevalidb = (tvb_get_guint8(tvb, offset+51)& 0x02) >>1; + pfevalidc = (tvb_get_guint8(tvb, offset+53)& 0x02) >>1; + pfevalidd = (tvb_get_guint8(tvb, offset+55)& 0x02) >>1; + rf_infot = proto_tree_add_none_format(vw_rfinfo_tree, hf_radiotap_rfinfo_pfe, + tvb, offset, 8, "PFE: "); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + if ((frameformat == 0) && (legacy_type == 0)) + { + //The basic unit of OFDM frequency error measurement is in units of 80 MHz/2^22. + //This works out to approximately 19.073 Hz per measurement unit. + flttmp = (float)(tvb_get_ntohs(tvb, offset)*19.073); + } + else + { + //The basic unit of CCK frequency error measurement is in units of 88 MHz/2^22. + //This works out to approximately 20.981 Hz. + flttmp = (float)(tvb_get_ntohs(tvb, offset)*20.981); + } + + if (pfevalida == 1) + { + proto_item_append_text(rf_infot, "SS#1:%.0fHz, ", flttmp); + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_pfe_anta, + tvb, offset, 2, flttmp); + } + else + { + proto_item_append_text(rf_infot, "SS#1:N/A, "); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_pfe_anta, + tvb, offset, 2, flttmp, "N/A"); + } + offset += 2; + + if ((frameformat == 0) && (legacy_type == 0)) + { + flttmp = (float)(tvb_get_ntohs(tvb, offset)*19.073); + } + else + { + flttmp = (float)(tvb_get_ntohs(tvb, offset)*20.981); + } + if (pfevalidb == 1) + { + proto_item_append_text(rf_infot, "SS#2:%.0fHz, ", flttmp); + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_pfe_antb, + tvb, offset, 2, flttmp); + } + else + { + proto_item_append_text(rf_infot, "SS#2:N/A, "); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_pfe_antb, + tvb, offset, 2, flttmp, "N/A"); + } + offset += 2; + + if ((frameformat == 0) && (legacy_type == 0)) + { + flttmp = (float)(tvb_get_ntohs(tvb, offset)*19.073); + } + else + { + flttmp = (float)(tvb_get_ntohs(tvb, offset)*20.981); + } + if (pfevalidc == 1) + { + proto_item_append_text(rf_infot, "SS#3:%.0fHz, ", flttmp); + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_pfe_antc, + tvb, offset, 2, flttmp); + } + else + { + proto_item_append_text(rf_infot, "SS#3:N/A, "); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_pfe_antc, + tvb, offset, 2, flttmp, "N/A"); + } + offset += 2; + + if ((frameformat == 0) && (legacy_type == 0)) + { + flttmp = (float)(tvb_get_ntohs(tvb, offset)*19.073); + } + else + { + flttmp = (float)(tvb_get_ntohs(tvb, offset)*20.981); + } + if (pfevalidd == 1) + { + proto_item_append_text(rf_infot, "SS#4:%.0fHz", flttmp); + proto_tree_add_float(rf_info_tree, hf_radiotap_rfinfo_pfe_antd, + tvb, offset, 2, flttmp); + } + else + { + proto_item_append_text(rf_infot, "SS#4:N/A"); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_pfe_antd, + tvb, offset, 2, flttmp, "N/A"); + } + offset += 2; + + //AVG EVM SIG Data + rf_infot = proto_tree_add_none_format(vw_rfinfo_tree, hf_radiotap_rfinfo_sigdata, tvb, offset, 8, "AVG EVM SIG Data: "); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#1:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sd_siga, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#2:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sd_sigb, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#3:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sd_sigc, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#4:%.1f%%", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sd_sigd, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + //AVG EVM SIG Pilot + rf_infot = proto_tree_add_none_format(vw_rfinfo_tree, hf_radiotap_rfinfo_sigpilot, tvb, offset, 8, "AVG EVM SIG Pilot: "); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#1:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sp_siga, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#2:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sp_sigb, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#3:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sp_sigc, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#4:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_sp_sigd, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + //AVG EVM DATA Data + rf_infot = proto_tree_add_none_format(vw_rfinfo_tree, hf_radiotap_rfinfo_datadata, + tvb, offset, 8, "AVG EVM DATA Data: "); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#1:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dd_siga, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#2:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dd_sigb, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#3:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dd_sigc, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#4:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dd_sigd, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + //AVG EVM DATA Pilot + rf_infot = proto_tree_add_none_format(vw_rfinfo_tree, hf_radiotap_rfinfo_datapilot, + tvb, offset, 8, "AVG EVM DATA Pilot: "); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#1:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dp_siga, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#2:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dp_sigb, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#3:%.1f%%, ", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dp_sigc, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + flttmp = (float)(tvb_get_ntohs(tvb, offset)/512.0); + proto_item_append_text(rf_infot, "SS#4:%.1f%%", flttmp); + proto_tree_add_float_format_value(rf_info_tree, hf_radiotap_rfinfo_avg_evm_dp_sigd, + tvb, offset, 2, flttmp, "%.1f%%", flttmp); + offset += 2; + + //EVM Worst Symbol + rf_infot = proto_tree_add_item(vw_rfinfo_tree, hf_radiotap_rfinfo_avg_ws_symbol, + tvb, offset, 8, ENC_NA); + rf_info_tree = proto_item_add_subtree(rf_infot, ett_rf_info); + + proto_tree_add_item(rf_info_tree, hf_radiotap_rfinfo_avg_evm_ws_siga, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_item_append_text(rf_infot, ": SS#1:%u%%, ", tvb_get_ntohs(tvb, offset)); + offset += 2; + + proto_tree_add_item(rf_info_tree, hf_radiotap_rfinfo_avg_evm_ws_sigb, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_item_append_text(rf_infot, "SS#2:%u%%, ", tvb_get_ntohs(tvb, offset)); + offset += 2; + + proto_tree_add_item(rf_info_tree, hf_radiotap_rfinfo_avg_evm_ws_sigc, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_item_append_text(rf_infot, "SS#3:%u%%, ", tvb_get_ntohs(tvb, offset)); + offset += 2; + + proto_tree_add_item(rf_info_tree, hf_radiotap_rfinfo_avg_evm_ws_sigd, tvb, offset, 2, ENC_BIG_ENDIAN); + proto_item_append_text(rf_infot, "SS#4:%u%%", tvb_get_ntohs(tvb, offset)); + offset += 2; + + //ContextA + ti = proto_tree_add_bitmask(rf_info_tree, tvb, offset, hf_radiotap_rfinfo_contextpa, ett_radiotap_contextp, context_a_flags, ENC_BIG_ENDIAN); + rfinfo_contextp_tree = proto_item_add_subtree(ti, ett_radiotap_contextp); + + frameformat = tvb_get_guint8(tvb, offset)& 0x03; + if (frameformat == 0) + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_legacytypeA, tvb, offset, 1, ENC_NA); + } + else + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_frameformatA, tvb, offset, 1, ENC_NA); + } + + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_sigbwevmA, tvb, offset, 1, ENC_NA); + offset += 2; + + //ContextB + ti = proto_tree_add_bitmask(rf_info_tree, tvb, offset, hf_radiotap_rfinfo_contextpb, ett_radiotap_contextp, context_b_flags, ENC_BIG_ENDIAN); + rfinfo_contextp_tree = proto_item_add_subtree(ti, ett_radiotap_contextp); - /* dissect the ethernet or wlan header next */ - if (version == ETHERNET_PORT) + frameformat = tvb_get_guint8(tvb, offset)& 0x03; + if (frameformat == 0) + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_legacytypeB, tvb, offset, 1, ENC_NA); + } + else + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_frameformatB, tvb, offset, 1, ENC_NA); + } + + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_sigbwevmB, tvb, offset, 1, ENC_NA); + offset += 2; + + //ContextC + ti = proto_tree_add_bitmask(vw_rfinfo_tree, tvb, offset, hf_radiotap_rfinfo_contextpc, ett_radiotap_contextp, context_c_flags, ENC_BIG_ENDIAN); + rfinfo_contextp_tree = proto_item_add_subtree(ti, ett_radiotap_contextp); + + frameformat = tvb_get_guint8(tvb, offset)& 0x03; + if (frameformat == 0) + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_legacytypeC, tvb, offset, 1, ENC_NA); + } + else + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_frameformatC, tvb, offset, 1, ENC_NA); + } + + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_sigbwevmC, tvb, offset, 1, ENC_NA); + offset += 2; + + //ContextD + ti = proto_tree_add_bitmask(vw_rfinfo_tree, tvb, offset, hf_radiotap_rfinfo_contextpd, ett_radiotap_contextp, context_d_flags, ENC_BIG_ENDIAN); + rfinfo_contextp_tree = proto_item_add_subtree(ti, ett_radiotap_contextp); + + frameformat = tvb_get_guint8(tvb, offset)& 0x03; + if (frameformat == 0) + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_legacytypeD, tvb, offset, 1, ENC_NA); + } + else + { + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_frameformatD, tvb, offset, 1, ENC_NA); + } + + proto_tree_add_item(rfinfo_contextp_tree, hf_radiotap_rfinfo_sigbwevmD, tvb, offset, 1, ENC_NA); + offset += 2; + } + } + if (cmd_type !=3) //only RF + { + proto_item_set_len(vw_times_ti, 28); + + /* Grab the rest of the frame. */ + if(!ver_fpga) + { + next_tvb = tvb_new_subset_remaining(tvb, length); + } + else + { + if (cmd_type ==4) //RF+Rx + next_tvb = tvb_new_subset_remaining(tvb, 108); + else + next_tvb = tvb_new_subset_remaining(tvb, 32); + } + + /* dissect the ethernet or wlan header next */ + if (ixport_type == ETHERNET_PORT) ethernettap_dissect(next_tvb, pinfo, tree, common_tree); - else - wlantap_dissect(next_tvb, pinfo, tree, common_tree, vw_msdu_length); + else + wlantap_dissect(next_tvb, pinfo, tree, common_tree,vw_msdu_length, cmd_type, mgmt_byte); + } + return tvb_captured_length(tvb); } @@ -506,29 +1447,19 @@ dissect_ixveriwave(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* da static void ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree) { - proto_tree *vweft, *vw_errorFlags_tree = NULL, *vwift,*vw_infoFlags_tree = NULL; - int offset; + proto_tree *vwift,*vw_infoFlags_tree = NULL; + int offset = 0; tvbuff_t *next_tvb; guint length, length_remaining; - guint16 vw_flags, vw_info; - guint16 vw_l4id; - guint32 vw_error; - gint32 vwf_txf, vwf_fcserr; + gboolean vwf_txf = FALSE; ifg_info *p_ifg_info; proto_item *ti; - vwf_txf = 0; - - offset = 0; - /* First add the IFG information */ p_ifg_info = (struct ifg_info *) p_get_proto_data(wmem_file_scope(), pinfo, proto_ixveriwave, 0); - if (tap_tree) { - ti = proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_ifg, - tvb, offset, 0, p_ifg_info->ifg); - PROTO_ITEM_SET_GENERATED(ti); - } - + ti = proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_ifg, + tvb, offset, 0, p_ifg_info->ifg); + PROTO_ITEM_SET_GENERATED(ti); length = tvb_get_letohs(tvb, offset); length_remaining = length; @@ -538,16 +1469,10 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t /* extract flags (currently use only TX/RX and FCS error flag) */ if (length >= 2) { - vw_flags = tvb_get_letohs(tvb, offset); - vwf_txf = ((vw_flags & ETHERNETTAP_VWF_TXF) == 0) ? 0 : 1; - vwf_fcserr = ((vw_flags & ETHERNETTAP_VWF_FCSERR) == 0) ? 0 : 1; - - if (tap_tree) { - proto_tree_add_uint(tap_tree, hf_ixveriwave_vwf_txf, - tvb, 0, 0, vwf_txf); - proto_tree_add_uint(tap_tree, hf_ixveriwave_vwf_fcserr, - tvb, 0, 0, vwf_fcserr); - } + proto_tree_add_item_ret_boolean(tap_tree, hf_ixveriwave_vwf_txf, + tvb, offset, 2, ENC_LITTLE_ENDIAN, &vwf_txf); + proto_tree_add_item(tap_tree, hf_ixveriwave_vwf_fcserr, + tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; length_remaining -= 2; @@ -556,26 +1481,20 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t /*extract info flags , 2bytes*/ if (length_remaining >= 2) { - vw_info = tvb_get_letohs(tvb, offset); - - if (tap_tree) { - vwift = proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_info, - tvb, offset, 2, vw_info); - vw_infoFlags_tree = proto_item_add_subtree(vwift, ett_ethernettap_info); + vwift = proto_tree_add_item(tap_tree, hf_ixveriwave_vw_info, tvb, offset, 2, ENC_LITTLE_ENDIAN); + vw_infoFlags_tree = proto_item_add_subtree(vwift, ett_ethernettap_info); - if (vwf_txf == 0) { - /* then it's an rx case */ - proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit8, - tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit9, + if (vwf_txf == 0) { + /* then it's an rx case */ + proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit8, + tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_rx_1_bit9, + tvb, offset, 2, ENC_LITTLE_ENDIAN); + } else { + /* it's a tx case */ + proto_tree_add_item(vw_infoFlags_tree, hf_ixveriwave_vw_info_retryCount, tvb, offset, 2, ENC_LITTLE_ENDIAN); - } else { - /* it's a tx case */ - proto_tree_add_uint_format(vw_infoFlags_tree, hf_ixveriwave_vw_info_retryCount, - tvb, offset, 2, vw_info, - "Retry count: %u ", vw_info); - } - } /*end of if tree */ + } offset +=2; length_remaining -=2; @@ -583,67 +1502,51 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t /*extract error , 4bytes*/ if (length_remaining >= 4) { - vw_error = tvb_get_letohl(tvb, offset); - - if (tap_tree) { - vweft = proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_error, - tvb, offset, 4, vw_error); - vw_errorFlags_tree = proto_item_add_subtree(vweft, ett_ethernettap_error); - - if (vwf_txf == 0) { - /* then it's an rx case */ - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit0, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit1, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit2, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit3, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit4, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit5, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit6, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit7, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit8, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_rx_1_bit9, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - } else { - /* it's a tx case */ - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_tx_bit1, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_tx_bit5, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_tx_bit9, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_tx_bit10, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_errorFlags_tree, hf_ixveriwave_vw_error_tx_bit11, - tvb, offset, 4, ENC_LITTLE_ENDIAN); - } - } /*end of if (tap_tree) */ + if (vwf_txf == 0) { + /* then it's an rx case */ + static const int * vw_error_rx_flags[] = { + &hf_ixveriwave_vw_error_rx_1_bit0, + &hf_ixveriwave_vw_error_rx_1_bit1, + &hf_ixveriwave_vw_error_rx_1_bit2, + &hf_ixveriwave_vw_error_rx_1_bit3, + &hf_ixveriwave_vw_error_rx_1_bit4, + &hf_ixveriwave_vw_error_rx_1_bit5, + &hf_ixveriwave_vw_error_rx_1_bit6, + &hf_ixveriwave_vw_error_rx_1_bit7, + &hf_ixveriwave_vw_error_rx_1_bit8, + &hf_ixveriwave_vw_error_rx_1_bit9, + NULL + }; + + proto_tree_add_bitmask(tap_tree, tvb, offset, hf_ixveriwave_vw_error, ett_ethernettap_error, vw_error_rx_flags, ENC_LITTLE_ENDIAN); + } else { + /* it's a tx case */ + static const int * vw_error_tx_flags[] = { + &hf_ixveriwave_vw_error_tx_bit1, + &hf_ixveriwave_vw_error_tx_bit5, + &hf_ixveriwave_vw_error_tx_bit9, + &hf_ixveriwave_vw_error_tx_bit10, + &hf_ixveriwave_vw_error_tx_bit11, + NULL + }; + + proto_tree_add_bitmask(tap_tree, tvb, offset, hf_ixveriwave_vw_error, ett_ethernettap_error, vw_error_tx_flags, ENC_LITTLE_ENDIAN); + } offset +=4; length_remaining -=4; } /*extract l4id , 4bytes*/ if (length_remaining >= 4) { - vw_l4id = tvb_get_letohl(tvb, offset); - if (tap_tree) { - proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_l4id, - tvb, offset, 4, vw_l4id); - } + proto_tree_add_item(tap_tree, hf_ixveriwave_vw_l4id, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset +=4; length_remaining -=4; } /*extract pad, 4bytes*/ if (length_remaining >= 4) { - tvb_get_letohl(tvb, offset); /* throw away pad */ + /* throw away pad */ } /* Grab the rest of the frame. */ @@ -654,27 +1557,37 @@ ethernettap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_t } static void -wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree, guint16 vw_msdu_length) +wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree *tap_tree, guint16 vw_msdu_length, guint8 cmd_type, guint8 mgmt_byte) { proto_tree *ft, *flags_tree = NULL; + proto_item *hdr_fcs_ti = NULL; int align_offset, offset; + guint32 calc_fcs; tvbuff_t *next_tvb; guint length; gint8 dbm; - guint8 plcp_type; - guint8 mcs_index; - guint8 nss; + guint8 rflags = 0; + guint8 mcs_index, vw_plcp_info, vw_bssid; + guint8 plcp_type, vht_u3_coding_type = 0, vht_reserved_coding_type=1; guint8 vht_ndp_flag,vht_mu_mimo_flg,vht_coding_type,vht_u0_coding_type,vht_u1_coding_type,vht_u2_coding_type; float phyRate; guint i; - proto_tree *vweft, *vw_errorFlags_tree = NULL, *vwift,*vw_infoFlags_tree = NULL; - guint16 vw_flags, vw_chanflags, vw_info, vw_ht_length, vht_su_partial_id, vw_rflags; + proto_tree *vweft, *vw_errorFlags_tree = NULL, *vwict,*vw_infoC_tree = NULL; + guint16 vw_info, vw_chanflags, vw_flags, vw_ht_length, vht_su_partial_id,vw_rflags,vw_vcid, vw_seqnum, mpdu_length, vht_length, crc16, vht_plcp_length, plcp_service_ofdm; guint32 vw_errors; - guint8 vht_grp_id1, vht_grp_id2, vht_grp_id, vht_su_nsts,vht_beamformed,vht_user_pos,vht_u0_nsts,vht_u1_nsts,vht_u2_nsts,vht_u3_nsts,vht_su_partial_id1,vht_su_partial_id2; + guint8 vht_grp_id, vht_grp_id1, vht_grp_id2, vht_su_nsts,vht_beamformed,vht_user_pos,vht_su_partial_id1,vht_su_partial_id2; + guint32 vht_u0_nsts,vht_u1_nsts,vht_u2_nsts,vht_u3_nsts; + guint8 vht_bw, vht_stbc, vht_txop_ps_notallowd, vht_shortgi, vht_shortginsymdisa, vht_ldpc_ofdmsymbol, vht_su_mcs, vht_crc1, vht_crc2, vht_crc, vht_tail, rfid; + guint8 vht_mcs1, vht_mcs2, vht_mcs, vht_plcp_length1, vht_plcp_length2, vht_plcp_length3, vht_rate, vht_parity; + guint8 feccoding, aggregation, notsounding, smoothing, ness, plcp_service, signal, plcp_default; + guint8 ver_fpga, log_mode; ifg_info *p_ifg_info; proto_item *ti; + proto_tree *vwl1t,*vw_l1info_tree = NULL, *vwl2l4t,*vw_l2l4info_tree = NULL, *vwplt,*vw_plcpinfo_tree = NULL; + guint8 preamble, nss, direction, sigbw, cidv, bssidv, flowv, l4idv; + struct ieee_802_11_phdr phdr; /* We don't have any 802.11 metadata yet. */ @@ -684,100 +1597,103 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree phdr.datapad = FALSE; phdr.phy = PHDR_802_11_PHY_UNKNOWN; - /* First add the IFG information, need to grab the info bit field here */ - vw_info = tvb_get_letohs(tvb, 20); - p_ifg_info = (struct ifg_info *) p_get_proto_data(wmem_file_scope(), pinfo, proto_ixveriwave, 0); - if (tap_tree) { + //mgmt_bytes = tvb_get_letohs(tvb, offset); + //1st octet are as command type((7..4 bits)which indicates as Tx, Rx or RF frame) & port type((3..0 bits)ethernet or wlantap). + //Command type Rx = 0, Tx = 1, RF = 3 , RF_RX = 4 + //2nd octet are as Reduce logging(7..4 bits) & fpga version(3..0 bits). + //log mode = 0 is normal capture and 1 is reduced capture + //FPGA version = 1 for OCTO versions + //OCTO version like 48, 61, 83 + log_mode = (mgmt_byte & 0xf0) >> 4; + ver_fpga = mgmt_byte & 0x0f; + + if (!ver_fpga) + { + /* First add the IFG information, need to grab the info bit field here */ + vw_info = tvb_get_letohs(tvb, 20); + p_ifg_info = (struct ifg_info *) p_get_proto_data(wmem_file_scope(), pinfo, proto_ixveriwave, 0); if ((vw_info & INFO_MPDU_OF_A_MPDU) && !(vw_info & INFO_FIRST_MPDU_OF_A_MPDU)) /* If the packet is part of an A-MPDU but not the first MPDU */ ti = proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_ifg, tvb, 18, 0, 0); else ti = proto_tree_add_uint(tap_tree, hf_ixveriwave_vw_ifg, tvb, 18, 0, p_ifg_info->ifg); PROTO_ITEM_SET_GENERATED(ti); - } - offset = 0; + offset = 0; + length = tvb_get_letohs(tvb, offset); + offset += 2; - /* Length of the metadata header */ - length = tvb_get_letohs(tvb, offset); - offset += 2; + vw_rflags = tvb_get_letohs(tvb, offset); + if (vw_rflags & FLAGS_FCS) + phdr.fcs_len = 4; + else + phdr.fcs_len = 0; - vw_rflags = tvb_get_letohs(tvb, offset); - if (vw_rflags & FLAGS_FCS) - phdr.fcs_len = 4; - else - phdr.fcs_len = 0; - if (tap_tree) { - ft = proto_tree_add_uint(tap_tree, hf_radiotap_flags, tvb, offset, 2, vw_rflags); + ft = proto_tree_add_item(tap_tree, hf_radiotap_flags, tvb, offset, 2, ENC_LITTLE_ENDIAN); flags_tree = proto_item_add_subtree(ft, ett_radiotap_flags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_preamble, - tvb, offset, 2, vw_rflags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_wep, - tvb, offset, 2, vw_rflags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_fcs_present, - tvb, offset, 2, vw_rflags); + proto_tree_add_item(flags_tree, hf_radiotap_flags_cfp, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_preamble, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_wep, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_frag, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_fcs, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_datapad, tvb, offset, 2, ENC_LITTLE_ENDIAN); if ( vw_rflags & FLAGS_CHAN_HT ) { - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_ht, - tvb, offset, 2, vw_rflags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_40mhz, - tvb, offset, 2, vw_rflags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_shortgi, - tvb, offset, 2, vw_rflags); + proto_tree_add_item(flags_tree, hf_radiotap_flags_ht, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_40mhz, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_shortgi, tvb, offset, 2, ENC_LITTLE_ENDIAN); } if ( vw_rflags & FLAGS_CHAN_VHT ) { - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_vht, - tvb, offset, 2, vw_rflags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_shortgi, - tvb, offset, 2, vw_rflags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_40mhz, - tvb, offset, 2, vw_rflags); - proto_tree_add_boolean(flags_tree, hf_radiotap_flags_80mhz, - tvb, offset, 2, vw_rflags); + proto_tree_add_item(flags_tree, hf_radiotap_flags_vht, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_shortgi, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_40mhz, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(flags_tree, hf_radiotap_flags_80mhz, tvb, offset, 2, ENC_LITTLE_ENDIAN); } - } - offset += 2; - - vw_chanflags = tvb_get_letohs(tvb, offset); - offset += 2; - phyRate = (float)tvb_get_letohs(tvb, offset) / 10; - offset += 2; - plcp_type = tvb_get_guint8(tvb,offset) & 0x03; - vht_ndp_flag = tvb_get_guint8(tvb,offset) & 0x80; - offset++; - - mcs_index = tvb_get_guint8(tvb, offset); - offset++; - nss = tvb_get_guint8(tvb, offset); - offset++; - - if ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT)) { - if (vw_rflags & FLAGS_CHAN_VHT) { - phdr.phy = PHDR_802_11_PHY_11AC; - phdr.phy_info.info_11ac.has_short_gi = TRUE; - phdr.phy_info.info_11ac.short_gi = ((vw_rflags & FLAGS_CHAN_SHORTGI) != 0); - /* - * XXX - this probably has only one user, so only one MCS index - * and only one NSS. - */ - phdr.phy_info.info_11ac.nss[0] = nss; - phdr.phy_info.info_11ac.mcs[0] = mcs_index; - for (i = 1; i < 4; i++) - phdr.phy_info.info_11ac.nss[i] = 0; - } else { - /* - * XXX - where's the number of extension spatial streams? - * The code in wiretap/vwr.c doesn't seem to provide it. - */ - phdr.phy = PHDR_802_11_PHY_11N; - phdr.phy_info.info_11n.has_mcs_index = TRUE; - phdr.phy_info.info_11n.mcs_index = mcs_index; - - phdr.phy_info.info_11n.has_short_gi = TRUE; - phdr.phy_info.info_11n.short_gi = ((vw_rflags & FLAGS_CHAN_SHORTGI) != 0); + offset += 2; + + /* Need to add in 2 more bytes to the offset to account for the channel flags */ + vw_chanflags = tvb_get_letohs(tvb, offset); + offset += 2; + phyRate = (float)tvb_get_letohs(tvb, offset) / 10; + offset += 2; + plcp_type = tvb_get_guint8(tvb,offset) & 0x03; + vht_ndp_flag = tvb_get_guint8(tvb,offset) & 0x80; + offset++; + + vw_flags = tvb_get_letohs(tvb, 16); /**extract the transmit/rcvd direction flag**/ + + mcs_index = tvb_get_guint8(tvb, offset); + offset++; + nss = tvb_get_guint8(tvb, offset); + offset++; + + if ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT)) { + if (vw_rflags & FLAGS_CHAN_VHT) { + phdr.phy = PHDR_802_11_PHY_11AC; + phdr.phy_info.info_11ac.has_short_gi = TRUE; + phdr.phy_info.info_11ac.short_gi = ((vw_rflags & FLAGS_CHAN_SHORTGI) != 0); + /* + * XXX - this probably has only one user, so only one MCS index + * and only one NSS. + */ + phdr.phy_info.info_11ac.nss[0] = nss; + phdr.phy_info.info_11ac.mcs[0] = mcs_index; + for (i = 1; i < 4; i++) + phdr.phy_info.info_11ac.nss[i] = 0; + } else { + /* + * XXX - where's the number of extension spatial streams? + * The code in wiretap/vwr.c doesn't seem to provide it. + */ + phdr.phy = PHDR_802_11_PHY_11N; + phdr.phy_info.info_11n.has_mcs_index = TRUE; + phdr.phy_info.info_11n.mcs_index = mcs_index; + + phdr.phy_info.info_11n.has_short_gi = TRUE; + phdr.phy_info.info_11n.short_gi = ((vw_rflags & FLAGS_CHAN_SHORTGI) != 0); + + phdr.phy_info.info_11n.has_greenfield = TRUE; + phdr.phy_info.info_11n.greenfield = (plcp_type == PLCP_TYPE_GREENFIELD); + } - phdr.phy_info.info_11n.has_greenfield = TRUE; - phdr.phy_info.info_11n.greenfield = (plcp_type == PLCP_TYPE_GREENFIELD); - } - if (tap_tree) { proto_tree_add_item(tap_tree, hf_radiotap_mcsindex, tvb, offset - 2, 1, ENC_BIG_ENDIAN); @@ -785,157 +1701,124 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree tvb, offset - 1, 1, ENC_BIG_ENDIAN); proto_tree_add_uint_format_value(tap_tree, hf_radiotap_datarate, - tvb, offset - 5, 2, tvb_get_letohs(tvb, offset-5), - "%.1f (MCS %d)", phyRate, mcs_index); + tvb, offset - 5, 2, tvb_get_letohs(tvb, offset-5), + "%.1f (MCS %d)", phyRate, mcs_index); + } else { + /* + * XXX - CHAN_OFDM could be 11a or 11g. Unfortunately, we don't + * have the frequency, or anything else, to distinguish between + * them. + */ + if (vw_chanflags & CHAN_CCK) { + phdr.phy = PHDR_802_11_PHY_11B; + } + phdr.has_data_rate = TRUE; + phdr.data_rate = tvb_get_letohs(tvb, offset-5) / 5; + + proto_tree_add_uint_format_value(tap_tree, hf_radiotap_datarate, + tvb, offset - 5, 2, tvb_get_letohs(tvb, offset-5), + "%.1f Mb/s", phyRate); } - } else { - /* - * XXX - CHAN_OFDM could be 11a or 11g. Unfortunately, we don't - * have the frequency, or anything else, to distinguish between - * them. - */ - if (vw_chanflags & CHAN_CCK) { - phdr.phy = PHDR_802_11_PHY_11B; + col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f", phyRate); + + dbm = (gint8) tvb_get_guint8(tvb, offset); + phdr.has_signal_dbm = TRUE; + phdr.signal_dbm = dbm; + col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm", dbm); + + proto_tree_add_item(tap_tree, hf_radiotap_dbm_anta, tvb, offset, 1, ENC_NA); + offset++; + + dbm = (gint8) tvb_get_guint8(tvb, offset); + if (dbm != 100) { + proto_tree_add_item(tap_tree, hf_radiotap_dbm_antb, tvb, offset, 1, ENC_NA); } - phdr.has_data_rate = TRUE; - phdr.data_rate = tvb_get_letohs(tvb, offset-5) / 5; - if (tap_tree) { - proto_tree_add_uint_format_value(tap_tree, hf_radiotap_datarate, - tvb, offset - 5, 2, tvb_get_letohs(tvb, offset-5), - "%.1f Mb/s", phyRate); + offset++; + dbm = (gint8) tvb_get_guint8(tvb, offset); + if (dbm != 100) { + proto_tree_add_item(tap_tree, hf_radiotap_dbm_antc, tvb, offset, 1, ENC_NA); } - } - col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f", phyRate); - - dbm = (gint8) tvb_get_guint8(tvb, offset); - phdr.has_signal_dbm = TRUE; - phdr.signal_dbm = dbm; - col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm", dbm); - if (tap_tree) { - proto_tree_add_int(tap_tree, - hf_radiotap_dbm_antsignal, - tvb, offset, 1, dbm); - } + offset++; + dbm = (gint8) tvb_get_guint8(tvb, offset); + if (dbm != 100) { + proto_tree_add_item(tap_tree, hf_radiotap_dbm_antd, tvb, offset, 1, ENC_NA); + } + offset+=2; - offset++; - dbm = (gint8) tvb_get_guint8(tvb, offset); - if (tap_tree && dbm != 100) { - proto_tree_add_int(tap_tree, - hf_radiotap_dbm_antb, - tvb, offset, 1, dbm); - } - offset++; - dbm = (gint8) tvb_get_guint8(tvb, offset); - if (tap_tree && dbm != 100) { - proto_tree_add_int(tap_tree, - hf_radiotap_dbm_antc, - tvb, offset, 1, dbm); - } - offset++; - dbm = (gint8) tvb_get_guint8(tvb, offset); - if (tap_tree && dbm != 100) { - proto_tree_add_int(tap_tree, - hf_radiotap_dbm_antd, - tvb, offset, 1, dbm); - } - offset+=2; - - vw_flags = tvb_get_letohs(tvb, offset); - - if (tap_tree) { - if ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT)) { - if (plcp_type == PLCP_TYPE_VHT_MIXED) { - if (!(vw_flags & VW_RADIOTAPF_TXF) && (vht_ndp_flag == 0x80)) { - /*** VHT-NDP rx frame and ndp_flag is set***/ - proto_tree_add_uint_format(tap_tree, hf_radiotap_plcptype, - tvb, offset-3, 1, plcp_type, - "VHT-NDP"); - } else { - /*** VHT-NDP transmitted frame ***/ - if (vw_msdu_length == 4) { /*** Transmit frame and msdu_length = 4***/ - proto_tree_add_uint_format(tap_tree, hf_radiotap_plcptype, - tvb, offset-3, 1, plcp_type, - "VHT-NDP"); + vw_flags = tvb_get_letohs(tvb, offset); + + if ((vw_rflags & FLAGS_CHAN_HT) || (vw_rflags & FLAGS_CHAN_VHT)) { + if (plcp_type == PLCP_TYPE_VHT_MIXED) { + if (!(vw_flags & VW_RADIOTAPF_TXF) && (vht_ndp_flag == 0x80)) { + /*** VHT-NDP rx frame and ndp_flag is set***/ + proto_tree_add_uint(tap_tree, hf_radiotap_plcptype, + tvb, offset-3, 1, plcp_type); + } else { + /*** VHT-NDP transmitted frame ***/ + if (vw_msdu_length == 4) { /*** Transmit frame and msdu_length = 4***/ + proto_tree_add_uint(tap_tree, hf_radiotap_plcptype, + tvb, offset-3, 1, plcp_type); + } + } } - } } - } - - proto_tree_add_uint(tap_tree, hf_radiotap_vwf_txf, - tvb, offset, 2, (vw_flags & VW_RADIOTAPF_TXF) != 0); - proto_tree_add_uint(tap_tree, hf_radiotap_vwf_fcserr, - tvb, offset, 2, (vw_flags & VW_RADIOTAPF_FCSERR) != 0); - proto_tree_add_uint(tap_tree, hf_radiotap_vwf_dcrerr, - tvb, offset, 2, (vw_flags & VW_RADIOTAPF_DCRERR) != 0); - proto_tree_add_uint(tap_tree, hf_radiotap_vwf_retrerr, - tvb, offset, 2, (vw_flags & VW_RADIOTAPF_RETRERR) != 0); - proto_tree_add_uint(tap_tree, hf_radiotap_vwf_enctype, - tvb, offset, 2, (vw_flags & VW_RADIOTAPF_ENCMSK) >> - VW_RADIOTAPF_ENCSHIFT); - } - offset += 2; + proto_tree_add_item(tap_tree, hf_radiotap_vwf_txf, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tap_tree, hf_radiotap_vwf_fcserr, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tap_tree, hf_radiotap_vwf_dcrerr, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tap_tree, hf_radiotap_vwf_retrerr, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(tap_tree, hf_radiotap_vwf_enctype, tvb, offset, 2, ENC_LITTLE_ENDIAN); - align_offset = ALIGN_OFFSET(offset, 2); - offset += align_offset; - - vw_ht_length = tvb_get_letohs(tvb, offset); - if ((tree) && (vw_ht_length != 0)) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vw_ht_length, - tvb, offset, 2, vw_ht_length, "HT length: %u (includes the sum of the pieces of the aggregate and their respective Start_Spacing + Delimiter + MPDU + Padding)", - vw_ht_length); - } - offset += 2; + offset += 2; - align_offset = ALIGN_OFFSET(offset, 2); - offset += align_offset; + align_offset = ALIGN_OFFSET(offset, 2); + offset += align_offset; - /* vw_info grabbed in the beginning of the dissector */ + vw_ht_length = tvb_get_letohs(tvb, offset); + if ((vw_ht_length != 0)) { + proto_tree_add_uint_format_value(tap_tree, hf_radiotap_vw_ht_length, + tvb, offset, 2, vw_ht_length, "%u (includes the sum of the pieces of the aggregate and their respective Start_Spacing + Delimiter + MPDU + Padding)", + vw_ht_length); + } + offset += 2; - if (tap_tree) { - vwift = proto_tree_add_uint(tap_tree, hf_radiotap_vw_info, - tvb, offset, 2, vw_info); - vw_infoFlags_tree = proto_item_add_subtree(vwift, ett_radiotap_info); + align_offset = ALIGN_OFFSET(offset, 2); + offset += align_offset; if (!(vw_flags & VW_RADIOTAPF_TXF)) { /* then it's an rx case */ /*FPGA_VER_vVW510021 version decodes */ + static const int * vw_info_rx_2_flags[] = { + &hf_radiotap_vw_info_rx_2_bit8, + &hf_radiotap_vw_info_rx_2_bit9, + &hf_radiotap_vw_info_rx_2_bit10, + &hf_radiotap_vw_info_rx_2_bit11, + &hf_radiotap_vw_info_rx_2_bit12, + &hf_radiotap_vw_info_rx_2_bit13, + &hf_radiotap_vw_info_rx_2_bit14, + &hf_radiotap_vw_info_rx_2_bit15, + NULL + }; + + proto_tree_add_bitmask(tap_tree, tvb, offset, hf_radiotap_vw_info, ett_radiotap_info, vw_info_rx_2_flags, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit8, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit9, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit10, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit11, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit12, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit13, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit14, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_rx_2_bit15, tvb, offset, 2, ENC_LITTLE_ENDIAN); } else { /* it's a tx case */ + static const int * vw_info_tx_2_flags[] = { + &hf_radiotap_vw_info_tx_2_bit10, + &hf_radiotap_vw_info_tx_2_bit11, + &hf_radiotap_vw_info_tx_2_bit12, + &hf_radiotap_vw_info_tx_2_bit13, + &hf_radiotap_vw_info_tx_2_bit14, + &hf_radiotap_vw_info_tx_2_bit15, + NULL + }; + /* FPGA_VER_vVW510021 and VW_FPGA_VER_vVW510006 tx info decodes same*/ - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_tx_bit10, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_tx_bit11, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_tx_bit12, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_tx_bit13, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_tx_bit14, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(vw_infoFlags_tree, - hf_radiotap_vw_info_tx_bit15, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_bitmask(tap_tree, tvb, offset, hf_radiotap_vw_info, ett_radiotap_info, vw_info_tx_2_flags, ENC_LITTLE_ENDIAN); } - } - offset += 2; + offset += 2; + + vw_errors = tvb_get_letohl(tvb, offset); - vw_errors = tvb_get_letohl(tvb, offset); - if (tap_tree) { vweft = proto_tree_add_uint(tap_tree, hf_radiotap_vw_errors, tvb, offset, 4, vw_errors); vw_errorFlags_tree = proto_item_add_subtree(vweft, ett_radiotap_errors); @@ -982,248 +1865,1122 @@ wlantap_dissect(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_tree hf_radiotap_vw_errors_tx_bit5, tvb, offset, 2, ENC_LITTLE_ENDIAN); } + offset += 4; + + /*** POPULATE THE AMSDU VHT MIXED MODE CONTAINER FORMAT ***/ + if ((vw_rflags & FLAGS_CHAN_VHT) && vw_ht_length != 0) + { + if (plcp_type == 0x03) //If the frame is VHT type + { + offset += 4; /*** 4 bytes of ERROR ***/ + + /*** Extract SU/MU MIMO flag from RX L1 Info ***/ + vht_user_pos = tvb_get_guint8(tvb, offset); + vht_mu_mimo_flg = (vht_user_pos & 0x08) >> 3; + + if (vht_mu_mimo_flg == 1) { + proto_tree_add_item(tap_tree, hf_radiotap_vht_mu_mimo_flg, tvb, offset, 1, ENC_NA); + + /*** extract user Position in case of mu-mimo ***/ + proto_tree_add_item(tap_tree, hf_radiotap_vht_user_pos, tvb, offset, 1, ENC_NA); + + } else { + proto_tree_add_item(tap_tree, hf_radiotap_vht_su_mimo_flg, tvb, offset, 1, ENC_NA); + } + offset += 1; /*** skip the RX L1 Info byte ****/ + + /* + * XXX - no, 3 bytes are for the L-SIG. + */ + offset += 3; /** 3 bytes are for HT length ***/ + + /* + * Beginning of VHT-SIG-A1, 24 bits. + * XXX - get STBC from the 0x08 bit of the first byte + * and BW from the 0x03 bits? + */ + /* vht_grp_id = tvb_get_letohs(tvb, offset); */ + vht_grp_id1 = tvb_get_guint8(tvb, offset); + vht_grp_id2 = tvb_get_guint8(tvb, offset+1); + vht_grp_id = ((vht_grp_id1 &0xF0) >> 4) + ((vht_grp_id2 &0x03) << 4); + phdr.phy_info.info_11ac.has_group_id = TRUE; + phdr.phy_info.info_11ac.group_id = vht_grp_id; + proto_tree_add_uint(tap_tree, hf_radiotap_vht_grp_id, tvb, offset, 2, vht_grp_id); + + if ((vht_grp_id == 0) || (vht_grp_id == 63)) /*** SU VHT type*/ + { + proto_tree_add_item(tap_tree, hf_radiotap_vht_su_nsts, tvb, offset+1, 1, ENC_NA); + + /* Skip to second byte of VHT-SIG-A1 */ + offset += 1; /*** to decode partial id ***/ + vht_su_partial_id1 = tvb_get_guint8(tvb,offset); + vht_su_partial_id2 = tvb_get_guint8(tvb,offset+1); + vht_su_partial_id = ((vht_su_partial_id1 &0xE0) >> 5) + ((vht_su_partial_id2 &0x3f) << 3); + phdr.phy_info.info_11ac.has_partial_aid = TRUE; + phdr.phy_info.info_11ac.partial_aid = vht_su_partial_id; + proto_tree_add_item(tap_tree, hf_radiotap_vht_su_partial_aid, tvb, offset, 2, ENC_LITTLE_ENDIAN); + } + else { + /*** The below is MU VHT type**/ + proto_tree_add_item_ret_uint(tap_tree, hf_radiotap_vht_u0_nsts, tvb, offset, 2, ENC_LITTLE_ENDIAN, &vht_u0_nsts); + proto_tree_add_item_ret_uint(tap_tree, hf_radiotap_vht_u1_nsts, tvb, offset, 2, ENC_LITTLE_ENDIAN, &vht_u1_nsts); + proto_tree_add_item_ret_uint(tap_tree, hf_radiotap_vht_u2_nsts, tvb, offset, 2, ENC_LITTLE_ENDIAN, &vht_u2_nsts); + proto_tree_add_item_ret_uint(tap_tree, hf_radiotap_vht_u3_nsts, tvb, offset, 2, ENC_LITTLE_ENDIAN, &vht_u3_nsts); + } + + /* + * Skip past the other 2 bytes of VHT-SIG-A1. + * + * XXX - extract TXOP_PS_NOT_ALLOWED from the third byte of + * the VHT-SIG-A1 structure? + */ + offset += 2; + + /* + * Beginning of VHT-SIG-A2, 24 bits. + * + * XXX - extract Short GI NSYM Disambiguation from the first + * byte? + */ + + /*** extract LDPC or BCC coding *****/ + vht_coding_type = tvb_get_guint8(tvb, offset); + vht_u0_coding_type = ((vht_coding_type & 0x04) >> 2); + /*vht_su_coding_type = vht_u0_coding_type; */ + if ((vht_grp_id == 0) || (vht_grp_id == 63)) /*** SU VHT type*/ + { + if (vht_u0_coding_type == 0) { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, + tvb, offset, 1, vht_u0_coding_type, "VHT BCC Coding : %u ",vht_u0_coding_type); + } + else { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, + tvb, offset, 1, vht_u0_coding_type, "VHT LDPC Coding : %u ",vht_u0_coding_type); + } + /*** extract SU-MIMO VHT MCS ******/ + /***** + vht_su_mcs = tvb_get_guint8(tvb, offset); + vht_su_mcs = ((vht_su_mcs & 0xF0) >> 4); + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_su_mcs, + tvb, offset, 1, vht_su_mcs, "VHT SU MCS : %u ",vht_su_mcs); + *******/ + } else { + /*** it is MU MIMO type BCC coding ****/ + /*** extract U0 Coding ***/ + if (vht_u0_nsts) { + if (vht_u0_coding_type == 0) { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, + tvb, offset, 1, vht_u0_coding_type, "VHT U0 BCC Coding : %u ",vht_u0_coding_type); + } else { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, + tvb, offset, 1, vht_u0_coding_type, "VHT U0 LDPC Coding : %u ",vht_u0_coding_type); + } + } else { + /*** reserved **/ + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, + tvb, offset, 1, vht_u0_coding_type, "VHT U0 Reserved Coding : %u ",vht_u0_coding_type); + } + /*** extract U1 Coding type***/ + vht_u1_coding_type = ((vht_coding_type & 0x10) >> 4); + if (vht_u1_nsts) { + if (vht_u1_coding_type == 0) { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u1_coding_type, + tvb, offset, 1, vht_u1_coding_type, "VHT U1 BCC Coding : %u ",vht_u1_coding_type); + } else { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u1_coding_type, + tvb, offset, 1, vht_u1_coding_type, "VHT U1 LDPC Coding : %u ",vht_u1_coding_type); + } + } else { + /*** Reserved **/ + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u1_coding_type, + tvb, offset, 1, vht_u1_coding_type, "VHT U1 Reserved Coding : %u ",vht_u1_coding_type); + } + + /*** extract U2 Coding type***/ + vht_u2_coding_type = ((vht_coding_type & 0x20) >> 5); + if (vht_u2_nsts) { + if (vht_u2_coding_type == 0) { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u2_coding_type, + tvb, offset, 1, vht_u2_coding_type, "VHT U2 BCC Coding : %u ",vht_u2_coding_type); + } else { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u2_coding_type, + tvb, offset, 1, vht_u2_coding_type, "VHT U2 LDPC Coding : %u ",vht_u2_coding_type); + } + } else { + /**** Reserved *******/ + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u2_coding_type, + tvb, offset, 1, vht_u2_coding_type, "VHT U2 Reserved Coding : %u ",vht_u2_coding_type); + } + + /*** extract U3 Coding type***/ + if (vht_u3_nsts == 1) { + //guint vht_u3_coding_type; + + vht_u3_coding_type = ((vht_coding_type & 0x40) >> 6); + if (vht_u3_coding_type == 0) { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u3_coding_type, + tvb, offset, 1, vht_u3_coding_type, "VHT U3 BCC Coding : %u ",vht_u3_coding_type); + } else { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u3_coding_type, + tvb, offset, 1, vht_u3_coding_type, "VHT U3 LDPC Coding : %u ",vht_u3_coding_type); + } + } + } + + /*** decode Beamformed bit ****/ + offset += 1; + vht_beamformed = tvb_get_guint8(tvb, offset) & 0x01; + phdr.phy_info.info_11ac.has_beamformed = TRUE; + phdr.phy_info.info_11ac.beamformed = vht_beamformed; + proto_tree_add_item(tap_tree, hf_radiotap_vht_beamformed, tvb, offset, 1, ENC_NA); + } + } } - offset += 4; + else { + //RadioTapHeader New format for L1Info + offset = 0; - /* - * XXX - this appears to be the NDP flag for received frames and 0 - * for transmitted frames. The PLCP header follows it. - */ + length = tvb_get_letohs(tvb, offset); + offset += 2; + + if (tvb_get_guint8(tvb, offset+1) & 0x01) + vwl1t = proto_tree_add_item(tap_tree, hf_radiotap_tx, tvb, offset, 12, ENC_NA); + else + vwl1t = proto_tree_add_item(tap_tree, hf_radiotap_rx, tvb, offset, 12, ENC_NA); + vw_l1info_tree = proto_item_add_subtree(vwl1t, ett_radiotap_layer1); - /*** POPULATE THE AMSDU VHT MIXED MODE CONTAINER FORMAT ***/ - if ((vw_rflags & FLAGS_CHAN_VHT) && vw_ht_length != 0) { - /*** Extract SU/MU MIMO flag from RX L1 Info ***/ - vht_user_pos = tvb_get_guint8(tvb, offset); - vht_mu_mimo_flg = (vht_user_pos & 0x08) >> 3; + preamble = (tvb_get_guint8(tvb, offset) & 0x40) >> 6; + plcp_type = tvb_get_guint8(tvb, offset+4) & 0x0f; + if (plcp_type == 3) + mcs_index = tvb_get_guint8(tvb, offset) & 0x0f; + else + mcs_index = tvb_get_guint8(tvb, offset) & 0x3f; - if (vht_mu_mimo_flg == 1) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_mu_mimo_flg, - tvb, offset, 1, vht_mu_mimo_flg, "VHT MU MIMO: %u ",vht_mu_mimo_flg); + proto_tree_add_uint(vw_l1info_tree, hf_radiotap_preamble, + tvb, offset, 1, preamble); + proto_tree_add_uint(vw_l1info_tree, hf_radiotap_mcsindex, + tvb, offset, 1, mcs_index); + offset++; - /*** extract user Position in case of mu-mimo ***/ - vht_user_pos = (vht_user_pos & 0x03); - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_user_pos, - tvb, offset, 1, vht_user_pos, "VHT User Pos: %u ",vht_user_pos); + nss = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; + direction = tvb_get_guint8(tvb, offset) & 0x01; - } else { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_mu_mimo_flg, - tvb, offset, 1, vht_mu_mimo_flg, "VHT SU MIMO: %u ",vht_mu_mimo_flg); + if (plcp_type) + proto_tree_add_uint(vw_l1info_tree, hf_radiotap_nss, tvb, offset, 1, nss); + + proto_tree_add_uint(vw_l1info_tree, hf_radiotap_vwf_txf, tvb, offset, 1, direction); + offset++; + + /* New pieces of lines for + * #802.11 radio information# + * Referred from code changes done for old FPGA version + * **/ + phdr.fcs_len = 0; + switch (plcp_type) //To check 5 types of PLCP(NULL, CCK, OFDM, HT & VHT) + { + case 0: + /* + * XXX - CHAN_OFDM could be 11a or 11g. Unfortunately, we don't + * have the frequency, or anything else, to distinguish between + * them. + */ + if (mcs_index < 4) + { + phdr.phy = PHDR_802_11_PHY_11B; + } + phdr.has_data_rate = TRUE; + phdr.data_rate = tvb_get_letohs(tvb, offset) / 5; + break; + + case 1: + case 2: /* PLCP_TYPE =2 Greenfeild (Not supported)*/ + /* + * XXX - where's the number of extension spatial streams? + * The code in wiretap/vwr.c doesn't seem to provide it. + */ + phdr.phy = PHDR_802_11_PHY_11N; + phdr.phy_info.info_11n.has_mcs_index = TRUE; + phdr.phy_info.info_11n.mcs_index = mcs_index; + phdr.phy_info.info_11n.has_short_gi = TRUE; + phdr.phy_info.info_11n.short_gi = preamble; + phdr.phy_info.info_11n.has_greenfield = TRUE; + phdr.phy_info.info_11n.greenfield = (plcp_type == PLCP_TYPE_GREENFIELD); + break; + + case 3: + phdr.phy = PHDR_802_11_PHY_11AC; + phdr.phy_info.info_11ac.has_short_gi = TRUE; + phdr.phy_info.info_11ac.short_gi = preamble; + /* + * XXX - this probably has only one user, so only one MCS index + * and only one NSS. + */ + phdr.phy_info.info_11ac.nss[0] = nss; + phdr.phy_info.info_11ac.mcs[0] = mcs_index; + for (i = 1; i < 4; i++) + phdr.phy_info.info_11ac.nss[i] = 0; + break; } - offset += 1; /*** skip the RX L1 Info byte ****/ - /* - * XXX - no, 3 bytes are for the L-SIG. - */ - offset += 3; /** 3 bytes are for HT length ***/ + phyRate = (float)tvb_get_letohs(tvb, offset) / 10; + proto_tree_add_uint_format_value(vw_l1info_tree, hf_radiotap_datarate, + tvb, offset, 2, tvb_get_letohs(tvb, offset), + "%.1f Mb/s", phyRate); + offset = offset + 2; + col_add_fstr(pinfo->cinfo, COL_TX_RATE, "%.1f", phyRate); + + sigbw = (tvb_get_guint8(tvb, offset) & 0xf0) >> 4; + plcp_type = tvb_get_guint8(tvb, offset) & 0x0f; + proto_tree_add_uint(vw_l1info_tree, + hf_radiotap_sigbandwidth, tvb, offset, 1, sigbw); + + if (plcp_type) + proto_tree_add_uint(vw_l1info_tree, + hf_radiotap_modulation, tvb, offset, 1, plcp_type); + else + { + if (mcs_index < 4) + proto_tree_add_uint_format_value(vw_l1info_tree, hf_radiotap_modulation, + tvb, offset, 1, plcp_type, "CCK (%u)", plcp_type); + else + proto_tree_add_uint_format_value(vw_l1info_tree, hf_radiotap_modulation, + tvb, offset, 1, plcp_type, "OFDM (%u)", plcp_type); + } + offset++; - /* - * Beginning of VHT-SIG-A1, 24 bits. - * XXX - get STBC from the 0x08 bit of the first byte - * and BW from the 0x03 bits? - */ - /* vht_grp_id = tvb_get_letohs(tvb, offset); */ - vht_grp_id1 = tvb_get_guint8(tvb, offset); - vht_grp_id2 = tvb_get_guint8(tvb, offset+1); - vht_grp_id = ((vht_grp_id1 &0xF0) >> 4) + ((vht_grp_id2 &0x03) << 4); - phdr.phy_info.info_11ac.has_group_id = TRUE; - phdr.phy_info.info_11ac.group_id = vht_grp_id; - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_grp_id, - tvb, offset, 2, vht_grp_id, "VHT Group Id: %u ",vht_grp_id); - - if ((vht_grp_id == 0) || (vht_grp_id == 63)) /*** SU VHT type*/ + dbm = (gint8) tvb_get_guint8(tvb, offset); + + phdr.has_signal_dbm = TRUE; + phdr.signal_dbm = dbm; + + col_add_fstr(pinfo->cinfo, COL_RSSI, "%d dBm", dbm); + + if (cmd_type != 1) + proto_tree_add_item(vwl1t, hf_radiotap_dbm_anta, + tvb, offset, 1, ENC_NA); + else + proto_tree_add_item(vwl1t, hf_radiotap_dbm_tx_anta, + tvb, offset, 1, ENC_NA); + offset++; + + dbm = (gint8) tvb_get_guint8(tvb, offset); + if (dbm != 100) { + if (cmd_type != 1) + proto_tree_add_item(vwl1t, hf_radiotap_dbm_antb, + tvb, offset, 1, ENC_NA); + else + proto_tree_add_item(vwl1t, + hf_radiotap_dbm_tx_antb, + tvb, offset, 1, ENC_NA); + } + offset++; + + dbm = (gint8) tvb_get_guint8(tvb, offset); + if (dbm != 100) { + if (cmd_type != 1) + proto_tree_add_item(vwl1t, hf_radiotap_dbm_antc, + tvb, offset, 1, ENC_NA); + else + proto_tree_add_item(vwl1t, hf_radiotap_dbm_tx_antc, + tvb, offset, 1, ENC_NA); + } + offset++; + + dbm = (gint8) tvb_get_guint8(tvb, offset); + if (dbm != 100) { + if (cmd_type != 1) + proto_tree_add_item(vwl1t, hf_radiotap_dbm_antd, + tvb, offset, 1, ENC_NA); + else + proto_tree_add_item(vwl1t, + hf_radiotap_dbm_tx_antd, + tvb, offset, 1, ENC_NA); + } + offset++; + + proto_tree_add_item(vw_l1info_tree, hf_radiotap_sigbandwidthmask, tvb, offset, 1, ENC_NA); + offset++; + + if (cmd_type != 1) { - vht_su_nsts = tvb_get_guint8(tvb, offset+1); - vht_su_nsts = ((vht_su_nsts & 0x1c) >> 2); - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_su_nsts, - tvb, offset, 2, vht_su_nsts, "VHT NSTS: %u ",vht_su_nsts); - - offset += 1; /* Skip to second byte of VHT-SIG-A1 */ - vht_su_partial_id1 = tvb_get_guint8(tvb,offset); - vht_su_partial_id2 = tvb_get_guint8(tvb,offset+1); - vht_su_partial_id = ((vht_su_partial_id1 &0xE0) >> 5) + ((vht_su_partial_id2 &0x3f) << 3); - phdr.phy_info.info_11ac.has_partial_aid = TRUE; - phdr.phy_info.info_11ac.partial_aid = vht_su_partial_id; - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_su_partial_aid, - tvb, offset, 2, vht_su_partial_id, "VHT PARTIAL AID: %u ",vht_su_partial_id); + proto_tree_add_item(vw_l1info_tree, hf_radiotap_antennaportenergydetect, tvb, offset, 1, ENC_NA); } - else { - /*** The below is MU VHT type**/ - vht_u0_nsts = tvb_get_guint8(tvb, offset+1); - vht_u0_nsts = ((vht_u0_nsts & 0x1c) >> 2); - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_nsts, - tvb, offset, 2, vht_u0_nsts, "VHT U0 NSTS: %u ",vht_u0_nsts); - - vht_u1_nsts = tvb_get_guint8(tvb, offset+1); - vht_u1_nsts = ((vht_u1_nsts & 0xe0) >> 5); - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u1_nsts, - tvb, offset, 2, vht_u1_nsts, "VHT U1 NSTS: %u ",vht_u1_nsts); - - offset += 1; /* Skip to second byte of VHT-SIG-A1 */ - vht_u2_nsts = tvb_get_guint8(tvb, offset+1); - vht_u2_nsts = (vht_u2_nsts & 0x07); - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u2_nsts, - tvb, offset, 2, vht_u2_nsts, "VHT U2 NSTS: %u ",vht_u2_nsts); - - vht_u3_nsts = tvb_get_guint8(tvb, offset+1); - vht_u3_nsts = ((vht_u3_nsts & 0x38) >> 3); - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u3_nsts, - tvb, offset, 2, vht_u3_nsts, "VHT U3 NSTS: %u ",vht_u3_nsts); + else + { + proto_tree_add_item(vw_l1info_tree, hf_radiotap_tx_antennaselect, tvb, offset, 1, ENC_NA); + proto_tree_add_item(vw_l1info_tree, hf_radiotap_tx_stbcselect, tvb, offset, 1, ENC_NA); + } + if (plcp_type == 3) + { + proto_tree_add_item(vw_l1info_tree, hf_radiotap_mumask, tvb, offset, 1, ENC_NA); } + offset++; - /* - * Skip past the other 2 bytes of VHT-SIG-A1. - * - * XXX - extract TXOP_PS_NOT_ALLOWED from the third byte of - * the VHT-SIG-A1 structure? - */ - offset += 2; + if (plcp_type == 3) + { + // Extract SU/MU MIMO flag from RX L1 Info + vht_user_pos = tvb_get_guint8(tvb, offset); - /* - * Beginning of VHT-SIG-A2, 24 bits. - * - * XXX - extract Short GI NSYM Disambiguation from the first - * byte? - */ - /*** extract LDPC or BCC coding *****/ - vht_coding_type = tvb_get_guint8(tvb, offset); - vht_u0_coding_type = ((vht_coding_type & 0x04) >> 2); - if ((vht_grp_id == 0) || (vht_grp_id == 63)) /*** SU VHT type*/ + vwict = proto_tree_add_item(vw_l1info_tree, + hf_radiotap_l1infoc, tvb, offset, 1, vht_user_pos); + vw_infoC_tree = proto_item_add_subtree(vwict, ett_radiotap_infoc); + + vht_ndp_flag = (vht_user_pos & 0x80) >> 7; + vht_mu_mimo_flg = (vht_user_pos & 0x08) >> 3; + proto_tree_add_item(vw_infoC_tree, hf_radiotap_vht_ndp_flg, tvb, offset, 1, ENC_NA); + if (vht_ndp_flag == 0) + { + if (vht_mu_mimo_flg == 1) { + proto_tree_add_uint(vw_infoC_tree, hf_radiotap_vht_mu_mimo_flg, + tvb, offset, 1, vht_mu_mimo_flg); + + // extract user Postiion in case of mu-mimo + proto_tree_add_item(vw_infoC_tree, hf_radiotap_vht_user_pos, tvb, offset, 1, ENC_NA); + + } else { + proto_tree_add_item(vw_infoC_tree, hf_radiotap_vht_su_mimo_flg, tvb, offset, 1, ENC_NA); + } + } + } + offset++; + + mpdu_length = tvb_get_letohs(tvb, offset); + if (cmd_type != 1) //Checking for Rx and Tx { - if (vht_u0_coding_type == 0) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, - tvb, offset, 1, vht_u0_coding_type, "VHT BCC Coding : %u ",vht_u0_coding_type); + proto_tree_add_item(vw_l1info_tree, hf_ixveriwave_frame_length, tvb, offset, 2, mpdu_length); + } + offset += 2; + + //RadioTapHeader New format for PLCP section + vw_plcp_info = tvb_get_guint8(tvb, offset); + + vwplt = proto_tree_add_item(tap_tree, hf_radiotap_plcp_info, tvb, offset, 16, vw_plcp_info); + vw_plcpinfo_tree = proto_item_add_subtree(vwplt, ett_radiotap_plcp); + + switch (plcp_type) //To check 5 types of PLCP(NULL, CCK, OFDM, HT & VHT) + { + case 0: + if (mcs_index < 4) + { + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_type, + tvb, offset-10, 1, plcp_type, "Format: Legacy CCK "); + signal = tvb_get_guint8(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_plcp_signal, + tvb, offset, 1, signal); + offset = offset + 1; + plcp_service = tvb_get_guint8(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_plcp_service, + tvb, offset, 1, plcp_service); + offset = offset + 1; + vht_plcp_length = tvb_get_letohs(tvb, offset); + // proto_tree_add_item(vw_plcpinfo_tree, + // hf_radiotap_vht_length, tvb, offset, 2, vht_length); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_length, + tvb, offset, 2, vht_plcp_length, "PLCP Length: %u ",vht_plcp_length); + offset += 2; + crc16 = tvb_get_letohs(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_crc16, + tvb, offset, 2, crc16, "CRC 16: %u ",crc16); + offset += 2; + offset = offset + 9; + rfid = tvb_get_guint8(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rfid, + tvb, offset, 1, rfid); + offset = offset + 1; } - else { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, - tvb, offset, 1, vht_u0_coding_type, "VHT LDPC Coding : %u ",vht_u0_coding_type); + else + { + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_type, "Format: Legacy OFDM "); + vht_plcp_length1 = tvb_get_guint8(tvb, offset); + vht_plcp_length2 = tvb_get_guint8(tvb, offset+1); + vht_plcp_length3 = tvb_get_guint8(tvb, offset+2); + vht_plcp_length1 = ((vht_plcp_length1 & 0xe0) >> 5); + vht_plcp_length3 = ((vht_plcp_length3) & 0x01); + vht_plcp_length = (vht_plcp_length1 + (vht_plcp_length2 << 3) + (vht_plcp_length3 << 11)); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_plcp_length, + tvb, offset, 3, vht_plcp_length); + vht_rate = (tvb_get_guint8(tvb, offset) &0x0f); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rate, + tvb, offset, 1, vht_rate); + vht_parity = (tvb_get_guint8(tvb, offset+2) &0x02)>>1; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_parity, + tvb, offset+2, 1, vht_parity); + offset = offset + 3; + plcp_service_ofdm = tvb_get_letohs(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_plcp_service, + tvb, offset, 2, plcp_service_ofdm); + + offset = offset + 2; + offset = offset + 10; + rfid = tvb_get_guint8(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rfid, + tvb, offset, 1, rfid); + offset = offset + 1; + } - /*** extract SU-MIMO VHT MCS ******/ - /***** - vht_su_mcs = tvb_get_guint8(tvb, offset); - vht_su_mcs = ((vht_su_mcs & 0xF0) >> 4); - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_su_mcs, - tvb, offset, 1, vht_su_mcs, "VHT SU MCS : %u ",vht_su_mcs); - *******/ - } else { - /*** it is MU MIMO type BCC coding ****/ - /*** extract U0 Coding ***/ - if (vht_u0_nsts) { - if (vht_u0_coding_type == 0) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, - tvb, offset, 1, vht_u0_coding_type, "VHT U0 BCC Coding : %u ",vht_u0_coding_type); - } else { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, - tvb, offset, 1, vht_u0_coding_type, "VHT U0 LDPC Coding : %u ",vht_u0_coding_type); - } - } else { - /*** reserved **/ - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u0_coding_type, - tvb, offset, 1, vht_u0_coding_type, "VHT U0 Reserved Coding : %u ",vht_u0_coding_type); + break; + + case 1: + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_type, "Format: HT "); + vht_plcp_length1 = tvb_get_guint8(tvb, offset); + vht_plcp_length2 = tvb_get_guint8(tvb, offset+1); + vht_plcp_length3 = tvb_get_guint8(tvb, offset+2); + vht_plcp_length1 = ((vht_plcp_length1 & 0xe0) >> 5); + vht_plcp_length3 = ((vht_plcp_length3) & 0x01); + vht_plcp_length = (vht_plcp_length1 + (vht_plcp_length2 << 3) + (vht_plcp_length3 << 11)); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_plcp_length, + tvb, offset, 3, vht_plcp_length); + vht_rate = (tvb_get_guint8(tvb, offset) &0x0f); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rate, + tvb, offset, 1, vht_rate); + vht_parity = (tvb_get_guint8(tvb, offset+2) &0x02)>>1; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_parity, + tvb, offset+2, 1, vht_parity); + offset = offset + 3; + + vht_bw = tvb_get_guint8(tvb, offset) &0x80 >>7; + //proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_bw, + // tvb, offset, 1, vht_bw); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_bw, + tvb, offset, 1, vht_bw, "CBW 20/40: %u ",vht_bw); + vht_mcs = (tvb_get_guint8(tvb, offset)&0x7f); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_mcs, + tvb, offset, 1, vht_mcs); + offset = offset + 1; + vht_length = tvb_get_letohs(tvb, offset); + //proto_tree_add_item(vw_plcpinfo_tree, + // hf_radiotap_vht_length, tvb, offset, 2, vht_length); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_length, + tvb, offset, 2, vht_length, "HT Length: %u ", vht_length); + offset += 2; + vht_shortgi = (tvb_get_guint8(tvb, offset) &0x80) >> 7; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_shortgi, + tvb, offset, 1, vht_shortgi); + feccoding = (tvb_get_guint8(tvb, offset) &0x40) >> 6; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_feccoding, + tvb, offset, 1, feccoding); + vht_stbc = (tvb_get_guint8(tvb, offset) &0x30) >> 4; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_stbc, + tvb, offset, 1, vht_stbc); + aggregation = (tvb_get_guint8(tvb, offset) &0x08) >> 3; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_aggregation, + tvb, offset, 1, aggregation); + notsounding = (tvb_get_guint8(tvb, offset) &0x02) >> 1; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_notsounding, + tvb, offset, 1, notsounding); + smoothing = (tvb_get_guint8(tvb, offset) &0x01); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_smoothing, + tvb, offset, 1, smoothing); + offset = offset + 1; + + vht_crc1 = tvb_get_guint8(tvb, offset); + vht_crc2 = tvb_get_guint8(tvb, offset+1); + vht_crc = ((vht_crc1 &0xFC) >> 2) + ((vht_crc2 &0x03) << 2); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_crc, + tvb, offset, 2, vht_crc); + ness = (tvb_get_guint8(tvb, offset) &0x03); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_ness, + tvb, offset, 1, ness); + offset = offset + 1; + vht_tail = (tvb_get_guint8(tvb, offset) &0xFC) >> 2; + //proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_tail, + // tvb, offset, 1, vht_tail); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_tail, + tvb, offset, 1, vht_tail, "Signal Tail: %u ", vht_tail); + offset = offset + 1; + plcp_service_ofdm = tvb_get_letohs(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_plcp_service, + tvb, offset, 2, plcp_service_ofdm); + + offset = offset + 2; + offset = offset + 4; + rfid = tvb_get_guint8(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rfid, + tvb, offset, 1, rfid); + offset = offset + 1; + break; + + case 2: + //PLCP_TYPE =2 Greenfeild (Not supported) + break; + + case 3: + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_type, "Format: VHT "); + vht_plcp_length1 = tvb_get_guint8(tvb, offset); + vht_plcp_length2 = tvb_get_guint8(tvb, offset+1); + vht_plcp_length3 = tvb_get_guint8(tvb, offset+2); + vht_plcp_length1 = ((vht_plcp_length1 & 0xe0) >> 5); + vht_plcp_length3 = ((vht_plcp_length3) & 0x01); + vht_plcp_length = (vht_plcp_length1 + (vht_plcp_length2 << 3) + (vht_plcp_length3 << 11)); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_plcp_length, + tvb, offset, 3, vht_plcp_length); + vht_rate = (tvb_get_guint8(tvb, offset) &0x0f); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rate, + tvb, offset, 1, vht_rate); + vht_parity = (tvb_get_guint8(tvb, offset+2) &0x02) >>1; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_parity, + tvb, offset+2, 1, vht_parity); + offset = offset + 3; // 3 bytes are for HT length + vht_bw = tvb_get_guint8(tvb, offset) &0x03; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_bw, + tvb, offset, 1, vht_bw); + vht_stbc = (tvb_get_guint8(tvb, offset) &0x08) >> 3; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_stbc, + tvb, offset, 1, vht_stbc); + // vht_grp_id = tvb_get_letohs(tvb, offset); + vht_grp_id1 = tvb_get_guint8(tvb, offset); + vht_grp_id2 = tvb_get_guint8(tvb, offset+1); + vht_grp_id = ((vht_grp_id1 &0xF0) >> 4) + ((vht_grp_id2 &0x03) << 4); + + phdr.phy_info.info_11ac.has_group_id = TRUE; + phdr.phy_info.info_11ac.group_id = vht_grp_id; + + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_grp_id, + tvb, offset, 2, vht_grp_id); + offset = offset + 1; + if ((vht_grp_id == 0) || (vht_grp_id == 63)) // SU VHT type + { + vht_su_nsts = tvb_get_guint8(tvb, offset); + vht_su_nsts = ((vht_su_nsts & 0x1c) >> 2); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_su_nsts, + tvb, offset, 2, vht_su_nsts); + + vht_su_partial_id1 = tvb_get_guint8(tvb,offset); + vht_su_partial_id2 = tvb_get_guint8(tvb,offset+1); + vht_su_partial_id = ((vht_su_partial_id1 &0xE0) >> 5) + ((vht_su_partial_id2 &0x3f) << 3); + + phdr.phy_info.info_11ac.has_partial_aid = TRUE; + phdr.phy_info.info_11ac.partial_aid = vht_su_partial_id; + + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_su_partial_aid, + tvb, offset, 2, vht_su_partial_id, "PARTIAL AID: %u ",vht_su_partial_id); + offset = offset + 1; } - /*** extract U1 Coding type***/ - vht_u1_coding_type = ((vht_coding_type & 0x10) >> 4); - if (vht_u1_nsts) { - if (vht_u1_coding_type == 0) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u1_coding_type, - tvb, offset, 1, vht_u1_coding_type, "VHT U1 BCC Coding : %u ",vht_u1_coding_type); - } else { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u1_coding_type, - tvb, offset, 1, vht_u1_coding_type, "VHT U1 LDPC Coding : %u ",vht_u1_coding_type); - } + else { + // The below is MU VHT type* + vht_u0_nsts = tvb_get_guint8(tvb, offset); + vht_u0_nsts = ((vht_u0_nsts & 0x1c) >> 2); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_u0_nsts, + tvb, offset, 2, vht_u0_nsts, "MU[0] NSTS: %u ",vht_u0_nsts); + + vht_u1_nsts = tvb_get_guint8(tvb, offset); + vht_u1_nsts = ((vht_u1_nsts & 0xe0) >> 5); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_u1_nsts, + tvb, offset, 2, vht_u1_nsts, "MU[1] NSTS: %u ",vht_u1_nsts); + + vht_u2_nsts = tvb_get_guint8(tvb, offset+1); + vht_u2_nsts = (vht_u2_nsts & 0x07); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_u2_nsts, + tvb, offset, 2, vht_u2_nsts, "MU[2] NSTS: %u ",vht_u2_nsts); + + vht_u3_nsts = tvb_get_guint8(tvb, offset+1); + vht_u3_nsts = ((vht_u3_nsts & 0x38) >> 3); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_u3_nsts, + tvb, offset, 2, vht_u3_nsts, "MU[3] NSTS: %u ",vht_u3_nsts); + offset = offset + 1; + } + // extract LDPC or BCC coding + vht_txop_ps_notallowd = (tvb_get_guint8(tvb, offset) &0x40) >> 6; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_txop_ps_notallowd, + tvb, offset, 1, vht_txop_ps_notallowd); + offset = offset + 1; + + vht_shortgi = tvb_get_guint8(tvb, offset) &0x01; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_shortgi, + tvb, offset, 1, vht_shortgi); + vht_shortginsymdisa = (tvb_get_guint8(tvb, offset) &0x02) >> 1; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_shortginsymdisa, + tvb, offset, 1, vht_shortginsymdisa); +/* + vht_coding_type = (tvb_get_guint8(tvb, offset)& 0x04) >> 2; + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_u0_coding_type, + tvb, offset, 1, vht_coding_type, "SU/MU[0] Coding : %u ",vht_coding_type); +*/ + vht_ldpc_ofdmsymbol = (tvb_get_guint8(tvb, offset) &0x08) >> 3; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_ldpc_ofdmsymbol, + tvb, offset, 1, vht_ldpc_ofdmsymbol); + vht_coding_type = tvb_get_guint8(tvb, offset); + + //vht_su_coding_type = vht_u0_coding_type; + if ((vht_grp_id == 0) || (vht_grp_id == 63)) // SU VHT type + { + vht_coding_type = (tvb_get_guint8(tvb, offset)& 0x04) >> 2; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_su_coding_type, + tvb, offset, 1, vht_coding_type); + vht_su_mcs = (tvb_get_guint8(tvb, offset) &0xf0) >> 4; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_su_mcs, + tvb, offset, 1, vht_su_mcs); + } else { - /*** Reserved **/ - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u1_coding_type, - tvb, offset, 1, vht_u1_coding_type, "VHT U1 Reserved Coding : %u ",vht_u1_coding_type); + // it is MU MIMO type BCC coding + // extract U0 Coding + vht_u0_coding_type = ((vht_coding_type & 0x04) >> 2); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_u0_coding_type, + tvb, offset, 1, vht_u0_coding_type); + + // extract U1 Coding type + vht_u1_coding_type = ((vht_coding_type & 0x10) >> 4); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_u1_coding_type, + tvb, offset, 1, vht_u1_coding_type); + + // extract U2 Coding type + vht_u2_coding_type = ((vht_coding_type & 0x20) >> 5); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_u2_coding_type, + tvb, offset, 1, vht_u2_coding_type); + + // extract U3 Coding type + // reserved + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_vht_u3_coding_type, + tvb, offset, 1, vht_u3_coding_type, "MU[3] Coding Type: Reserved (%u)",vht_reserved_coding_type); + } - /*** extract U2 Coding type***/ - vht_u2_coding_type = ((vht_coding_type & 0x20) >> 5); - if (vht_u2_nsts) { - if (vht_u2_coding_type == 0) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u2_coding_type, - tvb, offset, 1, vht_u2_coding_type, "VHT U2 BCC Coding : %u ",vht_u2_coding_type); - } else { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u2_coding_type, - tvb, offset, 1, vht_u2_coding_type, "VHT U2 LDPC Coding : %u ",vht_u2_coding_type); - } - }else { - /**** Reserved *******/ - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u2_coding_type, - tvb, offset, 1, vht_u2_coding_type, "VHT U2 Reserved Coding : %u ",vht_u2_coding_type); + // decode Beamformed bit + offset = offset + 1; + vht_beamformed = tvb_get_guint8(tvb, offset); + vht_beamformed = (vht_beamformed & 0x01); + + phdr.phy_info.info_11ac.has_beamformed = TRUE; + phdr.phy_info.info_11ac.beamformed = vht_beamformed; + + proto_tree_add_item(vw_plcpinfo_tree, hf_radiotap_vht_beamformed, tvb, offset, 1, ENC_NA); + vht_crc1 = tvb_get_guint8(tvb, offset); + vht_crc2 = tvb_get_guint8(tvb, offset+1); + vht_crc = ((vht_crc1 &0xFC) >> 2) + ((vht_crc2 &0x03) << 2); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_crc, + tvb, offset, 2, vht_crc); + offset = offset + 1; + vht_tail = (tvb_get_guint8(tvb, offset) &0xFC) >> 2; + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_tail, + tvb, offset, 1, vht_tail); + offset = offset + 1; + vht_length = tvb_get_letohs(tvb, offset); + proto_tree_add_item(vw_plcpinfo_tree, + hf_radiotap_vht_length, tvb, offset, 2, vht_length); + offset += 2; + vht_mcs1 = tvb_get_guint8(tvb, offset); + vht_mcs2 = tvb_get_guint8(tvb, offset+1); + vht_mcs = ((vht_mcs1 &0xC0) >> 6) + ((vht_mcs2 &0x03) << 2); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_vht_mcs, + tvb, offset, 2, vht_mcs); + offset = offset + 2; + + offset = offset + 2; + rfid = tvb_get_guint8(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rfid, + tvb, offset, 1, rfid); + offset = offset + 1; + break; + + default: + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_type, "Format: Null "); + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP0: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP1: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP2: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP3: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP4: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP5: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP6: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP7: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP8: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP9: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP10: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP11: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP12: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP13: %u ", plcp_default); + offset = offset + 1; + plcp_default = tvb_get_guint8(tvb, offset); + proto_tree_add_uint_format(vw_plcpinfo_tree, hf_radiotap_plcp_default, + tvb, offset, 1, plcp_default, "PLCP14: %u ", plcp_default); + offset = offset + 1; + rfid = tvb_get_guint8(tvb, offset); + proto_tree_add_uint(vw_plcpinfo_tree, hf_radiotap_rfid, + tvb, offset, 1, rfid); + offset = offset + 1; + } + + //RadioTapHeader New format for L2-L4_Info + vwl2l4t = proto_tree_add_item(tap_tree, hf_radiotap_l2_l4_info, + tvb, offset, 23, ENC_NA); + vw_l2l4info_tree = proto_item_add_subtree(vwl2l4t, ett_radiotap_layer2to4); + cidv = ((tvb_get_guint8(tvb, offset+3)& 0x20) >> 5); + bssidv = ((tvb_get_guint8(tvb, offset+3)& 0x40) >> 6); + if (cmd_type != 1) + { + vw_vcid = (tvb_get_letohs(tvb, offset)) &0x0fff; + if (cidv == 1) + { + proto_tree_add_uint(vw_l2l4info_tree, hf_ixveriwave_vw_vcid, tvb, offset, 2, vw_vcid); + } + else + { + proto_tree_add_uint_format_value(vw_l2l4info_tree, hf_ixveriwave_vw_vcid, + tvb, offset, 2, vw_vcid, "Invalid"); } - /*** extract U3 Coding type***/ - if (vht_u3_nsts == 1) { - guint vht_u3_coding_type; + offset++; + vw_bssid = ((tvb_get_letohs(tvb, offset)) &0x0ff0)>>4; + if (bssidv == 1) + { + proto_tree_add_uint(vw_l2l4info_tree, hf_radiotap_bssid, + tvb, offset, 2, vw_bssid); + } + else + { + proto_tree_add_uint_format_value(vw_l2l4info_tree, hf_radiotap_bssid, + tvb, offset, 2, vw_bssid, "Invalid"); + } + offset +=2; - vht_u3_coding_type = ((vht_coding_type & 0x40) >> 6); - if (vht_u3_coding_type == 0) { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u3_coding_type, - tvb, offset, 1, vht_u3_coding_type, "VHT U3 BCC Coding : %u ",vht_u3_coding_type); - } else { - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_u3_coding_type, - tvb, offset, 1, vht_u3_coding_type, "VHT U3 LDPC Coding : %u ",vht_u3_coding_type); - } + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_clientidvalid, tvb, offset, 1, ENC_NA); + bssidv = ((tvb_get_guint8(tvb, offset)& 0x40) >> 6); + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_bssidvalid, tvb, offset, 1, ENC_NA); + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_unicastormulticast, tvb, offset, 1, ENC_NA); + offset++; + } + else + { + if (cidv == 1) + { + proto_tree_add_item(vw_l2l4info_tree, hf_ixveriwave_vw_vcid, + tvb, offset, 2, ENC_LITTLE_ENDIAN); } + else + { + vw_vcid = tvb_get_letohs(tvb, offset); + proto_tree_add_uint_format_value(vw_l2l4info_tree, hf_ixveriwave_vw_vcid, + tvb, offset, 2, vw_vcid, "Invalid"); + } + offset +=3; + + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_clientidvalid, tvb, offset, 1, ENC_NA); + offset++; + } + /* + wlantype = tvb_get_guint8(tvb, offset)& 0x3f; + proto_tree_add_uint(vw_l2l4info_tree, hf_radiotap_wlantype, + tvb, offset, 1, wlantype); + */ + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_tid, tvb, offset, 2, ENC_LITTLE_ENDIAN); + offset++; + if (cmd_type == 1) + { + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_ac, tvb, offset, 1, ENC_NA); + } + l4idv = (tvb_get_guint8(tvb, offset)& 0x10) >> 4; + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_l4idvalid, tvb, offset, 1, ENC_NA); + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_containshtfield, tvb, offset, 1, ENC_NA); + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_istypeqos, tvb, offset, 1, ENC_NA); + flowv = (tvb_get_guint8(tvb, offset)& 0x80) >> 7; + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_flowvalid, tvb, offset, 1, ENC_NA); + offset++; + + vw_seqnum = tvb_get_guint8(tvb, offset); + proto_tree_add_item(vw_l2l4info_tree, hf_ixveriwave_vw_seqnum, + tvb, offset, 1, vw_seqnum); + offset++; + if (flowv == 1) + { + proto_tree_add_item(vw_l2l4info_tree, hf_ixveriwave_vw_flowid, + tvb, offset, 3, ENC_LITTLE_ENDIAN); + } + else + { + proto_tree_add_uint_format_value(vw_l2l4info_tree, hf_ixveriwave_vw_flowid, + tvb, offset, 2, tvb_get_letohl(tvb, offset) & 0xffffff, "Invalid"); + } + offset +=3; + if (l4idv == 1) + { + proto_tree_add_item(vw_l2l4info_tree, hf_ixveriwave_vw_l4id, + tvb, offset, 2, ENC_LITTLE_ENDIAN); + } + else + { + proto_tree_add_uint_format_value(vw_l2l4info_tree, hf_ixveriwave_vw_l4id, + tvb, offset, 2, tvb_get_letohs(tvb, offset), "Invalid"); + } + offset +=2; + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_payloaddecode, tvb, offset, 4, ENC_LITTLE_ENDIAN); + offset +=4; + + if (cmd_type != 1) { /* then it's an rx case */ + /*FPGA_VER_vVW510021 version decodes */ + proto_tree_add_bitmask(vw_l2l4info_tree, tvb, offset, hf_radiotap_vw_info_rx, ett_radiotap_info, radiotap_info_rx_fields, ENC_LITTLE_ENDIAN); + + } else { /* it's a tx case */ + /* FPGA_VER_vVW510021 and VW_FPGA_VER_vVW510006 tx info decodes same*/ + proto_tree_add_bitmask(vw_l2l4info_tree, tvb, offset, hf_radiotap_vw_info_tx, ett_radiotap_info, radiotap_info_tx_fields, ENC_LITTLE_ENDIAN); + } + + offset +=3; + vw_errors = tvb_get_letohl(tvb, offset); + + /* build the individual subtrees for the various types of error flags */ + /* NOTE: as the upper 16 bits aren't used at the moment, we pretend that */ + /* the error flags field is only 16 bits (instead of 32) to save space */ + if (cmd_type != 1) { + /* then it's an rx case */ + static const int * vw_errors_rx_flags[] = { + &hf_radiotap_vw_errors_rx_bit0, + &hf_radiotap_vw_errors_rx_bit1, + &hf_radiotap_vw_errors_rx_bit2, + &hf_radiotap_vw_errors_rx_bit3, + &hf_radiotap_vw_errors_rx_bit4, + &hf_radiotap_vw_errors_rx_bit5, + &hf_radiotap_vw_errors_rx_bit6, + &hf_radiotap_vw_errors_rx_bit7, + &hf_radiotap_vw_errors_rx_bit8, + &hf_radiotap_vw_errors_rx_bit9, + &hf_radiotap_vw_errors_rx_bit10, + &hf_radiotap_vw_errors_rx_bit11, + &hf_radiotap_vw_errors_rx_bit12, + &hf_radiotap_vw_errors_rx_bit14, + &hf_radiotap_vw_errors_rx_bit15, + &hf_radiotap_vw_errors_rx_bit16, + &hf_radiotap_vw_errors_rx_bit17, + &hf_radiotap_vw_errors_rx_bit18, + &hf_radiotap_vw_errors_rx_bit19, + &hf_radiotap_vw_errors_rx_bit20, + &hf_radiotap_vw_errors_rx_bit21, + &hf_radiotap_vw_errors_rx_bit22, + &hf_radiotap_vw_errors_rx_bit23, + &hf_radiotap_vw_errors_rx_bit24, + &hf_radiotap_vw_errors_rx_bit31, + NULL + }; + + proto_tree_add_bitmask(vw_l2l4info_tree, tvb, offset, hf_radiotap_vw_errors, ett_radiotap_errors, vw_errors_rx_flags, ENC_LITTLE_ENDIAN); + + } else { /* it's a tx case */ + static const int * vw_errors_tx_flags[] = { + &hf_radiotap_vw_errors_tx_bit01, + &hf_radiotap_vw_errors_tx_bit05, + &hf_radiotap_vw_errors_tx_bit8, + &hf_radiotap_vw_errors_tx_bit9, + &hf_radiotap_vw_errors_tx_bit10, + &hf_radiotap_vw_errors_tx_bit31, + NULL + }; + + /* FPGA_VER_vVW510021 and VW_FPGA_VER_vVW510006 tx error decodes same*/ + proto_tree_add_bitmask(vw_l2l4info_tree, tvb, offset, hf_radiotap_vw_errors, ett_radiotap_errors, vw_errors_tx_flags, ENC_LITTLE_ENDIAN); + + // proto_tree_add_item(vw_l2l4info_tree, hf_ixveriwave_vw_seqnum, + // tvb, offset, 1, vw_seqnum); + //offset++; + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_vw_tx_retrycount, tvb, offset+2, 1, ENC_NA); + proto_tree_add_item(vw_l2l4info_tree, hf_radiotap_vw_tx_factorydebug, tvb, offset+2, 2, ENC_LITTLE_ENDIAN); } + offset +=4; - /*** decode Beamformed bit ****/ - offset = offset + 1; - vht_beamformed = tvb_get_guint8(tvb, offset); - vht_beamformed = (vht_beamformed & 0x01); - phdr.phy_info.info_11ac.has_beamformed = TRUE; - phdr.phy_info.info_11ac.beamformed = vht_beamformed; - proto_tree_add_uint_format(tap_tree, hf_radiotap_vht_beamformed, - tvb, offset, 1, vht_beamformed, "VHT Beamformed: %u ",vht_beamformed); + if (vwl2l4t && log_mode) + proto_item_append_text(vwl2l4t, " (Reduced)"); } +/* + align_offset = ALIGN_OFFSET(offset, 2); + offset += align_offset; - /* - * Skip the 16 bytes of PLCP + 1 byte of L1InfoC(UserPos) inserted - * by the Veriwave reader code in libwiretap. - */ - length = length + 17; + vw_ht_length = tvb_get_letohs(tvb, offset); + if ((tree) && (vw_ht_length != 0)) + if (plcp_type == 3) + { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vw_ht_length, + tvb, offset, 2, vw_ht_length, "VHT length: %u (includes the sum of the pieces of the aggregate and their respective Start_Spacing + Delimiter + MPDU + Padding)", + vw_ht_length); + } + else + { + proto_tree_add_uint_format(tap_tree, hf_radiotap_vw_ht_length, + tvb, offset, 2, vw_ht_length, "HT length: %u (includes the sum of the pieces of the aggregate and their respective Start_Spacing + Delimiter + MPDU + Padding)", + vw_ht_length); + } + offset +=2; - /* Grab the rest of the frame. */ - next_tvb = tvb_new_subset_remaining(tvb, length); + align_offset = ALIGN_OFFSET(offset, 2); + offset += align_offset;*/ + + /* vw_info grabbed in the beginning of the dissector */ + + + /*** POPULATE THE AMSDU VHT MIXED MODE CONTAINER FORMAT ***/ + /**** + if (vw_ht_length != 0) + ***/ + /*** + else { + offset = offset + 17; + } + ***/ + + /* This handles the case of an FCS existing at the end of the frame. */ + if (rflags & FLAGS_FCS) + pinfo->pseudo_header->ieee_802_11.fcs_len = 4; + else + pinfo->pseudo_header->ieee_802_11.fcs_len = 0; + + if (!ver_fpga) + { + /* Grab the rest of the frame. */ + if (plcp_type == 3) { + length = length + 17; /*** 16 bytes of PLCP + 1 byte of L1InfoC(UserPos) **/ + } - /* dissect the 802.11 packet next */ - call_dissector_with_data(ieee80211_radio_handle, next_tvb, pinfo, tree, &phdr); + next_tvb = tvb_new_subset_remaining(tvb, length); + } + else + { + if (cmd_type != 4) + proto_item_set_len(tap_tree, length + OCTO_TIMESTAMP_FIELDS_LEN); + else + proto_item_set_len(tap_tree, length + OCTO_TIMESTAMP_FIELDS_LEN + OCTO_MODIFIED_RF_LEN); + + /* Grab the rest of the frame. */ + next_tvb = tvb_new_subset_remaining(tvb, length); + } + + /* If we had an in-header FCS, check it. */ + if (hdr_fcs_ti) { + /* It would be very strange for the header to have an FCS for the + * frame *and* the frame to have the FCS at the end, but it's possible, so + * take that into account by using the FCS length recorded in pinfo. */ + + /* Watch out for [erroneously] short frames */ + if (tvb_captured_length(next_tvb) > (unsigned int) pinfo->pseudo_header->ieee_802_11.fcs_len) { + guint32 sent_fcs = 0; + calc_fcs = crc32_802_tvb(next_tvb, + tvb_captured_length(next_tvb) - pinfo->pseudo_header->ieee_802_11.fcs_len); + + /* By virtue of hdr_fcs_ti being set, we know that 'tree' is set, + * so there's no need to check it here. */ + if (calc_fcs == sent_fcs) { + proto_item_append_text(hdr_fcs_ti, " [correct]"); + } + else { + proto_item_append_text(hdr_fcs_ti, " [incorrect, should be 0x%08x]", calc_fcs); + proto_tree_add_expert(tap_tree, pinfo, &ei_radiotap_fcs_bad, + tvb, 0, 4); + } + } + else { + proto_item_append_text(hdr_fcs_ti, + " [cannot verify - not enough data]"); + } + } + /* dissect the 802.11 header next */ + if(!ver_fpga || mpdu_length != 0) + call_dissector_with_data(ieee80211_radio_handle, next_tvb, pinfo, tree, &phdr); } void proto_register_ixveriwave(void) { /* value_strings for TX/RX and FCS error flags */ - static const value_string tx_rx_type[] = { - { 0, "Received" }, - { 1, "Transmitted" }, + static const true_false_string tfs_tx_rx_type = { "Transmitted", "Received" }; + static const true_false_string tfs_fcserr_type = { "Incorrect", "Correct" }; + static const true_false_string tfs_preamble_type = { "Short", "Long", }; + + /* Added value_string for decrypt error flag */ + static const true_false_string tfs_decrypterr_type = { "Decrypt Failed", "Decrypt Succeeded" }; + + /* Added value_string for excess retry error flag */ + static const true_false_string tfs_retryerr_type = {"Excess retry abort", "Retry limit not reached" }; + + static const true_false_string tfs_legacy_type = {"802.11b LEGACY CCK", "LEGACY OFDM"}; + + static const value_string vht_coding_vals[] = { + { 0, "BCC" }, + { 1, "LDPC" }, { 0, NULL }, }; - static const value_string fcserr_type[] = { - { 0, "Correct" }, - { 1, "Incorrect" }, + + static const value_string l1_preamble_type[] = { + { 0, "Short" }, + { 1, "Long" }, { 0, NULL }, }; - static const true_false_string preamble_type = { - "Short", - "Long", + static const value_string modulation_type[] = { + { 0, "LEGACY" }, + { 1, "HT" }, + { 2, "HT-Greenfield" }, + { 3, "VHT" }, + { 0, NULL }, }; - /* Added value_string for decrypt error flag */ - static const value_string decrypterr_type[] = { - { 0, "Decrypt Succeeded" }, - { 1, "Decrypt Failed" }, + static const value_string sbw_type[] = { + { 0, "5 MHz" }, + { 1, "10 MHz" }, + { 2, "20 MHz" }, + { 3, "40 MHz" }, + { 4, "80 MHz" }, + { 5, "reserved" }, + { 6, "reserved" }, + { 7, "reserved" }, { 0, NULL }, }; - - /* Added value_string for excess retry error flag */ - static const value_string retryerr_type[] = { - { 0, "Retry limit not reached" }, - { 1, "Excess retry abort" }, - { 0, NULL }, +#if 0 + static const value_string mcs[] = { + { 0, "DBPSK" }, + { 1, "DQPSK" }, + { 2, "CCK (4bits)" }, + { 3, "CCK (8bits)" }, + { 4, "BPSK (1/2)" }, + { 5, "BPSK (3/4)" }, + { 6, "QPSK (1/2)" }, + { 7, "QPSK (3/4)" }, + { 8, "16-QAM (1/2)" }, + { 9, "16-QAM (3/4)" }, + { 10, "64-QAM (1/2)" }, + { 11, "64-QAM (3/4)" }, + { 0, NULL }, }; - +#endif /* Added value_string for encryption type field */ static const value_string encrypt_type[] = { { 0, "No encryption" }, @@ -1233,6 +2990,34 @@ void proto_register_ixveriwave(void) { 0, NULL }, }; + static const value_string bmbit[] = { + {0, "Unicast"}, + {1, "Multicast"}, + { 0, NULL }, + }; + + static const value_string sbw_evm[] = { + { 0, "20 MHz" }, + { 1, "40 MHz" }, + { 2, "80 MHz" }, + { 3, "160 MHz" }, + { 0, NULL }, + }; + static const value_string frameformat_type[] = { + { 0x0, "LEGACY" }, + { 0x1, "HT" }, + { 0x3, "VHT" }, + { 0, NULL }, + }; + + static const value_string crypto_TKIP_type[] = { + { 0x0, "False" }, + { 0x1, "TKIP Encapped" }, + { 0x2, "CCMP Encapped" }, + { 0x3, "BIP Encapped" }, + { 0, NULL }, + }; + static hf_register_info hf[] = { { &hf_ixveriwave_frame_length, { "Actual frame length", "ixveriwave.frame_length", @@ -1259,11 +3044,15 @@ void proto_register_ixveriwave(void) FT_FLOAT, 0, NULL, 0x0, NULL, HFILL } }, { &hf_ixveriwave_vw_latency, - { "Latency", "ixveriwave.latency", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "Frame latency", "ixveriwave.latency", + FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_nanoseconds, 0x0, NULL, HFILL } }, { &hf_ixveriwave, - { "Signature (32 LSBs)", "ixveriwave.sig_ts", + { "Frame Signature Timestamp(32 LSBs)", "ixveriwave.sig_ts", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_ixveriwave_vw_delay, + { "Frame Queue Delay (32 LSBs)", "ixveriwave.delay_ts", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_ixveriwave_vw_startt, @@ -1275,27 +3064,31 @@ void proto_register_ixveriwave(void) FT_UINT64, BASE_DEC|BASE_UNIT_STRING, &units_microseconds, 0x0, NULL, HFILL } }, { &hf_ixveriwave_vw_pktdur, - { "Packet duration", "ixveriwave.pktdur", - FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "Frame duration", "ixveriwave.pktdur", + FT_UINT32, BASE_DEC|BASE_UNIT_STRING, &units_nanoseconds, 0x0, NULL, HFILL } }, { &hf_ixveriwave_vw_ifg, { "Inter-frame gap (usecs)", "ixveriwave.ifg", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_ixveriwave_vw_ifg_neg, + { "Inter-frame gap (usecs)", "ixveriwave.ifg", + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_ixveriwave_vwf_txf, { "Frame direction", "ixveriwave.vwflags.txframe", - FT_UINT32, BASE_DEC, VALS(tx_rx_type), 0x0, NULL, HFILL } }, + FT_BOOLEAN, 8, TFS(&tfs_tx_rx_type), ETHERNETTAP_VWF_TXF, NULL, HFILL } }, { &hf_ixveriwave_vwf_fcserr, { "MAC FCS check", "ixveriwave.vwflags.fcserr", - FT_UINT32, BASE_DEC, VALS(fcserr_type), 0x0, NULL, HFILL } }, + FT_BOOLEAN, 8, TFS(&tfs_fcserr_type), ETHERNETTAP_VWF_FCSERR, NULL, HFILL } }, { &hf_ixveriwave_vw_info, { "Info field", "ixveriwave.info", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, { &hf_ixveriwave_vw_info_retryCount, - { "Info field retry count", "ixveriwave.info", + { "Retry count", "ixveriwave.info.retry_count", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, /* tx info decodes for VW510024 and 510012 */ @@ -1382,6 +3175,23 @@ framing signal deasserted. this is caused by software setting the drain all reg { "Layer 4 ID", "ixveriwave.layer4id", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + /* Presense flags */ +#define RADIOTAP_MASK_VW_FPGA_VERSION (1 << VW_RADIOTAP_FPGA_VERSION) +#define RADIOTAP_MASK_VW_MCID (1 << VW_RADIOTAP_MCID) +#define RADIOTAP_MASK_VW_ERRORS (1 << VW_RADIOTAP_ERRORS) +#define RADIOTAP_MASK_VW_INFO (1 << VW_RADIOTAP_INFO) +#define RADIOTAP_MASK_VW_MSDU_LENGTH (1 << VW_RADIOTAP_MSDU_LENGTH) +#define RADIOTAP_MASK_VW_HT_LENGTH (1 << VW_RADIOTAP_HT_LENGTH) +#define RADIOTAP_MASK_VW_FLOWID (1 << VW_RADIOTAP_FLOWID) +#define RADIOTAP_MASK_VW_SEQNUM (1 << VW_RADIOTAP_SEQNUM) +#define RADIOTAP_MASK_VW_LATENCY (1 << VW_RADIOTAP_LATENCY) +#define RADIOTAP_MASK_VW_SIG_TS (1 << VW_RADIOTAP_SIG_TS) +#define RADIOTAP_MASK_VW_STARTT (1 << VW_RADIOTAP_STARTT) +#define RADIOTAP_MASK_VW_ENDT (1 << VW_RADIOTAP_ENDT) +#define RADIOTAP_MASK_VW_PKTDUR (1 << VW_RADIOTAP_PKTDUR) +#define RADIOTAP_MASK_VW_IFG (1 << VW_RADIOTAP_IFG) + /* end veriwave addition*/ + { &hf_radiotap_datarate, { "Data rate", "ixveriwave.datarate", FT_UINT32, BASE_DEC, NULL, 0x0, @@ -1404,9 +3214,14 @@ framing signal deasserted. this is caused by software setting the drain all reg { "Flags", "ixveriwave.flags", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_flags_cfp, + { "CFP", "ixveriwave.flags.cfp", + FT_BOOLEAN, 12, NULL, IEEE80211_RADIOTAP_F_CFP, + "Sent/Received radha CFP", HFILL } }, + { &hf_radiotap_flags_preamble, { "Preamble", "ixveriwave.flags.preamble", - FT_BOOLEAN, 12, TFS(&preamble_type), FLAGS_SHORTPRE, + FT_BOOLEAN, 12, TFS(&tfs_preamble_type), FLAGS_SHORTPRE, "Sent/Received with short preamble", HFILL } }, { &hf_radiotap_flags_wep, @@ -1414,10 +3229,20 @@ framing signal deasserted. this is caused by software setting the drain all reg FT_BOOLEAN, 12, NULL, FLAGS_WEP, "Sent/Received with WEP encryption", HFILL } }, - { &hf_radiotap_flags_fcs_present, - { "FCS present", "ixveriwave.flags.fcs_present", + { &hf_radiotap_flags_frag, + { "Fragmentation", "ixveriwave.flags.frag", + FT_BOOLEAN, 12, NULL, IEEE80211_RADIOTAP_F_FRAG, + "Sent/Received with fragmentation", HFILL } }, + + { &hf_radiotap_flags_fcs, + { "FCS at end", "ixveriwave.flags.fcs", FT_BOOLEAN, 12, NULL, FLAGS_FCS, - "FCS present in frame", HFILL } }, + "Frame includes FCS at end", HFILL } }, + + { &hf_radiotap_flags_datapad, + { "Data Pad", "ixveriwave.flags.datapad", + FT_BOOLEAN, 12, NULL, IEEE80211_RADIOTAP_F_DATAPAD, + "Frame has padding between 802.11 header and payload", HFILL } }, { &hf_radiotap_flags_ht, { "HT frame", "ixveriwave.flags.ht", @@ -1439,8 +3264,8 @@ framing signal deasserted. this is caused by software setting the drain all reg { "Short guard interval", "ixveriwave.flags.shortgi", FT_BOOLEAN, 12, NULL, FLAGS_CHAN_SHORTGI, NULL, HFILL } }, - { &hf_radiotap_dbm_antsignal, - { "SSI Signal", "ixveriwave.dbm_antsignal", + { &hf_radiotap_dbm_anta, + { "SSI Signal for Antenna A", "ixveriwave.dbm_anta", FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0x0, "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } }, @@ -1459,89 +3284,604 @@ framing signal deasserted. this is caused by software setting the drain all reg FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0x0, "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } }, + { &hf_radiotap_dbm_tx_anta, + { "TX Power for Antenna A", "ixveriwave.dbm_anta", + FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_dbm, 0x0, + "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } }, + + { &hf_radiotap_dbm_tx_antb, + { "TX Power for Antenna B", "ixveriwave.dbm_antb", + FT_INT32, BASE_DEC, NULL, 0x0, + "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } }, + + { &hf_radiotap_dbm_tx_antc, + { "TX Power for Antenna C", "ixveriwave.dbm_antc", + FT_INT32, BASE_DEC, NULL, 0x0, + "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } }, + + { &hf_radiotap_dbm_tx_antd, + { "TX Power for Antenna D", "ixveriwave.dbm_antd", + FT_INT32, BASE_DEC, NULL, 0x0, + "RF signal power at the antenna from a fixed, arbitrary value in decibels from one milliwatt", HFILL } }, + /* Boolean 'present' flags */ /* VeriWave-specific flags */ { &hf_radiotap_vwf_txf, { "Frame direction", "ixveriwave.vwflags.txframe", - FT_UINT32, BASE_DEC, VALS(tx_rx_type), 0x0, NULL, HFILL } }, + FT_BOOLEAN, 16, TFS(&tfs_tx_rx_type), VW_RADIOTAPF_TXF, NULL, HFILL } }, { &hf_radiotap_vwf_fcserr, { "MAC FCS check", "ixveriwave.vwflags.fcserr", - FT_UINT32, BASE_DEC, VALS(fcserr_type), 0x0, NULL, HFILL } }, + FT_BOOLEAN, 16, TFS(&tfs_fcserr_type), VW_RADIOTAPF_FCSERR, NULL, HFILL } }, { &hf_radiotap_vwf_dcrerr, { "Decryption error", "ixveriwave.vwflags.decrypterr", - FT_UINT32, BASE_DEC, VALS(decrypterr_type), 0x0, NULL, HFILL } }, + FT_BOOLEAN, 16, TFS(&tfs_decrypterr_type), VW_RADIOTAPF_DCRERR, NULL, HFILL } }, { &hf_radiotap_vwf_retrerr, { "TX retry limit", "ixveriwave.vwflags.retryerr", - FT_UINT32, BASE_DEC, VALS(retryerr_type), 0x0, NULL, HFILL } }, + FT_BOOLEAN, 16, TFS(&tfs_retryerr_type), VW_RADIOTAPF_RETRERR, NULL, HFILL } }, { &hf_radiotap_vwf_enctype, { "Encryption type", "ixveriwave.vwflags.encrypt", - FT_UINT32, BASE_DEC, VALS(encrypt_type), 0x0, NULL, HFILL } }, + FT_UINT32, BASE_DEC, VALS(encrypt_type), VW_RADIOTAPF_ENCMSK, NULL, HFILL } }, /* start VeriWave-specific radiotap header elements 6-2007 */ { &hf_radiotap_vw_ht_length, - { "Total IP length (incl all pieces of an aggregate)", "ixveriwave.ht_length", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "HT length", "ixveriwave.ht_length", + FT_UINT16, BASE_DEC, NULL, 0x0, "Total IP length (incl all pieces of an aggregate)", HFILL } }, { &hf_radiotap_vht_grp_id, - { "VHT GRP ID})", "ixveriwave.VHT_GRPID", + { "Group Id", "ixveriwave.GRPID", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, { &hf_radiotap_vht_su_nsts, - { "VHT SU NSTS})", "ixveriwave.VHT_SU_NSTS", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "SU NSTS", "ixveriwave.SU_NSTS", + FT_UINT16, BASE_DEC, NULL, 0x1c, NULL, HFILL } }, { &hf_radiotap_vht_su_partial_aid, - { "VHT SU Partial ID})", "ixveriwave.VHT_SU_PARTIAL_AID", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "SU Partial ID", "ixveriwave.VHT_SU_PARTIAL_AID", + FT_UINT16, BASE_HEX, NULL, 0x3FE0, NULL, HFILL } }, + + { &hf_radiotap_vht_su_coding_type, + { "SU Coding Type", "ixveriwave.vht_su_coding_type", + FT_UINT16, BASE_DEC, VALS(vht_coding_vals), 0x0, NULL, HFILL } }, { &hf_radiotap_vht_u0_nsts, - { "VHT U0 NSTS})", "ixveriwave.VHT_U0_NSTS", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "MU[0] NSTS", "ixveriwave.VHT_U0_NSTS", + FT_UINT16, BASE_DEC, NULL, 0x001c, NULL, HFILL } }, { &hf_radiotap_vht_u1_nsts, - { "VHT U1 NSTS})", "ixveriwave.VHT_U1_NSTS", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "MU[1] NSTS", "ixveriwave.VHT_U1_NSTS", + FT_UINT16, BASE_DEC, NULL, 0x000e, NULL, HFILL } }, { &hf_radiotap_vht_u2_nsts, - { "VHT U2 NSTS})", "ixveriwave.VHT_U2_NSTS", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "MU[2] NSTS", "ixveriwave.VHT_U2_NSTS", + FT_UINT16, BASE_DEC, NULL, 0x0700, NULL, HFILL } }, { &hf_radiotap_vht_u3_nsts, - { "VHT U3 NSTS})", "ixveriwave.VHT_U3_NSTS", - FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "MU[3] NSTS", "ixveriwave.VHT_U3_NSTS", + FT_UINT16, BASE_DEC, NULL, 0x3800, NULL, HFILL } }, { &hf_radiotap_vht_beamformed, - { "VHT Beamformed", "ixveriwave.VHT_BEAMFORMED", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "Beamformed", "ixveriwave.BEAMFORMED", + FT_UINT8, BASE_DEC, NULL, 0x01, NULL, HFILL } }, { &hf_radiotap_vht_user_pos, { "VHT User Pos", "ixveriwave.VHT_user_pos", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + FT_UINT8, BASE_DEC, NULL, 0x03, NULL, HFILL } }, + + { &hf_radiotap_vht_ndp_flg, + { "NDP", "ixveriwave.VHT_ndp_flg", + FT_UINT8, BASE_HEX, NULL, 0x80, NULL, HFILL } }, { &hf_radiotap_vht_mu_mimo_flg, - { "VHT MU SU", "ixveriwave.VHT_mu_mimo_flg", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "VHT MU MIMO", "ixveriwave.VHT_mu_mimo_flg", + FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL } }, + + { &hf_radiotap_vht_su_mimo_flg, + { "VHT SU MIMO", "ixveriwave.VHT_su_mimo_flg", + FT_UINT8, BASE_DEC, NULL, 0x04, NULL, HFILL } }, { &hf_radiotap_vht_u0_coding_type, - { "VHT CODING", "ixveriwave.VHT_u0_CODING_TYPE", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "MU[0] Coding Type", "ixveriwave.vht_u0_coding_type", + FT_UINT16, BASE_DEC, VALS(vht_coding_vals), 0x0, NULL, HFILL } }, { &hf_radiotap_vht_u1_coding_type, - { "VHT CODING", "ixveriwave.VHT_u1_CODING_TYPE", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "MU[1] Coding Type", "ixveriwave.vht_u1_coding_type", + FT_UINT16, BASE_DEC, VALS(vht_coding_vals), 0x0, NULL, HFILL } }, { &hf_radiotap_vht_u2_coding_type, - { "VHT CODING", "ixveriwave.VHT_u2_CODING_TYPE", - FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { "MU[2] Coding Type", "ixveriwave.vht_u2_coding_type", + FT_UINT16, BASE_DEC, VALS(vht_coding_vals), 0x0, NULL, HFILL } }, { &hf_radiotap_vht_u3_coding_type, - { "VHT CODING", "ixveriwave.VHT_u3_CODING_TYPE", + { "MU[3] Coding Type", "ixveriwave.vht_u3_coding_type", + FT_UINT16, BASE_DEC, VALS(vht_coding_vals), 0x0, NULL, HFILL } }, + + { &hf_radiotap_rf_info, + { "RF Header", "ixveriwave.RFInfo", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + + { &hf_radiotap_tx, + { "Layer 1 Header (Direction=Transmit)", "ixveriwave.l1info", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_radiotap_rx, + { "Layer 1 Header (Direction=Receive)", "ixveriwave.l1info", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + + { &hf_radiotap_modulation, + { "Modulation", "ixveriwave.Modulation", + FT_UINT8, BASE_DEC, VALS(modulation_type), 0x0, NULL, HFILL } }, + + { &hf_radiotap_preamble, + { "Preamble", "ixveriwave.preamble", + FT_UINT8, BASE_DEC, VALS(l1_preamble_type), 0x0, NULL, HFILL } }, + + { &hf_radiotap_sigbandwidth, + { "Signaling Band Width", "ixveriwave.sigbandwidth", + FT_UINT8, BASE_DEC, VALS(sbw_type), 0x0, NULL, HFILL } }, +#if 0 + {&hf_radiotap_rssi, + { "RSSI", "ixveriwave.rssi", + FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } }, +#endif + {&hf_radiotap_l1infoc, + {"L1InfoC", "ixveriwave.l1InfoC", + FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_sigbandwidthmask, + { "Signaling Band Width Mask", "ixveriwave.sigbandwidthmask", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_antennaportenergydetect, + { "Antenna Port Energy Detect", "ixveriwave.antennaportenergydetect", + FT_UINT8, BASE_HEX, NULL, 0x0F, NULL, HFILL } }, + + { &hf_radiotap_mumask, + { "MU_MASK", "ixveriwave.mumask", + FT_UINT8, BASE_HEX, NULL, 0xF0, NULL, HFILL } }, + + { &hf_radiotap_plcp_info, + {"PLCP Header", "ixveriwave.plcp_info", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_radiotap_l2_l4_info, + {"Layer 2-4 Header", "ixveriwave.l2_l4info", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_radiotap_bssid, + {"BSS ID", "ixveriwave.bssid", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_unicastormulticast, + { "Unicast/Multicast", "ixveriwave.unicastormulticast", + FT_UINT8, BASE_DEC, VALS(bmbit), 0x80, NULL, HFILL } }, + + { &hf_radiotap_clientidvalid, + { "Client Id Valid", "ixveriwave.clientidvalid", + FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL } }, + + { &hf_radiotap_bssidvalid, + { "BSS ID Valid", "ixveriwave.bssidvalid", + FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL } }, + + { &hf_radiotap_flowvalid, + { "Flow Id Valid", "ixveriwave.flowvalid", + FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL } }, + + { &hf_radiotap_l4idvalid, + { "Layer 4 Id Valid", "ixveriwave.l4idvalid", + FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL } }, + + { &hf_radiotap_istypeqos, + { "Is Type QOS", "ixveriwave.istypeqos", + FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL } }, + + { &hf_radiotap_containshtfield, + { "Contains HT Field", "ixveriwave.containshtfield", + FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL } }, + + { &hf_radiotap_tid, + { "TID", "ixveriwave.tid", + FT_UINT16, BASE_HEX, NULL, 0x01c0, NULL, HFILL } }, +#if 0 + { &hf_radiotap_wlantype, + { "WLAN Type", "ixveriwave.wlantype", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, +#endif + { &hf_radiotap_payloaddecode, + { "Payload Decode", "ixveriwave.payloaddecode", + FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_bw, + { "BW", "ixveriwave.bw", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_stbc, + { "STBC", "ixveriwave.stbc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_txop_ps_notallowd, + { "TXOP_PS_NOT_ALLOWD", "ixveriwave.txop_ps_notallowd", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_shortgi, + { "Short GI", "ixveriwave.shortgi", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_shortginsymdisa, + { "Short GI NSYM DISA", "ixveriwave.shortginsymdisa", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_ldpc_ofdmsymbol, + { "LDPC Extra OFDM Symbol", "ixveriwave.ldpc_ofdmsymbol", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_su_mcs, + { "SU VHT-MCS", "ixveriwave.su_mcs", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_crc, + { "CRC8", "ixveriwave.crc", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_tail, + { "Tail", "ixveriwave.tail", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_length, + { "VHT Length", "ixveriwave.vht.length", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_rfid, + { "RFID", "ixveriwave.rfid", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_vht_mcs, + { "VHT MCS", "ixveriwave.vhtmcs", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_parity, + { "Parity", "ixveriwave.parity", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_rate, + { "Rate", "ixveriwave.rate", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_plcp_length, + { "PLCP Length", "ixveriwave.length", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_feccoding, + { "FEC Coding", "ixveriwave.feccoding", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_aggregation, + { "Aggregation", "ixveriwave.aggregation", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_notsounding, + { "Not Sounding", "ixveriwave.notsounding", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_smoothing, + { "Smoothing", "ixveriwave.smoothing", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_ness, + { "NUMBER of Extension Spatial Streams", "ixveriwave.ness", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_plcp_service, + { "Service", "ixveriwave.plcp.service", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_plcp_signal, + { "Signal", "ixveriwave.plcp.signal", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_plcp_default, + { "PLCP", "ixveriwave.plcp", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_tx_antennaselect, + { "Antenna Select", "ixveriwave.tx.antennaselect", + FT_UINT8, BASE_HEX, NULL, 0x07, NULL, HFILL } }, + { &hf_radiotap_tx_stbcselect, + { "STBC Select", "ixveriwave.tx.stbcselect", + FT_UINT8, BASE_HEX, NULL, 0x18, NULL, HFILL } }, + { &hf_radiotap_ac, + { "AC", "ixveriwave.tx.ac", + FT_UINT8, BASE_HEX, NULL, 0x0e, NULL, HFILL } }, + { &hf_radiotap_crc16, + { "CRC16", "ixveriwave.crc16", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_plcp_type, + { "PLCP_TYPE", "ixveriwave.plcp.type", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + // RF LOGGING +#if 0 + { &hf_radiotap_rfinfo_noise, + { "Noise", "ixveriwave.rfinfo.noise", + FT_FLOAT, 0, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_noise_anta, + { "Noise Antenna A", "ixveriwave.noise_anta", + FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_noise_antb, + { "Noise Antenna B", "ixveriwave.noise_antb", + FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_noise_antc, + { "Noise Antenna C", "ixveriwave.noise_antc", + FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_noise_antd, + { "Noise Antenna D", "ixveriwave.noise_antd", + FT_INT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, +#endif + { &hf_radiotap_rfinfo_snr, + { "SNR", "ixveriwave.snr", + FT_NONE, BASE_NONE, NULL, 0x0, "Signal-to-noise ratio", HFILL } }, + { &hf_radiotap_rfinfo_snr_anta, + { "SNR Antenna A", "ixveriwave.snr_anta", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_decibels, 0x0, "Signal-to-noise ratio", HFILL } }, + { &hf_radiotap_rfinfo_snr_antb, + { "SNR Antenna B", "ixveriwave.snr_antb", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_decibels, 0x0, "Signal-to-noise ratio", HFILL } }, + { &hf_radiotap_rfinfo_snr_antc, + { "SNR Antenna C", "ixveriwave.snr_antc", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_decibels, 0x0, "Signal-to-noise ratio", HFILL } }, + { &hf_radiotap_rfinfo_snr_antd, + { "SNR Antenna D", "ixveriwave.snr_antd", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_decibels, 0x0, "Signal-to-noise ratio", HFILL } }, + + { &hf_radiotap_rfinfo_pfe, + { "PFE", "ixveriwave.rfinfo.pfe", + FT_NONE, BASE_NONE, NULL, 0x0, "Preamble Frequency Error metric", HFILL } }, + { &hf_radiotap_rfinfo_pfe_anta, + { "PFE SS#1", "ixveriwave.pfe_anta", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_hz, 0x0, "Preamble Frequency Error metric", HFILL } }, + { &hf_radiotap_rfinfo_pfe_antb, + { "PFE SS#2", "ixveriwave.pfe_antb", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_hz, 0x0, "Preamble Frequency Error metric", HFILL } }, + { &hf_radiotap_rfinfo_pfe_antc, + { "PFE SS#3", "ixveriwave.pfe_antc", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_hz, 0x0, "Preamble Frequency Error metric", HFILL } }, + { &hf_radiotap_rfinfo_pfe_antd, + { "PFE SS#4", "ixveriwave.pfe_antd", + FT_FLOAT, BASE_NONE|BASE_UNIT_STRING, &units_hz, 0x0, "Preamble Frequency Error metric", HFILL } }, + + { &hf_radiotap_rfinfo_contextpa, + { "CONTEXT_A", "ixveriwave.contextpa", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpb, + { "CONTEXT_B", "ixveriwave.contextpb", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpc, + { "CONTEXT_C", "ixveriwave.contextpc", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpd, + { "CONTEXT_D", "ixveriwave.contextpd", + FT_NONE, BASE_NONE, NULL, 0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpA_bit0, + { "SNR_NOISE_valid", "ixveriwave.contextpA.bit0", + FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpA_bit1, + { "PFE_valid", "ixveriwave.contextpA.bit1", + FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpA_bit2, + { "PFE_is_CCK", "ixveriwave.contextpA.bit2", + FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, +#if 0 + { &hf_radiotap_rfinfo_contextp_bits3, + { "AGC", "ixveriwave.contextp.bits3", + FT_BOOLEAN, 16, NULL, 0x0038, "Automatic Gain Control", HFILL } }, +#endif + { &hf_radiotap_rfinfo_contextpA_bit3, + { "AGC 3", "ixveriwave.contextpA.bit3", + FT_BOOLEAN, 16, NULL, 0x0008, "Automatic Gain Control-[3] agc_idle2iqrdy_no_gain_change", HFILL } }, + { &hf_radiotap_rfinfo_contextpA_bit4, + { "AGC 4", "ixveriwave.contextpA.bit4", + FT_BOOLEAN, 16, NULL, 0x0010, "Automatic Gain Control-[4] agc_high_pwr_terminated", HFILL } }, + { &hf_radiotap_rfinfo_contextpA_bit5, + { "AGC 5", "ixveriwave.contextpA.bit5", + FT_BOOLEAN, 16, NULL, 0x0020, "Automatic Gain Control-[5] agc_high_pwr_terminator", HFILL } }, +#if 0 + { &hf_radiotap_rfinfo_contextpA_bit8, + { "Frame format", "ixveriwave.contextp.bits8", + FT_UINT16, BASE_DEC, VALS(frameformat_type), 0x0300, "0: LEGACY. 1:HT. 3:-VHT.", HFILL } }, + { &hf_radiotap_rfinfo_contextpA_bit10, + { "OFDM or CCK", "ixveriwave.contextp.bit10", + FT_BOOLEAN, 16, TFS(&tfs_legacy_type), 0x0400, "0: LEGACY OFDM 1: 802.11b LEGACY CCK", HFILL } }, + { &hf_radiotap_rfinfo_contextpA_bit11, + { "SigBandWidth of EVM", "ixveriwave.contextp.bits11", + FT_UINT16, BASE_DEC, VALS(sbw_evm), 0x1800, "Signal Bandwidth of EVM measurement", HFILL } }, +#endif + { &hf_radiotap_rfinfo_contextpA_bit13, + { "QAM modulation", "ixveriwave.contextpA.bits13", + FT_BOOLEAN, 16, NULL, 0xe000, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_contextpB_bit0, + { "SNR_NOISE_valid", "ixveriwave.contextpB.bit0", + FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpB_bit1, + { "PFE_valid", "ixveriwave.contextpB.bit1", + FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpB_bit2, + { "PFE_is_CCK", "ixveriwave.contextpB.bit2", + FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpB_bit3, + { "AGC 3", "ixveriwave.contextpB.bit3", + FT_BOOLEAN, 16, NULL, 0x0008, "Automatic Gain Control-[3] agc_idle2iqrdy_no_gain_change", HFILL } }, + { &hf_radiotap_rfinfo_contextpB_bit4, + { "AGC 4", "ixveriwave.contextpB.bit4", + FT_BOOLEAN, 16, NULL, 0x0010, "Automatic Gain Control-[4] agc_high_pwr_terminated", HFILL } }, + { &hf_radiotap_rfinfo_contextpB_bit5, + { "AGC 5", "ixveriwave.contextpB.bit5", + FT_BOOLEAN, 16, NULL, 0x0020, "Automatic Gain Control-[5] agc_high_pwr_terminator", HFILL } }, + { &hf_radiotap_rfinfo_contextpB_bit13, + { "QAM modulation", "ixveriwave.contextpB.bits13", + FT_BOOLEAN, 16, NULL, 0xe000, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_contextpC_bit0, + { "SNR_NOISE_valid", "ixveriwave.contextpC.bit0", + FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpC_bit1, + { "PFE_valid", "ixveriwave.contextpC.bit1", + FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpC_bit2, + { "PFE_is_CCK", "ixveriwave.contextpC.bit2", + FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpC_bit3, + { "AGC 3", "ixveriwave.contextpC.bit3", + FT_BOOLEAN, 16, NULL, 0x0008, "Automatic Gain Control-[3] agc_idle2iqrdy_no_gain_change", HFILL } }, + { &hf_radiotap_rfinfo_contextpC_bit4, + { "AGC 4", "ixveriwave.contextpC.bit4", + FT_BOOLEAN, 16, NULL, 0x0010, "Automatic Gain Control-[4] agc_high_pwr_terminated", HFILL } }, + { &hf_radiotap_rfinfo_contextpC_bit5, + { "AGC 5", "ixveriwave.contextpC.bit5", + FT_BOOLEAN, 16, NULL, 0x0020, "Automatic Gain Control-[5] agc_high_pwr_terminator", HFILL } }, + { &hf_radiotap_rfinfo_contextpC_bit13, + { "QAM modulation", "ixveriwave.contextpC.bits13", + FT_BOOLEAN, 16, NULL, 0xe000, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_contextpD_bit0, + { "SNR_NOISE_valid", "ixveriwave.contextpD.bit0", + FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpD_bit1, + { "PFE_valid", "ixveriwave.contextpD.bit1", + FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpD_bit2, + { "PFE_is_CCK", "ixveriwave.contextpD.bit2", + FT_BOOLEAN, 16, NULL, 0x0004, NULL, HFILL } }, + { &hf_radiotap_rfinfo_contextpD_bit3, + { "AGC 3", "ixveriwave.contextpD.bit3", + FT_BOOLEAN, 16, NULL, 0x0008, "Automatic Gain Control-[3] agc_idle2iqrdy_no_gain_change", HFILL } }, + { &hf_radiotap_rfinfo_contextpD_bit4, + { "AGC 4", "ixveriwave.contextpD.bit4", + FT_BOOLEAN, 16, NULL, 0x0010, "Automatic Gain Control-[4] agc_high_pwr_terminated", HFILL } }, + { &hf_radiotap_rfinfo_contextpD_bit5, + { "AGC 5", "ixveriwave.contextpD.bit5", + FT_BOOLEAN, 16, NULL, 0x0020, "Automatic Gain Control-[5] agc_high_pwr_terminator", HFILL } }, + { &hf_radiotap_rfinfo_contextpD_bit13, + { "QAM modulation", "ixveriwave.contextpD.bits13", + FT_BOOLEAN, 16, NULL, 0xe000, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_frameformatA, + { "Frame format", "ixveriwave.rfinfo.frameformatA", + FT_UINT8, BASE_DEC, VALS(frameformat_type), 0x03, NULL, HFILL } }, + { &hf_radiotap_rfinfo_frameformatB, + { "Frame format", "ixveriwave.rfinfo.frameformatB", + FT_UINT8, BASE_DEC, VALS(frameformat_type), 0x03, NULL, HFILL } }, + { &hf_radiotap_rfinfo_frameformatC, + { "Frame format", "ixveriwave.rfinfo.frameformatC", + FT_UINT8, BASE_DEC, VALS(frameformat_type), 0x03, NULL, HFILL } }, + { &hf_radiotap_rfinfo_frameformatD, + { "Frame format", "ixveriwave.rfinfo.frameformatD", + FT_UINT8, BASE_DEC, VALS(frameformat_type), 0x03, NULL, HFILL } }, + { &hf_radiotap_rfinfo_legacytypeA, + { "Frame format", "ixveriwave.rfinfo.legacytypeA", + FT_BOOLEAN, 8, TFS(&tfs_legacy_type), 0x04, NULL, HFILL } }, + { &hf_radiotap_rfinfo_legacytypeB, + { "Frame format", "ixveriwave.rfinfo.legacytypeB", + FT_BOOLEAN, 8, TFS(&tfs_legacy_type), 0x04, NULL, HFILL } }, + { &hf_radiotap_rfinfo_legacytypeC, + { "Frame format", "ixveriwave.rfinfo.legacytypeC", + FT_BOOLEAN, 8, TFS(&tfs_legacy_type), 0x04, NULL, HFILL } }, + { &hf_radiotap_rfinfo_legacytypeD, + { "Frame format", "ixveriwave.rfinfo.legacytypeD", + FT_BOOLEAN, 8, TFS(&tfs_legacy_type), 0x04, NULL, HFILL } }, + { &hf_radiotap_rfinfo_sigbwevmA, + { "SigBandWidth of EVM", "ixveriwave.rfinfo.sigbwevmA", + FT_UINT8, BASE_DEC, VALS(sbw_evm), 0x18, NULL, HFILL } }, + { &hf_radiotap_rfinfo_sigbwevmB, + { "SigBandWidth of EVM", "ixveriwave.rfinfo.sigbwevmB", + FT_UINT8, BASE_DEC, VALS(sbw_evm), 0x18, NULL, HFILL } }, + { &hf_radiotap_rfinfo_sigbwevmC, + { "SigBandWidth of EVM", "ixveriwave.rfinfo.sigbwevmC", + FT_UINT8, BASE_DEC, VALS(sbw_evm), 0x18, NULL, HFILL } }, + { &hf_radiotap_rfinfo_sigbwevmD, + { "SigBandWidth of EVM", "ixveriwave.rfinfo.sigbwevmD", + FT_UINT8, BASE_DEC, VALS(sbw_evm), 0x18, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_sigdata, + { "AVG EVM SIG Data", "ixveriwave.rfinfo.sigdata", + FT_NONE, BASE_NONE, NULL, 0x0, "Average EVM for DATA SUBCARRIERS for all SIG symbols of the frame", HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sd_siga, + { "AVG EVM SIG Data SS#1", "ixveriwave.avg_evm_sda", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sd_sigb, + { "AVG EVM SIG Data SS#2", "ixveriwave.avg_evm_sdb", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sd_sigc, + { "AVG EVM SIG Data SS#3", "ixveriwave.avg_evm_sdc", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sd_sigd, + { "AVG EVM SIG Data SS#4", "ixveriwave.avg_evm_sdd", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_sigpilot, + { "AVG EVM SIG Pilot", "ixveriwave.rfinfo.sigpilot", + FT_NONE, BASE_NONE, NULL, 0x0, "Average EVM for PILOT SUBCARRIERS for all SIG symbols of the frame", HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sp_siga, + { "AVG EVM SIG Pilot SS#1", "ixveriwave.avg_evm_spa", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sp_sigb, + { "AVG EVM SIG Pilot SS#2", "ixveriwave.avg_evm_spb", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sp_sigc, + { "AVG EVM SIG Pilot SS#3", "ixveriwave.avg_evm_spc", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_sp_sigd, + { "AVG EVM SIG Pilot SS#4", "ixveriwave.avg_evm_spd", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_datadata, + { "AVG EVM DATA Data", "ixveriwave.rfinfo.datadata", + FT_NONE, BASE_NONE, NULL, 0x0, "Average EVM for DATA SUBCARRIERS for all DATA symbols of the frame", HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dd_siga, + { "AVG EVM DATA Data SS#1", "ixveriwave.avg_evm_dda", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dd_sigb, + { "AVG EVM DATA Data SS#2", "ixveriwave.avg_evm_ddb", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dd_sigc, + { "AVG EVM DATA Data SS#3", "ixveriwave.avg_evm_ddc", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dd_sigd, + { "AVG EVM DATA Data SS#4", "ixveriwave.avg_evm_ddd", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_datapilot, + { "AVG EVM DATA Pilot", "ixveriwave.rfinfo.datapilot", + FT_NONE, BASE_NONE, NULL, 0x0, "Average EVM for PILOT SUBCARRIERS for all DATA symbols of the frame", HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dp_siga, + { "AVG EVM DATA Pilot SSI-1", "ixveriwave.avg_evm_dpa", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dp_sigb, + { "AVG EVM DATA Pilot SSI-2", "ixveriwave.avg_evm_dpb", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dp_sigc, + { "AVG EVM DATA Pilot SSI-3", "ixveriwave.avg_evm_dpc", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_dp_sigd, + { "AVG EVM DATA Pilot SSI-4", "ixveriwave.avg_evm_dpd", + FT_FLOAT, BASE_NONE, NULL, 0x0, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_avg_ws_symbol, + { "EVM Worst Symbol", "ixveriwave.wssymbol", + FT_NONE, BASE_NONE, NULL, 0, "WORST-CASE SYMBOL", HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_ws_siga, + { "EVM Worst Symbol SS#1", "ixveriwave.avg_evm_wsa", + FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_percent, 0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_ws_sigb, + { "EVM Worst Symbol SS#2", "ixveriwave.avg_evm_wsb", + FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_percent, 0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_ws_sigc, + { "EVM Worst Symbol SS#3", "ixveriwave.avg_evm_wsc", + FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_percent, 0, NULL, HFILL } }, + { &hf_radiotap_rfinfo_avg_evm_ws_sigd, + { "EVM Worst Symbol SS#4", "ixveriwave.avg_evm_wsd", + FT_UINT16, BASE_DEC|BASE_UNIT_STRING, &units_percent, 0, NULL, HFILL } }, + + { &hf_radiotap_rfinfo_rfid, + { "RF_ID", "ixveriwave.rfinfo.rfid", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } }, +#if 0 + { &hf_radiotap_rfinfo_tbd, + { "RF_TBD", "ixveriwave.rfinfo.tbd", + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } }, +#endif { &hf_radiotap_vw_errors, { "Errors", "ixveriwave.errors", FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL } }, @@ -1587,11 +3927,148 @@ framing signal deasserted. this is caused by software setting the drain all reg { "L4(TCP/ICMP/IGMP/UDP) checksum error", "ixveriwave.errors.bit11", FT_BOOLEAN, 16, NULL, 0x0800, NULL, HFILL } }, + { &hf_radiotap_vw_errors_tx_bit01, + { "CRC32 Error", "ixveriwave.errors.bit1", + FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL } }, + { &hf_radiotap_vw_errors_tx_bit05, + { "IP Checksum Error", "ixveriwave.errors.bit5", + FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL } }, + { &hf_radiotap_vw_errors_tx_bit8, + { "ACK Timeout", "ixveriwave.errors.bit8", + FT_BOOLEAN, 32, NULL, 0x00000100, NULL, HFILL } }, + { &hf_radiotap_vw_errors_tx_bit9, + { "CTS Timeout", "ixveriwave.errors.bit9", + FT_BOOLEAN, 32, NULL, 0x00000200, NULL, HFILL } }, + { &hf_radiotap_vw_errors_tx_bit10, + { "Last Retry Attempt for this MPDU", "ixveriwave.errors.bit10", + FT_BOOLEAN, 32, NULL, 0x00000400, NULL, HFILL } }, + { &hf_radiotap_vw_errors_tx_bit31, + { "Internal Error", "ixveriwave.errors.bit31", + FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL } }, + { &hf_radiotap_vw_tx_retrycount, + { "Retry Count", "ixveriwave.tx.retrycount", + FT_UINT8, BASE_DEC, NULL, 0x1f, NULL, HFILL } }, + { &hf_radiotap_vw_tx_factorydebug, + { "Factory Debug", "ixveriwave.tx.factorydebug", + FT_UINT8, BASE_HEX, NULL, 0x7f80, NULL, HFILL } }, + + { &hf_radiotap_vw_errors_rx_bit0, + { "SIG Field CRC/Parity Error", "ixveriwave.errors.bit0", + FT_BOOLEAN, 32, NULL, 0x00000001, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit1, + { "Non-supported service field", "ixveriwave.errors.bit1", + FT_BOOLEAN, 32, NULL, 0x00000002, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit2, + { "Frame Length Error", "ixveriwave.errors.bit2", + FT_BOOLEAN, 32, NULL, 0x00000004, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit3, + { "VHT_SIG_A/B CRC Error", "ixveriwave.errors.bit3", + FT_BOOLEAN, 32, NULL, 0x00000008, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit4, + { "CRC32 Error", "ixveriwave.errors.bit4", + FT_BOOLEAN, 32, NULL, 0x00000010, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit5, + { "L2 de-aggregation error", "ixveriwave.errors.bit5", + FT_BOOLEAN, 32, NULL, 0x00000020, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit6, + { "Duplicate MPDU", "ixveriwave.errors.bit6", + FT_BOOLEAN, 32, NULL, 0x00000040, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit7, + { "Bad Flow Magic Number", "ixveriwave.errors.bit7", + FT_BOOLEAN, 32, NULL, 0x00000080, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit8, + { "Bad flow payload checksum", "ixveriwave.errors.bit8", + FT_BOOLEAN, 32, NULL, 0x00000100, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit9, + { "Illegal VHT_SIG Value", "ixveriwave.errors.bit9", + FT_BOOLEAN, 32, NULL, 0x00000200, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit10, + { "Bad IP checksum error", "ixveriwave.errors.bit10", + FT_BOOLEAN, 32, NULL, 0x00000400, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit11, + { "TCP/ICMP/IGMP/UDP Checksum Error", "ixveriwave.errors.bit11", + FT_BOOLEAN, 32, NULL, 0x00000800, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit12, + { "Layer 1 Unsupported Feature", "ixveriwave.errors.bit12", + FT_BOOLEAN, 32, NULL, 0x00001000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit14, + { "Layer 1 Packet Termination", "ixveriwave.errors.bit14", + FT_BOOLEAN, 32, NULL, 0x00004000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit15, + { "Internal Error", "ixveriwave.errors.bit15", + FT_BOOLEAN, 32, NULL, 0x00008000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit16, + { "WEP IVC/TKIP/CCMP/BIP MIC Miscompare", "ixveriwave.errors.bit16", + FT_BOOLEAN, 32, NULL, 0x00010000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit17, + { "WEP/TKIP Rate Exceeded", "ixveriwave.errors.bit17", + FT_BOOLEAN, 32, NULL, 0x00020000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit18, + { "Crypto Short Error", "ixveriwave.errors.bit18", + FT_BOOLEAN, 32, NULL, 0x00040000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit19, + { "EXTIV Fault A", "ixveriwave.errors.bit19", + FT_BOOLEAN, 32, NULL, 0x00080000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit20, + { "EXTIV Fault B", "ixveriwave.errors.bit20", + FT_BOOLEAN, 32, NULL, 0x00100000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit21, + { "Internal Error", "ixveriwave.errors.bit21", + FT_BOOLEAN, 32, NULL, 0x00200000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit22, + { "Protected Fault A", "ixveriwave.errors.bit22", + FT_BOOLEAN, 32, NULL, 0x00400000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit23, + { "RX MAC Crypto Incompatibility", "ixveriwave.errors.bit23", + FT_BOOLEAN, 32, NULL, 0x00800000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit24, + { "Factory Debug", "ixveriwave.errors.bit24", + FT_BOOLEAN, 32, NULL, 0x7F000000, NULL, HFILL } }, + { &hf_radiotap_vw_errors_rx_bit31, + { "Internal Error", "ixveriwave.errors.bit31", + FT_BOOLEAN, 32, NULL, 0x80000000, NULL, HFILL } }, + { &hf_radiotap_vw_info, { "Info field", "ixveriwave.info", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx, + { "Info field", "ixveriwave.info", + FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx, + { "Info field", "ixveriwave.info", + FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL } }, /* tx info decodes for VW510021 and previous versions */ + + /* + { &hf_radiotap_vw_info_tx_bit0, + { "Crypto WEP Encoded", "ixveriwave.info.bit0", + FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit1, + { "Crypto TKIP Encoded", "ixveriwave.info.bit1", + FT_BOOLEAN, 16, NULL, 0x0006, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit3, + { "Crypto C bit Error", "ixveriwave.info.bit3", + FT_BOOLEAN, 16, NULL, 0x0008, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit4, + { "Crypto TKIP not full MSDU", "ixveriwave.info.bit4", + FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit5, + { "Crypto Software Error", "ixveriwave.info.bit5", + FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit6, + { "Crypto Short Fault", "ixveriwave.info.bit6", + FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit7, + { "Crypto Payload Length Fault", "ixveriwave.info.bit7", + FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit8, + { "Sent RTS before Data", "ixveriwave.info.bit8", + FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit9, + { "Sent CTS to Self before Data", "ixveriwave.info.bit9", + FT_BOOLEAN, 16, NULL, 0x0200, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit10, { "MPDU of A-MPDU", "ixveriwave.info.bit10", FT_BOOLEAN, 16, NULL, INFO_MPDU_OF_A_MPDU, NULL, HFILL } }, @@ -1615,9 +4092,155 @@ framing signal deasserted. this is caused by software setting the drain all reg { &hf_radiotap_vw_info_tx_bit15, { "Last MSDU of A-MSDU", "ixveriwave.info.bit15", FT_BOOLEAN, 16, NULL, INFO_LAST_MSDU_OF_A_MSDU, NULL, HFILL } }, + */ + /* tx info decodes for VW510021 and previous versions */ + { &hf_radiotap_vw_info_tx_bit0, + { "Crypto WEP Encoded", "ixveriwave.info.bit0", + FT_UINT16, BASE_DEC, NULL, 0x0001, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit1, + { "Crypto TKIP Encoded", "ixveriwave.info.bit1", + FT_UINT16, BASE_DEC, VALS(crypto_TKIP_type), 0x0006, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit3, + { "Crypto C bit Error", "ixveriwave.info.bit3", + FT_UINT16, BASE_DEC, NULL, 0x0008, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit4, + { "Crypto TKIP not full MSDU", "ixveriwave.info.bit4", + FT_UINT16, BASE_DEC, NULL, 0x0010, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit5, + { "Crypto Software Error", "ixveriwave.info.bit5", + FT_UINT16, BASE_DEC, NULL, 0x0020, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit6, + { "Crypto Short Fault", "ixveriwave.info.bit6", + FT_UINT16, BASE_DEC, NULL, 0x0040, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit7, + { "Crypto Payload Length Fault", "ixveriwave.info.bit7", + FT_UINT16, BASE_DEC, NULL, 0x0080, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit8, + { "Sent RTS before Data", "ixveriwave.info.bit8", + FT_UINT16, BASE_DEC, NULL, 0x0100, NULL, HFILL } }, + { &hf_radiotap_vw_info_tx_bit9, + { "Sent CTS to Self before Data", "ixveriwave.info.bit9", + FT_UINT16, BASE_DEC, NULL, 0x0200, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_bit10, + { "MPDU of A-MPDU", "ixveriwave.info.bit10", + FT_UINT16, BASE_DEC, NULL, INFO_MPDU_OF_A_MPDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_bit11, + { "First MPDU of A-MPDU", "ixveriwave.info.bit11", + FT_UINT16, BASE_DEC, NULL, INFO_FIRST_MPDU_OF_A_MPDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_bit12, + { "Last MPDU of A-MPDU", "ixveriwave.info.bit12", + FT_UINT16, BASE_DEC, NULL, INFO_LAST_MPDU_OF_A_MPDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_bit13, + { "MSDU of A-MSDU", "ixveriwave.info.bit13", + FT_UINT16, BASE_DEC, NULL, INFO_MSDU_OF_A_MSDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_bit14, + { "First MSDU of A-MSDU", "ixveriwave.info.bit14", + FT_UINT16, BASE_DEC, NULL, INFO_FIRST_MSDU_OF_A_MSDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_bit15, + { "Last MSDU of A-MSDU", "ixveriwave.info.bit15", + FT_UINT16, BASE_DEC, NULL, INFO_LAST_MSDU_OF_A_MSDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_2_bit10, + { "MPDU of A-MPDU", "ixveriwave.info.bit10", + FT_BOOLEAN, 16, NULL, INFO_MPDU_OF_A_MPDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_2_bit11, + { "First MPDU of A-MPDU", "ixveriwave.info.bit11", + FT_BOOLEAN, 16, NULL, INFO_FIRST_MPDU_OF_A_MPDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_2_bit12, + { "Last MPDU of A-MPDU", "ixveriwave.info.bit12", + FT_BOOLEAN, 16, NULL, INFO_LAST_MPDU_OF_A_MPDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_2_bit13, + { "MSDU of A-MSDU", "ixveriwave.info.bit13", + FT_BOOLEAN, 16, NULL, INFO_MSDU_OF_A_MSDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_2_bit14, + { "First MSDU of A-MSDU", "ixveriwave.info.bit14", + FT_BOOLEAN, 16, NULL, INFO_FIRST_MSDU_OF_A_MSDU, NULL, HFILL } }, + + { &hf_radiotap_vw_info_tx_2_bit15, + { "Last MSDU of A-MSDU", "ixveriwave.info.bit15", + FT_BOOLEAN, 16, NULL, INFO_LAST_MSDU_OF_A_MSDU, NULL, HFILL } }, /*v510006 uses bits */ /* rx info decodes for fpga ver VW510021 */ + { &hf_radiotap_vw_info_rx_bit0, + { "Crypto WEP Encoded", "ixveriwave.info.bit0", + FT_UINT24, BASE_DEC, NULL, 0x000001, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit1, + { "Crypto TKIP Encoded", "ixveriwave.info.bit1", + FT_UINT24, BASE_DEC, VALS(crypto_TKIP_type), 0x000006, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit3, + { "Crypto RX TKIP TSC SEQSKIP", "ixveriwave.info.bit3", + FT_UINT24, BASE_DEC, NULL, 0x000008, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit4, + { "Crypto RX CCMP PN SEQSKIP", "ixveriwave.info.bit4", + FT_UINT24, BASE_DEC, NULL, 0x000010, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit5, + { "TKIP not full MSDU", "ixveriwave.info.bit5", + FT_UINT24, BASE_DEC, NULL, 0x000020, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit6, + { "MPDU Length field is greater than MPDU octets", "ixveriwave.info.bit6", + FT_UINT24, BASE_DEC, NULL, 0x000040, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit7, + { "RX TKIP / CCMP TSC SEQERR", "ixveriwave.info.bit7", + FT_UINT24, BASE_DEC, NULL, 0x000080, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit8, + { "ACK withheld from frame", "ixveriwave.info.bit8", + FT_UINT24, BASE_DEC, NULL, 0x000100, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit9, + { "Client BSSID matched", "ixveriwave.info.bit9", + FT_UINT24, BASE_DEC, NULL, 0x000200, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit10, + { "MPDU of an A-MPDU", "ixveriwave.info.bit10", + FT_UINT24, BASE_DEC, NULL, 0x000400, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit11, + { "First MPDU of A-MPDU", "ixveriwave.info.bit11", + FT_UINT24, BASE_DEC, NULL, 0x000800, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit12, + { "Last MPDU of A-MPDU", "ixveriwave.info.bit12", + FT_UINT24, BASE_DEC, NULL, 0x001000, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit13, + { "MSDU of A-MSDU", "ixveriwave.info.bit13", + FT_UINT24, BASE_DEC, NULL, 0x002000, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit14, + { "First MSDU of A-MSDU", "ixveriwave.info.bit14", + FT_UINT24, BASE_DEC, NULL, 0x004000, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit15, + { "Last MSDU of A-MSDU", "ixveriwave.info.bit15", + FT_UINT24, BASE_DEC, NULL, 0x008000, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit16, + { "Layer 1 Info[0]", "ixveriwave.info.bit16", + FT_UINT24, BASE_DEC, NULL, 0x010000, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit17, + { "Layer 1 Info[1]", "ixveriwave.info.bit17", + FT_UINT24, BASE_DEC, NULL, 0x020000, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit18, + { "VHT frame received with the use of the VHT_SIG_B.LENGTH", "ixveriwave.info.bit18", + FT_UINT24, BASE_DEC, NULL, 0x040000, NULL, HFILL } }, + + { &hf_radiotap_vw_info_rx_bit19, + { "VHT frame received without the use of VHT_SIG_B.LENGTH", "ixveriwave.info.bit19", + FT_UINT24, BASE_DEC, NULL, 0x080000, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_bit20, + { "Factory Internal", "ixveriwave.info.bit20", + FT_UINT24, BASE_DEC, NULL, 0xf00000, NULL, HFILL } }, + { &hf_radiotap_vw_info_rx_2_bit8, { "ACK withheld from frame", "ixveriwave.info.bit8", FT_BOOLEAN, 16, NULL, 0x0100, NULL, HFILL } }, @@ -1660,12 +4283,28 @@ framing signal deasserted. this is caused by software setting the drain all reg &ett_radiotap_flags, &ett_radiotap_info, &ett_radiotap_times, - &ett_radiotap_errors + &ett_radiotap_errors, + &ett_radiotap_layer1, + &ett_radiotap_layer2to4, + &ett_radiotap_rf, + &ett_radiotap_plcp, + &ett_radiotap_infoc, + &ett_rf_info, + &ett_radiotap_contextp, }; + static ei_register_info ei[] = { + { &ei_radiotap_fcs_bad, { "ixveriwave.fcs_error", PI_CHECKSUM, PI_WARN, "FCS error", EXPFILL } }, + }; + + expert_module_t* expert_ixveriwave; + proto_ixveriwave = proto_register_protocol("ixveriwave", "ixveriwave", "ixveriwave"); proto_register_field_array(proto_ixveriwave, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + expert_ixveriwave = expert_register_protocol(proto_ixveriwave); + expert_register_field_array(expert_ixveriwave, ei, array_length(ei)); + ixveriwave_handle = register_dissector("ixveriwave", dissect_ixveriwave, proto_ixveriwave); } |