blacklist

package
v0.0.0-...-4aea6f0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2023 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteNetworkBlacklistToFile

func WriteNetworkBlacklistToFile(filePath string, blacklist *NetworkBlacklist) error

Types

type AliasCheckState

type AliasCheckState struct {
	// contains filtered or unexported fields
}

func NewAliasCheckState

func NewAliasCheckState(addr *net.IP, left uint8, right uint8) (*AliasCheckState, error)

func (*AliasCheckState) GenerateTestAddress

func (state *AliasCheckState) GenerateTestAddress()

func (*AliasCheckState) GetAliasedNetwork

func (state *AliasCheckState) GetAliasedNetwork() (*net.IPNet, error)

func (*AliasCheckState) GetBaseAddress

func (state *AliasCheckState) GetBaseAddress() *net.IP

Get the base IPv6 address that is being permuted against for this alias check

func (*AliasCheckState) GetFound

func (state *AliasCheckState) GetFound() bool

Get whether or not the aliased network length has been found

func (*AliasCheckState) GetLeft

func (state *AliasCheckState) GetLeft() uint8

Get the left-most checking index

func (*AliasCheckState) GetLeftTestIndex

func (state *AliasCheckState) GetLeftTestIndex() uint8

Get the left index (inclusive) for the next test range

func (*AliasCheckState) GetPossibleTestAddressCount

func (state *AliasCheckState) GetPossibleTestAddressCount() (uint64, bool)

Get the total number of potential addresses in the next test range for this alias check Note that if there are over 16 bits to test against a boolean value of true will be returned, indicating that there are at least 65535 possible addresses

func (*AliasCheckState) GetRight

func (state *AliasCheckState) GetRight() uint8

Get the right-mount checking index

func (*AliasCheckState) GetRightTestIndex

func (state *AliasCheckState) GetRightTestIndex() uint8

Get the right index (inclusive) for the next test range

func (*AliasCheckState) GetTestAddr

func (state *AliasCheckState) GetTestAddr() *net.IP

Get the IPv6 address being used to test against for this alias check

func (*AliasCheckState) GetTestBitCount

func (state *AliasCheckState) GetTestBitCount() uint8

Get the number of bits that will be tested against in the next round of alias checking

func (*AliasCheckState) GetTestDistance

func (state *AliasCheckState) GetTestDistance() uint8

Get the distance between the left and right positions

func (*AliasCheckState) Update

func (state *AliasCheckState) Update(foundAddrs map[string]*internal.Empty)

type AliasCheckStates

type AliasCheckStates struct {
	// contains filtered or unexported fields
}

func NewAliasCheckStates

func NewAliasCheckStates(addrs []*net.IP, left uint8, right uint8) (*AliasCheckStates, error)

func (*AliasCheckStates) GenerateTestAddresses

func (states *AliasCheckStates) GenerateTestAddresses()

func (*AliasCheckStates) GetAliasedNetworks

func (states *AliasCheckStates) GetAliasedNetworks() ([]*net.IPNet, error)

func (*AliasCheckStates) GetAllFound

func (states *AliasCheckStates) GetAllFound() bool

func (*AliasCheckStates) GetChecksCount

func (states *AliasCheckStates) GetChecksCount() int

func (*AliasCheckStates) GetFoundCount

func (states *AliasCheckStates) GetFoundCount() int

func (*AliasCheckStates) GetTestAddresses

func (states *AliasCheckStates) GetTestAddresses() []*net.IP

TODO unit test

func (*AliasCheckStates) PrintAliasedNetworks

func (states *AliasCheckStates) PrintAliasedNetworks() error

func (*AliasCheckStates) PrintStates

func (states *AliasCheckStates) PrintStates()

func (*AliasCheckStates) Update

func (states *AliasCheckStates) Update(foundAddrs map[string]*internal.Empty)

type NetworkBlacklist

type NetworkBlacklist struct {
	// contains filtered or unexported fields
}

func NewNetworkBlacklist

func NewNetworkBlacklist(nets []*net.IPNet) *NetworkBlacklist

func ReadNetworkBlacklistFromFile

func ReadNetworkBlacklistFromFile(filePath string) (*NetworkBlacklist, error)

func (*NetworkBlacklist) AddNetwork

func (blacklist *NetworkBlacklist) AddNetwork(toAdd *net.IPNet) bool

func (*NetworkBlacklist) AddNetworks

func (blacklist *NetworkBlacklist) AddNetworks(toAdd []*net.IPNet) (int, int)

func (*NetworkBlacklist) Clean

func (blacklist *NetworkBlacklist) Clean(emitFreq int) int

func (*NetworkBlacklist) CleanIPList

func (blacklist *NetworkBlacklist) CleanIPList(toClean []*net.IP, emitFreq int) []*net.IP

func (*NetworkBlacklist) GetBlacklistingNetworkFromIP

func (blacklist *NetworkBlacklist) GetBlacklistingNetworkFromIP(toTest *net.IP) *net.IPNet

func (*NetworkBlacklist) GetBlacklistingNetworkFromNetwork

func (blacklist *NetworkBlacklist) GetBlacklistingNetworkFromNetwork(toTest *net.IPNet) *net.IPNet

func (*NetworkBlacklist) GetCount

func (blacklist *NetworkBlacklist) GetCount() int

func (*NetworkBlacklist) GetMaskLengths

func (blacklist *NetworkBlacklist) GetMaskLengths() []int

func (*NetworkBlacklist) GetNetworks

func (blacklist *NetworkBlacklist) GetNetworks() []*net.IPNet

func (*NetworkBlacklist) IsIPBlacklisted

func (blacklist *NetworkBlacklist) IsIPBlacklisted(toTest *net.IP) bool

func (*NetworkBlacklist) IsNetworkBlacklisted

func (blacklist *NetworkBlacklist) IsNetworkBlacklisted(toTest *net.IPNet) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL