Add more network names

This commit is contained in:
世界 2023-03-22 01:26:31 +08:00
parent 4bbf5f2c30
commit 3e60222a1a
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -10,8 +10,11 @@ var ErrUnknownNetwork = E.New("unknown network")
//goland:noinspection GoNameStartsWithPackageName
const (
NetworkTCP = "tcp"
NetworkUDP = "udp"
NetworkIP = "ip"
NetworkTCP = "tcp"
NetworkUDP = "udp"
NetworkICMPv4 = "icmpv4"
NetworkICMPv6 = "icmpv6"
)
//goland:noinspection GoNameStartsWithPackageName
@ -20,6 +23,8 @@ func NetworkName(network string) string {
return NetworkTCP
} else if strings.HasPrefix(network, "udp") {
return NetworkUDP
} else if strings.HasPrefix(network, "ip") {
return NetworkIP
} else {
return network
}