/*
 * This file is part of DesktopBSD, see the README file.
 *
 * Author: Peter Hofer <ph@desktopbsd.net>
 *         (C) 2004, 2005
 *
 * Copyright: BSD, see the COPYING file included in this distribution
 *
 */

#ifndef __ACCESSPOINT_H
#define __ACCESSPOINT_H

#include <sys/types.h>
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/socket.h>

#include <net/if.h>
#include <net/if_var.h>
#include <net/ethernet.h>

#include <net80211/ieee80211.h>
#include <net80211/ieee80211_ioctl.h>
#include <dev/wi/if_wavelan_ieee.h>
#include <dev/wi/if_wireg.h>

#include <qstring.h>

/** @brief Wireless Access-Point class.
  *
  * This class provides information about a
  * wireless access point that was recognized
  * by a wireless lan device.
  */
class  AccessPoint {
public:
   enum  CapInfo {
      None = 0x0,

      ESS  = 0x1,
      WEP  = 0x2
	};


   AccessPoint(const struct ieee80211req_scan_result &, const QString &);

	QString	getSSID()  const;

   /** @return Signal quality [dBm] */
	int  getQuality()	const  { return apinfo.isr_rssi / apinfo.isr_noise;	}
   /** @return Signal.        */
	int  getSignal()	const  { return apinfo.isr_rssi;								}
   /** @return Signal noise   */
	int  getNoise()	const  { return apinfo.isr_noise;							}

   QString  getBSSID()    const;
   int      getCapInfo()  const;
   double   getRate()     const;

private:
	QString ssid;
	struct ieee80211req_scan_result apinfo;
};

#endif  /* __ACCESSPOINT_H */
