network

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NFTActionAccept = "accept"
	NFTActionDrop   = "drop"

	NFTProtoTCP = "tcp"
	NFTProtoUDP = "udp"
	NFTProtoAny = "any"
)

Variables

This section is empty.

Functions

func GenerateNFTPlan

func GenerateNFTPlan(p NFTPlan) (string, error)

Types

type NFTInputRule added in v0.2.0

type NFTInputRule struct {
	SourceCIDRs []string
	Protocol    string
	Ports       []int
	Action      string
	Comment     string
}

type NFTPlan

type NFTPlan struct {
	InterfaceName string `json:"interface_name"`
	WireGuardCIDR string `json:"wireguard_cidr"`
	PublicTCP     []int  `json:"public_tcp"`
	PublicUDP     []int  `json:"public_udp"`
	WireGuardTCP  []int  `json:"wireguard_tcp"`
	WireGuardUDP  []int  `json:"wireguard_udp"`

	// InputRules are server-composed policy rules folded into the single
	// lattice_guard input chain. They are intentionally not part of the public
	// JSON API for raw Network Guard inputs; callers must pass structured,
	// validated intent through server-owned compilers.
	InputRules []NFTInputRule `json:"-"`
}

func NormalizeNFTPlan added in v0.2.0

func NormalizeNFTPlan(p NFTPlan) (NFTPlan, error)

NormalizeNFTPlan applies defaults, validates every operator-controlled value, canonicalizes the WG CIDR, and returns sorted/deduplicated port lists.

Jump to

Keyboard shortcuts

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