ax25.ports

AX.25 Port Information

Methods to query for available AX.25 ports, by interface name, port name, or callsign. Required to obtain, for example, the AX.25 port name for unproto frames arriving on a given network interface.

Important

This implementation relies on the Linux AX.25 stack, and will not work on any other platform. An exception is raised if an attempt is made to use it on a non-Linux platform.

Exceptions

UnsupportedPlatformError

Raised when a Linux-only module is invoked on a non-Linux platform.

Classes

Port

Descriptor for an AX.25 port.

PortInfo

Centralized access to information about available AX.25 ports.

Module Contents

exception ax25.ports.UnsupportedPlatformError(name)

Bases: RuntimeError

Raised when a Linux-only module is invoked on a non-Linux platform.

Parameters:

name (str) – Name of the module being used in error.

class ax25.ports.Port(ifname, portname, callsign, speed, paclen, window, description)

Descriptor for an AX.25 port.

The information in this descriptor is a combination of static data from the axports file and live interface data from the Linux OS.

Parameters:
  • ifname (str) – Network interface name.

  • portname (str) – AX.25 port name.

  • callsign (str) – Callsign attached to the port.

  • speed (int) – Serial line speed between computer and TNC.

  • paclen (int) – Maximum packet length to send.

  • window (int) – Number of frames to send without an ACK.

  • description (str) – User description for this port.

class ax25.ports.PortInfo

Centralized access to information about available AX.25 ports.

The OS is interrogated to determine all currently active AX.25 ports. This information is then combined with data from axports to form a central source of data on available AX.25 ports. Multiple accessors provide convenient lookups for different use cases.

load()

Load the data for all available AX.25 ports.

Returns:

True if the information was loaded successfully; False if the information is not available.

Return type:

bool

first_port()

Retrieve the first active port configured in the axports file.

The first configured port is frequently used as a default by AX.25 applications.

Returns:

The first active AX.25 port, or None if there are no active ports.

Return type:

Port or None

find_by_ifname(ifname)

Look up port information based on its interface name.

Parameters:

ifname (str) – Interface name to look up.

Returns:

The port with this interface name, or None if there is no such port.

Return type:

Port or None

find_by_portname(portname)

Look up port information based on its port name.

Parameters:

portname (str) – Port name to look up.

Returns:

The port with this port name, or None if there is no such port.

Return type:

Port or None

find_by_callsign(callsign)

Look up port information based on its attached callsign.

Parameters:

callsign (str) – Callsign to look up.

Returns:

The port with this attached callsign, or None if there is no such port.

Return type:

Port or None