diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2009-04-10 05:56:28 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2009-04-10 05:56:28 +0000 |
commit | ae52bc80895a23ddbe33b86e75a9cf331ae32ba9 (patch) | |
tree | 5538a7d3541f6d56e4bbab9c6329f5b9db64dafb /net/gnome-nettool | |
parent | 7934df773e0cc2a9924de75dd7cad9cc3d79d4ee (diff) | |
download | ports-ae52bc80895a23ddbe33b86e75a9cf331ae32ba9.tar.gz ports-ae52bc80895a23ddbe33b86e75a9cf331ae32ba9.zip |
Notes
Diffstat (limited to 'net/gnome-nettool')
-rw-r--r-- | net/gnome-nettool/Makefile | 7 | ||||
-rw-r--r-- | net/gnome-nettool/distinfo | 6 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-src_info.c | 197 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-src_utils.c | 20 | ||||
-rw-r--r-- | net/gnome-nettool/pkg-plist | 15 |
5 files changed, 29 insertions, 216 deletions
diff --git a/net/gnome-nettool/Makefile b/net/gnome-nettool/Makefile index 328b54c1acc1..26c071b3d45e 100644 --- a/net/gnome-nettool/Makefile +++ b/net/gnome-nettool/Makefile @@ -3,12 +3,11 @@ # Whom: Adam Weinberger <adamw@FreeBSD.org> # # $FreeBSD$ -# $MCom: ports/net/gnome-nettool/Makefile,v 1.44 2008/09/22 23:38:56 kwm Exp $ +# $MCom: ports/net/gnome-nettool/Makefile,v 1.50 2009/04/01 04:33:15 marcus Exp $ # PORTNAME= gnome-nettool -PORTVERSION= 2.22.1 -PORTEPOCH= 1 +PORTVERSION= 2.26.1 CATEGORIES= net gnome MASTER_SITES= GNOME DIST_SUBDIR= gnome2 @@ -16,6 +15,8 @@ DIST_SUBDIR= gnome2 MAINTAINER= gnome@FreeBSD.org COMMENT= A GNOME utility that provides network information statistics +LIB_DEPENDS= gtop-2.0.7:${PORTSDIR}/devel/libgtop + USE_BZIP2= yes USE_GNOME= gnomehack intlhack gnomeprefix libglade2 gconf2 gnomedocutils USE_GMAKE= yes diff --git a/net/gnome-nettool/distinfo b/net/gnome-nettool/distinfo index dcc612d6ddbd..6f4d384b5012 100644 --- a/net/gnome-nettool/distinfo +++ b/net/gnome-nettool/distinfo @@ -1,3 +1,3 @@ -MD5 (gnome2/gnome-nettool-2.22.1.tar.bz2) = afcaff8ebc76b5f352902ed424dc2856 -SHA256 (gnome2/gnome-nettool-2.22.1.tar.bz2) = 90938c337575ce0f008a46a9f89f24bc6c04f5384337475fe3d5b960594c31b1 -SIZE (gnome2/gnome-nettool-2.22.1.tar.bz2) = 600085 +MD5 (gnome2/gnome-nettool-2.26.1.tar.bz2) = 476a0ffe807cfc374732d944efc83058 +SHA256 (gnome2/gnome-nettool-2.26.1.tar.bz2) = d8e71f2df9da5d5ba38c408f7646e92a89acc9a4a6af791cd1e9256c9b3af08f +SIZE (gnome2/gnome-nettool-2.26.1.tar.bz2) = 611892 diff --git a/net/gnome-nettool/files/patch-src_info.c b/net/gnome-nettool/files/patch-src_info.c index 74eb698a4665..88a107e6f825 100644 --- a/net/gnome-nettool/files/patch-src_info.c +++ b/net/gnome-nettool/files/patch-src_info.c @@ -1,5 +1,5 @@ ---- src/info.c.orig Fri Dec 1 10:36:15 2006 -+++ src/info.c Mon Dec 18 17:32:19 2006 +--- src/info.c.orig 2008-12-08 23:29:39.000000000 -0500 ++++ src/info.c 2009-02-27 16:33:49.000000000 -0500 @@ -20,6 +20,10 @@ #include <gtk/gtk.h> #include <glib/gi18n.h> @@ -11,19 +11,17 @@ #ifdef HAVE_CONFIG_H # include <config.h> -@@ -38,6 +42,11 @@ +@@ -37,6 +41,9 @@ #include <sys/ioctl.h> #include <stdlib.h> #include <net/if.h> +#ifdef __FreeBSD__ -+#include <sys/sysctl.h> -+#include <net/if_dl.h> +#include <net/if_media.h> +#endif - #include "info.h" - #include "utils.h" -@@ -58,6 +67,7 @@ static InfoInterfaceDescription info_ifa + #include <glibtop.h> + #include <glibtop/netlist.h> +@@ -61,6 +68,7 @@ static InfoInterfaceDescription info_ifa { N_("Ethernet Interface"), INFO_INTERFACE_ETH, "16_ethernet.xpm", "eth", NULL }, { N_("Wireless Interface"), INFO_INTERFACE_WLAN, "wavelan-16.png", "wlan", NULL }, { N_("Modem Interface"), INFO_INTERFACE_PPP, "16_ppp.xpm", "ppp", NULL }, @@ -31,7 +29,7 @@ { N_("Parallel Line Interface"), INFO_INTERFACE_PLIP, "16_plip.xpm", "plip", NULL }, { N_("Infrared Interface"), INFO_INTERFACE_IRLAN, "irda-16.png", "irlan", NULL }, { N_("Loopback Interface"), INFO_INTERFACE_LO, "16_loopback.xpm", "lo", NULL }, -@@ -128,9 +138,42 @@ info_get_interface_from_dev_name (const +@@ -131,9 +139,42 @@ info_get_interface_from_dev_name (const { gint i; gchar *path; @@ -76,184 +74,3 @@ (*iface) = g_strdup_printf ("%s (%s)", _(info_iface_desc[i].name), dev_name); if (info_iface_desc[i].pixbuf == NULL) { path = g_build_filename (PIXMAPS_DIR, info_iface_desc[i].icon, NULL); -@@ -218,38 +261,87 @@ info_nic_update_stats (gpointer data) - gchar tx[10], tx_error[10], tx_drop[10], tx_ovr[10]; - */ - gchar iface[30]; /*, flags[30]; */ -- gchar rx_bytes[16], rx_pkt[10], rx_error[10], rx_drop[10], rx_fifo[10]; -- gchar frame[10], compressed[10], multicast[10]; -- gchar tx_bytes[16], tx_pkt[10], tx_error[10], tx_drop[10], tx_fifo[10]; -+ gchar rx_bytes[16], rx_pkt[10], rx_error[10]; -+ gchar tx_bytes[16], tx_pkt[10], tx_error[10]; - gchar collissions[10]; -+#if defined(__linux__) -+ gchar rx_drop[10], rx_fifo[10]; -+ gchar frame[10], compressed[10], multicast[10]; -+ gchar tx_drop[10], tx_fifo[10]; -+#elif defined(__FreeBSD__) -+ char *p; -+ gchar **tokens, **argv; -+ int i; -+ int pipe_out; -+#endif - - GIOChannel *io = NULL; - gchar *line; - gboolean title = TRUE; - const gchar *text; - gchar *text_tx_bytes, *text_rx_bytes; -- -+ - g_return_val_if_fail (info != NULL, FALSE); - - model = gtk_combo_box_get_model (GTK_COMBO_BOX (info->combo)); - text = info_get_nic (info); - if (!text) - return FALSE; -- -+ - #if defined(__linux__) - io = g_io_channel_new_file ("/proc/net/dev", "r", NULL); -- -+#elif defined(__FreeBSD__) -+ if (!g_shell_parse_argv ("/usr/bin/netstat -in -b -f link", NULL, &argv, NULL)) { -+ return FALSE; -+ } -+ if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, NULL, NULL, NULL, NULL, &pipe_out, NULL, NULL)) { -+ g_strfreev (argv); -+ return FALSE; -+ } -+ -+ g_strfreev (argv); -+ -+ io = g_io_channel_unix_new (pipe_out); -+#endif /* defined(__linux__) */ -+ - while (g_io_channel_read_line (io, &line, NULL, NULL, NULL) == G_IO_STATUS_NORMAL) { - if (title) { - title = FALSE; - g_free (line); - continue; - } -+#if defined(__linux__) - line = g_strdelimit (line, ":", ' '); - sscanf (line, "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s", iface, - rx_bytes, rx_pkt, rx_error, rx_drop, rx_fifo, frame, - compressed, multicast, - tx_bytes, tx_pkt, tx_error, tx_drop, tx_fifo, collissions); -+#elif defined(__FreeBSD__) -+ tokens = (gchar **) g_malloc0 (sizeof (gchar *) * 12); -+ p = strtok (line, " \t\n"); -+ /* We only care about 11 fields for now */ -+ for (i = 0; i < 11 && p; i++, p = strtok (NULL, " \t\n")) { -+ tokens[i] = g_strdup (p); -+ } -+ -+ if (i == 0 || i < 10) { -+ g_free (line); -+ g_strfreev (tokens); -+ continue; -+ } -+ -+ g_strlcpy (iface, tokens[0], sizeof (iface)); -+ -+ g_strlcpy (collissions, tokens[--i], sizeof (collissions)); -+ g_strlcpy (tx_bytes, tokens[--i], sizeof (tx_bytes)); -+ g_strlcpy (tx_error, tokens[--i], sizeof (tx_error)); -+ g_strlcpy (tx_pkt, tokens[--i], sizeof (tx_pkt)); -+ g_strlcpy (rx_bytes, tokens[--i], sizeof (rx_bytes)); -+ g_strlcpy (rx_error, tokens[--i], sizeof (rx_error)); -+ g_strlcpy (rx_pkt, tokens[--i], sizeof (rx_pkt)); -+ -+ g_strfreev (tokens); -+#endif /* defined(__linux__) */ - - if (g_ascii_strcasecmp (iface, text) == 0) { - /* -@@ -277,7 +369,9 @@ info_nic_update_stats (gpointer data) - } - - g_io_channel_unref (io); --#endif /* defined(__linux__) */ -+#if defined(__FreeBSD__) -+ close (pipe_out); -+#endif /* defined(__FreeBSD__) */ - - return TRUE; - } -@@ -425,8 +519,19 @@ info_get_nic_information (const gchar *n - #ifdef __linux__ - mii_data_result data; - #endif -+#ifdef __FreeBSD__ -+ gint hwmib[6]; -+ size_t hwlen; -+ gchar *hwbuf; -+ guchar *hwptr; -+ struct if_msghdr *hwifm; -+ struct sockaddr_dl *hwsinptr; -+#endif - -- getifaddrs (&ifa0); -+ if (getifaddrs (&ifa0) != 0) { -+ g_warning ("getifaddrs failed: %s", g_strerror (errno)); -+ goto fail; -+ } - - for (ifr6 = ifa0; ifr6; ifr6 = ifr6->ifa_next) { - if (strcmp (ifr6->ifa_name, nic) != 0) { -@@ -510,6 +615,45 @@ info_get_nic_information (const gchar *n - (int) ((guchar *) &ifrcopy.ifr_hwaddr.sa_data)[3], - (int) ((guchar *) &ifrcopy.ifr_hwaddr.sa_data)[4], - (int) ((guchar *) &ifrcopy.ifr_hwaddr.sa_data)[5]); -+#elif defined(__FreeBSD__) -+ hwmib[0] = CTL_NET; -+ hwmib[1] = AF_ROUTE; -+ hwmib[2] = 0; -+ hwmib[3] = AF_LINK; -+ hwmib[4] = NET_RT_IFLIST; -+ if ((hwmib[5] = if_nametoindex (nic)) == 0) { -+ g_sprintf (dst, NOT_AVAILABLE); -+ goto hwfail; -+ } -+ if (sysctl (hwmib, 6, NULL, &hwlen, NULL, 0) < 0) { -+ g_sprintf (dst, NOT_AVAILABLE); -+ goto hwfail; -+ } -+ if ((hwbuf = g_malloc (hwlen)) == NULL) { -+ g_sprintf (dst, NOT_AVAILABLE); -+ goto hwfail; -+ } -+ if (sysctl (hwmib, 6, hwbuf, &hwlen, NULL, 0) < 0) { -+ g_sprintf (dst, NOT_AVAILABLE); -+ goto hwfail; -+ } -+ -+ hwifm = (struct if_msghdr *) hwbuf; -+ hwsinptr = (struct sockaddr_dl *) (hwifm + 1); -+ hwptr = (guchar *) LLADDR (hwsinptr); -+ if (*hwptr != 0 || *(hwptr + 1) != 0 || -+ *(hwptr + 2) != 0 || *(hwptr + 3) != 0 || -+ *(hwptr + 4) != 0 || *(hwptr + 5) != 0) { -+ g_sprintf (dst, "%02x:%02x:%02x:%02x:%02x:%02x", -+ *hwptr, *(hwptr + 1), *(hwptr + 2), -+ *(hwptr + 3), *(hwptr + 4), *(hwptr + 5)); -+ } -+ else { -+ g_sprintf (dst, NOT_AVAILABLE); -+ } -+ g_free (hwbuf); -+ -+hwfail: - #else - g_sprintf (dst, NOT_AVAILABLE); - #endif /* SIOCGIFHWADDR */ -@@ -625,6 +769,8 @@ info_get_nic_information (const gchar *n - } - - freeifaddrs (ifa0); -+fail: -+ ; - } - - static gint * diff --git a/net/gnome-nettool/files/patch-src_utils.c b/net/gnome-nettool/files/patch-src_utils.c deleted file mode 100644 index 921c780498c1..000000000000 --- a/net/gnome-nettool/files/patch-src_utils.c +++ /dev/null @@ -1,20 +0,0 @@ ---- src/utils.c.orig Fri May 6 16:10:28 2005 -+++ src/utils.c Sun Jul 3 17:48:12 2005 -@@ -24,6 +24,8 @@ - on GNOME 2.0 */ - - #include "utils.h" -+#include <stdlib.h> -+#include <limits.h> - #include <string.h> - #include <glib/gi18n.h> - -@@ -240,7 +242,7 @@ util_legible_bytes (gchar *bytes) - const gchar *unit = "B"; - gchar *result; - -- sscanf (bytes, "%lld", &rx); -+ rx = strtoull (bytes, (char **)NULL, 10); - short_rx = rx * 10; - - if (rx > 1125899906842624ull) { diff --git a/net/gnome-nettool/pkg-plist b/net/gnome-nettool/pkg-plist index 9ba878e67375..39446f94d070 100644 --- a/net/gnome-nettool/pkg-plist +++ b/net/gnome-nettool/pkg-plist @@ -14,20 +14,26 @@ share/gnome/help/gnome-nettool/C/legal.xml share/gnome/help/gnome-nettool/ca/gnome-nettool.xml share/gnome/help/gnome-nettool/cs/gnome-nettool.xml share/gnome/help/gnome-nettool/da/gnome-nettool.xml +share/gnome/help/gnome-nettool/de/gnome-nettool.xml +share/gnome/help/gnome-nettool/en_GB/gnome-nettool.xml share/gnome/help/gnome-nettool/es/gnome-nettool.xml share/gnome/help/gnome-nettool/fr/gnome-nettool.xml share/gnome/help/gnome-nettool/oc/gnome-nettool.xml share/gnome/help/gnome-nettool/pa/gnome-nettool.xml +share/gnome/help/gnome-nettool/pt_BR/gnome-nettool.xml share/gnome/help/gnome-nettool/sv/gnome-nettool.xml share/gnome/help/gnome-nettool/uk/gnome-nettool.xml share/gnome/help/gnome-nettool/vi/gnome-nettool.xml +share/gnome/help/gnome-nettool/zh_CN/gnome-nettool.xml share/icons/hicolor/16x16/apps/gnome-nettool.png share/icons/hicolor/22x22/apps/gnome-nettool.png share/icons/hicolor/24x24/apps/gnome-nettool.png share/icons/hicolor/32x32/apps/gnome-nettool.png share/icons/hicolor/scalable/apps/gnome-nettool.svg +share/locale/af/LC_MESSAGES/gnome-nettool.mo share/locale/ar/LC_MESSAGES/gnome-nettool.mo share/locale/as/LC_MESSAGES/gnome-nettool.mo +share/locale/ast/LC_MESSAGES/gnome-nettool.mo share/locale/az/LC_MESSAGES/gnome-nettool.mo share/locale/bg/LC_MESSAGES/gnome-nettool.mo share/locale/bn/LC_MESSAGES/gnome-nettool.mo @@ -78,6 +84,7 @@ share/locale/oc/LC_MESSAGES/gnome-nettool.mo share/locale/or/LC_MESSAGES/gnome-nettool.mo share/locale/pa/LC_MESSAGES/gnome-nettool.mo share/locale/pl/LC_MESSAGES/gnome-nettool.mo +share/locale/ps/LC_MESSAGES/gnome-nettool.mo share/locale/pt/LC_MESSAGES/gnome-nettool.mo share/locale/pt_BR/LC_MESSAGES/gnome-nettool.mo share/locale/ro/LC_MESSAGES/gnome-nettool.mo @@ -107,22 +114,30 @@ share/omf/gnome-nettool/gnome-nettool-C.omf share/omf/gnome-nettool/gnome-nettool-ca.omf share/omf/gnome-nettool/gnome-nettool-cs.omf share/omf/gnome-nettool/gnome-nettool-da.omf +share/omf/gnome-nettool/gnome-nettool-de.omf +share/omf/gnome-nettool/gnome-nettool-en_GB.omf share/omf/gnome-nettool/gnome-nettool-es.omf share/omf/gnome-nettool/gnome-nettool-fr.omf share/omf/gnome-nettool/gnome-nettool-oc.omf share/omf/gnome-nettool/gnome-nettool-pa.omf +share/omf/gnome-nettool/gnome-nettool-pt_BR.omf share/omf/gnome-nettool/gnome-nettool-sv.omf share/omf/gnome-nettool/gnome-nettool-uk.omf share/omf/gnome-nettool/gnome-nettool-vi.omf +share/omf/gnome-nettool/gnome-nettool-zh_CN.omf share/pixmaps/gnome-nettool.png @dirrm share/omf/gnome-nettool +@dirrm share/gnome/help/gnome-nettool/zh_CN @dirrm share/gnome/help/gnome-nettool/vi @dirrm share/gnome/help/gnome-nettool/uk @dirrm share/gnome/help/gnome-nettool/sv +@dirrm share/gnome/help/gnome-nettool/pt_BR @dirrm share/gnome/help/gnome-nettool/pa @dirrm share/gnome/help/gnome-nettool/oc @dirrm share/gnome/help/gnome-nettool/fr @dirrm share/gnome/help/gnome-nettool/es +@dirrm share/gnome/help/gnome-nettool/en_GB +@dirrm share/gnome/help/gnome-nettool/de @dirrm share/gnome/help/gnome-nettool/da @dirrm share/gnome/help/gnome-nettool/cs @dirrm share/gnome/help/gnome-nettool/ca |