|
|
@ -513,23 +513,23 @@ var PortRangeAny = PortRange{0, 65535}
|
|
|
|
// NetPortRange represents a single subnet:portrange.
|
|
|
|
// NetPortRange represents a single subnet:portrange.
|
|
|
|
type NetPortRange struct {
|
|
|
|
type NetPortRange struct {
|
|
|
|
_ structs.Incomparable
|
|
|
|
_ structs.Incomparable
|
|
|
|
IP string
|
|
|
|
IP string // "*" means all
|
|
|
|
Bits *int // backward compatibility: if missing, means "all" bits
|
|
|
|
Bits *int // backward compatibility: if missing, means "all" bits
|
|
|
|
Ports PortRange
|
|
|
|
Ports PortRange
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// FilterRule represents one rule in a packet filter.
|
|
|
|
// FilterRule represents one rule in a packet filter.
|
|
|
|
type FilterRule struct {
|
|
|
|
type FilterRule struct {
|
|
|
|
SrcIPs []string
|
|
|
|
SrcIPs []string // "*" means all
|
|
|
|
SrcBits []int
|
|
|
|
SrcBits []int
|
|
|
|
DstPorts []NetPortRange
|
|
|
|
DstPorts []NetPortRange
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var FilterAllowAll = []FilterRule{
|
|
|
|
var FilterAllowAll = []FilterRule{
|
|
|
|
FilterRule{
|
|
|
|
{
|
|
|
|
SrcIPs: []string{"*"},
|
|
|
|
SrcIPs: []string{"*"},
|
|
|
|
SrcBits: nil,
|
|
|
|
SrcBits: nil,
|
|
|
|
DstPorts: []NetPortRange{NetPortRange{
|
|
|
|
DstPorts: []NetPortRange{{
|
|
|
|
IP: "*",
|
|
|
|
IP: "*",
|
|
|
|
Bits: nil,
|
|
|
|
Bits: nil,
|
|
|
|
Ports: PortRange{0, 65535},
|
|
|
|
Ports: PortRange{0, 65535},
|
|
|
|