diff options
Diffstat (limited to 'net/knemo-kde4/files')
-rw-r--r-- | net/knemo-kde4/files/patch-kcm-configdialog.cpp | 78 | ||||
-rw-r--r-- | net/knemo-kde4/files/patch-knemod-data.h | 35 | ||||
-rw-r--r-- | net/knemo-kde4/files/patch-knemod-interfacestatusdialog.cpp | 50 | ||||
-rw-r--r-- | net/knemo-kde4/files/patch-knemod-interfacestatusdlg.ui | 271 | ||||
-rw-r--r-- | net/knemo-kde4/files/patch-knemod-interfacetooltip.cpp | 34 | ||||
-rw-r--r-- | net/knemo-kde4/files/patch-knemod-interfaceupdater.cpp | 291 |
6 files changed, 0 insertions, 759 deletions
diff --git a/net/knemo-kde4/files/patch-kcm-configdialog.cpp b/net/knemo-kde4/files/patch-kcm-configdialog.cpp deleted file mode 100644 index d8285d4fe55f..000000000000 --- a/net/knemo-kde4/files/patch-kcm-configdialog.cpp +++ /dev/null @@ -1,78 +0,0 @@ ---- kcm/configdialog.cpp.orig Wed Sep 15 18:24:37 2004 -+++ kcm/configdialog.cpp Wed Jan 19 15:23:57 2005 -@@ -17,6 +17,16 @@ - Boston, MA 02111-1307, USA. - */ - -+#ifdef __FreeBSD__ -+#include <sys/types.h> -+#include <sys/socket.h> -+#include <net/if.h> -+#include <net/if_mib.h> -+#include <sys/param.h> -+#include <sys/sysctl.h> -+#include <net/route.h> -+#endif -+ - #include <qfile.h> - #include <qdict.h> - #include <qlabel.h> -@@ -355,6 +365,39 @@ - void ConfigDialog::defaults() - { - // Default interfaces -+#ifdef Q_OS_FREEBSD -+ /* Determine number of interfaces */ -+ u_int n = 0; -+ size_t nlen = 0; -+ nlen = sizeof(n); -+ -+ if ( sysctlbyname("net.link.generic.system.ifcount", &n, &nlen, NULL, 0) != -1 ) -+ { -+ mSettingsDict.clear(); -+ mDlg->listBoxInterfaces->clear(); -+ -+ ifmibdata ifmd; -+ size_t len = 0; -+ len = sizeof(ifmd); -+ static int name[] = { CTL_NET, -+ PF_LINK, -+ NETLINK_GENERIC, -+ IFMIB_IFDATA, -+ 0, -+ IFDATA_GENERAL }; -+ -+ for (int i = 1; i <= n; ++i) -+ { -+ name[4] = i; -+ /* Get data for iface-number i */ -+ if ( sysctl(name, 6, (void*)&ifmd, (size_t*)&len, (void*)NULL, (size_t)0) == -1 ) -+ continue; -+ -+ QString interface = QString::fromLatin1(ifmd.ifmd_name); -+ -+ if ( ifmd.ifmd_flags & IFF_LOOPBACK) -+ continue; -+#else - QFile proc( "/proc/net/dev" ); - if ( proc.open( IO_ReadOnly ) ) - { -@@ -372,6 +415,7 @@ - if ( interface == "lo" ) - continue; - -+#endif - InterfaceSettings* settings = new InterfaceSettings(); - settings->customCommands = false; - settings->hideWhenNotAvailable = false; -@@ -391,8 +435,10 @@ - mDlg->checkBoxNotExisting->setChecked( false ); - mDlg->checkBoxCustom->setChecked( false ); - } -+#ifndef __FreeBSD__ - } - proc.close(); -+#endif - } - - // Default tool tips diff --git a/net/knemo-kde4/files/patch-knemod-data.h b/net/knemo-kde4/files/patch-knemod-data.h deleted file mode 100644 index c45f8b191029..000000000000 --- a/net/knemo-kde4/files/patch-knemod-data.h +++ /dev/null @@ -1,35 +0,0 @@ ---- knemod/data.h.orig Sat Jan 22 00:10:05 2005 -+++ knemod/data.h Fri Jan 21 17:38:50 2005 -@@ -22,6 +22,7 @@ - - #include <qpair.h> - #include <qcolor.h> -+#include <qdict.h> - #include <qstring.h> - #include <qvaluevector.h> - -@@ -41,6 +42,11 @@ - int toolTipContent; - }; - -+struct AddrData { -+ QString subnetMask; -+ QString broadcastAddress; -+}; -+ - struct InterfaceData - { - InterfaceData::InterfaceData() -@@ -64,11 +70,9 @@ - unsigned long prevTxBytes; - unsigned long incomingBytes; - unsigned long outgoingBytes; -- QString ipAddress; -- QString subnetMask; -+ QDict<AddrData> addrData; - QString hwAddress; - QString ptpAddress; -- QString broadcastAddress; - QString defaultGateway; - QString rxString; - QString txString; diff --git a/net/knemo-kde4/files/patch-knemod-interfacestatusdialog.cpp b/net/knemo-kde4/files/patch-knemod-interfacestatusdialog.cpp deleted file mode 100644 index 822857eff083..000000000000 --- a/net/knemo-kde4/files/patch-knemod-interfacestatusdialog.cpp +++ /dev/null @@ -1,50 +0,0 @@ ---- knemod/interfacestatusdialog.cpp.orig Sat Jan 22 00:11:02 2005 -+++ knemod/interfacestatusdialog.cpp Sat Jan 22 00:15:24 2005 -@@ -24,6 +24,7 @@ - #include <qtabwidget.h> - - #include <kdebug.h> -+#include <kcombobox.h> - #include <kconfig.h> - #include <klocale.h> - #include <kglobal.h> -@@ -69,6 +70,10 @@ - mTimer = new QTimer(); - connect( mTimer, SIGNAL( timeout() ), this, SLOT( updateDialog() ) ); - mTimer->start( 1000 ); -+ -+#ifdef Q_OS_FREEBSD -+ connect( comboBoxIP, SIGNAL( activated(int) ), this, SLOT( updateDialog() ) ); -+#endif - } - - InterfaceStatusDialog::~InterfaceStatusDialog() -@@ -152,12 +157,28 @@ - if ( data.available ) - { - // ip tab -+#ifdef Q_OS_FREEBSD -+ if ( data.addrData.count() != comboBoxIP->count() ) -+ comboBoxIP->clear(); -+ -+ QDictIterator<AddrData> it( data.addrData ); -+ for( ; it.current(); ++it ) -+ if (!comboBoxIP->contains(it.currentKey())) -+ comboBoxIP->insertItem( it.currentKey() ); -+ -+ textLabelSubnet->setText(data.addrData[ comboBoxIP->currentText() ]->subnetMask); -+#else - textLabelIP->setText( data.ipAddress ); - textLabelSubnet->setText( data.subnetMask ); -+#endif - if ( mInterface->getType() == Interface::ETHERNET ) - { - variableLabel1->setText( i18n( "Broadcast Address:" ) ); -+#ifdef Q_OS_FREEBSD -+ variableText1->setText( data.addrData[ comboBoxIP->currentText() ]->broadcastAddress); -+#else - variableText1->setText( data.broadcastAddress ); -+#endif - variableLabel2->setText( i18n( "Default Gateway:" ) ); - variableText2->setText( data.defaultGateway ); - variableLabel3->setText( i18n( "HW-Address:" ) ); diff --git a/net/knemo-kde4/files/patch-knemod-interfacestatusdlg.ui b/net/knemo-kde4/files/patch-knemod-interfacestatusdlg.ui deleted file mode 100644 index d506e3f44a0f..000000000000 --- a/net/knemo-kde4/files/patch-knemod-interfacestatusdlg.ui +++ /dev/null @@ -1,271 +0,0 @@ ---- knemod/interfacestatusdlg.ui.orig Fri Jan 21 16:57:24 2005 -+++ knemod/interfacestatusdlg.ui Fri Jan 21 20:02:50 2005 -@@ -9,7 +9,7 @@ - <x>0</x> - <y>0</y> - <width>272</width> -- <height>258</height> -+ <height>237</height> - </rect> - </property> - <property name="caption"> -@@ -145,7 +145,7 @@ - </property> - <widget class="QLayoutWidget"> - <property name="name"> -- <cstring>layout3</cstring> -+ <cstring>layout7</cstring> - </property> - <hbox> - <property name="name"> -@@ -171,18 +171,18 @@ - </property> - <property name="sizeHint"> - <size> -- <width>20</width> -+ <width>40</width> - <height>20</height> - </size> - </property> - </spacer> -- <widget class="KActiveLabel"> -+ <widget class="KComboBox"> - <property name="name"> -- <cstring>textLabelIP</cstring> -+ <cstring>comboBoxIP</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> -- <hsizetype>1</hsizetype> -+ <hsizetype>5</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> -@@ -193,7 +193,7 @@ - </widget> - <widget class="QLayoutWidget"> - <property name="name"> -- <cstring>layout4</cstring> -+ <cstring>layout8</cstring> - </property> - <hbox> - <property name="name"> -@@ -207,41 +207,30 @@ - <string>Subnet Mask:</string> - </property> - </widget> -- <spacer> -- <property name="name"> -- <cstring>spacer13_2</cstring> -- </property> -- <property name="orientation"> -- <enum>Horizontal</enum> -- </property> -- <property name="sizeType"> -- <enum>Expanding</enum> -- </property> -- <property name="sizeHint"> -- <size> -- <width>71</width> -- <height>21</height> -- </size> -- </property> -- </spacer> -- <widget class="KActiveLabel"> -+ <widget class="QLabel"> - <property name="name"> - <cstring>textLabelSubnet</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> -- <hsizetype>1</hsizetype> -- <vsizetype>0</vsizetype> -+ <hsizetype>7</hsizetype> -+ <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> -+ <property name="text"> -+ <string></string> -+ </property> -+ <property name="alignment"> -+ <set>AlignVCenter|AlignRight</set> -+ </property> - </widget> - </hbox> - </widget> - <widget class="QLayoutWidget"> - <property name="name"> -- <cstring>layout5</cstring> -+ <cstring>layout9</cstring> - </property> - <hbox> - <property name="name"> -@@ -255,41 +244,22 @@ - <string>Broadcast Address:</string> - </property> - </widget> -- <spacer> -- <property name="name"> -- <cstring>spacer13_3</cstring> -- </property> -- <property name="orientation"> -- <enum>Horizontal</enum> -- </property> -- <property name="sizeType"> -- <enum>Expanding</enum> -- </property> -- <property name="sizeHint"> -- <size> -- <width>71</width> -- <height>21</height> -- </size> -- </property> -- </spacer> -- <widget class="KActiveLabel"> -+ <widget class="QLabel"> - <property name="name"> - <cstring>variableText1</cstring> - </property> -- <property name="sizePolicy"> -- <sizepolicy> -- <hsizetype>1</hsizetype> -- <vsizetype>0</vsizetype> -- <horstretch>0</horstretch> -- <verstretch>0</verstretch> -- </sizepolicy> -+ <property name="text"> -+ <string></string> -+ </property> -+ <property name="alignment"> -+ <set>AlignVCenter|AlignRight</set> - </property> - </widget> - </hbox> - </widget> - <widget class="QLayoutWidget"> - <property name="name"> -- <cstring>layout6</cstring> -+ <cstring>layout10</cstring> - </property> - <hbox> - <property name="name"> -@@ -303,41 +273,30 @@ - <string>Default Gateway:</string> - </property> - </widget> -- <spacer> -- <property name="name"> -- <cstring>spacer13_4</cstring> -- </property> -- <property name="orientation"> -- <enum>Horizontal</enum> -- </property> -- <property name="sizeType"> -- <enum>Expanding</enum> -- </property> -- <property name="sizeHint"> -- <size> -- <width>71</width> -- <height>21</height> -- </size> -- </property> -- </spacer> -- <widget class="KActiveLabel"> -+ <widget class="QLabel"> - <property name="name"> - <cstring>variableText2</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> -- <hsizetype>1</hsizetype> -- <vsizetype>0</vsizetype> -+ <hsizetype>7</hsizetype> -+ <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> -+ <property name="text"> -+ <string></string> -+ </property> -+ <property name="alignment"> -+ <set>AlignVCenter|AlignRight</set> -+ </property> - </widget> - </hbox> - </widget> - <widget class="QLayoutWidget"> - <property name="name"> -- <cstring>layout7</cstring> -+ <cstring>layout11</cstring> - </property> - <hbox> - <property name="name"> -@@ -351,35 +310,24 @@ - <string>HW-Address:</string> - </property> - </widget> -- <spacer> -- <property name="name"> -- <cstring>spacer13_5</cstring> -- </property> -- <property name="orientation"> -- <enum>Horizontal</enum> -- </property> -- <property name="sizeType"> -- <enum>Expanding</enum> -- </property> -- <property name="sizeHint"> -- <size> -- <width>71</width> -- <height>21</height> -- </size> -- </property> -- </spacer> -- <widget class="KActiveLabel"> -+ <widget class="QLabel"> - <property name="name"> - <cstring>variableText3</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> -- <hsizetype>1</hsizetype> -- <vsizetype>0</vsizetype> -+ <hsizetype>7</hsizetype> -+ <vsizetype>5</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> -+ <property name="text"> -+ <string></string> -+ </property> -+ <property name="alignment"> -+ <set>AlignVCenter|AlignRight</set> -+ </property> - </widget> - </hbox> - </widget> -@@ -728,8 +676,6 @@ - </widget> - </vbox> - </widget> --<customwidgets> --</customwidgets> - <connections> - <connection> - <sender>buttonClose</sender> -@@ -740,10 +686,6 @@ - </connections> - <layoutdefaults spacing="6" margin="11"/> - <includehints> -- <includehint>kactivelabel.h</includehint> -- <includehint>kactivelabel.h</includehint> -- <includehint>kactivelabel.h</includehint> -- <includehint>kactivelabel.h</includehint> -- <includehint>kactivelabel.h</includehint> -+ <includehint>kcombobox.h</includehint> - </includehints> - </UI> diff --git a/net/knemo-kde4/files/patch-knemod-interfacetooltip.cpp b/net/knemo-kde4/files/patch-knemod-interfacetooltip.cpp deleted file mode 100644 index 10235e4477c3..000000000000 --- a/net/knemo-kde4/files/patch-knemod-interfacetooltip.cpp +++ /dev/null @@ -1,34 +0,0 @@ ---- knemod/interfacetooltip.cpp.orig Fri Jan 21 17:51:13 2005 -+++ knemod/interfacetooltip.cpp Fri Jan 21 17:59:47 2005 -@@ -99,6 +99,23 @@ - - if ( data.available ) - { -+#ifdef Q_OS_FREEBSD -+ QDictIterator<AddrData> it( data.addrData ); -+ for( ; it.current(); ++it ) -+ { -+ if ( toolTipContent & IP_ADDRESS ) -+ text += "<tr><td>" + mToolTips[4].first + "</td><td>" + it.currentKey() + "</td></tr>"; -+ if ( toolTipContent & SUBNET_MASK ) -+ text += "<tr><td>" + mToolTips[5].first + "</td><td>" + it.current()->subnetMask + "</td></tr>"; -+ if ( mInterface->getType() == Interface::ETHERNET ) -+ { -+ if ( toolTipContent & BCAST_ADDRESS ) -+ text += "<tr><td>" + mToolTips[18].first + "</td><td>" + it.current()->broadcastAddress + "</td></tr>"; -+ } -+ } -+ if ( mInterface->getType() == Interface::ETHERNET ) -+ { -+#else - if ( toolTipContent & IP_ADDRESS ) - text += "<tr><td>" + mToolTips[4].first + "</td><td>" + data.ipAddress + "</td></tr>"; - if ( toolTipContent & SUBNET_MASK ) -@@ -107,6 +124,7 @@ - { - if ( toolTipContent & BCAST_ADDRESS ) - text += "<tr><td>" + mToolTips[18].first + "</td><td>" + data.broadcastAddress + "</td></tr>"; -+#endif - if ( toolTipContent & GATEWAY ) - text += "<tr><td>" + mToolTips[19].first + "</td><td>" + data.defaultGateway + "</td></tr>"; - if ( toolTipContent & HW_ADDRESS ) diff --git a/net/knemo-kde4/files/patch-knemod-interfaceupdater.cpp b/net/knemo-kde4/files/patch-knemod-interfaceupdater.cpp deleted file mode 100644 index 4a743c105842..000000000000 --- a/net/knemo-kde4/files/patch-knemod-interfaceupdater.cpp +++ /dev/null @@ -1,291 +0,0 @@ ---- knemod/interfaceupdater.cpp.orig Fri Aug 20 20:26:41 2004 -+++ knemod/interfaceupdater.cpp Sat Jan 22 13:34:49 2005 -@@ -17,6 +17,24 @@ - Boston, MA 02111-1307, USA. - */ - -+#ifdef __FreeBSD__ -+#include <sys/types.h> -+#include <sys/socket.h> -+#include <sys/sysctl.h> -+#include <sys/time.h> -+#include <sys/ioctl.h> -+#include <net/ethernet.h> -+#include <net/if_media.h> -+#include <net/if_types.h> -+#include <net/if.h> -+#include <net/if_dl.h> -+#include <net/if_mib.h> -+#include <netdb.h> -+#include <ifaddrs.h> -+#include <netinet/in.h> -+#include <arpa/inet.h> -+#endif -+ - #include <qmap.h> - #include <qtimer.h> - #include <qregexp.h> -@@ -48,6 +66,7 @@ - mTimer->stop(); - delete mTimer; - -+#ifndef Q_OS_FREEBSD - if ( mRouteProcess ) - { - mRouteProcess->kill(); -@@ -63,10 +82,12 @@ - mIwconfigProcess->kill(); - delete mIwconfigProcess; - } -+#endif - } - - void InterfaceUpdater::checkConfig() - { -+#ifndef Q_OS_FREEBSD - if ( !mIfconfigProcess ) - { - mIfconfigStdout = QString::null; -@@ -108,6 +129,7 @@ - } - } - #endif -+#endif // Q_OS_FREEBSD - - #ifdef PATH_ROUTE - if ( !mRouteProcess ) -@@ -116,7 +138,11 @@ - mRouteProcess = new KProcess(); - mRouteProcess->setEnvironment( "LANG", "C" ); - mRouteProcess->setEnvironment( "LC_ALL", "C" ); -+#ifdef Q_OS_FREEBSD -+ *mRouteProcess << PATH_ROUTE << "-n" << "get" << "default"; -+#else - *mRouteProcess << PATH_ROUTE << "-n"; -+#endif - connect( mRouteProcess, SIGNAL( receivedStdout( KProcess*, char*, int ) ), - this, SLOT( routeProcessStdout( KProcess*, char*, int ) ) ); - connect( mRouteProcess, SIGNAL( receivedStderr( KProcess*, char*, int ) ), -@@ -131,6 +157,140 @@ - } - } - #endif -+ -+#ifdef Q_OS_FREEBSD -+ // Check interfaces and update accordingly -+ -+ Interface* interface = 0; -+ InterfaceData* data = 0; -+ -+ struct if_data* ifd; -+ struct ifaddrs *ifap; -+ char buf[NI_MAXHOST]; -+ -+ // Reset all devices first -+ QDictIterator<Interface> ifIt( mInterfaceDict ); -+ for ( ; ifIt.current(); ++ifIt ) -+ { -+ interface = ifIt.current(); -+ interface->getData().existing = false; -+ interface->getData().available = false; -+ interface->getData().addrData.clear(); -+ } -+ -+ // Get IP address and related information -+ if ( getifaddrs(&ifap) == 0 ) { -+ for ( ifaddrs *ifa = ifap; ifa; ifa = ifa->ifa_next ) { -+ switch ( ifa->ifa_addr->sa_family ) { -+ case AF_INET6: -+ case AF_INET: -+ interface = mInterfaceDict[QString::fromLatin1(ifa->ifa_name)]; -+ if ( interface ) { -+ data = &interface->getData(); -+ -+ bzero(buf, NI_MAXHOST); -+ getnameinfo(ifa->ifa_addr, ifa->ifa_addr->sa_len, buf, sizeof(buf), 0, 0, NI_NUMERICHOST); -+ AddrData *addrData = new AddrData; -+ data->addrData.insert( QString::fromLatin1(buf), addrData); -+ -+ if ( ifa->ifa_netmask != NULL ) { -+ if (ifa->ifa_addr->sa_family == AF_INET6 ) { -+ bzero(buf, NI_MAXHOST); -+ getnameinfo(ifa->ifa_netmask, ifa->ifa_netmask->sa_len, buf, sizeof(buf), 0, 0, NI_NUMERICHOST); -+ addrData->subnetMask = QString::fromLatin1( buf ); -+ } else { -+ struct sockaddr_in *sin = (struct sockaddr_in *)ifa->ifa_netmask; -+ addrData->subnetMask = QString::fromLatin1( inet_ntoa(sin->sin_addr) ); -+ } -+ } -+ -+ if ( ifa->ifa_broadaddr != NULL ) { -+ bzero(buf, NI_MAXHOST); -+ getnameinfo(ifa->ifa_broadaddr, ifa->ifa_broadaddr->sa_len, buf, sizeof(buf), 0, 0, NI_NUMERICHOST); -+ addrData->broadcastAddress = QString::fromLatin1(buf); -+ } -+ -+ if ( ifa->ifa_dstaddr != NULL ) { -+ bzero(buf, NI_MAXHOST); -+ getnameinfo(ifa->ifa_dstaddr, ifa->ifa_dstaddr->sa_len, buf, sizeof(buf), 0, 0, NI_NUMERICHOST); -+ data->ptpAddress = QString::fromLatin1(buf); -+ } -+ -+ data->existing = true; -+ interface->setType((ifa->ifa_flags & IFF_POINTOPOINT ) ? Interface::PPP : Interface::ETHERNET ); -+ -+ // Get media status -+ int s; -+ if ((s = socket(ifa->ifa_addr->sa_family, SOCK_DGRAM, 0)) >= 0) { -+ struct ifmediareq ifmr; -+ (void) memset(&ifmr, 0, sizeof(ifmr)); -+ (void) strncpy(ifmr.ifm_name, ifa->ifa_name, sizeof(ifmr.ifm_name)); -+ -+ if (ioctl(s, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) { -+ if (ifmr.ifm_status & IFM_AVALID) -+ /* -+ * The interface is marked available, if the interface is up -+ * and if it is has carrier (LAN) or is associated (WLAN) -+ */ -+ data->available = (ifa->ifa_flags & IFF_UP) && (ifmr.ifm_status & IFM_ACTIVE); -+ } -+ else -+ data->available = (ifa->ifa_flags & IFF_UP); -+ -+ close(s); -+ } -+ } -+ break; -+ -+ case AF_LINK: -+ interface = mInterfaceDict[QString::fromLatin1(ifa->ifa_name)]; -+ if ( interface ) { -+ data = &interface->getData(); -+ -+ // get MAC address -+ struct sockaddr_dl* sdl = (struct sockaddr_dl*)ifa->ifa_addr; -+ if (sdl->sdl_type == IFT_ETHER && sdl->sdl_alen == ETHER_ADDR_LEN) -+ data->hwAddress = QString::fromLatin1(ether_ntoa((struct ether_addr*)LLADDR(sdl))); -+ else -+ data->hwAddress = ""; -+ -+ // Get traffic statistics -+ if (ifa->ifa_data != NULL) { -+ ifd = (if_data *)ifa->ifa_data; -+ -+ data->rxPackets = ifd->ifi_ipackets; -+ data->txPackets = ifd->ifi_opackets; -+ -+ if ( data->prevRxBytes == 0L ) -+ data->prevRxBytes = ifd->ifi_ibytes; -+ else -+ data->prevRxBytes = data->rxBytes; -+ -+ data->rxBytes = ifd->ifi_ibytes; -+ data->incomingBytes = data->rxBytes - data->prevRxBytes; -+ data->rxString = KIO::convertSize( data->rxBytes ); -+ -+ if ( data->prevTxBytes == 0L ) -+ data->prevTxBytes = ifd->ifi_obytes; -+ else -+ data->prevTxBytes = data->txBytes; -+ -+ data->txBytes = ifd->ifi_obytes; -+ data->outgoingBytes = data->txBytes - data->prevTxBytes; -+ data->txString = KIO::convertSize( data->txBytes ); -+ } -+ } -+ break; -+ } -+ } -+ freeifaddrs(ifap); -+ } -+ -+ // Update the display -+ for ( ifIt.toFirst(); ifIt.current(); ++ifIt ) -+ ifIt.current()->activateMonitor(); -+ -+#endif // Q_OS_FREEBSD - } - - void InterfaceUpdater::routeProcessExited( KProcess* process ) -@@ -180,6 +340,7 @@ - - void InterfaceUpdater::parseIfconfigOutput() - { -+#ifndef Q_OS_FREEBSD - /* mIfconfigStdout contains the complete output of 'ifconfig' which we - * are going to parse here. - */ -@@ -235,10 +396,12 @@ - } - interface->activateMonitor(); - } -+#endif - } - - void InterfaceUpdater::updateInterfaceData( QString& config, InterfaceData& data, int type ) - { -+#ifndef Q_OS_FREEBSD - QRegExp regExp( ".*RX.*:(\\d+).*:\\d+.*:\\d+.*:\\d+" ); - if ( regExp.search( config ) > -1 ) - data.rxPackets = regExp.cap( 1 ).toULong(); -@@ -318,10 +481,12 @@ - if ( regExp.search( config ) > -1 ) - data.ptpAddress = regExp.cap( 2 ); - } -+#endif - } - - void InterfaceUpdater::parseIwconfigOutput() - { -+#ifndef Q_OS_FREEBSD - /* mIwconfigStdout contains the complete output of 'iwconfig' which we - * are going to parse here. - */ -@@ -364,10 +529,12 @@ - updateWirelessData( configs[key], interface->getWirelessData() ); - } - } -+#endif - } - - void InterfaceUpdater::updateWirelessData( QString& config, WirelessData& data ) - { -+#ifndef Q_OS_FREEBSD - QRegExp regExp( "ESSID:\"?([^\"]*)\"?" ); - if ( regExp.search( config ) > -1 ) - data.essid = regExp.cap( 1 ); -@@ -401,6 +568,7 @@ - regExp.setPattern( "Link Quality:([\\d/]*)" ); - if ( regExp.search( config ) > -1 ) - data.linkQuality = regExp.cap( 1 ); -+#endif - } - - void InterfaceUpdater::parseRouteOutput() -@@ -409,16 +577,25 @@ - * are going to parse here. - */ - QMap<QString, QStringList> configs; -- QStringList routeList = QStringList::split( "\n", mRouteStdout ); -+ QStringList gateway, routeList = QStringList::split( "\n", mRouteStdout ); - QStringList::Iterator it; - for ( it = routeList.begin(); it != routeList.end(); ++it ) - { - QStringList routeParameter = QStringList::split( " ", *it ); -+#ifdef Q_OS_FREEBSD -+ if ( routeParameter.count() != 2 ) -+ continue; -+ if ( routeParameter[0] == "gateway:" ) -+ gateway = routeParameter; -+ if ( routeParameter[0] == "interface:" ) -+ configs[routeParameter[1]] = gateway; -+#else - if ( routeParameter.count() < 8 ) // no routing entry - continue; - if ( routeParameter[0] != "0.0.0.0" ) // no default route - continue; - configs[routeParameter[7]] = routeParameter; -+#endif - } - - /* We loop over the interfaces the user wishs to monitor. |