firewall

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ProtoAny  = 0 // When we want to handle HOPOPT (0) we can change this, if ever
	ProtoTCP  = 6
	ProtoUDP  = 17
	ProtoICMP = 1

	PortAny      = 0  // Special value for matching `port: any`
	PortFragment = -1 // Special value for matching `port: fragment`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConntrackCache

type ConntrackCache map[Packet]struct{}

ConntrackCache is used as a local routine cache to know if a given flow has been seen in the conntrack table.

type ConntrackCacheTicker

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

func NewConntrackCacheTicker

func NewConntrackCacheTicker(d time.Duration) *ConntrackCacheTicker

func (*ConntrackCacheTicker) Get

Get checks if the cache ticker has moved to the next version before returning the map. If it has moved, we reset the map.

type Packet

type Packet struct {
	LocalIP    iputil.VpnIp
	RemoteIP   iputil.VpnIp
	LocalPort  uint16
	RemotePort uint16
	Protocol   uint8
	Fragment   bool
}

func (*Packet) Copy

func (fp *Packet) Copy() *Packet

func (Packet) MarshalJSON

func (fp Packet) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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