This is a list of undocumented features we have discovered -- Livingston 
Portmaster Commands to help you effectivly use your portmaster series 
machines to the fullest extent!

The original author of the bpmtools package is Brian Pollack.
The current maintainer of these tools is Gary E. Miller <gem@rellim.com>.
-----------------------------------------------------------------------------

				PREFACE

   Most of the commands listed in here come from one of two places, the
   portmaster-users mailing list, or the hard work of a system admin 
   struggling to make the portmaster all that it can and should be. A 
   large set of the commands listed here don't work from the portmaster
   protocal mode, they only work if you telnet into the portmaster. I
   do not recommend reading any further unless you are familiar with the
   portmaster and have a portmaster to "experiment" on.


				INTRODUCTION

   If you are still reading this, you are probably already familiar with
   the command "set console" to get into console mode on your port master.
   Well, that is about all you will need to know to continue.


				FROM THE LIST

   Here are two commands that have been documented by Carl from Livingston
   on the Portmaster-users mailing list. Both of these were suggestions to
   Livingston from Internet Direct, Inc. based on software we have written
   previously to do exactly the same thing. However, until the
   portmaster protocol became "available" to us, we had to use scripts that
   telnetted in to accomplish this, and it was slower than the new command
   set being created by Livingston directly.

				MODEM TABLE

Date: Thu, 22 Jun 1995 15:16:43 -0700
From: Carl Rigney <cdr@livingston.com>
Message-Id: <199506222216.PAA07004@server.livingston.com>
Subject: The Modem Table

ComOS 3.1.2 includes an undocumented modem table which you can add entries
to; you can then set the modem type for a port and the PortMaster will
configure the modem for you.  IMPORTANT!  It expects the modem to be in
factory default when it attempts to initialize it.

If the port has never been configured before either, then when you set
the modem type for the port and reset the port, the PortMaster will set
the port for hardware flow control (RTS/CTS), set the speed properly,
and turn modem control on.

Command> add modem usr-v34 "USRobotics V.34" 57600 "AT&F1S0=1&W^OK"
New script entry successfully added.
Modem usr-v34 successfully added.
Command> show table modem
Short Name       Long Name                                          Type
---------------- -------------------------------------------------- ------
usr-v34          USRobotics V.34                                    User
Command> show modem usr-v34
   Short Name: usr-v34
    Long Name: USRobotics V.34
Optimal Speed: 57600
         Type: User Defined

  Init Script:  Send Command                    Wait for Reply
                ------------------------------  -----------------------------
                AT&F1S0=1&W                     OK

Command> set s1 modem usr-v34
Modem type for port S1 changed from  to usr-v34
Command> reset s1
Resetting port S1

Modems that you add go into the User Modem Table.  In a future release
of ComOS we intend to pre-load a System Modem Table with configuration
strings for various popular brands of modems, so that configuring ports
and modems will become as simple as:

set all login network dialin
set all security on
set all modem usr-v34
reset all 
save all

We'll also put that table on our Web server and our FTP site eventually.


				ATTACH

We've added a command "attach" in 3.1.2 to make it easier to configure
modems by hand.

% telnet pm1
Trying 149.198.247.200
Connected to pm1.
Escape character is '^]'.

ComOS - Livingston PortMaster

login: !root
Password: 
pm1> attach s5
Trying 149.198.247.200 ...
Connected - Escape character is '^]'.
AT
OK
^]			(the escape character doesn't actually echo)
telnet> send escape
Connection Closed
 
pm1>  quit
Goodbye...
Connection closed by foreign host.
%

If you're on the console then the escape character will return you
to the console command prompt and you don't need the "send escape" part.


			     NOT FROM THE LIST

    Here are the commands and useful tools that I have been using with the
    portmaster, but have not yet seen described in officialese by the good
    technical folks at Livingston.

				 Debug Values
				 ------------

 Some of the most important commands in the Livingston ComOS software have
 to do with the output of debug commands.  First, telnet into the terminal
 server and type "set console" to get into console mode. Then, to set a
 debug value type "set debug <value>". The portmasters accept either
 decimal or hex values for debug mode. Following is a list of a few of my
 favorite debug values and what they appear to accomplish.

 value = 0x2b
 This value will show you when the portmaster tries to connect for
 certain services. The portmaster will periodically check to see if the
 "default host" is alive, or when the portmaster has to close a file 
 descriptor. This value will show you those internal calls displayed directly
 to the screen.

 value = 0x54
 This is one of the more useful debug values. When you then do a 'show' on a
 port, you will get some very valuable information for debugging ports. For
 example, here is a port on our terminal server:

 Modem: 0xb9   Line: 0x0   Flow: 0x24
 Last 60 Recvd: \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
  Last 60 Sent: rs log in as 'guest'\r\n\r\n(phx-ts5 port 2) indirect.com login:
  uptr = 0x65a50 iptr = 0x65a50 pop = 0 push = 0
  fifo = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

  This is mostly useful to check to see if a modem is responding to rts/cts,
  and to find out what is *really* going on when you dial in and get 
  "garbage" (as if the dte speed was set wrong, sighhhhh).

 value = 0x73
 This is a good value to see if your terminal server is seeing other people
 on the net, or to test any new hosts on your network. This will show
 you every time the portmaster hears an arp request and who it is for and
 who it is from. 

				 Other Commands
				 --------------

 There are a few commands on the terminal server that don't appear to do
 much at all and a few that appear to do some useful things. 

 The only really useful command that is not documented at all elsewhere,
 to the best of my knowledge, is "tftp".

 brian-test-1> tftp
 Usage: tftp get|put [nostop|config|comos] host filename

 - Here is how you can download the Com/OS files from the portmaster to 
 - your computer. The first command is needed by most secure tftp 
 - implementations.
 bash$ touch /tmp/comos; chmod 777 /tmp/comos  
 brian-test-1> tftp put comos 165.247.1.5 /tmp/comos

 - Now you can generate the Portmaster code from the file on your 
 - unix host. The portmaster just uploaded a file with two separate
 - files contained within it. They are very close to being in a uuencoded
 - format for unix.

 bash$ dos2bsd comos comos.uu
 bash$ cat comos.uu | sed 's/file pm/begin 755 pm/' | uudecode
 bash$ cat comos.uu | sed 's/file msg/begin 755 msg/' | uudecode
 bash$ ls 
 comos.uu        msgOS           pm2OS

 - The pm20S file is a binary file that can be sent to another portmaster
 - via pminstall. The msgOS file contains all of the portmaster messages
 - that are printed. Most of the messages are in printf style formatting, 
 - so if you know what the output looks like in the portmaster, you know
 - what values will replace each %s or %d in the file.

Well, that's it for right now. As we discover more, we will make them 
available in subsequent "Secrets" files, although we hope most of the 
great features available will be implemented officially and directly by 
Livingston.

If you know of a secret, or just want to fill us in on mistakes or 
questions with the above information, please e-mail gem@rellim.com.

Remember, don't try this at home kids. . . Unless you have a spare 
portmaster to play with!
