Documentation
¶
Overview ¶
Package ipblocklist contains default implementation of the IPBlocklist for mtg.
Please check documentation for mtglib.IPBlocklist interface to get an idea of this abstraction.
Index ¶
Constants ¶
View Source
const ( // DefaultFireholDownloadConcurrency defines a default max number of // concurrent downloads of ip blocklists for Firehol. DefaultFireholDownloadConcurrency = 1 // DefaultFireholUpdateEach defines a default time period when // Firehol requests updates of the blocklists. DefaultFireholUpdateEach = 6 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
func NewNoop ¶
func NewNoop() mtglib.IPBlocklist
NewNoop returns a dummy ipblocklist which allows all incoming connections.
Types ¶
type Firehol ¶
type Firehol struct {
// contains filtered or unexported fields
}
Firehol is IPBlocklist which uses lists from FireHOL: https://iplists.firehol.org/
It can use both local files and remote URLs. This is not necessary that blocklists should be taken from this website, we expect only compatible formats here.
Example of the format:
# this is a comment # to ignore 127.0.0.1 # you can specify an IP 10.0.0.0/8 # or cidr
func NewFirehol ¶
func NewFirehol(logger mtglib.Logger, network mtglib.Network, downloadConcurrency uint, remoteURLs []string, localFiles []string) (*Firehol, error)
NewFirehol creates a new instance of FireHOL IP blocklist.
This method does not start an update process so please execute Run when it is necessary.
Click to show internal directories.
Click to hide internal directories.