summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp12
-rw-r--r--libopie2/opienet/opcap.cpp23
2 files changed, 18 insertions, 17 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index 171a2bc..591681c 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -821,41 +821,41 @@ void OWirelessNetworkInterface::setPrivate( const QString& call, int numargs, ..
return;
}
odebug << "OWirelessNetworkInterface::setPrivate(): about to call '" << call << "' on interface '" << name() << "'" << oendl;
memset( &_iwr, 0, sizeof _iwr );
va_list argp;
va_start( argp, numargs );
for ( int i = 0; i < numargs; ++i )
{
priv->setParameter( i, va_arg( argp, int ) );
}
va_end( argp );
priv->invoke();
}
-void OWirelessNetworkInterface::getPrivate( const QString& call )
+void OWirelessNetworkInterface::getPrivate( const QString& )
{
oerr << "OWirelessNetworkInterface::getPrivate() is not implemented yet." << oendl;
}
bool OWirelessNetworkInterface::hasPrivate( const QString& call )
{
- return child( (const char*) call );
+ return child( call.local8Bit() );
}
QString OWirelessNetworkInterface::SSID() const
{
char str[IW_ESSID_MAX_SIZE];
_iwr.u.essid.pointer = &str[0];
_iwr.u.essid.length = IW_ESSID_MAX_SIZE;
if ( !wioctl( SIOCGIWESSID ) )
{
return "<unknown>";
}
else
{
return str;
}
@@ -999,34 +999,34 @@ OStationList* OWirelessNetworkInterface::scanNetwork()
int OWirelessNetworkInterface::signalStrength() const
{
iw_statistics stat;
::memset( &stat, 0, sizeof stat );
_iwr.u.data.pointer = (char*) &stat;
_iwr.u.data.flags = 0;
_iwr.u.data.length = sizeof stat;
if ( !wioctl( SIOCGIWSTATS ) )
{
return -1;
}
int max = _range.max_qual.qual;
int cur = stat.qual.qual;
- int lev = stat.qual.level; //FIXME: Do something with them?
- int noi = stat.qual.noise; //FIXME: Do something with them?
+// int lev = stat.qual.level; //FIXME: Do something with them?
+// int noi = stat.qual.noise; //FIXME: Do something with them?
return max != 0 ? cur*100/max: -1;
}
bool OWirelessNetworkInterface::wioctl( int call, struct iwreq& iwreq ) const
{
#ifndef NODEBUG
int result = ::ioctl( _sfd, call, &iwreq );
if ( result == -1 )
odebug << "ONetworkInterface::wioctl (" << name() << ") call '"
<< debugmapper->map( call ) << "' FAILED! " << result << " (" << strerror( errno ) << ")" << oendl;
else
odebug << "ONetworkInterface::wioctl (" << name() << ") call '"
@@ -1058,54 +1058,54 @@ OMonitoringInterface::OMonitoringInterface( ONetworkInterface* iface, bool prism
OMonitoringInterface::~OMonitoringInterface()
{
}
void OMonitoringInterface::setChannel( int c )
{
// use standard WE channel switching protocol
memset( &_if->_iwr, 0, sizeof( struct iwreq ) );
_if->_iwr.u.freq.m = c;
_if->_iwr.u.freq.e = 0;
_if->wioctl( SIOCSIWFREQ );
}
-void OMonitoringInterface::setEnabled( bool b )
+void OMonitoringInterface::setEnabled( bool )
{
}
/*======================================================================================
* OCiscoMonitoringInterface
*======================================================================================*/
OCiscoMonitoringInterface::OCiscoMonitoringInterface( ONetworkInterface* iface, bool prismHeader )
:OMonitoringInterface( iface, prismHeader )
{
iface->setMonitoring( this );
}
OCiscoMonitoringInterface::~OCiscoMonitoringInterface()
{
}
-void OCiscoMonitoringInterface::setEnabled( bool b )
+void OCiscoMonitoringInterface::setEnabled( bool /*b*/ )
{
QString fname;
fname.sprintf( "/proc/driver/aironet/%s", (const char*) _if->name() );
QFile f( fname );
if ( !f.exists() ) return;
if ( f.open( IO_WriteOnly ) )
{
QTextStream s( &f );
s << "Mode: r";
s << "Mode: y";
s << "XmitPower: 1";
}
// flushing and closing will be done automatically when f goes out of scope
}
diff --git a/libopie2/opienet/opcap.cpp b/libopie2/opienet/opcap.cpp
index 03e4502..25ac09b 100644
--- a/libopie2/opienet/opcap.cpp
+++ b/libopie2/opienet/opcap.cpp
@@ -177,32 +177,33 @@ QString OPacket::dump( int bpl ) const
str.append( chars );
}
str.append( '\n' );
return str;
}
int OPacket::len() const
{
return _hdr.len;
}
QTextStream& operator<<( QTextStream& s, const OPacket& p )
{
s << p.dumpStructure();
+ return s;
}
/*======================================================================================
* OEthernetPacket
*======================================================================================*/
OEthernetPacket::OEthernetPacket( const unsigned char* end, const struct ether_header* data, QObject* parent )
:QObject( parent, "Ethernet" ), _ether( data )
{
odebug << "Source = " << sourceAddress().toString() << oendl;
odebug << "Destination = " << destinationAddress().toString() << oendl;
if ( sourceAddress() == OMacAddress::broadcast )
odebug << "Source is broadcast address" << oendl;
@@ -314,33 +315,33 @@ int OIPPacket::ttl() const
int OIPPacket::protocol() const
{
return _iphdr->protocol;
}
int OIPPacket::checksum() const
{
return EXTRACT_16BITS( &_iphdr->check );
}
/*======================================================================================
* OARPPacket
*======================================================================================*/
-OARPPacket::OARPPacket( const unsigned char* end, const struct myarphdr* data, QObject* parent )
+OARPPacket::OARPPacket( const unsigned char* /*end*/, const struct myarphdr* data, QObject* parent )
:QObject( parent, "ARP" ), _arphdr( data )
{
odebug << "OARPPacket::OARPPacket(): decoding ARP header..." << oendl;
odebug << "ARP type seems to be " << EXTRACT_16BITS( &_arphdr->ar_op ) << " = " << type() << oendl;
odebug << "Sender: MAC " << senderMacAddress().toString() << " = IP " << senderIPV4Address().toString() << oendl;
odebug << "Target: MAC " << targetMacAddress().toString() << " = IP " << targetIPV4Address().toString() << oendl;
}
OARPPacket::~OARPPacket()
{
}
QString OARPPacket::type() const
{
@@ -534,33 +535,33 @@ QHostAddress ODHCPPacket::relayAddress() const
{
return EXTRACT_32BITS( &_dhcphdr->giaddr );
}
OMacAddress ODHCPPacket::clientMacAddress() const
{
return OMacAddress( _dhcphdr->chaddr );
}
/*======================================================================================
* OTCPPacket
*======================================================================================*/
-OTCPPacket::OTCPPacket( const unsigned char* end, const struct tcphdr* data, QObject* parent )
+OTCPPacket::OTCPPacket( const unsigned char* /*end*/, const struct tcphdr* data, QObject* parent )
:QObject( parent, "TCP" ), _tcphdr( data )
{
odebug << "OTCPPacket::OTCPPacket(): decoding TCP header..." << oendl;
}
OTCPPacket::~OTCPPacket()
{
}
int OTCPPacket::fromPort() const
{
return EXTRACT_16BITS( &_tcphdr->source );
}
@@ -821,33 +822,33 @@ bool OWaveLanManagementPacket::canCFP() const
bool OWaveLanManagementPacket::canCFP_REQ() const
{
return CAPABILITY_CFP_REQ( EXTRACT_LE_16BITS( &_body->capability_info ) );
}
bool OWaveLanManagementPacket::canPrivacy() const
{
return CAPABILITY_PRIVACY( EXTRACT_LE_16BITS( &_body->capability_info ) );
}
/*======================================================================================
* OWaveLanManagementSSID
*======================================================================================*/
-OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* end, const struct ssid_t* data, QObject* parent )
+OWaveLanManagementSSID::OWaveLanManagementSSID( const unsigned char* /*end*/, const struct ssid_t* data, QObject* parent )
:QObject( parent, "802.11 SSID" ), _data( data )
{
odebug << "OWaveLanManagementSSID()" << oendl;
}
OWaveLanManagementSSID::~OWaveLanManagementSSID()
{
}
QString OWaveLanManagementSSID::ID( bool decloak ) const
{
int length = _data->length;
if ( length > 32 ) length = 32;
char essid[length+1];
@@ -857,129 +858,129 @@ QString OWaveLanManagementSSID::ID( bool decloak ) const
odebug << "OWaveLanManagementSSID:ID(): SSID is cloaked - decloaking..." << oendl;
QString decloakedID;
for ( int i = 1; i < length; ++i )
{
if ( essid[i] >= 32 && essid[i] <= 126 ) decloakedID.append( essid[i] );
else decloakedID.append( '.' );
}
return decloakedID;
}
/*======================================================================================
* OWaveLanManagementRates
*======================================================================================*/
-OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* end, const struct rates_t* data, QObject* parent )
+OWaveLanManagementRates::OWaveLanManagementRates( const unsigned char* /*end*/, const struct rates_t* data, QObject* parent )
:QObject( parent, "802.11 Rates" ), _data( data )
{
odebug << "OWaveLanManagementRates()" << oendl;
}
OWaveLanManagementRates::~OWaveLanManagementRates()
{
}
/*======================================================================================
* OWaveLanManagementCF
*======================================================================================*/
-OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* end, const struct cf_t* data, QObject* parent )
+OWaveLanManagementCF::OWaveLanManagementCF( const unsigned char* /*end*/, const struct cf_t* data, QObject* parent )
:QObject( parent, "802.11 CF" ), _data( data )
{
odebug << "OWaveLanManagementCF()" << oendl;
}
OWaveLanManagementCF::~OWaveLanManagementCF()
{
}
/*======================================================================================
* OWaveLanManagementFH
*======================================================================================*/
-OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* end, const struct fh_t* data, QObject* parent )
+OWaveLanManagementFH::OWaveLanManagementFH( const unsigned char* /*end*/, const struct fh_t* data, QObject* parent )
:QObject( parent, "802.11 FH" ), _data( data )
{
odebug << "OWaveLanManagementFH()" << oendl;
}
OWaveLanManagementFH::~OWaveLanManagementFH()
{
}
/*======================================================================================
* OWaveLanManagementDS
*======================================================================================*/
-OWaveLanManagementDS::OWaveLanManagementDS( const unsigned char* end, const struct ds_t* data, QObject* parent )
+OWaveLanManagementDS::OWaveLanManagementDS( const unsigned char* /*end*/, const struct ds_t* data, QObject* parent )
:QObject( parent, "802.11 DS" ), _data( data )
{
odebug << "OWaveLanManagementDS()" << oendl;
}
OWaveLanManagementDS::~OWaveLanManagementDS()
{
}
int OWaveLanManagementDS::channel() const
{
return _data->channel;
}
/*======================================================================================
* OWaveLanManagementTim
*======================================================================================*/
-OWaveLanManagementTim::OWaveLanManagementTim( const unsigned char* end, const struct tim_t* data, QObject* parent )
+OWaveLanManagementTim::OWaveLanManagementTim( const unsigned char* /*end*/, const struct tim_t* data, QObject* parent )
:QObject( parent, "802.11 Tim" ), _data( data )
{
odebug << "OWaveLanManagementTim()" << oendl;
}
OWaveLanManagementTim::~OWaveLanManagementTim()
{
}
/*======================================================================================
* OWaveLanManagementIBSS
*======================================================================================*/
-OWaveLanManagementIBSS::OWaveLanManagementIBSS( const unsigned char* end, const struct ibss_t* data, QObject* parent )
+OWaveLanManagementIBSS::OWaveLanManagementIBSS( const unsigned char* /*end*/, const struct ibss_t* data, QObject* parent )
:QObject( parent, "802.11 IBSS" ), _data( data )
{
odebug << "OWaveLanManagementIBSS()" << oendl;
}
OWaveLanManagementIBSS::~OWaveLanManagementIBSS()
{
}
/*======================================================================================
* OWaveLanManagementChallenge
*======================================================================================*/
-OWaveLanManagementChallenge::OWaveLanManagementChallenge( const unsigned char* end, const struct challenge_t* data, QObject* parent )
+OWaveLanManagementChallenge::OWaveLanManagementChallenge( const unsigned char* /*end*/, const struct challenge_t* data, QObject* parent )
:QObject( parent, "802.11 Challenge" ), _data( data )
{
odebug << "OWaveLanManagementChallenge()" << oendl;
}
OWaveLanManagementChallenge::~OWaveLanManagementChallenge()
{
}
/*======================================================================================
* OWaveLanDataPacket
*======================================================================================*/
OWaveLanDataPacket::OWaveLanDataPacket( const unsigned char* end, const struct ieee_802_11_data_header* data, OWaveLanPacket* parent )
:QObject( parent, "802.11 Data" ), _header( data )
@@ -1019,33 +1020,33 @@ OLLCPacket::OLLCPacket( const unsigned char* end, const struct ieee_802_11_802_2
case ETH_P_ARP: new OARPPacket( end, (const struct myarphdr*) (data+1), this ); break;
default: owarn << "OLLCPacket::OLLCPacket(): Unknown Encapsulation type = " << EXTRACT_16BITS( &_header->type ) << oendl;
}
}
}
OLLCPacket::~OLLCPacket()
{
}
/*======================================================================================
* OWaveLanControlPacket
*======================================================================================*/
-OWaveLanControlPacket::OWaveLanControlPacket( const unsigned char* end, const struct ieee_802_11_control_header* data, OWaveLanPacket* parent )
+OWaveLanControlPacket::OWaveLanControlPacket( const unsigned char* /*end*/, const struct ieee_802_11_control_header* data, OWaveLanPacket* parent )
:QObject( parent, "802.11 Control" ), _header( data )
{
odebug << "OWaveLanControlPacket::OWaveLanDataControl(): decoding frame..." << oendl;
odebug << "Detected subtype is " << controlType() << oendl;
}
OWaveLanControlPacket::~OWaveLanControlPacket()
{
}
QString OWaveLanControlPacket::controlType() const
{
switch ( FC_SUBTYPE( EXTRACT_LE_16BITS( &_header->fc ) ) )
{