summaryrefslogtreecommitdiff
path: root/net/knemo/files/patch-kcm-configdialog.cpp
diff options
context:
space:
mode:
authorMarkus Brueffer <markus@FreeBSD.org>2005-01-22 01:39:05 +0000
committerMarkus Brueffer <markus@FreeBSD.org>2005-01-22 01:39:05 +0000
commit9c29f9eabbe0fd2bb8bbcba4b1ad7cbc099e4425 (patch)
treebb7bbe3a431fe7b2c4d4e1b2ea420285023c6d33 /net/knemo/files/patch-kcm-configdialog.cpp
parentDisable H.264 encoder support unless WITH_H264 is defined (diff)
Add knemo 0.3.1, a network monitor for KDE.
KNemo offers a network monitor similar to the one found in Windows. For every network interface it displays an icon in the systray. http://www.kde-apps.org/content/show.php?content=12956 Note: There are two extensions to the original KNemo: 1. Multiple IPs on devices are supported 2. The semantics of not available devices were changed from: "device is not up" to: "device is not up" or "device is up but has no carrier/is not associated" which mimics the behaviour of the Windows counterpart more closely Bugs: The stats page for wireless specific statistics doesn't work, yet
Diffstat (limited to 'net/knemo/files/patch-kcm-configdialog.cpp')
-rw-r--r--net/knemo/files/patch-kcm-configdialog.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/net/knemo/files/patch-kcm-configdialog.cpp b/net/knemo/files/patch-kcm-configdialog.cpp
new file mode 100644
index 000000000000..d8285d4fe55f
--- /dev/null
+++ b/net/knemo/files/patch-kcm-configdialog.cpp
@@ -0,0 +1,78 @@
+--- 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