From 3e60222a1a7dc68b2d47dcc0f11a2c062cd2fd9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 22 Mar 2023 01:26:31 +0800 Subject: [PATCH] Add more network names --- common/network/name.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/network/name.go b/common/network/name.go index 28a745b..a028474 100644 --- a/common/network/name.go +++ b/common/network/name.go @@ -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 }