summaryrefslogtreecommitdiff
path: root/proto_80211_mac_hdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto_80211_mac_hdr.c')
-rw-r--r--proto_80211_mac_hdr.c175
1 files changed, 107 insertions, 68 deletions
diff --git a/proto_80211_mac_hdr.c b/proto_80211_mac_hdr.c
index 199c4e7..e37397c 100644
--- a/proto_80211_mac_hdr.c
+++ b/proto_80211_mac_hdr.c
@@ -883,7 +883,7 @@ static int8_t inf_reserved(struct pkt_buff *pkt, u8 *id)
if (reserved == NULL)
return 0;
- tprintf("Reserved (%u, Len (%u)): ", *id, reserved->len);
+ tprintf(" Reserved (%u, Len (%u)): ", *id, reserved->len);
data = pkt_pull(pkt, reserved->len);
if (data == NULL)
@@ -2578,68 +2578,101 @@ static int8_t inf_ht_cap(struct pkt_buff *pkt, u8 *id)
beam_cap = le32_to_cpu(ht_cap->beam_cap);
ext_cap = le16_to_cpu(ht_cap->ext_cap);
- tprintf(" HT Capabilities (%u, Len(%u)): ", *id, ht_cap->len);
+ tprintf(" HT Capabilities (%u, Len(%u)):\n", *id, ht_cap->len);
if (len_neq_error(ht_cap->len, 26))
return 0;
- tprintf("Info (LDCP Cod Cap (%u), Supp Ch Width Set (%u),"
- " SM Pwr Save(%u), HT-Greenfield (%u), Short GI for 20/40 MHz"
- " (%u/%u), Tx/Rx STBC (%u/%u), HT-Delayed Block Ack (%u),"
- " Max A-MSDU Len (%u), DSSS/CCK Mode in 40 MHz (%u),"
- " Res (0x%x), Forty MHz Intol (%u), L-SIG TXOP Protection Supp"
- " (%u)), ", ht_cap->ldpc, ht_cap->supp_width,
- ht_cap->sm_pwr, ht_cap->ht_green, ht_cap->gi_20mhz,
- ht_cap->gi_40mhz, ht_cap->tx_stbc, ht_cap->rx_stbc,
- ht_cap->ht_ack, ht_cap->max_msdu_length, ht_cap->dsss_ck_mode,
- ht_cap->res, ht_cap->forty_int, ht_cap->prot_supp);
- tprintf("A-MPDU Params (Max Len Exp (%u), Min Start Spacing (%u),"
- " Res (0x%x)), ", ht_cap->param >> 6, (ht_cap->param >> 3) & 0x7,
- ht_cap->param & 0x07);
- tprintf("Supp MCS Set (Rx MCS Bitmask (0x%x%x%x%x%x%x%x%x%x%x),"
- " Res (0x%x), Rx High Supp Data Rate (%u), Res (0x%x),"
- " Tx MCS Set Def (%u), Tx Rx MCS Set Not Eq (%u),"
- " Tx Max Number Spat Str Supp (%u),"
- " Tx Uneq Mod Supp (%u), Res (0x%x)), ",
- ht_cap->bitmask1, ht_cap->bitmask2, ht_cap->bitmask3,
- ht_cap->bitmask4, ht_cap->bitmask5, ht_cap->bitmask6,
- ht_cap->bitmask7, ht_cap->bitmask8, ht_cap->bitmask9,
- ht_cap->bitmask10_res >> 3, ht_cap->bitmask10_res & 0x7,
- le16_to_cpu(ht_cap->supp_rate_res) >> 6,
- le16_to_cpu(ht_cap->supp_rate_res) & 0x3F,
- tx_param_res >> 31, (tx_param_res >> 30) & 1,
- (tx_param_res >> 28) & 3, (tx_param_res >> 27) & 1,
- tx_param_res & 0x7FFFFFF);
- tprintf("Ext Cap (PCO (%u), PCO Trans Time (%u), Res (0x%x),"
- " MCS Feedb (%u), +HTC Supp (%u), RD Resp (%u), Res (0x%x)), ",
- ext_cap >> 15, (ext_cap >> 13) & 3, (ext_cap >> 8) & 0x1F,
- (ext_cap >> 6) & 3, (ext_cap >> 5) & 1, (ext_cap >> 4) & 1,
- ext_cap & 0xF);
- tprintf("Transm Beamf (Impl Transm Beamf Rec Cap (%u),"
- " Rec/Transm Stagg Sound Cap (%u/%u),"
- " Rec/Trans NDP Cap (%u/%u), Impl Transm Beamf Cap (%u),"
- " Cal (%u), Expl CSI Transm Beamf Cap (%u),"
- " Expl Noncmpr/Compr Steering Cap (%u/%u),"
- " Expl Trans Beamf CSI Feedb (%u),"
- " Expl Noncmpr/Cmpr Feedb Cap (%u/%u),"
- " Min Grpg (%u), CSI Num Beamf Ant Supp (%u),"
- " Noncmpr/Cmpr Steering Nr Beamf Ant Supp (%u/%u),"
- " CSI Max Nr Rows Beamf Supp (%u),"
- " Ch Estim Cap (%u), Res (0x%x)), ",
- beam_cap >> 31, (beam_cap >> 30) & 1, (beam_cap >> 29) & 1,
- (beam_cap >> 28) & 1, (beam_cap >> 27) & 1, (beam_cap >> 26) & 1,
- (beam_cap >> 24) & 3, (beam_cap >> 23) & 1, (beam_cap >> 22) & 1,
- (beam_cap >> 21) & 1, (beam_cap >> 19) & 3, (beam_cap >> 17) & 3,
- (beam_cap >> 15) & 3, (beam_cap >> 13) & 3, (beam_cap >> 11) & 3,
- (beam_cap >> 9) & 3, (beam_cap >> 7) & 3, (beam_cap >> 5) & 3,
- (beam_cap >> 3) & 3, beam_cap & 7);
- tprintf("ASEL (Ant Select Cap (%u),"
- " Expl CSI Feedb Based Transm ASEL Cap (%u),"
- " Ant Indic Feedb Based Transm ASEL Cap (%u),"
- " Expl CSI Feedb Cap (%u), Ant Indic Feedb Cap (%u),"
- " Rec ASEL Cap (%u), Transm Sound PPDUs Cap (%u), Res (0x%x))",
- ht_cap->asel_cap >> 7, (ht_cap->asel_cap >> 6) & 1,
- (ht_cap->asel_cap >> 5) & 1, (ht_cap->asel_cap >> 4) & 1,
- (ht_cap->asel_cap >> 3) & 1, (ht_cap->asel_cap >> 2) & 1,
- (ht_cap->asel_cap >> 1) & 1, ht_cap->asel_cap & 1);
+
+ tprintf("\t\t\t Info:\n");
+ tprintf("\t\t\t\t LDCP Cod Cap (%u)\n", ht_cap->ldpc);
+ tprintf("\t\t\t\t Supp Ch Width Set (%u)\n", ht_cap->supp_width);
+ tprintf("\t\t\t\t SM Pwr Save(%u)\n", ht_cap->sm_pwr);
+ tprintf("\t\t\t\t HT-Greenfield (%u)\n", ht_cap->ht_green);
+ tprintf("\t\t\t\t Short GI for 20/40 MHz (%u/%u)\n", ht_cap->gi_20mhz,
+ ht_cap->gi_40mhz);
+ tprintf("\t\t\t\t Tx/Rx STBC (%u/%u)\n", ht_cap->tx_stbc,
+ ht_cap->rx_stbc);
+ tprintf("\t\t\t\t HT-Delayed Block Ack (%u)\n", ht_cap->ht_ack);
+ tprintf("\t\t\t\t Max A-MSDU Len (%u)\n", ht_cap->max_msdu_length);
+ tprintf("\t\t\t\t DSSS/CCK Mode in 40 MHz (%u)\n",
+ ht_cap->dsss_ck_mode);
+ tprintf("\t\t\t\t Res (0x%x)\n", ht_cap->res);
+ tprintf("\t\t\t\t Forty MHz Intol (%u)\n", ht_cap->forty_int);
+ tprintf("\t\t\t\t L-SIG TXOP Protection Supp (%u)\n",
+ ht_cap->prot_supp);
+
+ tprintf("\t\t\t A-MPDU Params:\n");
+ tprintf("\t\t\t\t Max Len Exp (%u)\n", ht_cap->param >> 6);
+ tprintf("\t\t\t\t Min Start Spacing (%u)\n",
+ (ht_cap->param >> 3) & 0x7);
+ tprintf("\t\t\t\t Res (0x%x)\n", ht_cap->param & 0x07);
+
+ tprintf("\t\t\t Supp MCS Set:\n");
+ tprintf("\t\t\t\t Rx MCS Bitmask (0x%x%x%x%x%x%x%x%x%x%x)\n",
+ ht_cap->bitmask1, ht_cap->bitmask2, ht_cap->bitmask3,
+ ht_cap->bitmask4, ht_cap->bitmask5, ht_cap->bitmask6,
+ ht_cap->bitmask7, ht_cap->bitmask8, ht_cap->bitmask9,
+ ht_cap->bitmask10_res >> 3);
+ tprintf("\t\t\t\t Res (0x%x)\n", ht_cap->bitmask10_res & 0x7);
+ tprintf("\t\t\t\t Rx High Supp Data Rate (%u)\n",
+ le16_to_cpu(ht_cap->supp_rate_res) >> 6);
+ tprintf("\t\t\t\t Res (0x%x)\n",
+ le16_to_cpu(ht_cap->supp_rate_res) & 0x3F);
+ tprintf("\t\t\t\t Tx MCS Set Def (%u)\n", tx_param_res >> 31);
+ tprintf("\t\t\t\t Tx Rx MCS Set Not Eq (%u)\n",
+ (tx_param_res >> 30) & 1);
+ tprintf("\t\t\t\t Tx Max Number Spat Str Supp (%u)\n",
+ (tx_param_res >> 28) & 3);
+ tprintf("\t\t\t\t Tx Uneq Mod Supp (%u)\n", (tx_param_res >> 27) & 1);
+ tprintf("\t\t\t\t Res (0x%x)\n", tx_param_res & 0x7FFFFFF);
+
+ tprintf("\t\t\t Ext Cap:\n");
+ tprintf("\t\t\t\t PCO (%u)\n", ext_cap >> 15);
+ tprintf("\t\t\t\t PCO Trans Time (%u)\n", (ext_cap >> 13) & 3);
+ tprintf("\t\t\t\t Res (0x%x)\n", (ext_cap >> 8) & 0x1F);
+ tprintf("\t\t\t\t MCS Feedb (%u)\n", (ext_cap >> 6) & 3);
+ tprintf("\t\t\t\t +HTC Supp (%u)\n", (ext_cap >> 5) & 1);
+ tprintf("\t\t\t\t RD Resp (%u)\n", (ext_cap >> 4) & 1);
+ tprintf("\t\t\t\t Res (0x%x)\n", ext_cap & 0xF);
+
+ tprintf("\t\t\t Transm Beamf:\n");
+ tprintf("\t\t\t\t Impl Transm Beamf Rec Cap (%u)\n", beam_cap >> 31);
+ tprintf("\t\t\t\t Rec/Transm Stagg Sound Cap (%u/%u)\n",
+ (beam_cap >> 30) & 1, (beam_cap >> 29) & 1);
+ tprintf("\t\t\t\t Rec/Trans NDP Cap (%u/%u)\n",
+ (beam_cap >> 28) & 1, (beam_cap >> 27) & 1);
+ tprintf("\t\t\t\t Impl Transm Beamf Cap (%u)\n", (beam_cap >> 26) & 1);
+ tprintf("\t\t\t\t Cal (%u)\n", (beam_cap >> 24) & 3);
+ tprintf("\t\t\t\t Expl CSI Transm Beamf Cap (%u)\n",
+ (beam_cap >> 23) & 1);
+ tprintf("\t\t\t\t Expl Noncmpr/Compr Steering Cap (%u/%u)\n",
+ (beam_cap >> 22) & 1, (beam_cap >> 21) & 1);
+ tprintf("\t\t\t\t Expl Trans Beamf CSI Feedb (%u)\n",
+ (beam_cap >> 19) & 3);
+ tprintf("\t\t\t\t Expl Noncmpr/Cmpr Feedb Cap (%u/%u)\n",
+ (beam_cap >> 17) & 3, (beam_cap >> 15) & 3);
+ tprintf("\t\t\t\t Min Grpg (%u)\n", (beam_cap >> 13) & 3);
+ tprintf("\t\t\t\t CSI Num Beamf Ant Supp (%u)\n", (beam_cap >> 11) & 3);
+ tprintf("\t\t\t\t Noncmpr/Cmpr Steering Nr Beamf Ant Supp (%u/%u)\n",
+ (beam_cap >> 9) & 3, (beam_cap >> 7) & 3);
+ tprintf("\t\t\t\t CSI Max Nr Rows Beamf Supp (%u)\n",
+ (beam_cap >> 5) & 3);
+ tprintf("\t\t\t\t Ch Estim Cap (%u)\n", (beam_cap >> 3) & 3);
+ tprintf("\t\t\t\t Res (0x%x)\n", beam_cap & 7);
+
+ tprintf("\t\t\t ASEL:\n");
+ tprintf("\t\t\t\t Ant Select Cap (%u)\n", ht_cap->asel_cap >> 7);
+ tprintf("\t\t\t\t Expl CSI Feedb Based Transm ASEL Cap (%u)\n",
+ (ht_cap->asel_cap >> 6) & 1);
+ tprintf("\t\t\t\t Ant Indic Feedb Based Transm ASEL Cap (%u)\n",
+ (ht_cap->asel_cap >> 5) & 1);
+ tprintf("\t\t\t\t Expl CSI Feedb Cap (%u)\n",
+ (ht_cap->asel_cap >> 4) & 1);
+ tprintf("\t\t\t\t Ant Indic Feedb Cap (%u)\n",
+ (ht_cap->asel_cap >> 3) & 1);
+ tprintf("\t\t\t\t Rec ASEL Cap (%u)\n", (ht_cap->asel_cap >> 2) & 1);
+ tprintf("\t\t\t\t Transm Sound PPDUs Cap (%u)\n",
+ (ht_cap->asel_cap >> 1) & 1);
+ tprintf("\t\t\t\t Res (0x%x)", ht_cap->asel_cap & 1);
return 1;
}
@@ -2917,6 +2950,16 @@ static int8_t cap_field(u16 cap_inf)
return 1;
}
+static void print_inf_elements(struct pkt_buff *pkt)
+{
+ if (pkt_len(pkt)) {
+ tprintf("\n\tParameters:\n\t\t");
+ while (inf_elements(pkt)) {
+ tprintf("\n\t\t");
+ }
+ }
+}
+
/* Management Dissectors */
static int8_t beacon(struct pkt_buff *pkt)
{
@@ -2933,15 +2976,11 @@ static int8_t beacon(struct pkt_buff *pkt)
cap_field(le16_to_cpu(beacon->capab_info));
tprintf(")");
- if(pkt_len(pkt)) {
- tprintf("\n\tParameters:");
- while (inf_elements(pkt)) {
- tprintf("\n\t");
- }
- }
+ print_inf_elements(pkt);
- if(pkt_len(pkt))
+ if (pkt_len(pkt))
return 0;
+
return 1;
}