filters

package
v0.13.13 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package filters implements the IS->RF gating rule engine. Rules are evaluated in priority order (lowest Priority value first); the first matching rule's Action determines the outcome. If no rule matches, traffic is denied — the iGate must never blindly forward APRS-IS traffic to RF.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string

Action is the outcome when a rule matches.

const (
	Allow Action = "allow"
	Deny  Action = "deny"
)

type Engine

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

Engine evaluates rules against decoded packets.

func New

func New(rules []Rule) *Engine

New builds an Engine with rules sorted by Priority asc, then ID asc.

func (*Engine) Allow

func (e *Engine) Allow(pkt *aprs.DecodedAPRSPacket) bool

Allow reports whether pkt should be forwarded IS->RF. The first matching rule decides; absent a match, the default is deny.

func (*Engine) Rules

func (e *Engine) Rules() []Rule

Rules returns a copy of the engine's rules in evaluation order.

type Rule

type Rule struct {
	ID       uint32
	Priority int
	Type     RuleType
	Pattern  string // interpretation depends on Type
	Action   Action
}

Rule is a single filter entry. Priority orders evaluation (lower first).

type RuleType

type RuleType string

RuleType classifies a filter rule.

const (
	TypeCallsign    RuleType = "callsign"     // exact source match (with SSID)
	TypePrefix      RuleType = "prefix"       // source callsign prefix (no SSID)
	TypeMessageDest RuleType = "message_dest" // message addressee match
	TypeObject      RuleType = "object"       // object/item name match
)

Jump to

Keyboard shortcuts

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