You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

388 lines
7.3 KiB

  1. .\" -*- nroff -*-
  2. .TH MODEMU2k 1 "June 2020" "Version 0.0.6"
  3. .\"
  4. .\"
  5. .SH NAME
  6. .\"
  7. modemu2k \- dialup TCP connecting
  8. .\"
  9. .\"
  10. .SH SYNOPSIS
  11. .\"
  12. .B modemu2k
  13. [\fB-c \fIcomm_prog\fR] [\fB-d \fIpty_master\fR] [\fB-e \fIatcmds\fR]
  14. [\fB-h\fR] [\fB-s\fR] [\fB-\fR]
  15. .\"
  16. .\"
  17. .SH DESCRIPTION
  18. .\"
  19. .B Modemu2k
  20. is a TELNET client with a modem-like user interface.
  21. It can redirect its I/O via a
  22. .BR pty (4)
  23. so that a comm program can handle the pty as a tty with a real modem.
  24. .PP
  25. .B Modemu2k
  26. has two major modes: a command mode and online mode.
  27. When invoked,
  28. .B modemu2k
  29. is in the command mode, waiting for AT commands input.
  30. Entering a D or O command will put into the online mode, in which \" <===
  31. .B modemu2k
  32. communicate with a remote host.
  33. Connection closing or a escape command input returns to the command mode.
  34. .\"
  35. .\"
  36. .SH OPTIONS
  37. .\" ===== -c =====
  38. .TP
  39. .BI -c " comm_prog"
  40. Invoke a comm program \fIcomm_prog\fP.
  41. .B Modemu2k
  42. invokes it by passing /bin/sh an option `-c \fIcomm_prog\fP'.
  43. Therefore, any
  44. .BR sh (1)
  45. commands can be specified.
  46. The string \fIcomm_prog\fP can include a `%s',
  47. which will be replaced with the
  48. device name of the slave device after removal of the initial "/dev/".
  49. .RS
  50. Example:
  51. .RS
  52. modemu2k -c "xc -l %s"
  53. .RE
  54. .RE
  55. .\" ===== -d =====
  56. .TP
  57. .BI -d " pty_master"
  58. Open a file \fIpty_master\fP and talk through it.
  59. A named pipe can be a
  60. .I pty_master
  61. as well as a pty master device because
  62. .B modemu2k
  63. doesn't ioctl a \fIpty_master\fP.
  64. .\" ===== -e =====
  65. .TP
  66. .BI -e " atcmds"
  67. Execute a series of AT commands \fIatcmds\fP initially.
  68. .I Atcmds
  69. must have an `AT' or `at' prefix.
  70. D and O commands in \fIatcmds\fP are ignored.
  71. .\" ===== -h =====
  72. .TP
  73. .B -h
  74. Print a usage summary.
  75. .\" ===== -s =====
  76. .TP
  77. .B -s
  78. Print the last two letters of a device name.
  79. The device is a pty master device which
  80. .B modemu2k
  81. talks through.
  82. Therefore, when
  83. .B modemu2k
  84. prints `p8',
  85. comm program must open /dev/tty\fIp8\fP.
  86. .\" ==========
  87. .PP
  88. Note: The -c, -d, and -s options are exclusive of each other.
  89. If two or more of the options are specified,
  90. only the last one is effective.
  91. .\"
  92. .\"
  93. .SH COMMAND MODE
  94. .\"
  95. Command mode expects lines in the following format:
  96. .IP ""
  97. [\fIgarbage\fP]\fIat\fP[\fIsp\fP][\fIcmd\fP[\fIsp\fP]]...\fIcr\fP
  98. .PP
  99. where
  100. .I at
  101. is an `AT' or `at',
  102. .I sp
  103. is spaces,
  104. .I cr
  105. is a carriage return character (register S3),
  106. .I garbage
  107. is a string includes no \fIat\fP.
  108. If a `#' prefixes a line, the line is ignored.
  109. Available
  110. .IR cmd s
  111. are listed below.
  112. They are all case in-sensitive except for some literally used arguments.
  113. A (*) marks default settings.
  114. .\" ===== D =====
  115. .TP
  116. .BI D str
  117. Dialing command.
  118. Open a connection to \fIhost\fP.
  119. If \fIport\fP is specified,
  120. .B modemu2k
  121. attempts to connect with the port instead of the default TELNET port,
  122. and
  123. doesn't initiate TELNET option negotiation.
  124. The following formats are available for \fIstr\fP:
  125. .RS
  126. .TP
  127. \fIhost\fP [\fIport\fP]
  128. \fIHost\fP is an Internet address in numbers-and-dots notation.
  129. Optional \fIport\fP is a port number.
  130. .TP
  131. "\fIhost\fP [\fIport\fP]["]
  132. \fIHost\fP is an Internet address or host name.
  133. Optional \fIport\fP is a port number or service name.
  134. The closing double quote can be omitted if no command follows.
  135. .PP
  136. .I Str
  137. can be prefixed with `T', `P', `\fIdigit\fPW' and/or `\fIdigit\fP,'.
  138. The prefixes are simply ignored.
  139. .br
  140. Example:
  141. .RS
  142. ATDT0W127.0.0.1
  143. .br
  144. ATDP"foo.bar.jp daytime
  145. .RE
  146. .RE
  147. .\" ===== E =====
  148. .TP
  149. .B E1
  150. No operation.
  151. .\" ===== F =====
  152. .TP
  153. .B F1
  154. No operation.
  155. .\" ===== H =====
  156. .TP
  157. .BR H [ 0 ]
  158. Close the current TELNET session.
  159. .\" ===== I =====
  160. .TP
  161. .BI I n
  162. Print various information.
  163. .RS
  164. .IP I4
  165. Current settings
  166. .IP I5
  167. `&W'ed settings
  168. .IP I6
  169. TELNET option states
  170. .IP I7
  171. .B Modemu2k
  172. version
  173. .RE
  174. .\" ===== O =====
  175. .TP
  176. .BR O [ 0 ]
  177. Return to online mode.
  178. .\" ===== P =====
  179. .TP
  180. .B P
  181. No operation.
  182. .\" ===== Q =====
  183. .TP
  184. .BR Q [ 0 ]
  185. No operation.
  186. .TP
  187. .B T
  188. No operation.
  189. .\" ===== V =====
  190. .TP
  191. .B V1
  192. No operation.
  193. .\" ===== X =====
  194. .TP
  195. .BR X [ 0 ]
  196. No operation.
  197. .\" ===== Sn=m =====
  198. .TP
  199. .BI S n = m
  200. Set S-register S\fIn\fP to \fIm\fP.
  201. A number from 0-255 is allowed for \fIm\fP.
  202. .\" ===== Sn? =====
  203. .TP
  204. .BI S n ?
  205. Print an S-register S\fIn\fP's value.
  206. .\" ===== Z =====
  207. .TP
  208. .B Z
  209. Close the current TELNET session, and restore `&W'ed settings.
  210. .\" ===== &W =====
  211. .TP
  212. .B &W
  213. Save current settings.
  214. The saved settings will be lost with the end of the process
  215. because they are not stored into NV-RAM nor files.
  216. .\" ===== %B =====
  217. .TP
  218. .BI %B n = m
  219. Control TELNET binary option.
  220. Valid values for \fIn\fP are:
  221. .RS
  222. .RS
  223. .IP 0
  224. Control the local (modemu2k) option
  225. .IP 1
  226. Control the remote (TELNET server) option
  227. .RE
  228. .PP
  229. Valid values for \fIm\fP are:
  230. .RS
  231. .IP 0
  232. Request non-binary transmission mode (*)
  233. .IP 1
  234. Request binary transmission (8bit through) mode
  235. .TP
  236. .I above+2
  237. Disconnect if the request is refused
  238. .RE
  239. .PP
  240. Example:
  241. .RS
  242. .IP AT%B1=1
  243. Requesting binary mode in remote-to-modemu2k direction
  244. .IP AT%B0=3%B1=3
  245. Requesting binary mode
  246. in both remote-to-modemu2k and modemu2k-to-remote direction.
  247. No use connecting in non-binary mode (using file xfer protocol or something)
  248. .RE
  249. .RE
  250. .\" ===== %D =====
  251. .TP
  252. .BI %D n
  253. Control dial-canceling.
  254. .RS
  255. .IP %D0
  256. A keypress cancels dialing (*)
  257. .IP %D1
  258. Keypresses don't cancel dialing
  259. .RE
  260. .\" ===== %L =====
  261. .TP
  262. .BI %L n
  263. Control line-mode.
  264. .RS
  265. .IP %L0
  266. Request character-at-a-time mode (*)
  267. .IP %L1
  268. Request line-at-a-time mode (old line-mode).
  269. Input characters are buffered and not sent until a CR character is entered.
  270. .RE
  271. .\" ===== %Q =====
  272. .TP
  273. .B %Q
  274. Quit
  275. .BR modemu2k .
  276. .\" ===== %R =====
  277. .TP
  278. .BI %R n
  279. Control raw-mode.
  280. .RS
  281. .IP %R0
  282. Normal mode (*)
  283. .IP %R1
  284. Raw mode.
  285. .B Modemu2k
  286. transmits every octet as received.
  287. Applied to both remote-to-modemu2k and modemu2k-to-remote direction.
  288. Override %B and %L settings.
  289. .RE
  290. .\" ===== %T =====
  291. .TP
  292. .BI %T str
  293. Control TELNET terminal-type option.
  294. .RS
  295. .IP %T0
  296. Refuse terminal-type option
  297. .IP %T1
  298. Same as %T="$\fBTERM\fP"
  299. (\fBTERM\fP environment value is used) (*)
  300. .IP %T="\fIterm\fP["]
  301. Send \fIterm\fP as the terminal-type if remote requests.
  302. The closing double quote can be omitted if no command follows.
  303. .RE
  304. .\" ===== %V =====
  305. .TP
  306. .BI %V n
  307. Control verbose level.
  308. %V0 (*) is the quietest, and adding following values to \fIn\fP lets
  309. .B modemu2k
  310. print more information to stderr.
  311. .RS
  312. .IP +1
  313. Print misc info to make up for less descriptive ATX0 indication
  314. .IP +2
  315. Print TELNET option negotiation
  316. .RE
  317. .\"
  318. .\"
  319. .SH ONLINE MODE
  320. .\"
  321. .B Modemu2k
  322. recognizes only the following command when in online mode.
  323. .\" ===== +++ =====
  324. .TP
  325. .IB "wait " +++ " wait"
  326. Escape to command mode.
  327. The `+++' must be input within the guard time.
  328. .I Wait
  329. is a period of time longer than the guard time
  330. without hitting any key.
  331. See also S2 and S12 register descriptions.
  332. .\"
  333. .\"
  334. .SH S REGISTERS
  335. .\"
  336. Only meaningful registers are listed here.
  337. Values in braces are default ones.
  338. .TP
  339. .B S2
  340. Escape character code. (43 = `+')
  341. .TP
  342. .B S3
  343. Carriage return character code.
  344. (13)
  345. .TP
  346. .B S4
  347. Line feed character code.
  348. (10)
  349. .TP
  350. .B S5
  351. Backspace character code.
  352. (8)
  353. .TP
  354. .B S7
  355. Connection attempt time-out (in seconds).
  356. (20)
  357. .TP
  358. .B S12
  359. Escape sequence guard time in 50ths of a second.
  360. (50)
  361. .\"
  362. .\"
  363. .SH ENVIRONMENT VARIABLES
  364. .\"
  365. .TP
  366. .B MODEMU2k
  367. Initially evaluated as AT commands
  368. (before -e option argument is evaluated).
  369. Must have an `AT' or `at' prefix.
  370. .TP
  371. .B TERM
  372. See %T1 command description.
  373. .\"
  374. .\"
  375. .SH MAINTAINER
  376. Andy Alt (andy400-dev@yahoo.com)
  377. .\"
  378. .\"
  379. .SH SEE ALSO
  380. telnet(1),
  381. .I Your favorite modem's manual
  382. .\"
  383. .\"
  384. .SH BUGS
  385. .\"
  386. No dial-restriction or blacklisting capability so using modemu2k may be
  387. unlawful in some countries.