--- a/patches/gnome-nettool-01-sun-patch.diff Thu Mar 19 10:46:31 2009 +0000
+++ b/patches/gnome-nettool-01-sun-patch.diff Thu Mar 19 12:52:42 2009 +0000
@@ -1,25 +1,28 @@
---- gnome-nettool-2.22.1/configure.in-orig 2009-01-22 16:38:04.706619000 -0600
-+++ gnome-nettool-2.22.1/configure.in 2009-01-22 16:40:06.153176000 -0600
-@@ -15,8 +15,14 @@ IT_PROG_INTLTOOL([0.35.0])
- AC_ISC_POSIX
- AC_PROG_CC
- AC_HEADER_STDC([])
-+
+diff -urN gnome-nettool-2.26.0/configure.in ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/configure.in
+--- gnome-nettool-2.26.0/configure.in 2009-03-17 02:43:58.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/configure.in 2009-03-19 12:38:25.699172000 +0000
+@@ -12,11 +12,16 @@
+
+ IT_PROG_INTLTOOL([0.35.0])
+
+dnl *** checks for socket, nsl, and kstat libraries ***
+AC_CHECK_FUNC(socket,,[AC_CHECK_LIB(socket,socket)])
+AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
+AC_CHECK_FUNC(kstat_open,,[AC_CHECK_LIB(kstat,kstat_open)])
+
+ AC_ISC_POSIX
+ AC_PROG_CC
+ AC_HEADER_STDC([])
AC_CHECK_HEADERS(sys/sockio.h)
-AC_CHECK_HEADERS(sys/socket.h ifaddrs.h,,AC_MSG_ERROR(Required header not found: $ac_header))
+AC_CHECK_HEADERS(sys/socket.h,,AC_MSG_ERROR(Required header not found: $ac_header))
dnl AC_ARG_PROGRAM
AM_PROG_LIBTOOL
-diff -urN gnome-nettool-2.22.0/src/Makefile.am ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/Makefile.am
---- gnome-nettool-2.22.0/src/Makefile.am 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/Makefile.am 2008-09-10 18:04:16.691985000 +0100
-@@ -8,11 +8,12 @@
+diff -urN gnome-nettool-2.26.0/src/Makefile.am ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/Makefile.am
+--- gnome-nettool-2.26.0/src/Makefile.am 2008-03-25 04:25:11.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/Makefile.am 2009-03-19 10:49:56.907192000 +0000
+@@ -8,7 +8,7 @@
@NETTOOL_CFLAGS@
LDADD = \
@@ -28,433 +31,53 @@
bin_PROGRAMS = gnome-nettool
- gnome_nettool_SOURCES = \
-+ getifaddrs.c ifaddrs.h \
- callbacks.c callbacks.h \
- nettool.c nettool.h \
- gn-combo-history.c gn-combo-history.h \
-diff -urN gnome-nettool-2.22.0/src/getifaddrs.c ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/getifaddrs.c
---- gnome-nettool-2.22.0/src/getifaddrs.c 1970-01-01 01:00:00.000000000 +0100
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/getifaddrs.c 2008-09-10 18:06:18.210459000 +0100
-@@ -0,0 +1,210 @@
-+/*
-+ * Copyright (c) 2008 Sun Microsystems, Inc.. All rights reserved.
-+ * Use is subject to license terms
-+ *
-+ * Author: James Carlson, [email protected]
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#include <unistd.h>
-+#include <stdlib.h>
-+#include <errno.h>
-+#include <string.h>
-+#include <sys/sockio.h>
-+#include <sys/socket.h>
-+#include <net/if.h>
-+
-+#include "ifaddrs.h"
-+
-+static int
-+get_lifreq(int fd, struct lifreq **ifr_ret)
-+{
-+ struct lifnum lifn;
-+ struct lifconf lifc;
-+ struct lifreq *lifrp;
-+
-+ lifn.lifn_family = AF_UNSPEC;
-+ lifn.lifn_flags = 0;
-+ if (ioctl(fd, SIOCGLIFNUM, &lifn) == -1)
-+ lifn.lifn_count = 16;
-+ else
-+ lifn.lifn_count += 16;
-+
-+ for (;;) {
-+ lifc.lifc_len = lifn.lifn_count * sizeof (*lifrp);
-+ lifrp = malloc(lifc.lifc_len);
-+ if (lifrp == NULL)
-+ return (-1);
-+
-+ lifc.lifc_family = AF_UNSPEC;
-+ lifc.lifc_flags = 0;
-+ lifc.lifc_buf = (char *)lifrp;
-+ if (ioctl(fd, SIOCGLIFCONF, &lifc) == -1) {
-+ free(lifrp);
-+ if (errno == EINVAL) {
-+ lifn.lifn_count <<= 1;
-+ continue;
-+ }
-+ (void) close(fd);
-+ return (-1);
-+ }
-+ if (lifc.lifc_len < (lifn.lifn_count - 1) * sizeof (*lifrp))
-+ break;
-+ free(lifrp);
-+ lifn.lifn_count <<= 1;
-+ }
-+
-+ *ifr_ret = lifrp;
-+
-+ return (lifc.lifc_len / sizeof (*lifrp));
-+}
-+
-+static size_t
-+nbytes(const struct lifreq *lifrp, int nlif, size_t socklen)
-+{
-+ size_t len = 0;
-+ size_t slen;
-+
-+ while (nlif > 0) {
-+ slen = strlen(lifrp->lifr_name) + 1;
-+ len += sizeof (struct ifaddrs) + ((slen + 3) & ~3);
-+ len += 3 * socklen;
-+ lifrp++;
-+ nlif--;
-+ }
-+ return (len);
-+}
-+
-+static struct sockaddr *
-+addrcpy(struct sockaddr_storage *addr, char **bufp)
-+{
-+ char *buf = *bufp;
-+ size_t len;
-+
-+ len = addr->ss_family == AF_INET ? sizeof (struct sockaddr_in) :
-+ sizeof (struct sockaddr_in6);
-+ (void) memcpy(buf, addr, len);
-+ *bufp = buf + len;
-+ return ((struct sockaddr *)buf);
-+}
-+
-+static int
-+populate(struct ifaddrs *ifa, int fd, struct lifreq *lifrp, int nlif, int af,
-+ char **bufp)
-+{
-+ char *buf = *bufp;
-+ size_t slen;
-+
-+ while (nlif > 0) {
-+ ifa->ifa_next = (nlif > 1) ? ifa + 1 : NULL;
-+ (void) strcpy(ifa->ifa_name = buf, lifrp->lifr_name);
-+ slen = strlen(lifrp->lifr_name) + 1;
-+ buf += (slen + 3) & ~3;
-+ if (ioctl(fd, SIOCGLIFFLAGS, lifrp) == -1)
-+ ifa->ifa_flags = 0;
-+ else
-+ ifa->ifa_flags = lifrp->lifr_flags;
-+ if (ioctl(fd, SIOCGLIFADDR, lifrp) == -1)
-+ ifa->ifa_addr = NULL;
-+ else
-+ ifa->ifa_addr = addrcpy(&lifrp->lifr_addr, &buf);
-+ if (ioctl(fd, SIOCGLIFNETMASK, lifrp) == -1)
-+ ifa->ifa_netmask = NULL;
-+ else
-+ ifa->ifa_netmask = addrcpy(&lifrp->lifr_addr, &buf);
-+ if (ifa->ifa_flags & IFF_POINTOPOINT) {
-+ if (ioctl(fd, SIOCGLIFDSTADDR, lifrp) == -1)
-+ ifa->ifa_dstaddr = NULL;
-+ else
-+ ifa->ifa_dstaddr =
-+ addrcpy(&lifrp->lifr_dstaddr, &buf);
-+ } else if (ifa->ifa_flags & IFF_BROADCAST) {
-+ if (ioctl(fd, SIOCGLIFBRDADDR, lifrp) == -1)
-+ ifa->ifa_broadaddr = NULL;
-+ else
-+ ifa->ifa_broadaddr =
-+ addrcpy(&lifrp->lifr_broadaddr, &buf);
-+ } else {
-+ ifa->ifa_dstaddr = NULL;
-+ }
-+
-+ ifa++;
-+ nlif--;
-+ lifrp++;
-+ }
-+ *bufp = buf;
-+ return (0);
-+}
-+
-+int
-+getifaddrs(struct ifaddrs **ifap)
-+{
-+ int fd4, fd6;
-+ int nif4, nif6 = 0;
-+ struct lifreq *ifr4 = NULL;
-+ struct lifreq *ifr6 = NULL;
-+ struct ifaddrs *ifa = NULL;
-+ char *buf;
-+
-+ if ((fd4 = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
-+ return (-1);
-+ if ((fd6 = socket(AF_INET6, SOCK_DGRAM, 0)) == -1 &&
-+ errno != EAFNOSUPPORT) {
-+ (void) close(fd4);
-+ return (-1);
-+ }
-+
-+ if ((nif4 = get_lifreq(fd4, &ifr4)) == -1 ||
-+ (fd6 != -1 && (nif6 = get_lifreq(fd6, &ifr6)) == -1))
-+ goto failure;
-+
-+ if (nif4 == 0 && nif6 == 0) {
-+ *ifap = NULL;
-+ return (0);
-+ }
-+
-+ ifa = malloc(nbytes(ifr4, nif4, sizeof (struct sockaddr_in)) +
-+ nbytes(ifr6, nif6, sizeof (struct sockaddr_in6)));
-+ if (ifa == NULL)
-+ goto failure;
-+
-+ buf = (char *)(ifa + nif4 + nif6);
-+
-+ if (populate(ifa, fd4, ifr4, nif4, AF_INET, &buf) == -1)
-+ goto failure;
-+ if (nif4 > 0 && nif6 > 0)
-+ ifa[nif4 - 1].ifa_next = ifa + nif4;
-+ if (populate(ifa + nif4, fd6, ifr6, nif6, AF_INET6, &buf) == -1)
-+ goto failure;
-+
-+ *ifap = ifa;
-+ return (0);
-+
-+failure:
-+ free(ifa);
-+ (void) close(fd4);
-+ if (fd6 != -1)
-+ (void) close(fd6);
-+ free(ifr4);
-+ free(ifr6);
-+ return (-1);
-+}
-+
-+void
-+freeifaddrs(struct ifaddrs *ifa)
-+{
-+ free(ifa);
-+}
-diff -urN gnome-nettool-2.22.0/src/ifaddrs.h ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/ifaddrs.h
---- gnome-nettool-2.22.0/src/ifaddrs.h 1970-01-01 01:00:00.000000000 +0100
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/ifaddrs.h 2008-09-10 18:06:02.712815000 +0100
-@@ -0,0 +1,41 @@
-+/*
-+ * Copyright (c) 2008 Sun Microsystems, Inc.. All rights reserved.
-+ * Use is subject to license terms
-+ *
-+ * Author: James Carlson, [email protected]
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License as published by
-+ * the Free Software Foundation; either version 2 of the License, or
-+ * (at your option) any later version.
-+ *
-+ * This program is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+ * GNU General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU General Public License
-+ * along with this program; if not, write to the Free Software
-+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-+ */
-+
-+#ifndef __IFADDRS_H
-+#define __IFADDRS_H
-+
-+#include <sys/types.h>
-+
-+#undef ifa_broadaddr
-+#undef ifa_dstaddr
-+struct ifaddrs {
-+ struct ifaddrs *ifa_next; /* Pointer to next struct */
-+ char *ifa_name; /* Interface name */
-+ uint64_t ifa_flags; /* Interface flags */
-+ struct sockaddr *ifa_addr; /* Interface address */
-+ struct sockaddr *ifa_netmask; /* Interface netmask */
-+ struct sockaddr *ifa_dstaddr; /* P2P interface destination */
-+};
-+#define ifa_broadaddr ifa_dstaddr
-+
-+extern int getifaddrs(struct ifaddrs **);
-+extern void freeifaddrs(struct ifaddrs *);
-+#endif
-diff -urN gnome-nettool-2.22.0/src/info.c ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/info.c
---- gnome-nettool-2.22.0/src/info.c 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/info.c 2008-09-10 18:04:16.693375000 +0100
-@@ -20,6 +20,8 @@
- #include <gtk/gtk.h>
- #include <glib/gi18n.h>
- #include <glib/gprintf.h>
-+#include <errno.h>
-+#include <kstat.h>
+@@ -29,7 +29,9 @@
+ util-mii-wireless.h \
+ main.c
- #ifdef HAVE_CONFIG_H
- # include <config.h>
-@@ -208,6 +210,106 @@
- gtk_combo_box_set_active (GTK_COMBO_BOX (info->combo), 0);
+-gnome_nettool_LDADD = @NETTOOL_LIBS@
++gnome_nettool_LDADD = @NETTOOL_LIBS@ \
++ -lsocket \
++ -lnsl
+
+ EXTRA_DIST = \
+ gnome-nettool.desktop.in \
+diff -urN gnome-nettool-2.26.0/src/callbacks.c ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/callbacks.c
+--- gnome-nettool-2.26.0/src/callbacks.c 2008-12-12 03:03:54.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/callbacks.c 2009-03-19 12:30:24.250566000 +0000
+@@ -306,7 +306,7 @@
}
-+char *
-+gnome_nettool_sysdeps_read_iface_statistics (const char *iface,
-+ gulong *out_bytes,
-+ gulong *out_packets,
-+ gulong *out_errors,
-+ gulong *in_bytes,
-+ gulong *in_packets,
-+ gulong *in_errors,
-+ gulong *collisions,
-+ gulong *if_speed)
-+{
-+ char *error_message = NULL;
-+ static kstat_ctl_t *kc = NULL;
-+ kstat_t *ksp;
-+ kstat_named_t *kn;
-+
-+ /*
-+ * The linux-specific code uses -1 as the default value. But if we return -1
-+ * (see comment below), then it gets interpreted as (unsigned long)-1, which
-+ * looks stupid and is definitely more wrong than just showing 0.
-+ */
-+
-+ *out_bytes = 0;
-+ *out_packets = 0;
-+ *out_errors = 0;
-+ *in_bytes = 0;
-+ *in_packets = 0;
-+ *in_errors = 0;
-+ *collisions = 0;
-+ *if_speed = 0;
-+
-+ if (kc == NULL)
-+ {
-+ if ((kc = kstat_open ()) == NULL)
-+ return g_strdup_printf ("Cannot open /dev/kstat: %s",
-+ g_strerror (errno));
-+ }
-+ else
-+ {
-+ if (kstat_chain_update (kc) < 0)
-+ {
-+ int e = errno;
-+ kstat_close (kc);
-+ kc = NULL;
-+ return g_strdup_printf ("Cannot update kstats: %s",
-+ g_strerror (e));
-+ }
-+ }
-+
-+ if ((ksp = kstat_lookup (kc, NULL, -1, iface)) == NULL)
-+ {
-+ kstat_close (kc);
-+ kc = NULL;
-+ return g_strdup_printf ("Cannot find information on interface '%s'",
-+ iface);
-+ }
-+
-+ if (kstat_read (kc, ksp, NULL) < 0)
-+ {
-+ kstat_close (kc);
-+ kc = NULL;
-+ return g_strdup_printf ("Cannot read kstat");
-+ }
-+
-+ if ((kn = kstat_data_lookup (ksp, "rbytes")) != NULL)
-+ *in_bytes = kn->value.ui32;
-+
-+ if ((kn = kstat_data_lookup (ksp, "opackets")) != NULL)
-+ *out_packets = kn->value.ui32;
-+
-+ if ((kn = kstat_data_lookup (ksp, "oerrors")) != NULL)
-+ *out_errors = kn->value.ui32;
-+
-+ if ((kn = kstat_data_lookup (ksp, "obytes")) != NULL)
-+ *out_bytes = kn->value.ui32;
-+
-+ if ((kn = kstat_data_lookup (ksp, "ipackets")) != NULL)
-+ *in_packets = kn->value.ui32;
-+
-+ if ((kn = kstat_data_lookup (ksp, "ierrors")) != NULL)
-+ *in_errors = kn->value.ui32;
-+
-+ if ((kn = kstat_data_lookup (ksp, "collisions")) != NULL)
-+ *collisions = kn->value.ui32;
-+
-+ if ((kn = kstat_data_lookup (ksp, "ifspeed")) != NULL)
-+ *if_speed = kn->value.ui32;
-+
-+
-+
-+ /*
-+ * On Solaris, loopback doesn't report bytes, just packets. The behavior of
-+ * the linux-specific code reports an error if all the data is not present,
-+ * and that shuts the applet down. So perhaps it's best to simply return
-+ * success if we can access the data at all.
-+ */
-+
-+ return NULL;
-+}
-+
- static gboolean
- info_nic_update_stats (gpointer data)
+ void
+-on_about_activate (gpointer window, GtkWidget *menu_item)
++on_about_activate (GtkWidget *menu_item, gpointer window)
{
-@@ -279,6 +381,30 @@
- g_io_channel_unref (io);
- #endif /* defined(__linux__) */
+ const gchar *authors[] = {
+ "Germán Poo Caamaño <[email protected]>",
+diff -urN gnome-nettool-2.26.0/src/callbacks.h ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/callbacks.h
+--- gnome-nettool-2.26.0/src/callbacks.h 2008-12-12 01:44:23.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/callbacks.h 2009-03-19 12:33:31.479093000 +0000
+@@ -36,6 +36,6 @@
+ guint page_num,
+ gpointer data);
+
+-void on_about_activate (gpointer window, GtkWidget *menu_item);
++void on_about_activate (GtkWidget *menu_item, gpointer window);
-+ gulong out_bytes, out_pkts, out_err, in_bytes, in_pkts, in_err, collisions, ifspeed;
-+ char buf[128];
-+
-+ gnome_nettool_sysdeps_read_iface_statistics (text, &out_bytes,
-+ &out_pkts, &out_err,
-+ &in_bytes, &in_pkts,
-+ &in_err, &collisions,
-+ &ifspeed);
-+ snprintf (buf, 128, "%ld", out_bytes);
-+ gtk_label_set_text (GTK_LABEL (info->tx_bytes), buf);
-+ snprintf (buf, 128, "%ld", out_pkts);
-+ gtk_label_set_text (GTK_LABEL (info->tx), buf);
-+ snprintf (buf, 128, "%ld", out_err);
-+ gtk_label_set_text (GTK_LABEL (info->tx_errors), buf);
-+ snprintf (buf, 128, "%ld", in_bytes);
-+ gtk_label_set_text (GTK_LABEL (info->rx_bytes), buf);
-+ snprintf (buf, 128, "%ld", in_pkts);
-+ gtk_label_set_text (GTK_LABEL (info->rx), buf);
-+ snprintf (buf, 128, "%ld", in_err);
-+ gtk_label_set_text (GTK_LABEL (info->rx_errors), buf);
-+ snprintf (buf, 128, "%ld", collisions);
-+ gtk_label_set_text (GTK_LABEL (info->collisions), buf);
-+ snprintf (buf, 128, "%ld", ifspeed);
-+ gtk_label_set_text (GTK_LABEL (info->link_speed), buf);
- return TRUE;
- }
-
-@@ -369,7 +495,7 @@
- scope = g_strdup ("Link");
- else if (IN6_IS_ADDR_SITELOCAL (&sinptr6->sin6_addr))
- scope = g_strdup ("Site");
-- else if (IN6_IS_ADDR_GLOBAL (&sinptr6->sin6_addr))
-+ else if (IN6_IS_ADDR_MC_GLOBAL (&sinptr6->sin6_addr))
- scope = g_strdup ("Global");
- else if (IN6_IS_ADDR_MC_ORGLOCAL (&sinptr6->sin6_addr))
- scope = g_strdup ("Global");
-diff -urN gnome-nettool-2.22.0/src/main.c ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/main.c
---- gnome-nettool-2.22.0/src/main.c 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/main.c 2008-09-10 18:04:16.694097000 +0100
-@@ -151,6 +151,7 @@
+ void on_help_activate (gpointer window, GtkWidget *menu_item);
+diff -urN gnome-nettool-2.26.0/src/main.c ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/main.c
+--- gnome-nettool-2.26.0/src/main.c 2009-03-17 02:15:43.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/main.c 2009-03-19 11:58:36.941490000 +0000
+@@ -54,7 +54,7 @@
+ main (int argc, char *argv[])
+ {
+ GtkWidget *window;
+- GtkWidget *menu_beep;
++ GtkWidget *menu_beep, *menu_quit, *menu_about;
+ GladeXML *xml;
+ GtkWidget *notebook;
+ GtkWidget *statusbar;
+@@ -155,6 +155,7 @@
current_page = INFO;
info_set_nic (info, info_input);
}
@@ -462,7 +85,32 @@
if (ping_input) {
current_page = PING;
netinfo_set_host (pinger, ping_input);
-@@ -475,6 +476,9 @@
+@@ -215,11 +216,24 @@
+ g_object_set_data (G_OBJECT (notebook), "finger", finger);
+ g_object_set_data (G_OBJECT (notebook), "whois", whois);
+
++ menu_quit = glade_xml_get_widget (xml, "m_quit");
++
++ g_signal_connect (G_OBJECT (menu_quit), "activate",
++ G_CALLBACK (gn_quit_app),
++ NULL);
++
+ menu_beep = glade_xml_get_widget (xml, "m_beep");
+
+ g_signal_connect (G_OBJECT (menu_beep), "activate",
+ G_CALLBACK (on_beep_activate),
+ (gpointer) pinger);
++
++ menu_about = glade_xml_get_widget (xml, "m_about");
++
++ g_signal_connect (G_OBJECT (menu_about), "activate",
++ G_CALLBACK (on_about_activate),
++ (gpointer) window);
++
+
+ glade_xml_signal_autoconnect (xml);
+ g_object_unref (G_OBJECT (xml));
+@@ -441,6 +455,9 @@
netstat->button = glade_xml_get_widget (xml, "netstat_button");
netstat->routing = glade_xml_get_widget (xml, "netstat_routing");
netstat->protocol = glade_xml_get_widget (xml, "netstat_protocol");
@@ -472,9 +120,9 @@
netstat->multicast = glade_xml_get_widget (xml, "netstat_multicast");
netstat->sensitive = NULL;
netstat->label_run = _("Netstat");
-diff -urN gnome-nettool-2.22.0/src/netstat.c ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/netstat.c
---- gnome-nettool-2.22.0/src/netstat.c 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/netstat.c 2008-09-10 18:04:16.694666000 +0100
+diff -urN gnome-nettool-2.26.0/src/netstat.c ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/netstat.c
+--- gnome-nettool-2.26.0/src/netstat.c 2009-03-17 02:15:43.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/netstat.c 2009-03-18 11:09:37.057963000 +0000
@@ -110,13 +110,21 @@
g_return_val_if_fail (netinfo != NULL, NULL);
@@ -503,8 +151,8 @@
g_return_if_fail (line != NULL);
count = strip_route_line (line, &data);
--#if defined(__FreeBSD__) || defined(__OpenBSD__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(sun)
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(sun)
if (count == 6) {
#else
if ((count == 8) || (count == 7)) {
@@ -520,21 +168,16 @@
3, data.iface, -1);
gtk_tree_view_set_model (widget, model);
-@@ -562,7 +574,12 @@
+@@ -562,7 +574,7 @@
gchar **items;
#endif
--#if defined(__FreeBSD__) || defined(__OpenBSD__)
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(sun)
-+ count = sscanf (line, NETSTAT_ROUTE_FORMAT,
-+ data->destination,
-+ data->gateway, flags,
-+ &ref, &use, data->iface);
-+#elif defined(sun)
+-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
++#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(sun)
count = sscanf (line, NETSTAT_ROUTE_FORMAT,
data->destination,
data->gateway, flags,
-@@ -718,9 +735,15 @@
+@@ -718,9 +730,15 @@
gint count = 0;
gint members;
@@ -550,9 +193,9 @@
snprintf ((data)->members, 30, "%d", members);
-diff -urN gnome-nettool-2.22.0/src/netstat.h ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/netstat.h
---- gnome-nettool-2.22.0/src/netstat.h 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/netstat.h 2008-09-10 18:04:16.696775000 +0100
+diff -urN gnome-nettool-2.26.0/src/netstat.h ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/netstat.h
+--- gnome-nettool-2.26.0/src/netstat.h 2008-12-10 00:38:30.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/netstat.h 2009-03-18 10:37:52.715528000 +0000
@@ -34,10 +34,19 @@
# define NETSTAT_PROTOCOL_FORMAT "%s %d %d %d.%d.%d.%d.%s %s %s"
# define ALT_NETSTAT_PROTOCOL_FORMAT "%s %d %d *.%s %s %s"
@@ -573,10 +216,10 @@
typedef enum {
NONE,
ROUTE,
-diff -urN gnome-nettool-2.22.0/src/ping.c ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/ping.c
---- gnome-nettool-2.22.0/src/ping.c 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/ping.c 2008-09-10 18:04:16.747361000 +0100
-@@ -300,7 +300,11 @@
+diff -urN gnome-nettool-2.26.0/src/ping.c ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/ping.c
+--- gnome-nettool-2.26.0/src/ping.c 2008-12-10 00:38:44.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/ping.c 2009-03-19 11:46:23.642754000 +0000
+@@ -294,7 +294,11 @@
program = util_find_program_dialog ("ping", parent);
break;
case IPV6:
@@ -588,34 +231,55 @@
break;
case -1:
-@@ -310,7 +314,7 @@
- }
-
- if (program != NULL) {
+@@ -308,7 +312,7 @@
+ if (count == -1) {
+ count_string = g_strdup_printf(" ");
+ } else {
-#if defined(__sun__) || defined(__hpux__)
+#if defined(sun) || defined(__hpux__)
- if (ip_version == IPV4)
+ count_string = g_strdup_printf("%d", count);
+ #else
+ count_string = g_strdup_printf(" -c %d ", count);
+@@ -317,7 +321,7 @@
+
+ if (ip_version == IPV4) {
command =
- g_strdup_printf (PING_PROGRAM_FORMAT, program, host,
-diff -urN gnome-nettool-2.22.0/src/ping.h ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/ping.h
---- gnome-nettool-2.22.0/src/ping.h 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/ping.h 2008-09-10 18:04:16.747660000 +0100
-@@ -35,10 +35,10 @@
- # define PING_PROGRAM_FORMAT_6 "%s ping6 -c %d -n %s"
+-#if defined(__sun__) || defined(__hpux__)
++#if defined(__hpux__) || defined(sun)
+ g_strdup_printf (PING_PROGRAM_FORMAT, program,
+ host, count_string);
+ #else
+@@ -326,7 +330,7 @@
+ #endif
+ } else {
+ command =
+-#if defined(__sun__) || defined(__hpux__)
++#if defined(sun) || defined(__hpux__)
+ g_strdup_printf (PING_PROGRAM_FORMAT_6, program,
+ host, count_string);
+ #else
+diff -urN gnome-nettool-2.26.0/src/ping.h ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/ping.h
+--- gnome-nettool-2.26.0/src/ping.h 2008-12-10 00:38:44.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/ping.h 2009-03-19 11:46:50.554824000 +0000
+@@ -36,11 +36,11 @@
+ # define PING_PROGRAM_FORMAT_6 "%s ping6%s-n %s"
# define PING_FORMAT "%d bytes from %s icmp_seq=%d ttl=%d time=%s %s"
# define PING_PARAMS_6
-#elif defined(__sun__)
+#elif defined(sun)
- # define PING_PROGRAM_FORMAT "%s ping -s -n %s 56 %d"
- # define PING_PROGRAM_FORMAT_6 "%s ping -s -A inet6 -a -n %s 56 %d"
+ /* <path to program> ping -s -n <host> [<count>] */
+-# define PING_PROGRAM_FORMAT "%s ping -s -n %s 56%s"
+-# define PING_PROGRAM_FORMAT_6 "%s ping -s -A inet6 -a -n %s 56%s"
-# define PING_FORMAT "%d bytes from %s icmp_seq=%d. time=%f %s"
++# define PING_PROGRAM_FORMAT "%s ping -s -n %s 56 %s"
++# define PING_PROGRAM_FORMAT_6 "%s ping -s -A inet6 -a -n %s 56 %s"
+# define PING_FORMAT "%d bytes from %s icmp_seq=%d. time=%s %s"
# define PING_PARAMS_5
#elif defined(__hpux__)
- # define PING_PROGRAM_FORMAT "%s ping %s -n %d"
-diff -urN gnome-nettool-2.22.0/src/utils.h ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/utils.h
---- gnome-nettool-2.22.0/src/utils.h 2008-02-12 18:25:08.000000000 +0000
-+++ ../SUNWgnome-nettool-2.22.0.hacked/gnome-nettool-2.22.0/src/utils.h 2008-09-10 18:04:16.748633000 +0100
+ # define PING_PROGRAM_FORMAT "%s ping %s -n%s"
+diff -urN gnome-nettool-2.26.0/src/utils.h ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/utils.h
+--- gnome-nettool-2.26.0/src/utils.h 2008-12-08 15:35:27.000000000 +0000
++++ ../SUNWgnome-nettool-2.26.0.hacked/gnome-nettool-2.26.0/src/utils.h 2009-03-18 10:37:52.716289000 +0000
@@ -29,6 +29,10 @@
# include <config.h>
#endif