summaryrefslogtreecommitdiff
path: root/libopie2/opienet/onetwork.cpp
Unidiff
Diffstat (limited to 'libopie2/opienet/onetwork.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opienet/onetwork.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/libopie2/opienet/onetwork.cpp b/libopie2/opienet/onetwork.cpp
index be2736a..95e7043 100644
--- a/libopie2/opienet/onetwork.cpp
+++ b/libopie2/opienet/onetwork.cpp
@@ -630,49 +630,50 @@ void OWirelessNetworkInterface::setChannelHopping( int interval )
630int OWirelessNetworkInterface::channelHopping() const 630int OWirelessNetworkInterface::channelHopping() const
631{ 631{
632 return _hopper->interval(); 632 return _hopper->interval();
633} 633}
634 634
635 635
636OChannelHopper* OWirelessNetworkInterface::channelHopper() const 636OChannelHopper* OWirelessNetworkInterface::channelHopper() const
637{ 637{
638 return _hopper; 638 return _hopper;
639} 639}
640 640
641 641
642void OWirelessNetworkInterface::setMonitorMode( bool b ) 642void OWirelessNetworkInterface::setMonitorMode( bool b )
643{ 643{
644 if ( _mon ) 644 if ( _mon )
645 _mon->setEnabled( b ); 645 _mon->setEnabled( b );
646 else 646 else
647 qDebug( "ONetwork(): can't switch monitor mode without installed monitoring interface" ); 647 qDebug( "ONetwork(): can't switch monitor mode without installed monitoring interface" );
648} 648}
649 649
650 650
651bool OWirelessNetworkInterface::monitorMode() const 651bool OWirelessNetworkInterface::monitorMode() const
652{ 652{
653 qDebug( "dataLinkType = %d", dataLinkType() ); 653 qDebug( "dataLinkType = %d", dataLinkType() );
654 return dataLinkType() == ARPHRD_IEEE80211; 654 return ( dataLinkType() == ARPHRD_IEEE80211 || dataLinkType() == 802 );
655 // 802 is the header type for PRISM - Linux support for this is pending...
655} 656}
656 657
657 658
658QString OWirelessNetworkInterface::nickName() const 659QString OWirelessNetworkInterface::nickName() const
659{ 660{
660 char str[IW_ESSID_MAX_SIZE]; 661 char str[IW_ESSID_MAX_SIZE];
661 _iwr.u.data.pointer = &str[0]; 662 _iwr.u.data.pointer = &str[0];
662 _iwr.u.data.length = IW_ESSID_MAX_SIZE; 663 _iwr.u.data.length = IW_ESSID_MAX_SIZE;
663 if ( !wioctl( SIOCGIWNICKN ) ) 664 if ( !wioctl( SIOCGIWNICKN ) )
664 { 665 {
665 return "<unknown>"; 666 return "<unknown>";
666 } 667 }
667 else 668 else
668 { 669 {
669 str[_iwr.u.data.length] = 0x0; // some drivers (e.g. wlan-ng) don't zero-terminate the string 670 str[_iwr.u.data.length] = 0x0; // some drivers (e.g. wlan-ng) don't zero-terminate the string
670 return str; 671 return str;
671 } 672 }
672} 673}
673 674
674 675
675void OWirelessNetworkInterface::setPrivate( const QString& call, int numargs, ... ) 676void OWirelessNetworkInterface::setPrivate( const QString& call, int numargs, ... )
676{ 677{
677 OPrivateIOCTL* priv = static_cast<OPrivateIOCTL*>( child( (const char*) call ) ); 678 OPrivateIOCTL* priv = static_cast<OPrivateIOCTL*>( child( (const char*) call ) );
678 if ( !priv ) 679 if ( !priv )
@@ -912,45 +913,45 @@ void OHostAPMonitoringInterface::setEnabled( bool b )
912QString OHostAPMonitoringInterface::name() const 913QString OHostAPMonitoringInterface::name() const
913{ 914{
914 return "hostap"; 915 return "hostap";
915} 916}
916 917
917 918
918/*====================================================================================== 919/*======================================================================================
919 * OOrinocoNetworkInterface 920 * OOrinocoNetworkInterface
920 *======================================================================================*/ 921 *======================================================================================*/
921 922
922OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface ) 923OOrinocoMonitoringInterface::OOrinocoMonitoringInterface( ONetworkInterface* iface )
923 :OMonitoringInterface( iface ) 924 :OMonitoringInterface( iface )
924{ 925{
925 iface->setMonitoring( this ); 926 iface->setMonitoring( this );
926} 927}
927 928
928 929
929OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface() 930OOrinocoMonitoringInterface::~OOrinocoMonitoringInterface()
930{ 931{
931} 932}
932 933
933 934
934void OOrinocoMonitoringInterface::setChannel( int c ) 935void OOrinocoMonitoringInterface::setChannel( int c )
935{ 936{
936 _if->setPrivate( "monitor", 2, 2, c ); 937 _if->setPrivate( "monitor", 2, 1, c );
937} 938}
938 939
939 940
940void OOrinocoMonitoringInterface::setEnabled( bool b ) 941void OOrinocoMonitoringInterface::setEnabled( bool b )
941{ 942{
942 if ( b ) 943 if ( b )
943 { 944 {
944 setChannel( 1 ); 945 setChannel( 1 );
945 } 946 }
946 else 947 else
947 { 948 {
948 _if->setPrivate( "monitor", 2, 0, 0 ); 949 _if->setPrivate( "monitor", 2, 0, 0 );
949 } 950 }
950} 951}
951 952
952 953
953QString OOrinocoMonitoringInterface::name() const 954QString OOrinocoMonitoringInterface::name() const
954{ 955{
955 return "orinoco"; 956 return "orinoco";
956} 957}