checkip

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NetListedIP   event.Code = 10010
	NetUnlistedIP event.Code = 10011
)

Event registered codes

View Source
const ActionClass = "checkip"

ActionClass defines action name

Variables

This section is empty.

Functions

func Builder

func Builder() builder.BuildActionFn

Builder returns a builder function

Types

type Action

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

Action checks ip addresses against an xlist service

func New

func New(aname string, c xlist.Checker, cfg Config, l yalogi.Logger) (*Action, error)

New returns a new instance

func (*Action) Class

func (a *Action) Class() string

Class implements ipp.Action interface

func (*Action) Name

func (a *Action) Name() string

Name implements ipp.Action interface

func (*Action) PluginClass

func (a *Action) PluginClass() string

PluginClass implements ipp.Action interface

func (*Action) Register

func (a *Action) Register(hooks *ipp.Hooks)

Register implements ipp.Action interface

type Config

type Config struct {
	Mode      Mode
	LocalNets []*net.IPNet
	//rules
	WhenListed   Rule
	WhenUnlisted Rule
	OnError      nfqueue.Verdict
}

Config stores configuration for action

type Mode

type Mode int

Mode sets mode for checking

const (
	CheckBoth Mode = iota
	CheckSrc
	CheckDst
)

Available values

type Rule

type Rule struct {
	Merge      bool
	EventRaise bool
	EventLevel event.Level
	Verdict    nfqueue.Verdict
	Log        bool
}

Rule stores information

Jump to

Keyboard shortcuts

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