Documentation ¶
Index ¶
Constants ¶
const P_CIDR = 103
Variables ¶
var ( // ErrCIDROverflow is returned when a CIDR block is too large. ErrCIDROverflow = errors.New("CIDR overflow") )
Functions ¶
This section is empty.
Types ¶
type CIDR ¶
The CIDR crawl-strategy iterates through a subnet in pseudorandom order, skipping over the network and broadcast addresses, issuing requests to a fixed port.
Note that /32 subnets for IPv4 and /128 subnets for IPv6 are not supported, and will result in no-ops due to the aforementioned address-skipping behavior.
This is the recommended strategy for hosting environments without IP Multicast support.
func (*CIDR) Next ¶
Next updates addr with the next IP in the CIDR block traversal, and the target port. The supplied Addr MUST be a non-nil *net.UDPAddr or *net.TCPAddr. If addr.IP == nil, it is automatically populated. Note that a call to Next MAY use addr.IP as scratch space, even if the call to Next returns false. When Next returns false, the CIDR iteration has been exhausted.
type Crawler ¶
type Crawler struct {
// contains filtered or unexported fields
}
type PortRange ¶
PortRange iterates through ports on the specified IP, in order, from Low to High.
If len(ip) == 0, it defaults to 127.0.0.1.
If Low = High = 0, the port-range defaults to match all non- reserved ports, i.e. all ports in the range (1024, 65535).
type Strategy ¶
func NewCIDR ¶
NewCIDR returns a range that iterates through a block of IP addreses in pseudorandom order, with a fixed port.
func NewPortRange ¶
NewPortRange returns a PortRange from low to high on the supplied IP address. If Low = High = 0, the range defaults to match all non-reserved ports. See PortRange.
type TranscoderCIDR ¶
type TranscoderCIDR struct{}
TranscoderCIDR decodes a uint8 CIDR block
func (TranscoderCIDR) BytesToString ¶
func (ct TranscoderCIDR) BytesToString(b []byte) (string, error)
func (TranscoderCIDR) StringToBytes ¶
func (ct TranscoderCIDR) StringToBytes(cidrBlock string) ([]byte, error)
func (TranscoderCIDR) ValidateBytes ¶
func (ct TranscoderCIDR) ValidateBytes(b []byte) error