mirror of
https://github.com/nxtrace/NTrace-core.git
synced 2025-08-12 06:26:39 +00:00
增加对多MPLS情景的支持,支持通过ENV或参数禁用MPLS功能
要提交的变更: 修改: cmd/cmd.go 修改: printer/basic.go 修改: printer/printer.go 修改: printer/realtime_printer.go 修改: trace/icmp_ipv4.go 修改: trace/icmp_ipv6.go 修改: trace/trace.go 修改: util/util.go
This commit is contained in:
@@ -109,7 +109,4 @@ func applyLangSetting(h *trace.Hop) {
|
||||
}
|
||||
}
|
||||
|
||||
if len(h.MPLS) > 1 {
|
||||
h.Hostname += " [MPLS: " + h.MPLS + "]"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,9 +47,8 @@ func HopPrinter(h trace.Hop, info HopInfo) {
|
||||
if h.Geo != nil {
|
||||
txt += " " + formatIpGeoData(h.Address.String(), h.Geo)
|
||||
}
|
||||
|
||||
if len(h.MPLS) > 1 {
|
||||
txt += " [MPLS: " + h.MPLS + "]"
|
||||
for _, v := range h.MPLS {
|
||||
txt += " " + v
|
||||
}
|
||||
switch info {
|
||||
case IXP:
|
||||
|
||||
@@ -166,6 +166,11 @@ func RealtimePrinter(res *trace.Result, ttl int) {
|
||||
)
|
||||
}
|
||||
}
|
||||
for _, v := range res.Hops[ttl][i].MPLS {
|
||||
fmt.Fprintf(color.Output, "%s",
|
||||
color.New(color.FgHiBlack, color.Bold).Sprintf("\n %s", v),
|
||||
)
|
||||
}
|
||||
fmt.Println()
|
||||
blockDisplay = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user