v4 mpls实装显示

This commit is contained in:
tsosunchia
2023-10-05 06:42:04 +08:00
parent 13aaa54067
commit db1e9e2b0c
4 changed files with 31 additions and 3 deletions

View File

@@ -108,4 +108,8 @@ func applyLangSetting(h *trace.Hop) {
}
}
}
if len(h.MPLS) > 1 {
h.Hostname += " [MPLS: " + h.MPLS + "]"
}
}

View File

@@ -47,6 +47,10 @@ 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 + "]"
}
switch info {
case IXP:
fmt.Print(CYAN_PREFIX)