diff --git a/NEWS b/NEWS index f4e92dd..c52d866 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ WHAT'S NEW? + V0.76 display load sharing hosts in --raw output. + added about button in gui. v0.75 Feelgood patch to move sprintf to snprintf. People might think that sprintf might cause a buffer overflow. Now it's clean. cut-paste patches: you can now copy an intermediate host to the diff --git a/README b/README index 1eca21c..625f9eb 100644 --- a/README +++ b/README @@ -60,6 +60,11 @@ INSTALLING knows how to make this automatic using autoconf / the configure script, please tell me.... + This should now also work: + ./configure CFLAGS="-arch i386 -arch x86_64" LIBS="-lresolv" \ + --without-gtk --disable-endian-check --disable-dependency-tracking + + WHERE CAN I GET THE LATEST VERSION OR MORE INFORMATION? diff --git a/configure.in b/configure.in index d73e994..ff6d51f 100644 --- a/configure.in +++ b/configure.in @@ -1,5 +1,5 @@ AC_INIT(mtr.c) -AM_INIT_AUTOMAKE(mtr, 0.75) +AM_INIT_AUTOMAKE(mtr, 0.76) AC_SUBST(GTK_OBJ) @@ -49,7 +49,7 @@ AC_ARG_ENABLE(ipv6, WANTS_IPV6=$enableval, WANTS_IPV6=yes) if test "x$WANTS_GTK" = "xyes"; then - AM_PATH_GTK_2_0(2.4.0, CFLAGS="$CFLAGS $GTK_CFLAGS" + AM_PATH_GTK_2_0(2.6.0, CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS -lm", AC_MSG_WARN(Building without GTK2 display support) AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.]) @@ -108,7 +108,13 @@ AC_MSG_CHECKING(for C flags to get more warnings) ac_save_CFLAGS="$CFLAGS" if test "x$ac_cv_c_compiler_gnu" = "xyes" ; then dnl gcc is the easiest C compiler - warning_CFLAGS="-Wall -Wno-pointer-sign" + warning_CFLAGS="-Wall" + # Check if compiler supports -Wno-pointer-sign and add it if supports + CFLAGS_saved="$CFLAGS" + CFLAGS="$CFLAGS -Wno-pointer-sign" + AC_COMPILE_IFELSE([ AC_LANG_SOURCE([[ int foo; ]])], + [ warning_CFLAGS="${warning_CFLAGS} -Wno-pointer-sign" ],) + CFLAGS="$CFLAGS_saved" else dnl Vendor supplied C compilers are a bit tricky case "$host_os" in diff --git a/curses.c b/curses.c index db4209d..880d85f 100644 --- a/curses.c +++ b/curses.c @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/display.c b/display.c index e18374f..f27cd7c 100644 --- a/display.c +++ b/display.c @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/display.h b/display.h index 2c96171..87be8a1 100644 --- a/display.h +++ b/display.h @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/dns.c b/dns.c index d33df81..be13e8b 100644 --- a/dns.c +++ b/dns.c @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -484,6 +483,7 @@ void dns_open(void) { int option,i; + if (!dns) return; res_init(); if (!_res.nscount) { fprintf(stderr,"No nameservers defined.\n"); diff --git a/dns.h b/dns.h index 47ed4be..b25c267 100644 --- a/dns.h +++ b/dns.h @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/getopt.h b/getopt.h index 8dd3498..aaa627e 100644 --- a/getopt.h +++ b/getopt.h @@ -5,8 +5,7 @@ The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + License as published by the Free Software Foundation version 2. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/getopt1.c b/getopt1.c index 4580211..bccf8b2 100644 --- a/getopt1.c +++ b/getopt1.c @@ -2,10 +2,9 @@ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994 Free Software Foundation, Inc. - 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, or (at your option) any - later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/gtk.c b/gtk.c index f79aefd..3aa2132 100644 --- a/gtk.c +++ b/gtk.c @@ -4,9 +4,8 @@ Changes/additions Copyright (C) 1998 R.E.Wolff@BitWizard.nl 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -55,6 +54,7 @@ extern int af; static int tag; static GtkWidget *Pause_Button; static GtkWidget *Entry; +static GtkWidget *main_window; void gtk_add_ping_timeout (void) { @@ -122,6 +122,68 @@ gint Pause_clicked(UNUSED GtkWidget *Button, UNUSED gpointer data) return FALSE; } +gint About_clicked(UNUSED GtkWidget *Button, UNUSED gpointer data) +{ + gchar *authors[] = { + "Roger Wolff ", + "Bohdan Vlasyuk ", + "Evgeniy Tretyak ", + "John Thacker ", + "Juha Takala", + "David Sward ", + "David Stone ", + "Andrew Stesin", + "Greg Stark ", + "Robert Sparks ", + "Mike Simons ", + "Aaron Scarisbrick,", + "Craig Milo Rogers ", + "Antonio Querubin ", + "Russell Nelson ", + "Davin Milun ", + "Josh Martin ", + "Alexander V. Lukyanov ", + "Charles Levert ", + "Bertrand Leconte ", + "Anand Kumria", + "Olav Kvittem ", + "Adam Kramer ", + "Philip Kizer ", + "Simon Kirby", + "Christophe Kalt", + "Steve Kann ", + "Brett Johnson ", + "Roland Illig ", + "Damian Gryski ", + "Rob Foehl ", + "Mircea Damian", + "Cougar ", + "Brian Casey", + "Andrew Brown ", + "Bill Bogstad ", + "Marc Bejarano ", + "Moritz Barsnick ", + NULL + }; + + gtk_show_about_dialog(GTK_WINDOW(main_window) + , "version", VERSION + , "copyright", "Copyright \xc2\xa9 1997,1998 Matt Kimball" + , "website", "http://www.bitwizard.nl/mtr/" + , "authors", authors + , "comments", "The 'traceroute' and 'ping' programs in a single network diagnostic tool." + , "license", +"This program is free software; you can redistribute it and/or modify\n" +"it under the terms of the GNU General Public License version 2 as\n" +"published by the Free Software Foundation.\n" +"\n" +"This program is distributed in the hope that it will be useful,\n" +"but WITHOUT ANY WARRANTY; without even the implied warranty of\n" +"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" +"GNU General Public License for more details." + , NULL); + return TRUE; +} /* * There is a small problem with the following code: @@ -182,6 +244,11 @@ void Toolbar_fill(GtkWidget *Toolbar) g_signal_connect(GTK_OBJECT(Button), "clicked", GTK_SIGNAL_FUNC(Window_destroy), NULL); + Button = gtk_button_new_from_stock(GTK_STOCK_ABOUT); + gtk_box_pack_end(GTK_BOX(Toolbar), Button, FALSE, FALSE, 0); + g_signal_connect(GTK_OBJECT(Button), "clicked", + GTK_SIGNAL_FUNC(About_clicked), NULL); + Button = gtk_button_new_with_mnemonic("_Restart"); gtk_box_pack_end(GTK_BOX(Toolbar), Button, FALSE, FALSE, 0); g_signal_connect(GTK_OBJECT(Button), "clicked", @@ -443,7 +510,7 @@ void Window_fill(GtkWidget *Window) GtkWidget *Toolbar; GtkWidget *scroll; - gtk_window_set_title(GTK_WINDOW(Window), "My traceroute [v" VERSION "]"); + gtk_window_set_title(GTK_WINDOW(Window), "My traceroute"); gtk_window_set_default_size(GTK_WINDOW(Window), 650, 400); gtk_container_set_border_width(GTK_CONTAINER(Window), 10); VBox = gtk_vbox_new(FALSE, 10); @@ -465,8 +532,7 @@ void Window_fill(GtkWidget *Window) void gtk_open(void) { - GtkWidget *Window; - GdkPixmap *icon; + GdkPixbuf *icon; int argc; char *args[2]; @@ -477,19 +543,21 @@ void gtk_open(void) argv[1] = NULL; gtk_do_init(&argc, &argv); - Window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + icon = gdk_pixbuf_new_from_xpm_data((const char**)mtr_icon); + gtk_window_set_default_icon(icon); + + main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); + + g_set_application_name("My traceroute"); - Window_fill(Window); + Window_fill(main_window); - g_signal_connect(GTK_OBJECT(Window), "delete_event", + g_signal_connect(GTK_OBJECT(main_window), "delete_event", GTK_SIGNAL_FUNC(Window_destroy), NULL); - g_signal_connect(GTK_OBJECT(Window), "destroy", + g_signal_connect(GTK_OBJECT(main_window), "destroy", GTK_SIGNAL_FUNC(Window_destroy), NULL); - icon = gtk_load_pixmap(mtr_icon); - gtk_widget_show_all(Window); - gdk_window_set_icon(Window->window, NULL, icon, NULL); - gdk_window_set_icon_name(Window->window, "mtr"); + gtk_widget_show_all(main_window); } diff --git a/mtr-curses.h b/mtr-curses.h index 732a71a..e5099fb 100644 --- a/mtr-curses.h +++ b/mtr-curses.h @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/mtr-gtk.h b/mtr-gtk.h index 01bc03d..cb27186 100644 --- a/mtr-gtk.h +++ b/mtr-gtk.h @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/mtr.c b/mtr.c index 5ce68ba..bc988b0 100644 --- a/mtr.c +++ b/mtr.c @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -380,6 +379,7 @@ int main(int argc, char **argv) "\t\t[--report-wide] [--report-cycles=COUNT] [--curses] [--gtk]\n" "\t\t[--raw] [--split] [--no-dns] [--address interface]\n" /* BL */ "\t\t[--psize=bytes/-s bytes]\n" /* ok */ + "\t\t[--report-wide|-w] [-u]\n" /* rew */ "\t\t[--interval=SECONDS] HOSTNAME [PACKETSIZE]\n", argv[0]); exit(0); } @@ -402,7 +402,10 @@ int main(int argc, char **argv) hints.ai_socktype = SOCK_DGRAM; error = getaddrinfo( Hostname, NULL, &hints, &res ); if ( error ) { - perror( gai_strerror(error) ); + if (error == EAI_SYSTEM) + perror ("Failed to resolve host"); + else + fprintf (stderr, "Failed to resolve host: %s\n", gai_strerror(error)); exit( EXIT_FAILURE ); } /* Convert the first addrinfo into a hostent. */ diff --git a/mtr.h b/mtr.h index 3239b0b..2f5e72b 100644 --- a/mtr.h +++ b/mtr.h @@ -4,9 +4,8 @@ Copyright (C) 2005 R.E.Wolff@BitWizard.nl 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/net.c b/net.c index ea583d9..97c6bcf 100644 --- a/net.c +++ b/net.c @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -481,6 +480,9 @@ void net_process_ping(int seq, void * addr, struct timeval now) if( addrcmp( (void *) &(host[index].addrs[i]), addrcopy, af ) != 0 && i= 0) + set_fd_flags(recvsock6); #endif - set_fd_flags(recvsock6); return 0; } diff --git a/net.h b/net.h index 5807042..6f05c6b 100644 --- a/net.h +++ b/net.h @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/raw.c b/raw.c index 1674167..8b0df47 100644 --- a/raw.c +++ b/raw.c @@ -5,9 +5,8 @@ raw.c -- raw output (for logging for later analysis) 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/raw.h b/raw.h index 06f6b88..357c8f3 100644 --- a/raw.h +++ b/raw.h @@ -5,9 +5,8 @@ raw.h -- raw output (for logging for later analysis) 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/report.c b/report.c index 510ef47..e87fa07 100644 --- a/report.c +++ b/report.c @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/report.h b/report.h index 4e8fd1c..755c596 100644 --- a/report.h +++ b/report.h @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/select.c b/select.c index 3577c9c..a53017f 100644 --- a/select.c +++ b/select.c @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/select.h b/select.h index 03876e5..68903e3 100644 --- a/select.h +++ b/select.h @@ -3,9 +3,8 @@ Copyright (C) 1997,1998 Matt Kimball 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/split.c b/split.c index 01ceaa9..4453dac 100644 --- a/split.c +++ b/split.c @@ -7,9 +7,8 @@ Copyright (C) 1998 Bertrand Leconte 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of diff --git a/split.h b/split.h index 2a19eb9..a9b9405 100644 --- a/split.h +++ b/split.h @@ -5,9 +5,8 @@ Copyright (C) 1998 Bertrand Leconte 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. + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of