// License: BSD/LGPL // Copyright (C) 2011 Thomas d'Otreppe using System; using System.Collections.Generic; namespace WirelessPanda { public class AccessPoint : WirelessDevice, IEquatable { #region Properties /// /// Max Rate /// public double MaxRate { get { return (double)this.getDictValue("Max Rate"); } set { this.setDictValue("Max Rate", value); } } /// /// Max Seen Rate /// public double MaxSeenRate { get { return (double)this.getDictValue("Max Seen Rate"); } set { this.setDictValue("Max Seen Rate", value); } } /// /// Privacy /// public string Privacy { get { return (string)this.getDictValue("Privacy"); } set { this.setDictValue("Privacy", value); } } /// /// Cipher /// public string Cipher { get { return (string)this.getDictValue("Cipher"); } set { this.setDictValue("Cipher", value); } } /// /// Authentication /// public string Authentication { get { return (string)this.getDictValue("Authentication"); } set { this.setDictValue("Authentication", value); } } /// /// # Data Frames /// public ulong DataFrames { get { return (ulong)this.getDictValue("Data"); } set { this.setDictValue("Data", value); } } /// /// Beacons /// public long Beacons { get { return (long)this.getDictValue("Beacons"); } set { this.setDictValue("Beacons", value); } } /// /// IP Address /// public string IP { get { return (string)this.getDictValue("IP"); } set { this.setDictValue("IP", value); } } /// /// IP Type /// public int IPType { get { return (int)this.getDictValue("IP Type"); } set { this.setDictValue("IP Type", value); } } /// /// ESSID /// public string ESSID { get { return (string)this.getDictValue("ESSID"); } set { this.setDictValue("ESSID", value); } } /// /// ESSID Length /// public byte ESSIDLength { get { return (byte)this.getDictValue("ESSID Length"); } set { this.setDictValue("ESSID Length", value); } } /// /// Key /// public string Key { get { return (string)this.getDictValue("Key"); } set { this.setDictValue("Key", value); } } /// /// Network Type /// public string NetworkType { get { return (string)this.getDictValue("Network Type"); } set { this.setDictValue("Network Type", value); } } /// /// Info /// public string Info { get { return (string)this.getDictValue("Info"); } set { this.setDictValue("Info", value); } } /// /// Encoding /// public string Encoding { get { return (string)this.getDictValue("Encoding"); } set { this.setDictValue("Encoding", value); } } /// /// Cloaked ? /// public bool Cloaked { get { return (bool)this.getDictValue("Cloaked"); } set { this.setDictValue("Cloaked", value); } } /// /// Encryption /// public string Encryption { get { return (string)this.getDictValue("Encryption"); } set { this.setDictValue("Encryption", value); } } /// /// Is the traffic decrypted? /// public bool Decrypted { get { return (bool)this.getDictValue("Decrypted"); } set { this.setDictValue("Decrypted", value); } } /// /// # Beacon Frames /// public ulong Beacon { get { return (ulong)this.getDictValue("Beacon"); } set { this.setDictValue("Beacon", value); } } /// /// # LLC Frames /// public ulong LLC { get { return (ulong)this.getDictValue("LLC"); } set { this.setDictValue("LLC", value); } } /// /// # Crypt Frames /// public ulong Crypt { get { return (ulong)this.getDictValue("Crypt"); } set { this.setDictValue("Crypt", value); } } /// /// # Weak Frames /// public ulong Weak { get { return (ulong)this.getDictValue("Weak"); } set { this.setDictValue("Weak", value); } } /// /// Total Nb of Frames /// public ulong Total { get { return (ulong)this.getDictValue("Total"); } set { this.setDictValue("Total", value); } } /// /// Carrier /// public string Carrier { get { return (string)this.getDictValue("Carrier"); } set { this.setDictValue("Carrier", value); } } /// /// Best Quality /// public int BestQuality { get { return (int)this.getDictValue("BestQuality"); } set { this.setDictValue("BestQuality", value); } } /// /// Best Signal /// public int BestSignal { get { return (int)this.getDictValue("Best Signal"); } set { this.setDictValue("Best Signal", value); } } /// /// Best Noise /// public int BestNoise { get { return (int)this.getDictValue("Best Noise"); } set { this.setDictValue("Best Noise", value); } } /// /// Min Location /// public Coordinates MinLocation { get { return (Coordinates)this.getDictValue("Min Location"); } set { this.setDictValue("Min Location", value); } } /// /// Best Location /// public Coordinates BestLocation { get { return (Coordinates)this.getDictValue("Best Location"); } set { this.setDictValue("Best Location", value); } } /// /// Max Location /// public Coordinates MaxLocation { get { return (Coordinates)this.getDictValue("Max Location"); } set { this.setDictValue("Max Location", value); } } /// /// Data Size /// public ulong DataSize { get { return (ulong)this.getDictValue("Data Size"); } set { this.setDictValue("Data Size", value); } } #endregion /// /// Internal list of client /// private List _clientList = new List(); /// /// Add a client to our list /// /// public void addClient(Station sta) { this._clientList.Add(sta); sta.AP = this; } /// /// Returns the client list /// public List ClientList { get { return this._clientList; } } /// /// Implements IEquatable /// /// Other AccessPoint to compare to /// true if equals, false if not public bool Equals(AccessPoint other) { try { if (this.BSSID == other.BSSID) { return true; } } catch { } return false; } } }