Commit Graph

69 Commits

Author SHA1 Message Date
Nikolai R Kristiansen
87adbb213b Add support for JSON as report output format
This is based on the equivalent code for XML.
2016-07-29 17:31:14 +02:00
russor
5dbeb8f1b4 add option to set graceperiod
useful when running a single probe on a network where many hops never
respond
2016-07-28 22:48:46 -07:00
penyu
a8532c78b6 add max-unknown option
remove the MAX_UNKNOWN_HOSTS macro, use maxUnknown variable
instead of it, and add --max-unknown option, let it can be
configured at run time.
2016-07-03 20:12:01 +00:00
Baptiste Jonglez
5f909e3346 Cosmetic cleanup of the option-parsing code
Align everything nicely, update helpful comments, and use NULL instead
of 0 for the third element of long_options: it's a pointer, see getopt(3).
2016-06-09 19:29:41 +01:00
russor
fbc8666d6f automatically set udp address if needed 2016-04-08 16:59:27 -07:00
russor
aaccfc0efa allow setting local and remote port for UDP probing
This allows for testing over a single network path in a load balanced
network where flows are hashed on the ips and ports (relatively common), the
default behavior is to use the destination port as the sequence number when
doing UDP probes, so you see (more or less) an average of all the paths.

If the remote port is set, we need to use the checksum field to store
sequence and adjust the paylod so the checksum is valid; therefore we need
to have the source address, as it's part of the checksum calculation.  We
also need to increase the minimum packet size so we have at least 2 bytes of
payload.
2016-04-08 16:59:27 -07:00
swordfeng
83aca68ea8 Add SCTP support (same way with tcp) 2015-06-05 20:16:29 +08:00
R.E. Wolff
effef18b35 modified name of timeout variable to prevent warning on solaris. 2015-03-23 09:09:59 +01:00
Kris Coward
70b00c9e9f Added --displaymode option 2015-01-05 12:17:48 -05:00
Baptiste Jonglez
051671dca4 Print a meaningful error when -M is used but SO_MARK is not supported 2014-07-12 14:50:52 +09:00
Baptiste Jonglez
9d62fe4fd5 Improve command-line handling and documentation
In particular:

- generally improve the look of the man page and help message
- add missing command line options to the man page
- reorder command line options to be more consistent
- use the same order for command line options everywhere (man page, code, help message)
- add missing switches in getopt_long call (-M, -F)
- fix incorrect switch in getopt_long call (-Z)

Note that a few options were never documented (they are now marked as
"MISSING" in the man page).
2014-07-12 14:21:27 +09:00
R.E. Wolff
0cc9f56313 fixed len confusion for IPV4 / IPV6 addresses 2014-06-20 14:26:36 +02:00
João Taveira Araújo
8430389f2b Add support for setting SO_MARK through --mark option.
This emulates the -m option for ping provided in iputils. When coupled
with iptables, this option provides a means of using source routing to
force probes through a consistent nexthop on multihomed systems.
2014-06-18 19:55:52 +01:00
Roger Wolff
edd4258f25 Moved include of config.h above all other includes. 2013-10-26 19:13:48 +02:00
Michal Sekletar
975c51d35c doc: add missing documentation 2013-10-03 16:00:03 +02:00
Roger Wolff
0d772cc818 removed double negatives for ipinfo define. 2013-07-06 07:36:42 +02:00
Roger Wolff
25a2456845 glib dependency fixes. 2013-07-05 11:40:02 +02:00
Roger Wolff
a646775da8 fixed default hostname 2013-07-03 12:00:28 +02:00
Vaibhav Bajpai
562551b4d3 added file locking capability if --csv results are written to file 2013-05-13 17:22:54 +02:00
Vaibhav Bajpai
9807ccd617 when looping on a list of service names with --csv, do not exit on the first
failure; instead write the error on stderr, skip that service names and move
on to the next service name in the list
2013-05-13 17:22:54 +02:00
Vaibhav Bajpai
df4cedc895 added --filename=FILE option
service names read from this file are allocated in a linked list
multiple service names are only accepted with --csv flag
without --csv flag, the first service name is used
2013-05-13 17:22:54 +02:00
Vaibhav Bajpai
d7d03cce9a --csv allows multiple service names as arguments 2013-05-13 17:22:54 +02:00
Vaibhav Bajpai
5f636d7124 enabled displayCSV with --csv (or -C) argument 2013-05-13 17:22:53 +02:00
R.E. Wolff
3ab3b5640a fixed merge conflicts 2013-04-29 20:21:44 +02:00
R.E. Wolff
03f3da5c3f Added Yakovetsky Vladimir (vsyakovetsky)'s asn/ipinfo patch from launchpad bugs. (701514) 2013-04-24 11:35:52 +02:00
Travis Cross
9bc6dc5097 Remove vanity comments and update AUTHORS
Let's set a precedent of recognizing people in the AUTHORS file and in
the version history rather than in comments littered throughout the
code base.
2013-03-10 11:23:40 +00:00
Rogier 'DocWilco' Mulhuijzen
2cf22b2409 Add TCP (SYN) support
Instead of sending ICMP ECHO or UDP packets, this mode opens a TCP
connection to the port of choice (80 by default) and sets IP_TTL
or IPV6_UNICAST_HOPS to control the TTL of the outgoing SYN packet.

Instead of using ICMP ECHO sequence or UDP destination port, the
source port number is used to track how many hops away a router is.

For getting the final hop, sockets are left open until a timeout
is reached (10 seconds default) and a write is attempted as soon
as the socket becomes available for writing. Anything other than
a succesful write or a "Connection refused" error is ignored.
2013-02-22 12:12:42 +01:00
Travis Cross
354c28d707 Add git version handling to build system
When building from a git tree, the version number built into the
binary will be appended with +git-XXXXXXXX.

The base version number is stored in-tree in configure.in and is that
of the last tagged release.  Presumably the git version is later than
the last tag, so we use '+git' rather than '-git' to produce the
correct the lexical sort order -- though of course the sort order
between any two git revisions can only be determined from the git tree
rather than from a lexical sort.
2013-02-09 09:07:51 +00:00
R.E. Wolff
1ce786f432 fix behaviour of -b switch. Now works both in report and curses. 2013-02-07 14:25:38 +01:00
Travis Cross
f9846b966b Fix commit 14bc40b8 2013-02-05 16:00:54 +00:00
Travis Cross
14bc40b844 --show-ips is now -b
This matches the flag used in tracepath.  The undocumented
--bitpattern option has been moved to -B.
2013-02-05 15:04:07 +00:00
R.E. Wolff
d90dd1fd8f added aslookup patch from bug #701514 2013-02-05 15:32:53 +01:00
R.E. Wolff
55cc4a7045 Made report wide switch properly to displayreport mode. Bug #780647 2013-02-05 14:56:14 +01:00
R.E. Wolff
bc39728995 some running patches 2013-02-05 13:09:21 +00:00
Travis Cross
8bddb5b8c3
Add -z / --show-ip support
This new option displays both the hostname and the IP address of a
host in the path.  This is particularly important when the hostname
determined by a reverse lookup has no corresponding forward record.

This is similar to the -b (both) option in tracepath, but -b was
already taken in mtr for --bitpattern.

Using this option also implies -w / --report-wide as this option isn't
terribly useful without it in report mode.

In general we endeavor to only show the IP address once per line, but
in the split view we consistently add a separate field for IP address
to the output.

Signed-off-by: Travis Cross <tc@traviscross.com>
2013-02-04 07:44:43 +00:00
Travis Cross
856dcdff9f Resolve -Wunused-but-set-variable warnings 2013-02-03 20:58:50 +00:00
Roger Wolff
a932cb2abc mtr v0.82
- Removed old Changelog file appended at the end as oldest changes.

2011-03-28 Mark Kamichoff <prox@prolixium.com>
 - Enable decoding of ICMP extensions for MPLS for curses and report
   interfaces.  Use the -e flag or press 'e' to enable it.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.82.tar.gz
2013-02-03 20:45:39 +00:00
Roger Wolff
5c7494c44f mtr v0.76
- display load sharing hosts in --raw output.  added about button in
   gui.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.76.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
ae6cb801f1 mtr 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 clipboard.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.75.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
0697fbe707 mtr v0.74
- Martin Pels' patch to allow UDP probes.
 - KES reported a build problem. Turns out I need to install gtk-1.2
   on my development sytem, otherwise my release script causes the
   build to break.
 - changed some docs to advertise the new mailing list.  added
   documentation for the Mac OS X compilation problem.  added
   -Wno-pointer-sign to the compiler options.
 - Nico Lichtmaier's cleanup-gtk patch. (now mtr uses a more modern
   dialect of gtk).

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.74.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
de3d6bc16e mtr v0.73
- Some securty patches. Although MTR drops privileges as soon as
   possible after opening the sockets, it still had some sprintf
   calls, which have now been converted into snprintf.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.73.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
a8c1d0d597 mtr v0.72
- Fix signed/unsigned bug in IPV6 part improved random packet size
   behaviour. --REW

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.72.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
7fc783cecb mtr v0.71
- Some IPV6 fixes, introduce packet size cmdline option.  (was
   already present as a cmdline argument)

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.71.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
1217d66e6b mtr v0.70
- Antinio submitted a cumulative patch containing some nice
   improvements. He also submitted an automake patch that causes mtr
   to no longer compile on my system. I refuse to have mtr "in the
   dark" that I can't test-compile the dist.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.70.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
fc3fcefbc2 mtr v0.68
- included some old patches.
 - included patch from Antonio Querubin for better IPV6 support
   restructured some more whitespace.
 - added mtr.h where "global" things should go. Not finished moving
   things around, but now that the infrastructure is there, it should
   be easy.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.68.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
1f8386e1fa mtr v0.66
- Through the Debian bugtracking system a bug report and fix was sent
   my way, that deals with stupid optmization trying to save some 768
   bytes of memory, sacrificing "it works" on a different
   architecture... (default char signedness)

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.66.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
2006090bce mtr v0.62
- Apparently someone changed gethostbyname into gethostbyname2 in
   mtr.c in an attempt to add IPV6 support. For systems without ipv6
   support, the old gethostbyname should be used! Linux has the call
   even if you don't enable IPV6. Thanks Gary (rsub)

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.62.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
3adcb265b5 mtr v0.61
- Attempt to get/print the local IP address. Now shows as 0.0.0.0 :-(
   Hints and tips appreciated! -- REW
 - Lots of blank space reformatting.
 - Moved the interface address setting to net.c (where it belongs).

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.61.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
81684295f6 mtr v0.59
- Josh Martin suggested to add some bounds checking to the dynamic
   field code. This caused me to delve in, and rewrite some
   things. Now 50 lines of code less, but cleaner code. :-)

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.59.tar.gz
2013-02-03 20:45:38 +00:00
Roger Wolff
548d4b6082 mtr v0.55
- Cleanup patch. I'm going to do some maintenance on MTR, but I want
   to be able to say: Can you see which version fixed/broke things for
   you, so you're going to see a bunch of new releases soon.

source: ftp://ftp.bitwizard.nl/mtr/mtr-0.55.tar.gz
2013-02-03 20:45:37 +00:00