This commit is contained in:
qaq
2025-06-17 12:17:33 +08:00
parent 4a6b2c8e0f
commit 9fa968d07c
648 changed files with 64968 additions and 1621 deletions
+26
View File
@@ -0,0 +1,26 @@
package ip
import (
"fmt"
"github.com/songgao/water/waterutil"
)
var prots = map[waterutil.IPProtocol]string{
waterutil.HOPOPT: "HOPOPT",
waterutil.ICMP: "ICMP",
waterutil.IGMP: "IGMP",
waterutil.GGP: "GGP",
waterutil.TCP: "TCP",
waterutil.UDP: "UDP",
waterutil.IPv6_Route: "IPv6-Route",
waterutil.IPv6_Frag: "IPv6-Frag",
waterutil.IPv6_ICMP: "IPv6-ICMP",
}
func Protocol(p waterutil.IPProtocol) string {
if v, ok := prots[p]; ok {
return v
}
return fmt.Sprintf("unknown(%d)", p)
}