diff options
Diffstat (limited to 'net/gnome-nettool/files')
-rw-r--r-- | net/gnome-nettool/files/patch-configure | 49 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo::info.c | 63 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo_callbacks.c | 10 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo_netinfo.c | 41 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo_netstat.c | 136 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo_netstat.h | 14 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo_ping.c | 11 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo_ping.h | 11 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-gnome-netinfo_util-mii.c | 15 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-network-utilities_gnome-remote-shell.c | 12 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-src_info.c | 191 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-src_netstat.c | 20 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-src_nettool.c | 10 | ||||
-rw-r--r-- | net/gnome-nettool/files/patch-src_utils.c | 11 |
14 files changed, 276 insertions, 318 deletions
diff --git a/net/gnome-nettool/files/patch-configure b/net/gnome-nettool/files/patch-configure index f195f07b43c6..d2759248b4d6 100644 --- a/net/gnome-nettool/files/patch-configure +++ b/net/gnome-nettool/files/patch-configure @@ -1,10 +1,49 @@ ---- configure.orig Wed Dec 11 18:31:51 2002 -+++ configure Thu Dec 12 12:07:17 2002 -@@ -7414,6 +7414,7 @@ +--- configure.orig Sun Jul 4 16:00:33 2004 ++++ configure Sun Jul 4 16:02:31 2004 +@@ -20269,7 +20269,7 @@ + # This can be used to rebuild libtool when needed - LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" -+$ac_aux_dir/ltconfig $LIBTOOL_DEPS +-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"; $ac_aux_dir/ltconfig $LIBTOOL_DEPS; ++LIBTOOL_DEPS="--disable-ltlibs /usr/local/share/libtool13/ltmain.sh"; /usr/local/share/libtool13/ltconfig13 $LIBTOOL_DEPS; # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' +@@ -22038,13 +22038,13 @@ + if test "x${prefix}" = "xNONE"; then + + cat >>confdefs.h <<_ACEOF +-#define GNOME_ICONDIR "${ac_default_prefix}/share/pixmaps" ++#define GNOME_ICONDIR "${ac_default_prefix}/share/gnome/pixmaps" + _ACEOF + + else + + cat >>confdefs.h <<_ACEOF +-#define GNOME_ICONDIR "${prefix}/share/pixmaps" ++#define GNOME_ICONDIR "${prefix}/share/gnome/pixmaps" + _ACEOF + + fi +@@ -22052,17 +22052,17 @@ + if test "x${prefix}" = "xNONE"; then + + cat >>confdefs.h <<_ACEOF +-#define PIXMAPS_DIR "${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps" ++#define PIXMAPS_DIR "${ac_default_prefix}/${DATADIRNAME}/gnome/${PACKAGE}/pixmaps" + _ACEOF + +- pixmapsdir="${ac_default_prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps" ++ pixmapsdir="${ac_default_prefix}/${DATADIRNAME}/gnome/${PACKAGE}/pixmaps" + else + + cat >>confdefs.h <<_ACEOF +-#define PIXMAPS_DIR "${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps" ++#define PIXMAPS_DIR "${prefix}/${DATADIRNAME}/gnome/${PACKAGE}/pixmaps" + _ACEOF + +- pixmapsdir="${prefix}/${DATADIRNAME}/${PACKAGE}/pixmaps" ++ pixmapsdir="${prefix}/${DATADIRNAME}/gnome/${PACKAGE}/pixmaps" + fi + + diff --git a/net/gnome-nettool/files/patch-gnome-netinfo::info.c b/net/gnome-nettool/files/patch-gnome-netinfo::info.c deleted file mode 100644 index 54c795546c31..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo::info.c +++ /dev/null @@ -1,63 +0,0 @@ ---- gnome-netinfo/info.c.orig Mon Nov 24 18:29:43 2003 -+++ gnome-netinfo/info.c Wed Dec 17 22:27:46 2003 -@@ -27,6 +27,7 @@ - #endif - - -+#include <netinet/in.h> - #include <sys/socket.h> /* basic socket definitions */ - #include <arpa/inet.h> /* inet(3) functions */ - #include <sys/un.h> /* for Unix domain sockets */ -@@ -173,7 +174,7 @@ - for (ptr = buf; ptr < buf + ifc.ifc_len;) { - ifr = (struct ifreq *) ptr; - len = sizeof (struct sockaddr); --#ifdef HAVE_SOCKADDR_SA_LEN -+#if defined(HAVE_SOCKADDR_SA_LEN) || defined(__FreeBSD__) - if (ifr->ifr_addr.sa_len > len) - len = ifr->ifr_addr.sa_len; /* length > 16 */ - #endif -@@ -182,8 +183,12 @@ - if (strcmp (ifr->ifr_name, nic) != 0) { - continue; - } -+ -+ memset (&data, 0, sizeof(data)); - -+#ifdef __linux__ - data = mii_get_basic (nic); -+#endif - - switch (ifr->ifr_addr.sa_family) { - case AF_INET: -@@ -306,7 +311,6 @@ - break; - } - } -- g_free (ifr); - } - - static GList * -@@ -321,6 +325,8 @@ - - sockfd = socket (AF_INET, SOCK_DGRAM, 0); - -+ memset (&ifc, 0, sizeof (struct ifconf)); -+ memset (&buf, 0, sizeof (buf)); - ifc.ifc_len = sizeof (buf); - ifc.ifc_req = (struct ifreq *) buf; - -@@ -331,9 +337,11 @@ - len = sizeof (struct sockaddr); - - iface = g_strdup (ifr->ifr_name); -- items = g_list_append (items, iface); -+ if (g_list_find_custom (items, iface, (GCompareFunc) g_ascii_strcasecmp) == NULL) { -+ items = g_list_append (items, iface); -+ } - --#ifdef HAVE_SOCKADDR_SA_LEN -+#if defined(HAVE_SOCKADDR_SA_LEN) || defined(__FreeBSD__) - if (ifr->ifr_addr.sa_len > len) - len = ifr->ifr_addr.sa_len; /* length > 16 */ - #endif diff --git a/net/gnome-nettool/files/patch-gnome-netinfo_callbacks.c b/net/gnome-nettool/files/patch-gnome-netinfo_callbacks.c deleted file mode 100644 index 32d818c6f24a..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo_callbacks.c +++ /dev/null @@ -1,10 +0,0 @@ ---- gnome-netinfo/callbacks.c.orig Sat Dec 6 23:20:05 2003 -+++ gnome-netinfo/callbacks.c Sat Dec 6 23:20:14 2003 -@@ -27,6 +27,7 @@ - #include <sys/wait.h> - #include <unistd.h> - #include <sys/types.h> -+#include <signal.h> - - #include "callbacks.h" - #include "traceroute.h" diff --git a/net/gnome-nettool/files/patch-gnome-netinfo_netinfo.c b/net/gnome-nettool/files/patch-gnome-netinfo_netinfo.c deleted file mode 100644 index 4048c43b48ab..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo_netinfo.c +++ /dev/null @@ -1,41 +0,0 @@ ---- gnome-netinfo/netinfo.c.orig Mon Nov 24 18:29:43 2003 -+++ gnome-netinfo/netinfo.c Sun Dec 7 01:00:52 2003 -@@ -20,6 +20,7 @@ - - #include <gnome.h> - #include <sys/types.h> -+#include <sys/socket.h> - #include <signal.h> - #include <errno.h> - #include <sys/wait.h> -@@ -253,14 +254,16 @@ - if (condition & G_IO_IN) { - g_io_channel_read_line (channel, &text, &len, NULL, NULL); - -- if (netinfo->process_line != NULL) { -- (netinfo->process_line) ((gpointer) netinfo, text, -- len, NULL); -- } -+ if (text != NULL) { -+ if (netinfo->process_line != NULL) { -+ (netinfo->process_line) ((gpointer) netinfo, text, -+ len, NULL); -+ } - -- g_free (text); -+ g_free (text); - -- return TRUE; -+ return TRUE; -+ } - } - - /* The condition is not G_IO_HUP | G_IO_ERR | G_IO_NVAL, so -@@ -285,6 +288,7 @@ - } - return FALSE; - } -+ - - void - netinfo_stop_process_command (Netinfo * netinfo) diff --git a/net/gnome-nettool/files/patch-gnome-netinfo_netstat.c b/net/gnome-nettool/files/patch-gnome-netinfo_netstat.c deleted file mode 100644 index 4f0a7240ba9c..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo_netstat.c +++ /dev/null @@ -1,136 +0,0 @@ ---- gnome-netinfo/netstat.c.orig Mon Nov 24 18:29:43 2003 -+++ gnome-netinfo/netstat.c Sun Dec 7 01:34:51 2003 -@@ -113,7 +113,11 @@ - } - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (netinfo->protocol))) { - /* Only works for Solaris */ -+#ifdef __FreeBSD__ -+ option = g_strdup ("-a -f inet -ln"); -+#else - option = g_strdup ("-A inet -ln"); -+#endif - } - if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (netinfo->multicast))) { - /* It works for Solaris and Linux */ -@@ -266,7 +270,11 @@ - g_return_if_fail (line != NULL); - - count = strip_protocol_line (line, &data); -+#ifdef __FreeBSD__ -+ if (count == 5 || count == 6 || count == 9 || count == 10) { -+#else - if (count == 7 || count == 8) { -+#endif - #ifdef DEBUG - g_print ("%s\t%s:%s\t%s\n", data.protocol, - data.ip_src, data.port_src, data.state); -@@ -331,11 +339,42 @@ - strip_protocol_line (gchar * line, netstat_protocol_data *data) - { - gint count = 0; -+#ifdef __FreeBSD__ -+ gint a1, a2, a3, a4; -+ gchar s9[30]; -+#else - gchar s6[30], s7[30]; -+#endif - gint n2, n3; - - line = g_strdelimit (line, ":", ' '); - -+#ifdef __FreeBSD__ -+ count = sscanf (line, NETSTAT_PROTOCOL_FORMAT, -+ data->protocol, &n2, &n3, -+ &a1, &a2, &a3, &a4, data->port_src, -+ s9, data->state); -+ g_snprintf (data->ip_src, 30, "%d.%d.%d.%d", a1, a2, a3, a4); -+ -+ if (count == 9) { -+ bzero (&(data)->state, 30); -+ } -+ -+ if (count == 3) { -+ /* Handle the *.* entries. */ -+ gchar s5[30]; -+ count = sscanf (line, ALT_NETSTAT_PROTOCOL_FORMAT, -+ data->protocol, &n2, &n3, -+ data->port_src, s5, -+ data->state); -+ g_snprintf (data->ip_src, 30, "*"); -+ -+ if (count == 5) { -+ bzero (&(data)->state, 30); -+ } -+ } -+ -+#else - count = sscanf (line, NETSTAT_PROTOCOL_FORMAT, - data->protocol, &n2, &n3, - data->ip_src, data->port_src, -@@ -344,6 +383,7 @@ - if (count == 7) { - bzero (&(data)->state, 30); - } -+#endif - - return count; - } -@@ -405,7 +445,11 @@ - g_return_if_fail (line != NULL); - - count = strip_route_line (line, &data); -+#ifdef __FreeBSD__ -+ if (count == 6) { -+#else - if (count == 8) { -+#endif - #ifdef DEBUG - g_print ("%s\t%s:%s\t%d\t%s\n", data.destination, - data.gateway, data.netmask, data.metric, -@@ -474,11 +518,19 @@ - gchar flags[30]; - gint ref, use; - -+#ifdef __FreeBSD__ -+ count = sscanf (line, NETSTAT_ROUTE_FORMAT, -+ data->destination, -+ data->gateway, flags, -+ &ref, &use, data->iface); -+#else -+ - count = sscanf (line, NETSTAT_ROUTE_FORMAT, - data->destination, - data->gateway, data->netmask, - flags, &(data)->metric, &ref, &use, - data->iface); -+#endif - - return count; - } -@@ -493,7 +545,11 @@ - renderer = gtk_cell_renderer_text_new (); - column = - gtk_tree_view_column_new_with_attributes -+#ifdef __FreeBSD__ -+ (_("Destination/Prefix"), renderer, "text", 0, NULL); -+#else - (_("Destination"), renderer, "text", 0, NULL); -+#endif - gtk_tree_view_append_column (widget, column); - - renderer = gtk_cell_renderer_text_new (); -@@ -503,12 +559,14 @@ - gtk_tree_view_column_set_alignment (column, 0.5); - gtk_tree_view_append_column (widget, column); - -+#ifndef __FreeBSD__ - renderer = gtk_cell_renderer_text_new (); - column = - gtk_tree_view_column_new_with_attributes - (_("Netmask"), renderer, "text", 2, NULL); - - gtk_tree_view_append_column (widget, column); -+#endif - - renderer = gtk_cell_renderer_text_new (); - column = diff --git a/net/gnome-nettool/files/patch-gnome-netinfo_netstat.h b/net/gnome-nettool/files/patch-gnome-netinfo_netstat.h deleted file mode 100644 index 6e00ba018f0b..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo_netstat.h +++ /dev/null @@ -1,14 +0,0 @@ ---- gnome-netinfo/netstat.h.orig Sun Jul 20 22:31:57 2003 -+++ gnome-netinfo/netstat.h Sun Dec 7 01:32:10 2003 -@@ -28,6 +28,11 @@ - # define NETSTAT_PROTOCOL_FORMAT "%s %d %d %s %s %s %s %s" - # define NETSTAT_ROUTE_FORMAT "%s %s %s %s %d %d %d %s" - # define NETSTAT_MULTICAST_FORMAT "%s %d %s" -+#elif defined(__FreeBSD__) -+# 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" -+# define NETSTAT_ROUTE_FORMAT "%s %s %s %d %d %s" -+# define NETSTAT_MULTICAST_FORMAT "%s %d %s" - - #endif - diff --git a/net/gnome-nettool/files/patch-gnome-netinfo_ping.c b/net/gnome-nettool/files/patch-gnome-netinfo_ping.c deleted file mode 100644 index 40f2b83fa6b1..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo_ping.c +++ /dev/null @@ -1,11 +0,0 @@ ---- gnome-netinfo/ping.c.orig Sat Dec 6 23:08:52 2003 -+++ gnome-netinfo/ping.c Sat Dec 6 23:17:35 2003 -@@ -330,6 +330,8 @@ - - if (netinfo_get_ip_version (netinfo) == IPV4) - line = g_strdelimit (line, ":", ' '); -+ else -+ line = g_strdelimit (line, ",", ' '); - - #ifdef PING_PARAMS_5 - count = sscanf (line, PING_FORMAT, diff --git a/net/gnome-nettool/files/patch-gnome-netinfo_ping.h b/net/gnome-nettool/files/patch-gnome-netinfo_ping.h deleted file mode 100644 index debf4603d263..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo_ping.h +++ /dev/null @@ -1,11 +0,0 @@ ---- gnome-netinfo/ping.h.orig Sat Dec 6 23:11:01 2003 -+++ gnome-netinfo/ping.h Sat Dec 6 23:17:53 2003 -@@ -25,7 +25,7 @@ - - /* The ping usage and output is different between Unix flavours */ - /* FIXME: Add BSD support */ --#if defined(__linux__) || defined(__OSF__) -+#if defined(__linux__) || defined(__OSF__) || defined(__FreeBSD__) - # define PING_PROGRAM_FORMAT "%s ping -c %d -n %s" - # define PING_PROGRAM_FORMAT_6 "%s ping6 -c %d -n %s" - # define PING_FORMAT "%d bytes from %s icmp_seq=%d ttl=%d time=%s %s" diff --git a/net/gnome-nettool/files/patch-gnome-netinfo_util-mii.c b/net/gnome-nettool/files/patch-gnome-netinfo_util-mii.c deleted file mode 100644 index 9d38a3d3daa6..000000000000 --- a/net/gnome-nettool/files/patch-gnome-netinfo_util-mii.c +++ /dev/null @@ -1,15 +0,0 @@ ---- gnome-netinfo/util-mii.c.orig Sat Dec 6 23:30:50 2003 -+++ gnome-netinfo/util-mii.c Sat Dec 6 23:38:14 2003 -@@ -39,6 +39,7 @@ - * http://www.national.com/pf/DP/DP83840.html - */ - -+#ifdef __linux__ - #include <glib.h> - - #include <errno.h> -@@ -237,3 +238,4 @@ - close (sock); - return data; - } -+#endif diff --git a/net/gnome-nettool/files/patch-network-utilities_gnome-remote-shell.c b/net/gnome-nettool/files/patch-network-utilities_gnome-remote-shell.c deleted file mode 100644 index 0ac22218e1ab..000000000000 --- a/net/gnome-nettool/files/patch-network-utilities_gnome-remote-shell.c +++ /dev/null @@ -1,12 +0,0 @@ ---- network-utilities/gnome-remote-shell.c.orig Mon Sep 1 01:56:21 2003 -+++ network-utilities/gnome-remote-shell.c Mon Sep 1 01:58:11 2003 -@@ -23,6 +23,9 @@ - #endif - - #include <netdb.h> -+#include <sys/types.h> -+#include <sys/socket.h> -+#include <netinet/in.h> - #include <gconf/gconf-client.h> - #include <gtk/gtkdialog.h> - #include <gtk/gtkentry.h> diff --git a/net/gnome-nettool/files/patch-src_info.c b/net/gnome-nettool/files/patch-src_info.c new file mode 100644 index 000000000000..7b6e43a5fcf4 --- /dev/null +++ b/net/gnome-nettool/files/patch-src_info.c @@ -0,0 +1,191 @@ +--- src/info.c.orig Fri Jun 11 07:14:17 2004 ++++ src/info.c Mon Jul 5 15:25:09 2004 +@@ -37,6 +37,9 @@ + #include <sys/ioctl.h> + #include <stdlib.h> + #include <net/if.h> ++#ifdef __FreeBSD__ ++#include <net/if_media.h> ++#endif + + #include "info.h" + #include "utils.h" +@@ -57,10 +60,11 @@ + { 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 }, ++ { N_("Modem Interface"), INFO_INTERFACE_PPP, "16_ppp.xpm", "tun", NULL }, + { 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 }, +- { N_("Unknown Interface"), INFO_INTERFACE_UNKNOWN, "network.png", NULL, NULL }, ++ { N_("Unknown Interface"), INFO_INTERFACE_UNKNOWN, "network.png", "", NULL }, + { NULL, INFO_INTERFACE_UNKNOWN, NULL, NULL, NULL } + }; + +@@ -97,9 +101,39 @@ + { + gint i; + gchar *path; +- ++ gchar *dev_type = NULL; ++#if defined(__FreeBSD__) ++ int s; ++ struct ifmediareq ifmr; ++ ++ if ((s = socket (AF_INET, SOCK_DGRAM, 0)) > -1) { ++ ++ (void) memset (&ifmr, 0, sizeof (ifmr)); ++ (void) strncpy (ifmr.ifm_name, dev_name, sizeof (ifmr.ifm_name)); ++ ++ if (ioctl (s, SIOCGIFMEDIA, (caddr_t) &ifmr) > -1) { ++ switch (IFM_TYPE (ifmr.ifm_active)) { ++ case IFM_ETHER: ++ dev_type = "eth"; ++ break; ++ case IFM_FDDI: ++ case IFM_TOKEN: ++ dev_type = "other_type"; ++ break; ++ case IFM_IEEE80211: ++ dev_type = "wlan"; ++ break; ++ } ++ } ++ close (s); ++ } ++#endif /* defined(__FreeBSD__) */ ++ ++ if (!dev_type) ++ dev_type = (gchar *) dev_name; ++ + for (i = 0; info_iface_desc[i].name; i++) +- if (strstr (dev_name, info_iface_desc[i].prefix) == dev_name) { ++ if (strstr (dev_type, info_iface_desc[i].prefix) == dev_type) { + (*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); +@@ -187,17 +221,26 @@ + 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)); +@@ -206,21 +249,61 @@ + else + return FALSE; + /*text = gtk_entry_get_text (GTK_ENTRY (info->nic));*/ +- ++ + #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 (char)) * (strlen (line) + 2)); ++ 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) { + /* +@@ -248,7 +331,9 @@ + } + + g_io_channel_unref (io); +-#endif /* defined(__linux__) */ ++#if defined(__FreeBSD__) ++ close (pipe_out); ++#endif /* defined(__FreeBSD__) */ + + return TRUE; + } +@@ -384,6 +469,7 @@ + mii_data_result data; + + getifaddrs (&ifa0); ++ memset (&data, 0, sizeof (data)); + + for (ifr6 = ifa0; ifr6; ifr6 = ifr6->ifa_next) { + if (strcmp (ifr6->ifa_name, nic) != 0) { +@@ -425,7 +511,9 @@ + ifc.ifc_req = (struct ifreq *) buf; + ioctl (sockfd, SIOCGIFCONF, &ifc); + ++#if defined(__linux__) + data = mii_get_basic (nic); ++#endif /* defined(__linux__) */ + + for (ptr = buf; ptr < buf + ifc.ifc_len;) { + ifr = (struct ifreq *) ptr; diff --git a/net/gnome-nettool/files/patch-src_netstat.c b/net/gnome-nettool/files/patch-src_netstat.c new file mode 100644 index 000000000000..eed0a328c47c --- /dev/null +++ b/net/gnome-nettool/files/patch-src_netstat.c @@ -0,0 +1,20 @@ +--- src/netstat.c.orig Sun Jul 4 17:57:03 2004 ++++ src/netstat.c Sun Jul 4 17:57:48 2004 +@@ -108,12 +108,17 @@ + g_return_val_if_fail (netinfo != NULL, NULL); + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (netinfo->routing))) { ++#ifdef __FreeBSD__ ++ /* XXX We only support ipv4 now */ ++ option = g_strdup ("-rn -f inet"); ++#else + /* Works for Solaris and Linux */ + if (netinfo_is_ipv6_enable ()) { + option = g_strdup ("-rn -A inet -A inet6"); + } else { + option = g_strdup ("-rn -A inet"); + } ++#endif + } + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (netinfo->protocol))) { + /* Only works for Solaris */ diff --git a/net/gnome-nettool/files/patch-src_nettool.c b/net/gnome-nettool/files/patch-src_nettool.c new file mode 100644 index 000000000000..3319e36a70ae --- /dev/null +++ b/net/gnome-nettool/files/patch-src_nettool.c @@ -0,0 +1,10 @@ +--- src/nettool.c.orig Sun Jul 4 15:52:03 2004 ++++ src/nettool.c Sun Jul 4 15:53:11 2004 +@@ -21,6 +21,7 @@ + #include <gnome.h> + #include <sys/types.h> + #include <sys/socket.h> ++#include <netinet/in.h> + #include <signal.h> + #include <errno.h> + #include <sys/wait.h> diff --git a/net/gnome-nettool/files/patch-src_utils.c b/net/gnome-nettool/files/patch-src_utils.c new file mode 100644 index 000000000000..0c8111ade4bf --- /dev/null +++ b/net/gnome-nettool/files/patch-src_utils.c @@ -0,0 +1,11 @@ +--- src/utils.c.orig Sun Jul 4 20:11:49 2004 ++++ src/utils.c Sun Jul 4 20:12:14 2004 +@@ -240,7 +240,7 @@ + const gchar *unit = "B"; + gchar *result; + +- sscanf (bytes, "%lld", &rx); ++ rx = strtoull (bytes, (char **)NULL, 10); + short_rx = rx * 10; + + if (rx > 1125899906842624ull) { |