Mircea Damian
Cougar <cougar@random.ee>
Travis Cross <tc@traviscross.com>
- Brian Casey
+ Brian Casey <bcasey@imagiware.com>
Andrew Brown <atatat@atatdot.net>
Bill Bogstad <bogstad@pobox.com>
Marc Bejarano <marc.bejarano@openwave.com>
Moritz Barsnick <barsnick@gmx.net>
Thomas Klausner <wiz@NetBSD.org>
+ Roderick Groesbeek <mtr@roderick.triple-it.nl>
+ Kyle J. McKay <mackyle@gmail.com>
+ Joseph Carter
+ Thales <thales@paponline.net>
+ "Min"
and anyone who has slipped through the cracks of my mail file.
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/*
- Copyright (C) 2010 by Roderick Groesbeek <mtr@roderick.triple-it.nl>
- Released under GPL, as above.
-*/
-
#include "asn.h"
#include <unistd.h>
AC_CHECK_HEADERS(ncurses.h ncurses/curses.h curses.h cursesX.h sys/types.h fcntl.h)
AC_CHECK_HEADERS(socket.h sys/socket.h sys/xti.h arpa/nameser_compat.h)
-# Some doc I found somewhere. :-) -- REW
-# - Macro: AC_CHECK_FUNC (FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
-# - Macro: AC_CHECK_LIB (LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]])
-
# We don't refer to any symbols in termcap, but -lcurses on SunOS does.
# We have to trust the linker not to mess things up... (It should not
# pull in anything if we don't refer to anything in the lib).
AC_CHECK_LIB(m, floor, , AC_MSG_ERROR(No math library found))
-dnl Added ability to cleanly disable GTK+ (12 Jan 2000, Joseph Carter)
AC_ARG_WITH(gtk,
[ --without-gtk Do not try to use GTK+ at all],
WANTS_GTK=$withval, WANTS_GTK=yes)
-dnl Added ability to cleanly disable glib (22 Feb 2013, Kyle J. McKay)
AC_ARG_WITH(glib,
[ --without-glib Do not try to use glib at all],
WANTS_GLIB=$withval, WANTS_GLIB=yes)
# AC_CHECK_LIB(bind, res_mkquery, ,
# AC_CHECK_LIB(resolv, res_mkquery, ,
# AC_CHECK_LIB(resolv, __res_mkquery, , AC_MSG_ERROR(No resolver library found)))))
-# This next line would override the just detected-or-not -lresolv.
-# This apparently hurts BSD. And it's bad practise. So it should go.
-# However, it probably didn't get added for nothing..... Holler if
-# removing it hurts your OS.... -- REW
-#LIBS="$LIBS -lresolv"
-dnl Improved tests to select resolver library (22 Feb 2013, Kyle J. McKay)
# See if a library is needed for res_mkquery and if so put it in RESOLV_LIBS
RESOLV_LIBS=
AC_SUBST(RESOLV_LIBS)
USES_IPV6=yes
fi])
-dnl Check to see whether or not __res_state_ext needs to be defined (22 Feb 2013, Kyle J. McKay)
AC_DEFUN([NEED_RES_STATE_EXT_TEST_SRC], [
AC_LANG_PROGRAM([[
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
-/* Philippe tells me MacOSX needs this before scoket.h... -- REW */
+/* MacOSX may need this before scoket.h...*/
#if defined(HAVE_SYS_TYPES_H)
#include <sys/types.h>
#else
if (c == '-')
return ActionScrollUp;
- /* more stuffs added by Min */
if (tolower(c) == 's') {
mvprintw(2, 0, "Change Packet Size: %d\n", cpacketsize );
mvprintw(3, 0, "Size Range: %d-%d, < 0:random.\n", MINPACKET, MAXPACKET);
return ActionNone;
}
- /* fields to display & their ordering -Min */
+ /* fields to display & their ordering */
if (tolower(c) == 'o') {
mvprintw(2, 0, "Fields: %s\n\n", fld_active );
}
return ActionNone;
}
- /* reserve to display help message -Min */
+ /* reserve to display help message */
if (tolower(c) == '?'|| tolower(c) == 'h') {
mvprintw(2, 0, "Command:\n" );
printw(" ?|h help\n" );
move(y, startstat);
/* net_xxx returns times in usecs. Just display millisecs */
- /* changedByMin */
hd_len = 0;
for( i=0; i<MAXFLD; i++ ) {
/* Ignore options that don't exist */
}
}
- /* Multi path by Min */
+ /* Multi path */
for (i=0; i < MAXPATH; i++ ) {
addrs = net_addrs(at, i);
mplss = net_mplss(at, i);
attron(A_BOLD); printw("q"); attroff(A_BOLD); printw("uit\n");
if (display_mode == 0) {
- /* changedByMin */
for (i=0; i < MAXFLD; i++ ) {
j = fld_index[fld_active[i]];
if (j < 0) continue;
mtr_curses_hosts(maxx-hd_len-1);
} else {
- /* David Sward, Jan 1999 */
char msg[80];
int max_cols = maxx<=SAVED_PINGS+30 ? maxx-30 : SAVED_PINGS;
startstat = 28;
case DisplayCurses:
mtr_curses_open();
break;
- case DisplaySplit: /* BL */
+ case DisplaySplit:
split_open();
break;
case DisplayGTK:
case DisplayCurses:
mtr_curses_close();
break;
- case DisplaySplit: /* BL */
+ case DisplaySplit:
split_close();
break;
case DisplayGTK:
mtr_curses_redraw();
break;
- case DisplaySplit: /* BL */
+ case DisplaySplit:
split_redraw();
break;
case DisplayCurses:
return mtr_curses_keyaction();
- case DisplaySplit: /* BL */
+ case DisplaySplit:
return split_keyaction();
case DisplayGTK:
case DisplayTXT:
case DisplayXML:
case DisplayCSV:
- case DisplaySplit: /* BL */
+ case DisplaySplit:
case DisplayCurses:
case DisplayGTK:
break;
case DisplayTXT:
case DisplayXML:
case DisplayCSV:
- case DisplaySplit: /* BL */
+ case DisplaySplit:
case DisplayCurses:
case DisplayGTK:
break;
case DisplayTXT:
case DisplayXML:
case DisplayCSV:
- case DisplaySplit: /* BL */
+ case DisplaySplit:
case DisplayCurses:
case DisplayRaw:
select_loop();
case DisplayTXT:
case DisplayXML:
case DisplayCSV:
- case DisplaySplit: /* BL */
+ case DisplaySplit:
case DisplayRaw:
break;
#include <netinet/in.h>
/* Don't put a trailing comma in enumeration lists. Some compilers
- (notably the one on Irix 5.2) do not like that. -- REW */
+ (notably the one on Irix 5.2) do not like that. */
enum { ActionNone, ActionQuit, ActionReset, ActionDisplay,
ActionClear, ActionPause, ActionResume, ActionMPLS, ActionDNS,
ActionScrollDown, ActionScrollUp };
/* Please don't use a trailing comma in enumerations: It doesn't
- work on all compilers -- REW */
+ work on all compilers */
enum {
RR_UNKNOWN,
RR_QUERY,
#if 0
/* The execution order inside an expression is undefined! That means that
- this might work, but then again, it might not... Sun Lint pointed this
- one out...*/
+ this might work, but then again, it might not... */
#define sucknetword(x) (((word)*(x) << 8) | (((x)+= 2)[-1]))
#define sucknetshort(x) (((short)*(x) << 8) | (((x)+= 2)[-1]))
* There is a small problem with the following code:
* The timeout is canceled and removed in order to ensure that
* it takes effect (consider what happens if you set the timeout to 999,
- * then try to undo the change); is a better approach possible? -- CMR
+ * then try to undo the change); is a better approach possible?
*
- * What's the problem with this? (-> "I don't think so) -- REW
+ * What's the problem with this? (-> "I don't think so)
*/
gint WaitTime_changed(UNUSED GtkAdjustment *Adj, UNUSED GtkWidget *Button)
if(addr) {
net_reopen(addr);
/* If we are "Paused" at this point it is usually because someone
- entered a non-existing host. Therefore do the go-ahead... --REW */
+ entered a non-existing host. Therefore do the go-ahead... */
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( Pause_Button ) , 0);
} else {
int pos = strlen(gtk_entry_get_text( GTK_ENTRY(Entry)));
// architectures, the pointer is 64 bits and the integer only 32.
// The compiler warns us of loss of precision. However we know we
// casted a normal 32-bit integer into this pointer a few microseconds
-// earlier, so it is ok. Nothing to worry about.... -- REW.
+// earlier, so it is ok. Nothing to worry about....
#define POINTER_TO_INT(p) ((int)(long)(p))
void float_formatter(GtkTreeViewColumn *tree_column,
display_detect(&argc, &argv);
/* The field options are now in a static array all together,
- but that requires a run-time initialization. -- REW */
+ but that requires a run-time initialization. */
init_fld_options ();
parse_mtr_options (getenv ("MTR_OPTIONS"));
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.
-
- 1999-08-13 ok Olav@okvittem.priv.no added -psize
-
*/
#include <config.h>
/* Configuration parameter: How many queries to unknown hosts do we
send? (This limits the amount of traffic generated if a host is not
- reachable) -- REW */
+ reachable) */
#define MAX_UNKNOWN_HOSTS 5
ip_t * sourceaddress;
ip_t * remoteaddress;
-/* XXX How do I code this to be IPV6 compatible??? -- REW */
+/* XXX How do I code this to be IPV6 compatible??? */
#ifdef ENABLE_IPV6
char localaddr[INET6_ADDRSTRLEN];
#else
host[index].mpls = mpls;
display_rawhost(index, (void *) &(host[index].addr));
- /* multi paths by Min */
+ /* multi paths */
addrcpy( (void *) &(host[index].addrs[0]), addrcopy, af );
host[index].mplss[0] = mpls;
} else {
i<MAXPATH ) {
addrcpy( (void *) &(host[index].addrs[i]), addrcopy, af );
host[index].mplss[i] = mpls;
-
- /* rafaelmartins: multi path support to '--raw' */
display_rawhost(index, (void *) &(host[index].addrs[i]));
}
- /* end multi paths */
}
host[index].jitter = totusec - host[index].last;
* at least in linux 2.4.x.
* safe guard 1) best[index]>=best[index-1] if index>0
* 2) best >= average-20,000 usec (good number?)
- * Min
if (index > 0) {
if (totusec < host[index].best &&
totusec>= host[index-1].best) host[index].best = totusec;
host[index].jworst = host[index].jitter;
host[index].returned++;
- /* begin addByMin do more stats */
oldavg = host[index].avg;
host[index].avg += (totusec - oldavg +.0) / host[index].returned;
host[index].var += (totusec - oldavg +.0) * (totusec - host[index].avg) / 1000000;
if ( host[index].returned > 1 )
host[index].gmean = pow( (double) host[index].gmean, (host[index].returned-1.0)/host[index].returned )
* pow( (double) totusec, 1.0/host[index].returned );
- /* end addByMin*/
host[index].sent = 0;
host[index].up = 1;
host[index].transit = 0;
}
-/* jitter stuff */
int net_jitter(int at)
{
return (host[at].jitter);
{
return (host[at].jinta);
}
-/* end jitter */
int net_max(void)
int max;
max = 0;
- /* replacedByMin
- for(at = 0; at < MaxHost-2; at++) { */
+ /* for(at = 0; at < MaxHost-2; at++) { */
for(at = 0; at < maxTTL-1; at++) {
if ( addrcmp( (void *) &(host[at].addr),
(void *) remoteaddress, af ) == 0 ) {
}
-/* add by Min (wonder its named net_min;-)) because of ttl stuff */
int net_min (void)
{
return ( fstTTL - 1 );
}
-/* Added by Brian Casey December 1997 bcasey@imagiware.com*/
int net_returned(int at)
{
return host[at].returned;
As our detination range (in the example 10000) is much
smaller (reasonable packet sizes), and our rand() range much
larger, this effect is insignificant. Oh! That other formula
- didn't work. -- REW */
+ didn't work. */
packetsize = MINPACKET + rand () % (-cpacketsize - MINPACKET);
} else {
packetsize = cpacketsize;
but I don't remember why. It makes mtr stop skipping sections of unknown
hosts. Removed in 0.65.
If the line proves neccesary, it should at least NOT trigger that line
- when host[i].addr == 0 -- REW */
+ when host[i].addr == 0 */
if ( ( addrcmp( (void *) &(host[i].addr),
(void *) remoteaddress, af ) == 0 )
/* || (host[i].addr == host[batch_at].addr) */)
int calc_deltatime (float WaitTime);
-
-/* Added by Brian Casey, December 1997 bcasey@imagiware.com*/
int net_returned(int at);
int net_xmit(int at);
int net_transit(int at);
#define MINPACKET 28 /* 20 bytes IP header and 8 bytes ICMP or UDP */
#define MAXLABELS 8 /* http://kb.juniper.net/KB2190 (+ 3 just in case) */
-/* stuff used by display such as report, curses... --Min */
+/* stuff used by display such as report, curses... */
#define MAXFLD 20 /* max stats fields to display */
#if defined (__STDC__) && __STDC__
/* XXX This doesn't really belong in this header file, but as the
- right c-files include it, it will have to do for now. -- REW */
+ right c-files include it, it will have to do for now. */
/* dynamic field drawing */
struct fields {
}
printf("%s\n",buf);
- /* Thales (thales@paponline.net) --
- * This feature show 'loadbalances' on routes
- */
-
+ /* This feature shows 'loadbalances' on routes */
+
/* z is starting at 1 because addrs[0] is the same that addr */
for (z = 1; z < MAXPATH ; z++) {
addr2 = net_addrs(at, z);
if ((addrcmp ((void *) &unspec_addr, (void *) addr2, af)) == 0)
break;
for (w = 0; w < z; w++)
- /* Thales -- Ok... checking if there are ips repeated on same hop */
+ /* Ok... checking if there are ips repeated on same hop */
if ((addrcmp ((void *) addr2, (void *) net_addrs (at,w), af)) == 0) {
found = 1;
break;