📄 protocol
字号:
[This document should not be considered a complete description
of the protocol, as it is still under development.]
The RTERM protocol is very simple.
The data stream consists of data and commands. Immediately after
opening a connection to an RTERM server, all data is ignored until
an <open ...> command successfully associates this connection with
a serial port. As long as the connection is associated with a port,
all data received from the connection is transferred to the port and
all data received from the serial port is sent back over the network.
Commands are enclosed in '<' and '>'. If you need to transmit
a '<' as data, send it as '<<'. Arguments to commands are separated
by whitespace and are send before the closing '>'.
Commands are not case sensitive. There is no mechanism for quoting
arguments, so arguments cannot contain whitespace or '>' characters.
The response to a command is also enclosed in '<' and '>'. The
first character of the response is either '+' to indicate success
or '-' to indicate an error.
The following commands are defined:
<open arg>
Requests that this connection be associated with serial port 'arg'.
In portserver's implementation, 'arg' must the name of a port
defined in the configuration file. Other implementations are free
to interpret 'arg' in other ways, such as a Unix-style device name
(e.g. "/dev/tty1").
<close>
Disconnect from the serial port. It is an error to use this
command if not currently associated with a port.
<disc>
Disconnect from a serial port, if connected, and close the network
connection. Closing the TCP connection on the client side has the
same effect as this command.
<echo arg1 ... argN>
The arguments are echoed back as the response. Used for testing.
<speed baud-rate>
Set the baud rate of the serial port to the rate specified.
<connections>
List the currently active connections. The response to this
command will look like:
<+OK user,portname,device,description
*,kenn@localhost,none,none,none
-,user@somehost,Modem,/dev/cua1,External 33.6K Modem
>
The first line is explanatory. Each subsequent line will have
five comma-separated fields:
Current: '*' if this is the connection that is executing the
<connections> command. '-' otherwise.
User@host: the user and originating host as determined by
tcpwrappers
Port: the name of the port being used by this connection
or 'none' if this connection is not using any port
Device: the name of the physical device being used
or 'none' if this connection is not using any port
Description: the description of the port as supplied in the
config file or 'none' if this connection is not
using any port
<ports>
List all ports currently available. The response to this
command will look like:
<+OK user,portname,device,description
-,none,com1,/dev/cua0,Local serial port 1
-,user@somehost,Modem,/dev/cua1,External 33.6K Modem
*,kenn@localhost,com3,/dev/cua2,Local serial port 3
>
The first line is explanatory. Each subsequent line will have
five comma-separated fields:
Current: '*' if this port is in use by the connection that
is executing the <ports> command. '-' otherwise.
User@host: the user and originating host as determined by
tcpwrappers, or 'none' if this port is not in use
Port: the name of the port
Device: the name of the physical device
Description: the description of the port as supplied in the
config file
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -