Documentation
¶
Overview ¶
Package agw is a small client for the AGWPE protocol that Direwolf serves (TCP, default port 8000).
It gives hamstack a way to watch packet traffic and make a connected-mode call without the Linux kernel's AX.25 stack, which needs root, extra packages and a kernel that still has the module (recent kernels do not). Direwolf allows several AGW clients at once, so this works while Pat is connected.
Index ¶
- Variables
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) Connect(port byte, from, to string, via []string) error
- func (c *Conn) Disconnect(port byte, from, to string) error
- func (c *Conn) Monitor() error
- func (c *Conn) Next() (Frame, error)
- func (c *Conn) Register(call string) error
- func (c *Conn) Send(f Frame) error
- func (c *Conn) SendData(port byte, from, to string, data []byte) error
- func (c *Conn) Version() error
- type Frame
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("the packet TNC closed the connection")
ErrClosed is returned when the server closes the connection.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection to an AGW server.
func Dial ¶
Dial connects to an AGW server such as Direwolf's. The connection is closed when ctx ends, which unblocks a Next that is waiting for a frame; a caller that wants to say goodbye first (send a disconnect) should give Dial a context that outlives that, and call Close itself.
func (*Conn) Disconnect ¶
Disconnect ends a connection.
func (*Conn) Register ¶
Register tells the server a callsign this client answers to (needed to make or accept a connection).
type Frame ¶
type Frame struct {
Port byte
Kind byte // 'R' version, 'X' register callsign, 'm' monitor, 'C' connect, 'v' connect via, 'D' data, 'd' disconnect, ...
PID byte
CallFrom string
CallTo string
Data []byte
}
Frame is one AGW frame.
func (Frame) IsMonitor ¶
IsMonitor reports whether a frame is a monitored packet (heard on the air, or one we sent).
func (Frame) Text ¶
Text returns the frame's data as printable text: a carriage return (packet's line ending), a line feed, or the pair, becomes one newline, and escape and other control characters are dropped, so a packet from the air cannot move the cursor or change the terminal. Text in UTF-8 is kept whole.