in network/policy.go [29:58]
func GetPortEnumValue(protocol string) (uint32, error) {
var protocolInt uint32
u, error := strconv.ParseUint(protocol, 0, 10)
if error != nil {
switch strings.ToLower(protocol) {
case "tcp":
protocolInt = 6
break
case "udp":
protocolInt = 17
break
case "icmpv4":
protocolInt = 1
break
case "icmpv6":
protocolInt = 58
break
case "igmp":
protocolInt = 2
break
default:
return 0, errors.New("invalid protocol supplied to port mapping policy")
}
} else {
protocolInt = uint32(u)
}
return protocolInt, nil
}