diff options
Diffstat (limited to '')
-rwxr-xr-x | wrappers/tcptraceroute | 78 | ||||
-rw-r--r-- | wrappers/tcptraceroute.8 | 34 |
2 files changed, 112 insertions, 0 deletions
diff --git a/wrappers/tcptraceroute b/wrappers/tcptraceroute new file mode 100755 index 0000000..6abe4bf --- /dev/null +++ b/wrappers/tcptraceroute @@ -0,0 +1,78 @@ +#!/bin/sh +# +# Copyright (c) 2007 Dmitry Butskoy +# <dmitry@butskoy.name> +# License: GPL v2 or any later +# +# See COPYING for the status of this software. +# + +# +# Shell wrapper providing tcptraceroute(8) command line interface. +# +# The original implementation of tcptraceroute(8) can be obtained +# from http://michael.toren.net/code/tcptraceroute/ +# + +opts="-T -O info" +length="" +prgname=$0 + + +usage () { + echo "Usage: $prgname [-hvnFSAE] [-i dev] [-f furst_ttl] [-l length] + [-q nqueries] [-t tos] [-m max_ttl] [-p src_port] [-s src_addr] + [-w wait_time] host [dest_port] [length]" >&2 +} + + +PARSED=`getopt -- 'hvdnNi:l:f:Fm:p:q:w:s:t:SAE' "$@"` +[ $? != 0 ] && exit 2 + +eval set -- "$PARSED" + +while [ $# -gt 0 ] +do + case "$1" in + -[dnF]) opts="$opts $1"; shift ;; + -N) shift ;; + -[ifmqwst]) opts="$opts $1 $2"; shift 2 ;; + -l) length=$2; shift 2 ;; + -p) opts="$opts --sport=$2"; shift 2 ;; + -S) opts="$opts -O syn"; shift ;; + -A) opts="$opts -O ack"; shift ;; + -E) opts="$opts -O ecn"; shift ;; + -h) usage ; exit 0 ;; + -v) echo "\"tcptraceroute\"-compatible wrapper for new Linux Traceroute" >&2; + exit 0 ;; + --) shift; break ;; + *) echo "$prgname: Internal parsing error" >&2; exit 2 ;; + esac +done + +[ $# -eq 0 ] && { + usage + exit 2 +} + +host=$1 +shift + +[ $# -gt 0 ] && { + opts="$opts -p $1" + shift +} + +[ $# -gt 0 ] && { + length=$1 + shift +} + + +# Say to the people it is actually another program... +echo "Running: + traceroute $opts $host $length" >&2 + + +exec traceroute $opts $host $length + diff --git a/wrappers/tcptraceroute.8 b/wrappers/tcptraceroute.8 new file mode 100644 index 0000000..7c19ecf --- /dev/null +++ b/wrappers/tcptraceroute.8 @@ -0,0 +1,34 @@ +.\" Copyright (c) 2016 Dmitry Butskoy (dmitry@butskoy.name) +.\" License: GPL v2 or any later version +.\" See COPYING for the status of this software +.TH TCPTRACEROUTE 8 "8 March 2016" "Traceroute" "Traceroute For Linux" +.\" .UC 6 +.SH NAME +tcptraceroute \- print the route packets trace to network host +.SH SYNOPSIS +.na +.BR tcptraceroute +.RI " [" options ] +.ad +.SH DESCRIPTION +.I tcptraceroute +is just a link to the system +.B traceroute\fR, +to allow run it without specifying +.B \-T +option each time (for switch to the TCP method). It is fully equivalent to +.B traceroute \-T\fR, +the rest of the command line is the same. +.br +See +.BR traceroute (8) +for more info. +.SH NOTES +There was an original implementation of tcptraceroute, which had some options +differ (but rare used). Most common +.BR "" [ "dnFi:f:m:q:w:s:t:" ] +was exactly the same, but +.BR "" [ "l:p:NSAE" ] +was not. For full compatibility, a wrapper provided (available in the source code). +.SH SEE ALSO +.BR traceroute (8) |