emailler/client/basic/KB.htm

183 lines
8.4 KiB
HTML

<h1>KIPPER BASIC <h1>
<h2>COMMAND SUMMARY</h2>
<table border=1>
<tr>
<th>Command</th>
<th>Descrption</th>
<th>Parameters</th>
<th>Example</th>
</tr>
<tr>
<td>IPCFG</td>
<td>Display the current IP stack configuration</td>
<td>none</td>
<td><li>IPCFG</td>
</tr>
<tr>
<td>MAC</td>
<td>Set the last 3 bytes of the MAC address. Top 3 bytes will always be "00:80:10".<br> This command
also resets the whole IP stack, so new IP address will need to be assigned (via MYIP or DHCP) after calling MAC</td>
<td>3 byte string</td>
<td><li>MAC "FOO" - MAC will become 00:80:10:46:4F:4F (in PETSCII, $46 is 'F' and $4F is 'O') </td>
</tr>
<tr>
<td>DHCP</td>
<td>Use DHCP to assign IP address, netmask, default gateway and DNS server </td>
<td>none</td>
<td><li>DHCP</td>
</tr>
<tr>
<td>MYIP</td>
<td>Assign a new IP address</td>
<td><li>IP address (string)</td>
<td><li>MYIP"10.1.1.2"</td>
</tr>
<tr>
<td>NETMASK</td>
<td>Assign a new netmask</td>
<td><li>netmask (string)</td>
<td><li>NETMASK"255.255.255.0"</td>
</tr>
<tr>
<td>GATEWAY</td>
<td>Assign a new default gateway (router to send non-local traffic to)</td>
<td><li>gateway IP address (string)</td>
<td><li>GATEWAY"10.1.1.1"</td>
</tr>
<tr>
<td>DNS</td>
<td>Specify the DNS server to be used for resolving hostnames</td>
<td><li>DNS server IP address (string)</td>
<td><li>DNS"10.1.1.1"</td>
</tr>
<tr>
<td>TFTP</td>
<td>Specify the TFTP server that will be accessed by TFPUT and TFGET.</td>
<td><li>TFTP server IP address or hostname (string)</td>
<td><li>TFTP"10.1.1.5"<li>TFTP"JAMTRONIX.COM"</td>
</tr>
<tr>
<td>PING</td>
<td>Sends a number of ICMP echo requests to the specified host. For each packet sent, if a response is received a "." is displayed, if an error occurs (including a timeout) then a "!" is displayed.</td>
<td><li>hostname&nbsp;or&nbsp;IP&nbsp;ddress&nbsp;(string)<li>[optional] number of PING request to be sent (1..255) - default is 3</td>
<td><li>PING"JAMTRONIX.COM"<li>PING"10.1.1.1",10</td>
</tr>
<tr>
<td>NETCAT</td>
<td>Open a TCP connection to a remote server. Any data received on the connection will be displayed on screen, any keypress will be sent to the remote server. To exit, hit RUN/STOP. <br><br>The optional mode paramater determines whether the connection should be in PETSCII 'char at a time' mode, where every keypress is sent 'as is' to the remote site, or ASCII 'line mode', which allows a line to be edited and is sent (with a CR/LF at the end) only when the RETURN key is pressed. In this mode, data is converted between the PETSCII character set and standard ASCII - you will need to shift to the "lower case" char set for this to display properly.
<br><br> The PETSCII mode is appropriate for connecting to e.g. a PETSCII BBS. The ASCII mode is appropriate for connecting to a server running a "network ASCII" derived protocol, e.g. SMTP or HTTP.
'
</td>
<td><li>hostname&nbsp;or&nbsp;IP&nbsp;ddress&nbsp;(string)<li>port&nbsp;number&nbsp;(1..65535)<li>[optional] mode: <ul><li>0=PETSCII (default)<li>1=ASCII</ul></td>
<td><li>NETCAT"JAMTRONIX.COM",6464<li>NETCAT"10.1.1.1",25,1</td>
</tr>
<tr>
<td>TFPUT</td>
<td>Upload a file to a TFTP server. By default, TFPUT will use the broadcast address (255.255.255.255), meaning
any TFTP server on the LAN will respond. To send a file to a specific TFTP server (including one not on the local network), specify the
destination TFTP server with the "TFTP" command prior to calling TFPUT. The filename specified will be looked for on whichever drive was last accessed.</td>
<td><li>filename (string)</td>
<td><li>TFPUT"KIPPERBAS.PRG"</td>
</tr>
<tr>
<td>TFGET</td>
<td>Download a file from a TFTP server. By default, TFPUT will use the broadcast address (255.255.255.255), meaning
any TFTP server on the LAN will respond. To download a file from a specific TFTP server (including one not on the local network), specify the
destination TFTP server with the "TFTP" command prior to calling TFGET. The file will be written (as a PRG file) to whichever drive was last accessed.</td>
<td><li>filename (string)</td>
<td><li>TFGET"KIPPERBAS.PRG"</td>
</tr>
<tr>
<td>TCPCONNECT</td>
<td>Open a TCP connection to a remote server.</td>
<td><li>hostname&nbsp;or&nbsp;IP&nbsp;address&nbsp;(string)<li>port&nbsp;number&nbsp;(1..65535)</td>
<td><li>TCPCONNECT"JAMTRONIX.COM",70<li>TCPCONNECT"10.1.1.1",80</td>
</tr>
<tr>
<td>TCPLISTEN</td>
<td>Wait for an inbound TCP connection from a remote client. This is a blocking command, i.e. the BASIC program will not continue executing until either an inbound connection is made, or the program is terminated by pressing RUN/STOP</td>
<td><li>port&nbsp;number&nbsp;(1..65535)</td>
<td><li>TCPLISTEN 80</td>
</tr>
<tr>
<td>POLL</td>
<td>Check for network traffic. If data has arrived on a previously opened TCP connection, that data (up to a maximum of 255 bytes) will be set into string variable IN$.If no data has arrived since the last POLL, then IN$ will be an empty string. Integer variables CO% and ER%
are also set to indicate current connection state and error conditions (if any).
</li>
</td>
<td>none</td>
<td>POLL</td>
</tr>
<td>TCPSEND</td>
<td>Send a string (up to 255 bytes) over a previously opened connection.Integer variables CO% and ER% ae aset to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
<td><li>data (string)</td>
<td><li>TCPSEND"HELLO "+"WORLD"</td>
</tr>
<tr>
<td>TCPBLAT</td>
<td>Send a file (of any length) over a previously opened connection. The file will be looked for on the current 'default' device, i.e. which ever drive was last accessed. Integer variables CO% and ER% ae aset to indicate current connection state and any error condition which may occur during the sending of the file. <i>NB - in the current implementation of Kipper BASIC, it is possible for data to arrive during a call to TCPSEND, which may not be passed through to the BASIC program.</i></td>
<td><li>filename (string)</td>
<td><li>TCPBLAT"GOPHERMAP.TXT"</td>
</tr>
</table>
<h2>Magic Variables</h2>
The following BASIC variables are set by the TCP commands and POLL.
<h3>CO%</h3>
<li>CO%=1 means there is a current TCP connection</li>
<li>CO%=0 means there is no current TCP connection (either one has never been opened, or else it has been closed)
<h3>ER%</h3>
ER% is set to indicate any error occuring inside the <a href=http://ip65.sourceforge.net/>ip65 TCP/IP stack</a> that Kipper BASIC is built on top of.
Possible values:
<table><tr><th>ERROR CODE<br>HEX / DEC</th><th>DESCRIPTION</th></tr>
<tr><td>$80 / 128</td><td>PORT IN USE</td></tr>
<tr><td>$81 / 129</td><td>TIMEOUT ON RECEIVE</td></tr>
<tr><td>$82 / 130</td><td>TRANSMIT FAILED</td></tr>
<tr><td>$83 / 131</td><td>TRANSMISSION REJECTED BY PEER</td></tr>
<tr><td>$84 / 132</td><td>INPUT TOO LARGE</td></tr>
<tr><td>$85 / 133</td><td>DEVICE FAILURE</td></tr>
<tr><td>$86 / 134</td><td>ABORTED BY USER</td></tr>
<tr><td>$87 / 135</td><td>LISTENER NOT AVAILABLE</td></tr>
<tr><td>$88 / 136</td><td>NO SUCH LISTENER</td></tr>
<tr><td>$89 / 137</td><td>CONNECTION RESET BY PEER</td></tr>
<tr><td>$8A / 138</td><td>CONNECTION CLOSED</td></tr>
<tr><td>$8B / 139</td><td>TOO MANY ERRORS</td></tr>
<tr><td>$90 / 140</td><td>FILE ACCESS FAILURE</td></tr>
<tr><td>$A0 / 160</td><td>MALFORMED URL</td></tr>
<tr><td>$A1 / 161</td><td>DNS LOOKUP FAILED</td></tr>
<tr><td>$FE / 254</td><td>OPTION NOT SUPPORTED</td></tr>
<tr><td>$FF / 255</td><td>FUNCTION NOT SUPPORTED</td></tr>
</table>
<h2>STARTUP</h2>
If you try and load Kipper BASIC twice (or some other BASIC extender before Kipper BASIC) you will get an 'insufficient memory' error.
<br>
<br>
After Kipper BASIC has been installed, it will attempt to load (and run) a file (from whatever device Kipper BASIC was loaded from) called "AUTOEXEC.BAS".
If this file does not exist, then Kipper BASIC will exit with 'FILE NOT FOUND ERROR IN 10". This error can be ignored - you can load any file you want from then, or type
in a new one, or even use the commands in interactive mode.
<br>
<br>
For example, try:
<pre>
DHCP:NETCAT"JAMTRONIX.COM",6464
</pre>