# LinPac - Packet Radio Terminal for Linux

Version 0.28

(c) 2020 - 1998 by David Ranch KI6ZHD

## User manual

Index

1 What is LinPac

2 First configuration

3 LinPac controls
3.1 Keyboard
3.2 Entering commands
3.3 Initiating a connection
3.4 Receiving and sending files
3.5 Remote commands
3.6 Character encoding
3.7 Huffman compression

4 Variables
4.1 Special variables

5 Station database
5.1 The station.data file format
5.2 The 'Name' command
5.3 Using the database

6 About macros
6.1 Creating macros
6.2 Commands used in macros
6.3 Special system macros

7 Creating new commands

8 Standard applications
8.1 File transfer protocols
8.2 Automatic password generation
8.2.1 Login passwords
8.2.2 Sysop and general use passwords
8.3 Utilities for mail exchange
8.4 Mail client
8.5 Logbook

9 Command line options

10 Copying

Appendix A: List of LinPac commands

Appendix B: Linpac FAQ / Questions and Answers / Getting more help

Appendix C: Errata

## 1 What is LinPac

LinPac is a packet radio terminal for Linux that allows wide configurability and easy addition of new functions and special functions needed by the user. The aim is to minimize the amount of 'hard coded' functions and create a complete set of applications that can be easy expanded and/or completely reconfigured.

All functions described in this manual match the standard configuration that comes with the distribution package.

## 2 First configuration

When linpac is started for the first time on your computer, it automaticaly creates the directory called `LinPac` in the running user's home directory. This directory will contain the user's personal LinPac configuration settings. After creating this directory, LinPac asks for basic callsign, port and other information and prepares a useable configuration for you. An example setup dialog is as shown, where we are using the bogus call "n0call" logging into the local home BBS "n0ary-1":

    $ linpac

    Hello dear user. You seem to run LinPac for the first time.
    LinPac has to create a directory in your home directory for storing
    your personal configuration.

    For creating your personal configuration please answer following questions:

    Your callsign:
    n0call

    Enter your home BBS callsign with SSID :
    n0ary-1

    Enter the name of port to connect N0ARY-1
    d710

    Enter the digipeaters used to connect N0ARY-1 or press enter
    when no digipeaters are used:

    Enter the full hierarchical address of N0ARY-1
    (e.g. #MOR.CZE.EU)
    #NCA.CA.USA.NOAM

    Thank you, N0CALL
    Please wait a moment for creating your personal configuration
    Installation done.
    Press ENTER to run LinPac

The above information is then stored in the `$HOME/LinPac/macro/init.mac` file as various 'functions'. These functions are based on the very simple interpreted language (actually it's not a language but something like the batch files in DOS). In the LinPac/macro directory are all the scripts written in this language. The init.mac macro is loaded at start of loading Linpac and contains the commands to setup the callsigns and other settings. You can modify this file to change the initial configuration of LinPac. Other macros can be run in LinPac as desired or required. The simplest case of a macro is a normal text file that is just printed to the screen (or sent to the remote peer) when executed. The language is described in chapter 6.

You may also want to review or change following macro files:

- info.mac - contains information about your system
- ctext.mac - executed when the peer connects and should contain the greeting text
- quit.mac - called when user enters the Quit command (end of connection) and should print some farewell text and disconnect

After this you should be able to make your first connection.

## 3 LinPac controls

After automatically running the LinPac setup routine, the main screen should appear. If you see a segmentation fault, please see Linux AX.25 issues with long predictable network interface names for a work around. Moving on, in Linpac's main interface in the standard configuraion, the screen is divided into five parts (described from the top of the screen to the bottom):

- QSO window: this window contains the text that came from the peer and also the sent text and some special messages (different text colours).
- Status line: displays your callsign, current time and some information about the current connection.
- Editor: allows you to enter the text you want to send to the peer or the commands you want to execute
- Channel list: displays the list of channels with the callsign of connected users. The currently selected channel is highlighted.
- Monitor : displays the traffic on your radio ports

LinPac is mostly driven by commands. The commands are entered using the editor and must start with a colon (':') in the first column. Lines that don't begin with a colon are sent to the peer, if connected.

LinPac allows up to eight connections to be made simultaneously. For each connection one channel is used. You can switch between channels by pressing the F1 - F8 keys. Each has its own QSO window, status line and editor. The channel list and the monitor are common across all the channels.

There is a special channel invoked by pressing F10. This channel has no QSO window and doesn't allow making a connection. The text written is sent out immediately using UI frames (beacon).

### 3.1 Keyboard

The following list contains the important shortcuts:

Global
F1 - F8 : switch to channel 1 - 8
F10 : switch to monitor
Alt-X : end of LinPac

QSO Window
PgUp, PgDn, ctrl-R, ctrl-V : scroll one page up / down
ctrl-E, ctrl-X : scroll one line up / down
ctrl-B : skip to end of buffer

Editor
Cursor keys, Home, End, Backspace, Del : text editing
ctrl-Y : delete current line
Enter : send current line

Some applications (e.g. mailer) can use the whole screen. Each channel can run only one such application at a time. It's possible to switch to this application using Alt-<channel_number> (e.g. Alt-5) and switch back to terminal using F1 - F10.

### 3.2 Entering commands

Each command is invoked using its name. Some commands can be abbreviated. In this manual the mandatory part is always written in upper case. The remainder of the command name is optional. Some commands require some extra arguments. The arguments are written after the command and are separated by one or more spaces. If you want to enter an argument containing more than one word, that argument must be entered in quotation marks.

Examples:

`:color red blue` - calls the 'color' command with two arguments - 'red' and 'blue'
`:color 'light red'` or
`:color "light red"` - calls the 'color' command with one argument 'light red'

Most of the commands work on the currently selected channel. If you want to execute the command on some other channel, you can enter the number of the channel this way. For example, to make an OUTGOING connection to destination OK0PAB on Linpac channel 5:

`:connect@5 OK0PAB`

In this case the 'connect' command is executed on channel 5.

The complete list of commands with descriptions is available in Appendix A.

### 3.3 Initiating a connection

To initiate a connection the `:Connect` command is used. Just switch to the channel you want to use by pressing F1 - F8 and enter the following command:

`:connect CALLSIGN`

Replace the CALLSIGN with the real callsign of the station you want to connect. The command can be abbreviated to the first letter only. Example:

`:c OK0PAB`

This command will initiate the connecting sequence to OK0PAB. To close the connection, you can use the `:Disconnect` command by entering

`:d
`

When your system has multiple radio ports, you can specify its name before the callsign like this:

`:c 2:OK0PAB`

This command will try to connect OK0PAB via port 2. When no port name is specified, the default one is used. Initially the default port is the first port in `/etc/axports` (your system AX.25 port configuration file). If you want to change the default port, just use the command `:port`.

`:port 2`

This will change the default port name to '2'. In some cases it is useful to set another default port for some selected channels. For this the variable `CHN_PORT` can be used (see chapter 4). When set, the content of this variable overrides the default port selection for the particular channel. For example, when you set the variable for channel 4 using

`:set CHN_PORT@4 1
`

the port '1' will be used as the default one for the channel 4. For other channels, the previously set default port will be used.

### 3.4 Receiving and sending files

The standard distribution can receive files using plain text or binary transfer and using file transfer protocols YAPP and Autobin. LinPac will automaticaly start to receive the file when the peer begins to send using the YAPP or Autobin protocols. The 7+ files are automaticaly saved too. When you want to save the incoming text you have to use the command

`:Write <filename>`

The incoming text will be saved until you stop the saving using

`:Write off`

For receiving a plain binary file, the corresponding command `:WBin` can be used. This way of transferring binary files is not recommended; use the autobin or yapp protocol instead.

The following commands are available for sending files:

`:rprg <filename>` - sends the file using the Autobin protocol
`:yput <filename>` - sends the file using the YAPP protocol
`:rbin <filename>` - sends the binary file (no protocol - not recommended)
`:read <filename>` - semds the text file

### 3.5 Remote commands

LinPac allows the remote user to enter commands. For remote control, all LinPac commands are available but there can be (and should be) some restrictions for each user.

The remote command must start with the `//` sequence. For example if some connected user sends you the text '`//info`' your terminal will send back the station information.

The remote commands can be disabled using the command `:remote off` and enabled by `:remote on`. You can also specify that only some commands be available for remote users. The default list of available remote commands is defined in the init.mac file (the DEF_RCMD line). It is also possible to enable various commands for each user. This is described in chapter 5.

### 3.6 Character encoding

Some countries use different national character encodings for some historical reasons. A user who has his Linux console configured for example for some of the standard ISO encodings may be incompatible with another one using a traditional encoding. To solve this LinPac allows the translation of the input and output of each channel using a translation table. The translation tables are stored in files `*.ctt` in the LinPac home directory.

All known encodings must be defined in the file called `encodings` in the LinPac home directory. This file contains a single line for each encoding that specifies its alias (name which will identify the encoding in LinPac), encoding name (an official name such as iso-8859-1) and optionally the name of the translation table file to be used (without the extension `.ctt`).

Note that LinPac does not support multi-byte encodings such as UTF-8 or other Unicode encodings.

The current encoding can be switched using the :TRanslate command separately for each channel. To specify the default encoding for each user you can add the line

`ENC=<alias>`

to the appropriate record in the station database. (The station database is described in chapter 5.) When no encoding is specified for the user, the default one is used. The default encoding alias is stored in the DEF_ENC@0 variable which is set in the macro init.mac.

When the conversion table is not specified in the encodings file LinPac only changes the name of currently used encoding but doesn't provide any conversion. However some applications (such as QLinPac which works in unicode) are able to do their own conversions.

### 3.7 Huffman compression

Some packet radio terminals and BBS software allows the compression of transferred text. When switched on, the sender does the compression of all data before sending them to the other station and the recipient has to decompress the data after receiving them. This makes the communication more reliable and reduces the load of the radio link.

The line compression in LinPac is activated using the `:comp` command. The compression is switched on using `:comp on` and switched off using `:comp off`. To ensure that the compression is activated or deactivated on both ends of the link simultaneously LinPac sends the remote command `:comp 1` or `:comp 0` to the other station automatically. The arguments 1 and 0 have the same effect as `on` and `off,` but they don't cause sending any command to the other station.

In the case in which the remote system doesn't support the `:comp` command it's necessary to switch on the compression on the remote system manually and then use the`:comp 1` command in LinPac.

## 4 Variables

Each channel has its own set of variables. Some of the variables are used to store the configuration data. The user can create and remove variables and change the values of existing variables using following commands:

`:set <variable> <value>` - sets the value of the variable. If the variable doesn't exist, a new one is created.
`:get <variable>` - prints the value of the variable
`:unset <variable>` - removes the variable

Some examples:

`:set NAME John`
`:set WHOLE_NAME 'John Big'`
`:get NAME`
`:unset NAME`

The name of the variable can contain the specification of the channel. For example the variable `NAME@5` is the variable '`NAME`' defined on channel 5.

When LinPac finds the character '`%`' followed by the name of variable, it automatically replaces this text with the value of the variable. Considering the previous example, the text `%NAME` will be replaced with John.

### 4.1 Special variables

There are some special internal variables that don't allow changing their value. Their value is set and changed directly by LinPac and these variables can be used to add some actual information to the text. The list follows:

`%V` - LinPac version (e.g. 0.26)
`%C` - The callsign of connected station
`%N` - The name of connected station (when known), else replaced by the contents of %U macro
`%Y`- Channel callsign (mycall)
`%K`- Current channel number
`%T` - Current time
`%D` - Current date
`%B` - Audible bell
`%Z` - Current time zone
`%U` - The text used when the name is unknown. This can contain other macros (typicaly %C).
`%P`- The port number
`%M`- The number of connected users
`%A`- The time since the last operator activity
`%_`- End of line (CR)
`%<`- Contents of the last line received, this is cleared by reading
`%#number` - Replaced by a character with an ASCII value <number> (e.g. %#27 means ESC)
`%(command)` - Replaced by the command result.
`%[expression]` - Replaced by the result of mathematical expression

Variables for use in macros only:

`%R` - the number of macro arguments (up to 9)
`%0` - the name of the macro
`%1` - `%9` - macro arguments

For example try to write following text in the editor and press enter:

`The time is %T and the date is %D.`

## 5 Station database

The station database holds various information about known stations. All the information is stored in the '`station.data`' file and can be changed using the normal text editor or using the LinPac :`Name` command.

### 5.1 The station.data file format

The information about each station is written in a paragraph starting with the station callsign in square brackets. Each line in the paragraph contains one definition like:

`<item_name>=<value>`

A typical station information paragraph might look like this:

`[OK0NMA]`
`NAME=PC/FlexNet Brno`
`TYPE=FLEXNET`
`LOC=JN89HE`
`QRG=144.8125 MHz`
`SYSNUM=85946`

There are no mandatory items; the user can add various items depending on what information he wants to store. The current LinPac distribution uses following item names for standard information:

NAME - Text information about the station, or the operator's name. LinPac shows this information when connected to that station. LOC - QRA locator of the station. Shown after connect too.

TYPE - The type of the station. For standard stations the types FLEXNET, THENET, FBB, BAYBOX, DIEBOX, TNOS, JNOS, DXC and TERM for user terminals are recomended, but you can add any other type.

LANG - The language to communicate with the station. This is currently supported by macros only. When this item is set, LinPac will try to find the macro in the directory `macro/<LANG>/`.

NICKNAME - The nickname of the operator.

The standard LinPac configuration also uses these item names:

TERM - What type of terminal is used. If '`ansi`' is set, LinPac switches to the ansi-color mode after connecting this station.
ENC - The character encoding. Used to automaticaly switch to the i/o character conversion.
RCMD - The list of enabled remote commands for this station.
QRG - The user frequency. Used by the logbook.
SYSNUM and PWD - Sysop password for the station. See chapter 8.2 for more information.

### 5.2 The 'Name' command

The `:Name` command is used to modify the station database. Running the command without arguments results printing the name of currently connected station. Arguments can be used to modify the data:

`<name>` - modify the NAME item
`-l <locator>` - modify the LOC item
`-t <type>` - TYPE
`-L <language>` - LANG
`-n <nickname>` - NICKNAME
`-s <item>=<value>` - modify other item

The command '`Name -i`' prints all information about the station. When you need to change the information about a station other than the connected station, add the argument `-c <callsign>`.

Examples:

`:Name David`
`:Name -c KI6ZHD -l CM97ai David`
`:Name -i`

### 5.3 Using the database

After any connection is established, LinPac reads the information about the connected station from the database and creates the set of variables with names `STN_<database_item_name>` containing the values of the items. These variables can be used in macros as described below.

## 6 About macros

### 6.1 Creating macros

A macro is a LinPac command that is created using the macro language, and uses other LinPac commands to perform some action. A macro can be defined by creating the file `macro/<command_name>.mac`. It's possible to define an abbreviated form of the command; this is described in chapter 7. There are two ways to define a macro:

a) Text macros
This way is suitable for commands which are intended to produce a larger text output (for example station information). When executing this macro, each line that doesn't start with ':' is printed (sent out). All commands must start with the colon. This is suitable for modifying the text output using the IF ~ ELSE ~ ENDIF commands or for including some other commands.

b) Command macros
A command macro must start with the line
`:MACRO <name>`
Each line of a command macro is interpreted as a command (doesn't start with the colon and doesn't need to start at the begining of line). Text output is provided by the 'echo' command. This way is more synoptical and allows including comments that must start with the sequence '`;;`' and end at the end of the line.

A macro is called with its name. When the first arguments starts with the '@' symbol the macro is executed from the specified label. For example the command `:convers @SEND` will execute the macro 'convers.mac' from the label 'SEND' (see next chapter to see how to define the label).

### 6.2 Commands used in macros

A macro can contain all LinPac and user defined commands. There are also some special commands that can be used in macros only:

MACRO [name]
Start of the command script definition (see previous section).

LABEL <label_name>
Creates a label with specified name. In the command scripts the notation :<label_name> can be used.

GOTO <label_name>
Jump to specified label.

IF ~ ELSE ~ ENDIF
Conditional commands. There are two ways to specify a condition:

- normal notation (for more than one command)

IF <condition>
.
.
(commands to be executed when the condition is true)
.
.
ELSE
.
.
(commands to be executed when the condition is false)
.
.
ENDIF

The ELSE part is not necessary - the IF ~ ENDIF notation is possible.

- abbreviated notation (for one conditional command)

IF (<condition>) command

The parentheses are necessary in this case.

The following example shows how to use conditions and how to use the data from the station database. We want to create a macro that will greet the operator of the connected station with his nickname or with his name, if the nickname is not defined.

a) The solution using a text macro (the comments are actually not allowed in the text macros, they are here for explanation only)

`:if %(exist STN_NICKNAME) == 1 ;; when NICKNAME is defined`
`Hello %STN_NICKNAME ;; greet with the nickname`
`:else ;; else (not defined)`
`Hello %N ! ;; greet with the name`
`:endif ;;(following commands are always executed)`
`You have connected to %Y at %T. ;; Say your callsign and current time`

b) The solution using a command macro

`:macro GREETING ;; start the command macro`
`if %(exist STN_NICKNAME) == 1 ;; when NICKNAME is defined`
`echo Hello %STN_NICKNAME ;; greet with the nickname`
`else ;; else (not defined)`
`echo Hello %N ! ;; greet with the name`
`endif ;; (following commands are always executed)`
`echo You have connected to %Y at %T. ;; Say your callsign and current time`

### 6.3 Special system macros

There are some special macros that are executed automaticaly by LinPac in some cases:

init.mac - This is executed when LinPac is started and its function is to set the callsigns, screen options, and some other parameters.

cinit.mac - This is always executed when a connection is established. The distribution version of this macro sets the channel parameters in order to configure station settings from the station database (allowed remote commands, i/o encoding, terminal type) and executes the logbook command to sign the start of a connection. LinPac always passes two arguments to this macro. The first (%1) argument is the callsign of the connected station and the second (%2) argument is the callsign of the previously connected station that provides the connection, or empty in case of direct connection.

ctext.mac - This macro is executed when some station connects to the terminal. It should print some greeting text. No arguments are passed.

cexit.mac - This is always executed when a connection closes. The distribution version of this macro just executes the logbook command to sign the end of the connection and clears the list of allowed remote commands. There is always one argument passed by LinPac (%1), containing the callsign of the disconnected station.

## 7 Creating new commands

A new command can be represented by a macro or by an external program (standard linux program or special LinPac application). Macros are placed in the `$LINPACDIR/macro` directory and external programs are placed in the `$LINPACDIR/bin` directory. In both of these directories is the file '`commands`' that contains the list of commands in that directory. You should specify here the name of the file, the name of the command in LinPac (use upper case to specify the mandatory part of the command). It's not necessary to include the macros here if you don't want to define the abbreviation.

In case of external programs, it is also possibile to specify program flags. Currently the following flags are supported:

A - Ascii mode program. LinPac provides CR <-> LF conversion when communicating with this program. This is the default setting.
B - Binary mode. Disables the text conversions.
C - Leaves the stdout stream of the program on the console and reads its stderr stream instead.
D - DOS conversion - ignore LF characters.
S - Reads both stdin and stderr streams of the program (shell mode).
L - Local. This program is never available as a remote command.
R - This program is always run as a remote command (its messages are always sent out).
P - LinPac removes the paths from filenames that are passed as the argument of this command when the FIXPATH command is on. This is a security option.

## 8 Standard applications

### 8.1 File transfer protocols

At present LinPac supports two protocols for transferring files:

- Autobin - a simple protocol suitable for short files
- YAPP - a very sophisticated transfer protocol that provides better error detection and is able to resume a previously interrupted transfer

Usage of these protocols is described in chapter 3.4.

LinPac can also automatically save incomming 7+ files. After saving all parts of a file LinPac tries to call the '7plus' program to decode the file. Received 7+ files are not removed automatically.

### 8.2 Automatic password generation

#### 8.2.1 Login passwords

LinPac provides automatic replies to the login authorization requests for the following systems: F6FBB BBS (VE2BLY C_FILTER), BAYBOX, TNOS (numeric MD5). Each station which requests a login password must have an entry in the station database containing at least following fields:

A

`TYPE=<station_type>` (FBB, BAYBOX or TNOS)
`LOGINPW=<login_password>`
`PWPROMPT=<BBS_prompt>`

`BBS_prompt` is the text which the BBS sends when requesting the authorization. Usually it looks like 'Password>' or 'OK0XYZ>'.

#### 8.2.2 Sysop and general use passwords

LinPac provides automatic authorization to the following systems: F6FBB BBS (MD2 password), FLEXNET (older versions, the 'magic' numbers system and newer TheNet-like system), THENET and BAYBOX. Each station you want to authenticate with must have an entry in the station database. For password generation, the following fields must be set:

`TYPE=<station_type>`
`PWD=<your_password> or`
`SYSNUM=<magic_number>`

Known station types are:

- FBB - An F6FBB BBS. The PWD field must contain your password.
- THENET - A TheNet node. Again the PWD must contain the password.
- BAYBOX - The same system as TheNet.
- FPAC - A FPAC node. Password must be stored in the PWD field.
- FLEXNET - FlexNet node. If the magic number algorithm is used (older versions of flexdigi) the SYSNUM field must contain your magic number and the PWD field must not be set. When the TheNet algorithm is used (newer versions of flexdigi), the PWD field must contain the password and the SYSNUM field must not be used.

In case of FBB the authorization algorithm can be chosen by setting the MD field in the station database:

`MD=5` - this value will select the MD5 algorithm
`MD=2` - this value will select the MD2 algorithm

When no value is set, MD2 algorithm is used.

After connecting to the station you want to authenticate with, the authorization sequence begins with the `:PW` command. LinPac will send the authorization command to the station and tries to answer the authorization request using your password. If the password is correct, authorization should finish successfully.

The PW command accepts the following parameters:

`:PW [<command> [<system> [<password>]]]`

where

- `<command>` is the command to be sent to the remote station to start the authorization sequence (sys by default)
- `<system>` is one of the above-mentioned supported systems; this system is used instead of the one specified in station database
- `<password>` is the password that will be used instead of the one specified in the station database

It's recommended that you create simple macros for frequently used authorizations that require special arguments to the PW command.

### 8.3 Utilities for mail exchange

LinPac contains support for exchanging messages with remote Kantronics PBBSs as well as F6FBB BBS systems. This support utilizies some tools from the ax25mail-utils so please install that package first. THe next step would be to configure Linpac and ax25mail-utils's configuration settings with the following variables either in Linpac's channel 0 or in Linpac's init.mac file:

Example #1: Kantronics KPC3:

- HOME_TYPE - This sets the type of remote system you're connecting to. Supported options are either "PBBS" for Kantronics KPC3 type TNCs or "FBB" for F6FBB BBSes. Only "PBBS" is well understood though the FBB support has been there for some time.
- HOME_BBS - The AX.25 path to the home PBBS including the port name. For example `d710:AA6WK-1` means use the `d710` AX.25 port as defined in the `/etc/ax25/axports` configuration file and connect to the PBBS `AA6WK-1`. It's important to note that the callsigns in Linpac are CaSe-SeNsItIvE so make sure these two variables use the SAME case.
- HOME_ADDR - The full hierarchical address of the BBS (which technically isn't required for PBBSes). For example `AA6WK.#NCA.CA.USA.NOAM`.

To set the variable while in Linpac, the `:SET` command can be used. You can also put this same line (but without the colon) in Linpac's init.mac file:

`:set HOME_TYPE "PBBS"`
`:set HOME_BBS@0 "d710:AA6WK-1"`
`:set HOME_ADDR "AA6WK.#NCA.CA.USA.NOAM"`

The recommended place to set this variables is in the startup macro `init.mac`. The default version of this macro contains an example of setting these variables. After setting these variables, the following commands are available:

Example #2:

- HOME_TYPE - This sets the type of remote system you're connecting to. Supported options are either "PBBS" for Kantronics KPC3 type TNCs or "FBB" for F6FBB BBSes. Only "PBBS" is well understood though the FBB support has been there for some time.
- HOME_BBS - The AX.25 path to the home BBS including the port name. For example `kiss:OK0PAB OK0NMA` means use the `kiss` AX.25 port as defined in the `/etc/ax25/axports` configuration file and connec to the BBS `OK0PAB` via the digipeater `OK0NMA`. It's important to note that the callsigns are CaSe-SeNsItIvE in Linpac so make sure these two variables use the SAME case.
- HOME_ADDR - The full hierarchical address of the BBS. For example `OK0PAB.#MOR.CZE.EU`.

To set the variable while in Linpac, the `:SET` command can be used. You can also put this same line (but without the colon) in Linpac's init.mac file:

`:set HOME_TYPE "FBB"`
`:set HOME_BBS@0 "kiss:OK0PAB OK0NMA"`
`:set HOME_ADDR "OK0PAB.#MOR.CZE.EU"`

The recommended place to set this variables is in the startup macro `init.mac`. The default version of this macro contains an example of setting these variables. After setting these variables, the following commands are available:

Now you need to configure the ax25mail-utils program by editing the /etc/ax25/axgetlist.conf file. The following example is to support connecting to PBBSes in example #1 above:

       [AA6WK-1]
       MYCALL N0CALL
       BBSCALL AA6WK-1
       BBSPORT d710
       CMD_LIST LO +;L
       CMD_LIST_FROM LO +;L $
       CMD_DISC B
       HEADER_LINES 1
       FORMAT <NUM> <FLAGS> <SIZE> <TO> <FROM> <DATE> <TIME> <SUBJ>
       DATEFMT mm/dd/yyyy
       BPFPOS 1--

Each remote BBS gets it's own section, unique callsign, and any other specific settings to support the sending and receiving of messages.

NOTE: the associated ax25mail-utils `/etc/ax25/axgetmail.conf` configuration file NOT currently mentioned in this documentation is only used for remote "FBB" setups. That support is currently not documented yet.

Urgent: Linpac's packet messaging support is still a work in progress so some quirks exist for now:

- All remote BBS systems that use SSID numbers will have their message index files "flattened" aka written to the same base callsign name without the SSID in `/var/ax25/ulistd/`. In the future, this filename should include the `-SSID#`
- All non-private messages will be stored in `/var/ax25/mail/<callsign-SSID>`
- All private messages will be stored in `/var/ax25/mail/<callsign-SSID>`
- There is a known bug in Linpac's message system due to the index "flattening" issue where messages cannot be written to disk or found in the :mail interface. To work around this issue, do the following in the directory of the Linux user who is running Linpac:

`mkdir LinPac/mail/<callsign-SSID>`
`ln -s LinPac/mail/<callsign-SSID> LinPac/mail/<callsign>`

Now that the basics (and workarounds) are setup, let's fetch any pending messages for you on your configured remote BBS system. Enter in the following command on the Linux prompt (this example is following example #1 above):

`axgetlist -b AA6WK-1`

NOTE: The above Linux command must be run as the same Unix user that is running the Linpac program.

The axgetlist utility will now fetch an index of all messages on the remote BBS system and store this list in `/var/ax25/ulistd/<bbs-name>` (all SSIDs are currently stripped). While this Linux command line-based index capture occurs, the packet traffic will NOT show up in Linpac's main send/receive UI as this command is running outside of Linpac. You will see the AX.25 traffic if you have Linpac's AX.25 traffic monitor working. The resulting downloaded index file will then be used to manually download any messages with the `getmsg` command or interact with those remote messages them via Linpac's :mail interface

`:GETMSG <message_number> [<message_number> ...]`
From the main Linpac interface, this command reads specified messages from the remote BBS and stores them into `/var/ax25/mail/<BBS_callsign>/<message_number>`. The file system directory for the remote BBS must be created before using this command (use upper case for the BBS callsign). When the message number starts with the letter 'p', the message is considered a PERSONAL one and it's killed automatically after download. You can specify the kill command by setting the `KILLPERS` variable in channel 0 using the # character for the number of the message (e.g. `:set KILLPERS@0 "kill #"`). When this variable is not set, the default command `K #` is used. This can also be set in the init.mac file.

`:SP <address>` or `:SB <address>`
These commands can be used for creating new private messages or bulletins. The usage is the same as for the FBB BBS.

`:FORWARD`
Transfers all new messages to the BBS.

`:DELMSG <message_number>`
Marks the message for delete.

`:PACK`
Deletes all marked messages.

### 8.4 Mail client

This application allows full screen message editing and browsing. It provides a graphical (Ncurses) frontend to mail exchange utilities. The mail client is started by the `:MAIL` command from Linpac's Channel 0 (aka.. the F1-key view). If you run this command from any other Linpac channel, it won't display any messages!

After the mail interface opens, the H key shows the operating instructions.

In the INCOMING mail folder, you should see a list of messages available to download. Toggle the messages you want to fetch with the SPACEBAR and then use the "d" key to download those messages.

### 8.5 Logbook

Logbook is a simple application that is started from the cinit.mac and cexit.mac scripts (at the begining and at the end of each connection). It creates the file in the 'log' directory for each callsign and writes there the time when the connections were started and finished and the QRG. The QRG is taken from the `QRG` field of the station entry in station database. If the station has no QRG defined, the value from the `QRG@0` variable is taken.

## 9 Command line options

LinPac accepts following command line options:

-m : disable monitor. When this option is used, LinPac doesn't create it's internal monitor objects and saves memory.

-s : disable ax25spyd. Linpac normally tries to connect ax25spyd to get monitor data and when the connection fails, the listen utility is used instead. When -s swicth is used, LinPac doesn't try to connect ax25spyd at all.

-d : daemon mode. LinPac doesn't initialize the screen and runs in the background.

-p <string> : specify the arguments for the listen program. Default value is `ar8`.

## 10 Copying

LinPac is Copyright (c) 2002-2020 by David Ranch KI6ZHD and Copyright (c) 1998-2002 by Radek Burget, OK2JBG

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details (contained in file 'license').

You should have received a copy of the GNU General Public License along with this program; if not, see <https://www.gnu.org/licenses/>.

##

## Appendix A - LinPac commands

### Built-in commands

a) action commands

ABort [address]
Cancels an action. Some commands are cancelled without specifying any address (e.g. autobin). Addresses for some commands:

Action | Address for abort
autobin RX/TX | autobin (or none)
yapp RX/TX | yapp (or none)
7plus autosave | 7plus (or none)
read / RBin | read (or none)
write / WBin | write (or none)
forward | forward (mandatory)

Most of the other commands don't need any address.

COMPress [on | off | 1 | 0]
Switch the link compression on or off. The arguments 1 and 0 have the same meaning as on or off but the remote station is not synchronized.

Connect [port:]call [digi [digi...]]
Initiate a connection to the specified station.

Disconnect
Disconnect the channel.

Echo <text>
Print (send) the specified text.

FLUSH
Flush an output buffer (for example in scripts before disconnect or before requesting input).

SYstem
End of LinPac, cancel all connections.

UNproto <text>
Send specified text in a UI frame.

VERsion
Print version information.

b) Commands for variable handling

SET <variable> <value>
Assign a value to the variable. If the variable doesn't exist, it is created.

UNSET <variable>
Remove the variable.

GET <variable>
Return the value of the variable. Usually is better to use macro %variable (see file macros.txt)

EXISTs <variable>
Return 1 when variable exists, 0 when it doesn't exist.

c) information commands

ENVINFO
Display information about the variable environment.

ISCONnected
Return "1" when the channel is connected, "0" otherwise.

MAXCHannels
Return the number of LinPac channels (typically 8).

PCALL
Return the physical callsign of the connected station (first station connected)

UTCTime
Return current UTC time (operating system value).

d) setup commands

CBell [on|off]
When on, LinPac gives an audio signal when any station connects or disconnects.

FIXPath [on|off]
When FIXPath=ON then the paths to files mentioned in the parameters are ignored for external commands marked with a P flag. That means only the default paths are usable.

INFOLEvel [0 | 1 | 2]
Set the mode of information line:
0 - off (no connection info)
1 - show importatnt informations
2 - show all available informations

KNax [on|off]
Enable/disable sound signal when data is received.

Language [language]
Sets the language used. Currently supported in scripts only.

LIsten [on|off]
When listen is off, all connect requests are ignored by LinPac. Default value is on.

MBIN [on|off]
When switched on, the monitor shows binary data. When switched off, the binary data is hidden and replaced with the <Binary data> information.

MONitor [on|off]
Enable/disable monitor function. This command is usually followed by STATLINE and CHNLINE commands to adjust the screen layout.

MONPort <port_specification>
Monitor the specified port(s) only. Port specification is either a port name (as defined in /etc/ax25/axports) or * for monitoring all the ports.

MYcall <call>
Change the channel callsign.

Port <port_name>
Set the default port for the Connect command. This is usually the first port defined in the /etc/ax25/axports file but can be overriden here. This can be overriden for particular channels by setting the `CHN_PORT` variable for the channel (see chapter 3.3).

PRIVate [on|off]
Mark the channel as private. No stations are allowed to connect on this channel.

RCMD [<command list>]
Specify the list of available external commands. Only commands from this list are available to a remote user. It's possible to include abbreviated commands. The remote commands can be executed only on a channel which provides a connection. Adding the @ character just after the command name in the list (e.g. GET@) means that the remote user is allowed to specify the channel on which the command should be executed (e.g. //GET@5 NAME).

REMote [on|off]
Enable or disable remote commands.

RXFlow [on|off]
Enable or disable data RX. The data is received only when RXFlow is enabled on all channels.

TIMEZone [zone]
Set the time zone. Used for information only, doesn't affect time.

UNDest [call]
The destination address for UI / unconnected frames. You can use up to a maximum of seven digipeaters by by including the remote digis in a space delinated list. Here is an example where you MUST include the double quotes to complete the proper syntax:
undest "DAVID KLPRC3 KBETH KBANN KBULN"

UNPort <port_name>
Set the default port for the UI frames / unproto traffic command or F10 unproto traffic area. This is usually the first port defined in the /etc/ax25/axports file but can be overriden here. This can be overriden for particular channels by setting the unport variable for the channel.

UNSrc [call]
The source callsign for UI frames.

WAtch <port | 0> <pattern> <command/text>
Start to watch the specified port (0 for all ports). When the specified pattern is received then the specified command is executed or text is sent. (Commands must start with a colon.)

e) Screen control commands

STATLINE <n>
Place the status line at the n-th line of the screen.

CHNLINE <n>
Place the channel line at the n-th line of the screen.

SWAPEDit
Replace the editor window with the QSO window and vice versa.

INFOLine <nm> <text>
Change the specified info line text. If the info line doesn't exist, it's created.

REMOVEINFO <nm>
Remove the specified info line.

TRanslate <alias>
Switch I/O character translation (see chapter 3.6). Running this command on channel 0 (unproto channel) switches the translation table in all channels including the unproto channel and the monitor window.

TErm <type>
Set the terminal type. If 'ansi' is entered then ANSI-color control sequences are interpreted.

SCRLimit <low-limit> <high-limit>
When the size of the window buffer exceeds the high limit, then the size of the buffer is truncated to low-limit. The values are in bytes; default is 356352 and 524288 (384 and 512 kB).

DEFColor <color_name> <foreground_color> <background_color>
Change the color of some part of screen. The color_name parameter specifies which part of screen to change. The following values can be used:
QSO_RX - received text in QSO window
QSO_TX - sent text in QSO window
QSO_INFO - local information in QSO window
QSO_CTRL - control characters in QSO window
ED_TEXT - normal text in editor
ED_INFO - command results in editor
ED_CTRL - control characters in editor
CI_NORM - channel info line - channel numbers
CI_SLCT - selected channel
CI_NCHN - normal channel
CI_PRVT - private channel
IL_TEXT - status lines

For specifying foreground and background colors, these values can be used:
BLACK, RED, GREEN, BROWN, BLUE, MAGENTA, CYAN, LIGHTGRAY
These additional colors can be used for foreground only:
DARKGRAY, LIGHTRED, LIGHTGREEN, YELLOW, LIGHTBLUE, LIGHTMAGENTA, LIGHTCYAN, WHITE

f) system commands

RESULT <text>
Return the text as the result of a script.

g) string commands

STRMid <start> <length> <string>
Return the substring starting at <start> position and <length> characters long.

STRLeft <length> <string>
Return the left substring of specified length.

STRRight <length> <string>
Return the right substring of specified length.

STRLen <string>
Return the length of the string.

STRPos <substring> <string>
Return the position of the substring in the string or -1 when the string doesn't contain the substring.

UPCASE <string>
Return the string converted into upper case.

### External commands

Bell
Call the operator using an acoustic signal.

Compose [p|b] <address> [<subject>] [<filename>] Create either a Private message or a Bulletin packet message for the specified callsign or fully formatted packet BBS address. When no subject is specified, the user is prompted for the subject. When filename is specified, the message is created from the file, otherwise the text is read from the LinPac console.

CATCH -iol <pattern> <command/text>
Catch is the extended version of WAtch command. It scans one or more data streams (-i = input stream, -o = output stream, -l = local info stream) for the configured pattern. The pattern can contain * and ? wildcards. The command can contain string `$1` .. `$n` which are replaced with the string corresponding to the n-th wildcard in the pattern. The `$0` string is replaced with the whole string that matches the pattern. See `catch -h` for extended parameters.

DELMSG <message_number>
Mark the packet message for deletion

FORWARD
Transmit all new packet messages to a BBS

GETMsg <numers>
Fetch packet messages from the configured BBS

JOIN <channel_number>
This is a form of a group chat feature where you can join the specified Linpac channel to current Linpac channel. All data received on any of these channels is automatically redirected to the other channel. Stop with :ABort join.

MAIL
Simple full-screen packet message client

MHeard
List of heard stations.

Name
Store station name or change a station database entry. (see Name -h)

PACK
Delete all packet messages marked for deletion

Read <filename>
Send the specified text file (see Wbin / Rbin commands for BINARY files)

RPRg <filename>
Transmit the specified file using Autobin protocol

RTt
Measure the round trip time to the other connected Linpac station. Think of this as a "ping" time but results can be highly variable due to on-frequency packet collisions, poor packet decodes, RF propogation, etc.

SENDFile [p|b] <file> <address> [<num_messages>]
This command takes a binary file, splits the file into num_messages parts using 7plus and creates a separate packet message for each part. When num_messages is not specified, the command tries to use
the variable `BLOCK7P@0` which should contain the maximum size of one block. If this variable is not set, blocks of 5 KB are created.

WBin / RBin
The same as Read / Write file transfers but to be used with BINARY files. (See Read / Write commands for TEXT files)

Write <filename>
Start to write received TEXT to the file. (see Wbin / Rbin commands for BINARY files)

YPUT <filename>
Transmit the file using the YAPP protocol.

### Macros

Activity
Show the time since the last operator activity. This is also posted when users first log into the Linpac system

Conv
Enter the conference.

Info
Print local station information.

Help
Print brief help information.

PW [<command> [<system> [<password>] ] ]
Start the authorization to the BBS or the node. See chapter 8.2.2 .

Quit
Send the quit text and disconnect.

Users / CStatus
Print list of connected users.

### Commands for creating scripts

MACRO [name]
Start of the command script definition (see below).

LABEL <label_name>
Create a label with specified name. In the command scripts the notation :<label_name> can be used.

GOTO <label_name>
Jump to specified label.

IF ~ ELSE ~ ENDIF
Conditional commands. There are two ways to specify a condition:

- normal notation (for more than one command)

IF <condition>
.
.
(commands to be done when the condition is true)
.
.
ELSE
.
.
(commands to be done when the condition is false)
.
.
ENDIF

The ELSE part is not necessary - the IF ~ ENDIF notation is possible.

abbreviated notation (for one conditional command)

IF (<condition>) command

The parentheses are necessary in this case.

RETURN [<data>]
Abort the macro execution and return the data as a result.

SLEEP <seconds>
Pause the macro for specified time in seconds.

WAITFOR <condition>
Pause the macro until the condition is true.

##

## Appendix B - Linpac FAQ / Questions and Answers / Getting more help

1. Q: X doesn't work right in Linpact. Why?
   A: Have you looked in the errors.txt file found in the main LinPac directory? It can provide a lot of clues.

2. Q: When I start Linpac, I get "Segmentation fault". What is the fix?
   A: You are probably running an old version of Linpac. Please try the newest release version available at https://sourceforge.net/projects/linpac/ or possibly the newest DEVELOP branch. This will most likely require you to compile Linpac to get it running

3. Q: When I start Linpac, all of the text in the AX.25 monitor is indented to the right. How do I fix this?
   A: Exit Linpac, go into the directory where Linpac is installed, and delete the file:

   `monitor.screen`

   Now restart Linpac. Did that solve your issue? No? Also try deleting the files `window*.screen` and restart Linpac

4. Q: My question isn't addressed in this document, where else can I get help?
   A: Consider reviewing these other URLS:
   - Review Linpac's known bugs and enhancement requests
   - KI6ZHD's HamPacket documentation
   - KI6ZHD's Raspberry Pi documentation
   - Linpac's SourceForge Discussion area
   - Submit a bug / enhancement request via Linpac's SourceForge ticketing system

##

## Appendix c - Errata

03/30/2020 - dranch

- Expanded packet mail section on how to configure message system for PBBS and FBB remote systems
- Added a FAQ section and added this errata section
- Improved formatting and added this errata section

04/01/2019 - dranch

- Minor improvements

Last update: March 30 2020
Please report any errors to linpac@trinnet.net