/*
 * 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 __WIRELESSINTERFACE_H
#define __WIRELESSINTERFACE_H

#include <netinterface.h>

class QString;
class WLAN;
class LAN;
struct ieee80211req;
class AccessPoint;
template <class T> class QPtrList;

#include <wepmode.h>

/** @brief Wireless network interface.
  *
  * This class provides functionality to obtain information
  * about wireless networks in range, the currently used network
  * and to set wireless network properties such as the SSID.
  */
class  WirelessInterface : public  NetInterface {
public:
	WirelessInterface(const  QString &);

	bool  connectTo(const  WLAN &);

	bool  setSSID(const  QString &);
	bool  setWEPMode(WEPMode);
	bool  setWEPKey(const QString &);
	bool	setWEPKeyIndex(int);

	QString  getSSID()     const;
	WEPMode  getWEPMode()  const;

	QPtrList<AccessPoint>  getAPs();

	static  QPtrList<WirelessInterface>  getWirelessIfs();

private:
	int  set80211(int,  int,  int,  uint8_t *)  const;
	struct ieee80211req  *getIReq(int,  uint8_t **)  const;
	struct ieee80211req  *getIReq(int, uint8_t **, size_t, int16_t) const;
	QString copySSID(const uint8_t *, const size_t) const;

	int     hexToNumber(char)  const;
};

#endif /* __WIRELESSINTERFACE_H */
