Documentation
¶
Overview ¶
Package ax25 looks at, and sets up, the Linux kernel's AX.25 stack: the kernel module, the /etc/ax25/axports file, and the network interface (ax0) that kissattach creates for a KISS TNC.
It is optional. hamstack's own packet tools talk to Direwolf directly (package agw) and need none of this; the kernel stack is for the classic tools (axcall, axlisten, ax25d, listen) and for anything that wants an AX.25 socket. Most of it needs root, so this package only reads and plans: the commands that change the system are shown to the user and run by the install steps.
Index ¶
Constants ¶
const PortsFile = "/etc/ax25/axports"
PortsFile is the system's axports file.
const PtyPath = "/tmp/kisstnc"
PtyPath is where Direwolf (started with -p) offers its KISS pseudo-terminal. Direwolf fixes the name, so only one Direwolf can offer it.
Variables ¶
This section is empty.
Functions ¶
func Upsert ¶
Upsert returns the file with p's line added, or replacing the line of the same name. Everything else, comments included, is kept. changed is false when the file already says exactly this.
func ValidPortName ¶
ValidPortName reports whether s can name an axports port: short, no spaces.
Types ¶
type Iface ¶
type Iface struct{ Name, Addr string }
Iface is an AX.25 network interface (ax0, ax1, ...) the kernel has.
func Interfaces ¶
Interfaces lists the AX.25 interfaces under root: network devices of ARPHRD_AX25 type (3).
type KernelState ¶
type KernelState int
KernelState says whether the running kernel can do AX.25.
const ( KernelMissing KernelState = iota // the kernel has no AX.25 module (recent kernels dropped it) KernelAvailable // there is a module, not loaded yet KernelLoaded // loaded or built in )
func Kernel ¶
func Kernel(root string) (KernelState, string)
Kernel checks the kernel under root ("/" on a real system; tests pass a fake tree).
func (KernelState) String ¶
func (k KernelState) String() string
type Port ¶
type Port struct {
Name string // the name the tools use (axcall PORT ...)
Call string // the callsign of this port, usually with an SSID
Speed int // bits per second on the air
Paclen int // largest packet
Window int // frames in flight
Desc string
}
Port is one line of /etc/ax25/axports: a name for a radio port, and how to use it.
func DefaultPort ¶
DefaultPort returns the port hamstack proposes for a station: one name, the station's callsign, and settings that suit Direwolf at 1200 baud.
func ParsePorts ¶
ParsePorts reads an axports file; comments and blank lines are skipped.