BPQ Simple applications
The heading is to say that the BBS is not a simple application but rather complex ;-).
In the chapter on the switch above we have seen that applications are intimately related to callsigns. Since most radio amateurs use a single callsign for their station packet radio SSIDs are used to distinguish application callsigns. For an NTSD MBO you will probably use the main callsign for MBO access. For the choice of SSIDs adhere to the local standards on how to assign them, e.g.
Above we have already learned that you can have at most eight applications in BPW which are defined in the config file with the APPLICATION keyword:
numerical id of the application from 1 to 32; some ids are reserved (2 = chat, 32 = sysop chat)
the name of the application; this will be available as an NCI command e.g. "BBS"
used if the application is a single command at the switch typically a connect to another packet radio node
|call, alias, L2alias|| application callsign(s)
An incoming connection to one of these callsigns will automatically invoke the application. L2Alias is available from KISS ports only (???).
|quality||routing quality used for connections with this application|
Furthermore we have seen that the most simple application is the builtin sysop bell which has the fixed id 32:
Applications through switch commands
A command at the switch can be wrapped into an application and there are two use cases for this:
- connect to a remote site with a multi-connection port typically by packet radio
- initiate an outbound TCP connection.
You may use the last option for example to integrate with a local FBB system by using an FBBPORT.
For outbound connections on multi-connection simply place the connect string at the switchCMD position. Here is an example:
APPLICATION 3,DX,C 2 DB0SDX DB0BOS DB0AAI,DB0NTS-4,,0
This defines an application which can be either invoked at the switch with the newly defined "DX" command or by connecting to DB0NTS-4. When the application is invoked the command "C 2 ..." is executed and the user will be connected to the DB0SDX DX cluster via the route DB0BOS DB0AAI. Since callsigns are preserved across the switch (see the section on callsigns in the chapter on the switch above) the DX cluster will see the user's callsign as the source callsign of the connection.
With the PORTCALL or the USEAPPLCALLSFORPACTOR mechanism you can use this type of application to make packet radio services offered by other stations accessible on HF.
For outbound TCP connections the ATTACH command is used. See the section on the Telnet Server port above for details. You can use this for local integration of other TCP capable BBS software e.g. FBB or to connect two instances of BPQ with each other.
If you want to write your own applications the easiest way may be to use the CMDPORT feature which was inspired by the Unix inetd daemon.
You need to encapsulate your application in a TCP server and when BPQ invokes the application it will connect to the server and send the user's callsign on a single line. All following communication between the user and the application will simply be proxied by BPQ. BPQ will also convert CRLF sequences sent by the server into CRs sent to the user.
This is supported for TCP servers on the local host only but you can easily byüass this restriction by using generic TCP proxies (e.g. "netsh interface portproxy add v4tov4" on Windows). The list of TCP server ports is defined with the CMDPORT keyword in the BPQ telnet server port configuration:
PORT ID=name PORTNUM=p DRIVER=TELNET CONFIG ... ... ... CMDPORT <TCP port 1> [<TCP port 2> ... <TCP port n>] ... ... ... ENDPORT
The definition of the application uses the switch command syntax where the switch command is
C p HOST <idx>
where p is the BPQ PORTNUM of the telnet server port and <idx> is the index of the TCP server port list in the CMDPORT statement counted from 0.
Here is an example for a TCP server running on local TCP port 63000 (the lines are just for illustration and not part of the configuration):
APPLICATION 3,ECHO,C 2 HOST 0 ... ... | | ... ... | | PORT | | ID=Telnet | | PORTNUM=2 ---------+ | DRIVER=TELNET | | CONFIG | CMDPORT 63000 ----------+ ... ... ENDPORT
TODO (Peter) I remember to have somewhere seen an option "K" in the connect string which is used for TCP keepalives.