From f320fd62025258365bab9157ead43d39bb55d8ca Mon Sep 17 00:00:00 2001 From: sjlleo Date: Fri, 27 May 2022 21:27:26 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E4=BC=98=E5=8C=96=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E5=BA=9F=E5=BC=83=20realtime=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/main.go b/main.go index 1f44250..547c63d 100644 --- a/main.go +++ b/main.go @@ -25,7 +25,6 @@ var maxHops = fSet.Int("m", 30, "Set the max number of hops (max TTL to be reach var dataOrigin = fSet.String("d", "LeoMoeAPI", "Choose IP Geograph Data Provider [LeoMoeAPI, IP.SB, IPInfo, IPInsight, IPAPI.com]") var rdnsenable = fSet.Bool("rdns", false, "Set whether rDNS will be display") var routePath = fSet.Bool("report", false, "Route Path") -var realtimePrint = fSet.Bool("realtime", false, "Output trace results in runtime") var tablePrint = fSet.Bool("table", false, "Output trace results as table") var ver = fSet.Bool("V", false, "Check Version") @@ -105,25 +104,14 @@ func main() { log.Fatalln(err) } + if (*tcpSYNFlag && *udpPackageFlag) || *tablePrint { + printer.TracerouteTablePrinter(res) + } else if *tcpSYNFlag || *udpPackageFlag { + printer.TraceroutePrinter(res) + } + if *routePath { - // 如果为TCP SYN,也打印路由跟踪结果 - if *tcpSYNFlag { - printer.TracerouteTablePrinter(res) - } r := reporter.New(res, ip.String()) r.Print() - return - } - - if m == trace.ICMPTrace && *tablePrint { - printer.TracerouteTablePrinter(res) - } - - if m == trace.TCPTrace || m == trace.UDPTrace { - if *realtimePrint { - printer.TraceroutePrinter(res) - } else { - printer.TracerouteTablePrinter(res) - } } }