diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-12 14:17:18 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-12 14:17:18 +0000 |
commit | a356f552b43bbdedde3c04227d44d4f80d7e20eb (patch) | |
tree | d632574f235268d4d5745b2d6dac4baa3e3244cb /epan | |
parent | 5e893a8b1c6707a8526e9a60168e5dbebe567b05 (diff) |
Added WLAN Traffic Statistics dialog.
svn path=/trunk/; revision=24310
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ieee80211.c | 20 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee80211.h | 10 |
2 files changed, 30 insertions, 0 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c index c43b4068e9..ce04586e4d 100644 --- a/epan/dissectors/packet-ieee80211.c +++ b/epan/dissectors/packet-ieee80211.c @@ -141,6 +141,9 @@ static gint wlan_ignore_wep = WLAN_IGNORE_WEP_NO; static GHashTable *wlan_fragment_table = NULL; static GHashTable *wlan_reassembled_table = NULL; +/* Statistical data */ +static struct _wlan_stats wlan_stats; + /* Stuff for the WEP decoder */ static gboolean enable_decryption = FALSE; static void init_wepkeys(void); @@ -4128,6 +4131,9 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of if (tag_len > 0) { proto_item_append_text(ti, ": \"%s\"", format_text(ssid, tag_len)); + if (tag_len < 32) { + g_snprintf (wlan_stats.ssid, MAX_SSID_LEN, ssid); + } } else { proto_item_append_text(ti, ": Broadcast"); } @@ -4199,6 +4205,7 @@ add_tagged_field (packet_info * pinfo, proto_tree * tree, tvbuff_t * tvb, int of proto_tree_add_string (tree, tag_interpretation, tvb, offset + 2, tag_len, out_buff); proto_item_append_text(ti, ": %s", out_buff); + wlan_stats.channel = tvb_get_guint8(tvb, offset + 2); break; case TAG_CF_PARAMETER: @@ -6704,6 +6711,16 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, } } + if (algorithm == PROTECTION_ALG_WEP) { + strncpy (wlan_stats.protection, "WEP", MAX_PROTECT_LEN); + } else if (algorithm == PROTECTION_ALG_TKIP) { + strncpy (wlan_stats.protection, "TKIP", MAX_PROTECT_LEN); + } else if (algorithm == PROTECTION_ALG_CCMP) { + strncpy (wlan_stats.protection, "CCMP", MAX_PROTECT_LEN); + } else { + strncpy (wlan_stats.protection, "Unknown", MAX_PROTECT_LEN); + } + #ifndef HAVE_AIRPDCAP if (can_decrypt) next_tvb = try_decrypt_wep(tvb, hdr_len, reported_len + 8); @@ -6973,7 +6990,9 @@ dissect_ieee80211_common (tvbuff_t * tvb, packet_info * pinfo, pinfo->fragmented = save_fragmented; end_of_wlan: + whdr->stats = wlan_stats; tap_queue_packet(wlan_tap, pinfo, whdr); + memset (&wlan_stats, 0, sizeof wlan_stats); } /* @@ -10867,6 +10886,7 @@ proto_register_ieee80211 (void) }; module_t *wlan_module; + memset (&wlan_stats, 0, sizeof wlan_stats); proto_aggregate = proto_register_protocol("IEEE 802.11 wireless LAN aggregate frame", "IEEE 802.11 Aggregate Data", "wlan_aggregate"); diff --git a/epan/dissectors/packet-ieee80211.h b/epan/dissectors/packet-ieee80211.h index b75d739975..faf24bf3ff 100644 --- a/epan/dissectors/packet-ieee80211.h +++ b/epan/dissectors/packet-ieee80211.h @@ -38,9 +38,19 @@ void capture_wlancap(const guchar *, int, int, packet_counts *); void ieee_80211_add_tagged_parameters (tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, int tagged_parameters_len); +#define MAX_SSID_LEN 32 +#define MAX_PROTECT_LEN 10 + +struct _wlan_stats { + guint8 channel; + guchar ssid[MAX_SSID_LEN]; + guchar protection[MAX_PROTECT_LEN]; +}; + typedef struct _wlan_hdr { address bssid; address src; address dst; guint16 type; + struct _wlan_stats stats; } wlan_hdr; |