mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
修改一些显示问题,对于FASTTRACE/TESTFILE功能应用NO_COLOR属性,对于TESTFILE应用IP隐匿功能。
修改: fast_trace/fast_trace.go
This commit is contained in:
@@ -3,6 +3,7 @@ package fastTrace
|
|||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/fatih/color"
|
||||||
"github.com/nxtrace/NTrace-core/ipgeo"
|
"github.com/nxtrace/NTrace-core/ipgeo"
|
||||||
"github.com/nxtrace/NTrace-core/printer"
|
"github.com/nxtrace/NTrace-core/printer"
|
||||||
"github.com/nxtrace/NTrace-core/trace"
|
"github.com/nxtrace/NTrace-core/trace"
|
||||||
@@ -44,7 +45,10 @@ type IpListElement struct {
|
|||||||
var oe = false
|
var oe = false
|
||||||
|
|
||||||
func (f *FastTracer) tracert(location string, ispCollection ISPCollection) {
|
func (f *FastTracer) tracert(location string, ispCollection ISPCollection) {
|
||||||
fmt.Printf("%s『%s %s 』%s\n", printer.YELLOW_PREFIX, location, ispCollection.ISPName, printer.RESET_PREFIX)
|
//fmt.Printf("%s『%s %s 』%s\n", printer.YELLOW_PREFIX, location, ispCollection.ISPName, printer.RESET_PREFIX)
|
||||||
|
fmt.Fprintf(color.Output, "%s\n",
|
||||||
|
color.New(color.FgYellow, color.Bold).Sprint("『 "+location+ispCollection.ISPName+" 』"),
|
||||||
|
)
|
||||||
fmt.Printf("traceroute to %s, %d hops max, %d byte packets\n", ispCollection.IP, f.ParamsFastTrace.MaxHops, f.ParamsFastTrace.PktSize)
|
fmt.Printf("traceroute to %s, %d hops max, %d byte packets\n", ispCollection.IP, f.ParamsFastTrace.MaxHops, f.ParamsFastTrace.PktSize)
|
||||||
|
|
||||||
ip, err := util.DomainLookUp(ispCollection.IP, "4", "", true)
|
ip, err := util.DomainLookUp(ispCollection.IP, "4", "", true)
|
||||||
@@ -274,8 +278,14 @@ func testFile(paramsFastTrace ParamsFastTrace, tm bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, ip := range ipList {
|
for _, ip := range ipList {
|
||||||
fmt.Printf("%s『%s』%s\n", printer.YELLOW_PREFIX, ip.Desc, printer.RESET_PREFIX)
|
fmt.Fprintf(color.Output, "%s\n",
|
||||||
fmt.Printf("traceroute to %s, %d hops max, %d byte packets\n", ip.Ip, paramsFastTrace.MaxHops, paramsFastTrace.PktSize)
|
color.New(color.FgYellow, color.Bold).Sprint("『 "+ip.Desc+"』"),
|
||||||
|
)
|
||||||
|
if util.EnableHidDstIP == "" {
|
||||||
|
fmt.Printf("traceroute to %s, %d hops max, %d bytes packets\n", ip.Ip, paramsFastTrace.MaxHops, paramsFastTrace.PktSize)
|
||||||
|
} else {
|
||||||
|
fmt.Printf("traceroute to %s, %d hops max, %d bytes packets\n", util.HideIPPart(ip.Ip), paramsFastTrace.MaxHops, paramsFastTrace.PktSize)
|
||||||
|
}
|
||||||
var srcAddr string
|
var srcAddr string
|
||||||
if ip.Version4 {
|
if ip.Version4 {
|
||||||
if paramsFastTrace.SrcDev != "" {
|
if paramsFastTrace.SrcDev != "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user