author | mickeyl <mickeyl> | 2004-02-23 18:37:03 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-02-23 18:37:03 (UTC) |
commit | 19b274033fc05d5190cee2fa974c683892173c84 (patch) (side-by-side diff) | |
tree | 2ad0727ba2414c215cb4b55b93f3b610304c1742 /libopie2/opienet/onetwork.h | |
parent | ab0203a43a30598774d8d8a1cf32075817d0dceb (diff) | |
download | opie-19b274033fc05d5190cee2fa974c683892173c84.zip opie-19b274033fc05d5190cee2fa974c683892173c84.tar.gz opie-19b274033fc05d5190cee2fa974c683892173c84.tar.bz2 |
The Linux Wireless Extensions V16 introduce some massive changes in the
binary structures. Since we still use V15 on most target platforms I have
to introduce two headers. Define OPIE_WE_VERSION to specify which header to include
-rw-r--r-- | libopie2/opienet/onetwork.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libopie2/opienet/onetwork.h b/libopie2/opienet/onetwork.h index 9b8a0d4..0a51108 100644 --- a/libopie2/opienet/onetwork.h +++ b/libopie2/opienet/onetwork.h @@ -1,130 +1,140 @@ /* This file is part of the Opie Project Copyright (C) 2003-2004 by Michael 'Mickey' Lauer =. <mickey@Vanille.de> .=l. .>+-= _;:, .> :=|. This program is free software; you can .> <`_, > . <= redistribute it and/or modify it under :`=1 )Y*s>-.-- : the terms of the GNU Library General Public .="- .-=="i, .._ License as published by the Free Software - . .-<_> .<> Foundation; either version 2 of the License, ._= =} : or (at your option) any later version. .%`+i> _;_. .i_,=:_. -<s. This program is distributed in the hope that + . -:. = it will be useful, but WITHOUT ANY WARRANTY; : .. .:, . . . without even the implied warranty of =_ + =;=|` MERCHANTABILITY or FITNESS FOR A _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef ONETWORK_H #define ONETWORK_H -#include "wireless.h" +#if !defined( OPIE_WE_VERSION ) +#error Need to define a wireless extension version to build against! +#endif + +#if OPIE_WE_VERSION == 15 +#include "wireless.15.h" +#endif + +#if OPIE_WE_VERSION == 16 +#include "wireless.16.h" +#endif /* OPIE */ #include <opie2/onetutils.h> #include <opie2/ostation.h> /* QT */ #include <qvaluelist.h> #include <qdict.h> #include <qmap.h> #include <qobject.h> #include <qhostaddress.h> class ONetworkInterface; class OWirelessNetworkInterface; class OChannelHopper; class OMonitoringInterface; /*====================================================================================== * ONetwork *======================================================================================*/ /** * @brief A container class for all network interfaces * * This class provides access to all available network interfaces of your computer. * * @author Michael 'Mickey' Lauer <mickey@vanille.de> */ class ONetwork : public QObject { Q_OBJECT public: typedef QDict<ONetworkInterface> InterfaceMap; typedef QDictIterator<ONetworkInterface> InterfaceIterator; public: /** * @returns the number of available interfaces */ int count() const; /** * @returns a pointer to the (one and only) @ref ONetwork instance. */ static ONetwork* instance(); /** * @returns an iterator usable for iterating through all network interfaces. */ InterfaceIterator iterator() const; /** * @returns true, if the @a interface supports the wireless extension protocol. */ bool isWirelessInterface( const char* interface ) const; /** * @returns a pointer to the @ref ONetworkInterface object for the specified @a interface or 0, if not found. * @see ONetworkInterface */ ONetworkInterface* interface( const QString& interface ) const; /** * @internal Rebuild the internal interface database * @note Sometimes it might be useful to call this from client code, * e.g. after issuing a cardctl insert */ void synchronize(); /** * @returns the wireless extension version used at compile time. **/ static short wirelessExtensionVersion(); protected: ONetwork(); private: static ONetwork* _instance; InterfaceMap _interfaces; }; /*====================================================================================== * ONetworkInterface *======================================================================================*/ /** * @brief A network interface wrapper. * * This class provides a wrapper for a network interface. All the cumbersume details of * Linux ioctls are hidden under a convenient high-level interface. * @warning Most of the setting methods contained in this class require the appropriate * process permissions to work. * * @author Michael 'Mickey' Lauer <mickey@vanille.de> */ class ONetworkInterface : public QObject { |