Skip to content

Commit

Permalink
FT应用dot参数
Browse files Browse the repository at this point in the history
  • Loading branch information
tsosunchia committed Sep 2, 2024
1 parent e81400b commit f47e742
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func Excute() {
Timeout: time.Duration(*timeout) * time.Millisecond,
File: *file,
DontFragment: *dontFragment,
Dot: *dot,
}

fastTrace.FastTest(*tcp, *output, paramsFastTrace)
Expand Down
5 changes: 3 additions & 2 deletions fast_trace/fast_trace ipv6.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ func (f *FastTracer) tracert_v6(location string, ispCollection ISPCollection) {
fmt.Fprintf(color.Output, "%s\n", color.New(color.FgYellow, color.Bold).Sprintf("『%s %s 』", location, ispCollection.ISPName))
fmt.Printf("traceroute to %s, %d hops max, %d byte packets\n", ispCollection.IPv6, f.ParamsFastTrace.MaxHops, f.ParamsFastTrace.PktSize)

ip, err := util.DomainLookUp(ispCollection.IPv6, "6", "", true)
// ip, err := util.DomainLookUp(ispCollection.IPv6, "6", "", true)
ip, err := util.DomainLookUp(ispCollection.IPv6, "6", f.ParamsFastTrace.Dot, true)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -126,7 +127,7 @@ func FastTestv6(tm bool, outEnable bool, paramsFastTrace ParamsFastTrace) {

oe = outEnable

fmt.Println("您想测试哪些ISP的路由?\n1. 国内四网\n2. 电信\n3. 联通\n4. 移动\n5. 教育网\n6. 全部")
fmt.Println("您想测试哪些ISP的路由?\n1. 北京三网快速测试\n2. 全国电信\n3. 全国联通\n4. 全国移动\n5. 全国教育网\n6. 全国五网")
fmt.Print("请选择选项:")
_, err := fmt.Scanln(&c)
if err != nil {
Expand Down
4 changes: 3 additions & 1 deletion fast_trace/fast_trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ type ParamsFastTrace struct {
Timeout time.Duration
File string
DontFragment bool
Dot string
}

type IpListElement struct {
Expand All @@ -49,7 +50,8 @@ func (f *FastTracer) tracert(location string, ispCollection ISPCollection) {
fmt.Fprintf(color.Output, "%s\n", color.New(color.FgYellow, color.Bold).Sprintf("『%s %s 』", location, ispCollection.ISPName))
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)
ip, err := util.DomainLookUp(ispCollection.IP, "4", f.ParamsFastTrace.Dot, true)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit f47e742

Please sign in to comment.