firewall

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Enabled            bool     `toml:"enable"`
	BlackListAddresses []string `toml:"blacklist_addresses"`
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() *Config

func (*Config) BasicCheck added in v0.15.0

func (conf *Config) BasicCheck() error

BasicCheck performs basic checks on the configuration.

func (*Config) LoadDefaultBlackListAddresses added in v1.1.7

func (conf *Config) LoadDefaultBlackListAddresses()

LoadDefaultBlackListAddresses loads default blacklist addresses from the `black_list.json` file.

type Firewall

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

Firewall check packets before passing them to sync module.

func NewFirewall

func NewFirewall(conf *Config, net network.Network, peerSet *peerset.PeerSet, st state.Facade,
	log *logger.SubLogger,
) *Firewall

func (*Firewall) IsBlackListAddress added in v1.1.7

func (f *Firewall) IsBlackListAddress(remoteAddr string) bool

func (*Firewall) OpenGossipBundle

func (f *Firewall) OpenGossipBundle(data []byte, from peer.ID) *bundle.Bundle

func (*Firewall) OpenStreamBundle

func (f *Firewall) OpenStreamBundle(r io.Reader, from peer.ID) *bundle.Bundle

Jump to

Keyboard shortcuts

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