.\" $Id: jerm.1,v 1.3 2005/06/07 01:27:24 candy Exp $ .\" Written by Kogule, Ryo .\" .Dd Jul 16, 2004 .Dt JERM 1 .Os .Sh NAME .Nm jerm .Nd communication terminal through serial and TCP/IP interfaces .Sh SYNOPSIS .Nm .Op Fl Ar common_options .Op Fl Ar device_options .Op Fl Ar client_options .Ar device_file .Nm .Op Fl 46 .Op Fl P Ar port .Op Fl Ar common_options .Op Fl Ar client_options .Ar host_name .Nm .Fl i .Op Fl 46 .Op Fl P Ar port .Op Fl Ar common_options .Op Fl Ar device_options .Op Fl Ar client_options .Ar host_name < .Ar device_file > .Ar device_file .Nm .Fl D .Op Fl 46T .Op Fl P Ar port .Op Fl Ar common_options .Ar device_file .Sh DESCRIPTION .Nm is primarily intended to communicate with a remote machine through a serial interface. Additionally .Nm can communicate with another through a TCP/IP connection like .Xr telnet 1 and relay a serial communication to a TCP/IP connection to another remote machine. .Pp To connect a remote machine through a serial interface, use the first form. .Ar device_file should be a special device file of a serial interface (typically .Pa /dev/cu* Ns ).\ \& The second form lets .Nm connect to the remote machine .Ar host_name through the TCP .Ar port Ns . In the case of invoking .Nm with the third or the fourth form, it relays the communications between a serial and a TCP/IP ports. The former relays the specific machine .Ar host_name and the serial .Ar device_file Ns , while the latter lets .Nm work as a daemon; it listens to the TCP .Ar port first. After a connection on the port is established, then .Nm opens the device .Ar device_file and relay the communications between the TCP port and the device. See .Sx EXAMPLES for more information. .Pp The following options are available: .Ss Common options .Bl -tag -width indent .It Fl z Empty the log file at first. .It Fl l Ar log_file Write output characters to .Ar log_file Ns . Since .Nm always appends characters to .Ar log_file Ns , use .Fl z in conjunction with this flag to log a single session. .El .Ss Device options .Bl -tag -width indent .It Fl b Ar speed Designate the speed of serial interface. The default is 9600. .It Fl p Ar n Ns Bo one Bc Ns |e Ns Bo ven Bc Ns |o Ns Bo dd Bc Designate the parity of serial interface. The valid value is one of .Ql none Ns , .Ql even or .Ql odd Ns . The first character is suffice. The default is .Ql none Ns . .It Fl d Ar 7|8 Designate the bit length of data. The default is .Ql 8 Ns . .It Fl s Ar 1|1.5|2 Designate the stop bit. The default is .Ql 1 Ns . .It Fl f Ar n Ns Bo one Bc Ns |x|h Ns Bo ard Bc Designate the flow control. The default is .Ql none Ns . .El .Ss Client options .Bl -tag -width flag .It Fl x Starts in hexadecimal dump mode. .It Fl r Ar rnRN Set CR NL mapping method. Option argument .Ar rnRN consists of four charactears. Each character may be the one of the followings: .Dl `x' Map to nothing. (drop) .Dl `r' Map to CR. .Dl `n' Map to NL. .Dl `t' Map to CR+NL. The argument .Ar r specifies how to map a CR from remote to local, .Ar n specifies how to map a NL from remote to local, .Ar R specifies how to map a CR from local to remote, and .Ar N specifies how to map a NL from local to remote. The default is .Ql rnrn Ns . .El .Ss Other options .Bl -tag -width flag .It Fl i Pipe mode. Initialize the standard input/output as a serial interface. .It Fl 4 Use IPv4 for TCP/IP connection. .It Fl 6 Use IPv6 for TCP/IP connection. .It Fl P Ar port Designate TCP port for TCP/IP connection. The default port is .Ql 8086 Ns . .It Fl T Use hosts_access(3) when accepting connection. .El .Ss Escape Characters Typed characters are normally transmitted directly to the remote machine (which does the echoing as well). A tilde preceded by a Control-M or Enter .Pq Ql ^M\ \&~ is an escape signal; the following are recognized: .Bl -tag -width flag .It Ic ^M\ \&~\ \&. Drop the connection and exit (you may still be logged in on the remote machine). When .Nm is invoked as a relaying server .Pq with Fl D Ns , Control-C .Pq Ql ^C will terminate .Nm . If in the pipe mode .Po .Fl i is specified .Pc Ns , .Nm does not terminate. Send a hang up signal .Pq typically Ic kill -HUP instead. .It Ic ^M\ \&~\ \&~ Send a tilde .Pq Ql \&~ to the remote machine. .It Ic ^M\ \&~\ # Send a .Dv BREAK signal to the remote machine. .It Xo .Ic ^M\ \&~\ > .Pa file .Xc Send the local file .Pa file to the remote machine as its input. .It Ic ^M\ \&~\ x Toggle back and forth between the normal and the hexadecimal dump mode. The hexadecimal dump mode displays received characters in hexadecimal. .It Xo .Ic ^M\ \&~\ r .Pa rnRN .Xc Set CR NL mapping method in the same manner as the .Fl r option. .It Ic ^M\ \&~\ ? Get a summary of the .Ql ^M \&~ escapes. .El .Sh EXAMPLES The command: .Dl jerm /dev/cuaa0 Pq Fx .Dl jerm /dev/dty00 Pq Nx .Dl jerm /dev/cua00 Pq Ox .Dl jerm /dev/cu.usbmodemUSB-COM Pq Darwin/Mac OS X connects a remote host through a serial interface. The actual device file may vary. .Pp When .Fx HOST1 connects to the remote machine RMACH through a serial interface, The command: .Dl jerm -D -P 9800 -b 4800 /dev/cuaa0 on HOST1 will relay RMACH to TCP port 9800. Then the command: .Dl jerm -P 9800 HOST1 on .Nx HOST2 can communicate with RMACH. Instead of the above command, execute the command: .Dl jerm -i -P 9800 HOST1 -b 4800 < /dev/dty00 > /dev/dty00 on the HOST2 and connect HOST2's serial interface with Darwin HOST3, then the command: .Dl jerm /dev/cu.usbmodemUSB-COM on HOST3 connects RMACH through HOST1 and HOST2. .Sh SEE ALSO .Xr cu 1 , .Xr tip 1 , .Xr telnet 1 .Sh AUTHOR .An "KANDA Toshihiro" .Sh BUGS Although .Nm with TCP/IP connection is analogous to .Xr telnet 1 , .Nm does not support telnet protocol.