home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume6 / sysvdial / part1 next >
Encoding:
Internet Message Format  |  1986-11-30  |  25.6 KB

  1. Subject: v06i086:  System V generic dial routines (sysVdial), Part1/3
  2. Newsgroups: mod.sources
  3. Approved: rs@mirror.UUCP
  4.  
  5. Submitted by: ihnp4!quest!gene
  6. Mod.sources: Volume 6, Issue 86
  7. Archive-name: sysVdial/Part1
  8.  
  9. [  I did not try to compile this, as we run BSD exlusively.  It appears
  10.    that the hardest part of doing the port will be emulating the timed-
  11.    out reads (c_cc[VTIME]) in dial.c  --r$  ]
  12.  
  13. #    Generic Modem Dialer subroutine and support programs for system V.
  14. #    
  15. #    Modem configuration is done in the user configured file
  16. #    dialinfo.  Should be able to dial any modem (eg Vadic, Hayes)
  17. #    with a built-in auto dialer.   Replaces ATT dial(3C).
  18. #    Works with CU, uucico, lp, etc.
  19. #    
  20. #    This is part 1 of 3.
  21. #    
  22. #    The parts are:
  23. #    
  24. #    1)    README file and all documentation.
  25. #    2)    Makefile, dialinfo, *.h, some *.c files
  26. #    3)    dial.c
  27. #    
  28. #--------CUT---------CUT---------CUT---------CUT--------#
  29. #########################################################
  30. #                                                       #
  31. # This is a shell archive file.  To extract files:      #
  32. #                                                       #
  33. #    1)    Create an empty directory for the files.        #
  34. #    2) Write a file, such as "file.shar", containing   #
  35. #       this archive file into the directory.           #
  36. #    3) Type "sh file.shar".  Do not use csh.           #
  37. #                                                       #
  38. #########################################################
  39. echo Creating: README
  40. sed -e 's/^#//' >README <<'end_README'
  41. #MOTIVATION
  42. #
  43. #This Dial program is a replacement for the standard System V
  44. #"dial" subroutine documented in the V.2 and later manuals.
  45. #
  46. #It appears--see ACU(7)--the standard dial program requires
  47. #a real or pseudo device driver in the kernel to support dial
  48. #out.   In ATT machines,  this driver is tied to proprietary
  49. #hardware,  and that means--by and large--dial doesn't port well.
  50. #Every vendor seems to have a unique solution to the dial-out
  51. #problem,  and most of them are a mess.
  52. #
  53. #I wrote this in the hope vendors would pick it up and provide
  54. #a standard interface to dial-out lines.   It does nothing strange
  55. #and plugs into all the system V programs (I think).
  56. #
  57. #The System V.2 CU program (for sure) and the System V uucico
  58. #program (I am guessing) use the DIAL subroutine to do their
  59. #dialing.   Altos was gracious enough to let me try out this
  60. #subroutine with their CU source,  so I can tell you it definitely
  61. #works with System V CU.  Unfortunately, I was unable to try it
  62. #with uucico, but I believe it will work there also.   Ah,
  63. #for access to source....
  64. #
  65. #The main claim to fame this dialer has is its configurability,
  66. #portability and flexibility.
  67. #
  68. #I have used it to dial out on Altos and Plexus machines, and
  69. #it went without a hitch.  It has also been used to talk to
  70. #communication equipment (eg telephone systems) and even to
  71. #defeat dialback modems.  It works with the System V spooler
  72. #too.  You can have it call your home and put a message on
  73. #the screen for example.
  74. #
  75. #Anyway, read the "dialinfo" documentation.   If you find a
  76. #modem dialer it won't work with,  drop me a line and we'll
  77. #try to fix it....
  78. #
  79. #INSTALLATION
  80. #
  81. #1)    Get all 3 pieces of the USENET posting and "sh" them.
  82. #
  83. #2)    Print out the documentation and read it.  This step is
  84. #    supposed to get you all fired up for what follows.
  85. #
  86. #3)    Type "make".   This builds everything you need.   If you
  87. #    are wildly optimistic,  you might try "make install".
  88. #
  89. #4)    Copy "dialinfo" to /usr/lib/uucp.
  90. #
  91. #5)    Copy "dialer" and "dialprint" to /usr/lbin or wherever
  92. #    you keep your local binaries.
  93. #
  94. #6)    Either copy "libdial.a" to /usr/lib so it can be used
  95. #    as a library -ldial,  or replace "dial.o" and add
  96. #    dialinfo.o and readinfo.o--in that order--to your System V
  97. #    library (usually /lib/libc.a).
  98. #
  99. #7)    Take a look at "dialinfo".   If you have a hayes or
  100. #    vadic,  you are set to go.  Otherwise you may need to
  101. #    create a dialer entry.   Not to worry,  it is pretty easy
  102. #    to make a simple one.  If you use it much,  you may want
  103. #    to write a fancy one later.
  104. #
  105. #8)    Try "dialprint hayes" to make sure things are basically
  106. #    working.  That should print out a hayes entry.  If you
  107. #    are using a different dialer,  try that too.
  108. #
  109. #10)    Change L-devices to name the type of dialer you selected
  110. #    in the "dialinfo" file.   This entry goes in the third
  111. #    blank-separated field.   A typical entry is:
  112. #
  113. #        ACU tty12 hayes 1200
  114. #
  115. #    If you don't know what fields 1-2 and 4 do,  you will have
  116. #    to spend some time with the uucp documentation.   You may
  117. #    also need to figure out how to hook up a modem.
  118. #
  119. #11)    Hip-hip-hooray!  Now you are ready to actually dial someone.
  120. #    Try the following,  where you replace 5551212 with a harmless
  121. #    number to dial.
  122. #
  123. #        DIALDEBUG=a dialer 5551212
  124. #
  125. #    This should dial out on the first available line, and wait
  126. #    for carrier.   In the mean time, it will print gobs of
  127. #    debug output on your terminal.
  128. #
  129. #12)    If you have source or object copies of UUCICO and CU, you
  130. #    should just be able to compile/link them up and they should
  131. #    use the new dialer.  If not, this is the hard part.  You
  132. #    need to figure out what sort of dialer solution your vendor
  133. #    thought up,  which usually amounts to a special dial program
  134. #    in /usr/lib/uucp or elsewhere.   You must figure out what
  135. #    parameters are used to execute the program (maybe replace
  136. #    the program with an echo script) and then create a script
  137. #    to execute "dialer" with those parameters.  Usually, this
  138. #    script will look something like:
  139. #
  140. #        exec /usr/lbin/dialer -n -t$1 -s$2 $3
  141. #
  142. #    If all went well, you should now be able to use CU and UUCP
  143. #    with telephone numbers, dialing, and all the rest.  Chances
  144. #    are you will have to do some hacking on your system before
  145. #    that happens.  I can't give you too many hints,  because systems
  146. #    are so different in this regard.  Which is why I started this
  147. #    project in the first place.
  148. #
  149. #HINTS
  150. #
  151. #    Some vendors use field 3 in the L-devices file to name a
  152. #    program which actually does the dialing.  If your system
  153. #    is like this,  put the pathname of your dial script in there
  154. #    and also create a dialer with that name.   So maybe you
  155. #    have an entry that looks like:
  156. #
  157. #        ACU tty12 /usr/lib/uucp/dialscript 1200
  158. #
  159. #    and an entry in your dialinfo file that looks like:
  160. #
  161. #        /usr/lib/uucp/dialscript,
  162. #            use=hayes,
  163. #
  164. #    If you are having problems with modem control on your system,
  165. #    it is likely dip switches in the Modem,  a bad cable,  or
  166. #    straps on your computer.   This is kind of a nightmare too.
  167. #    You should be able to see your computer raise DTR (pin 20)
  168. #    on the modem when DIAL opens the communication line,  and
  169. #    sense one line back from the modem to tell when carrier is
  170. #    present.   I have seen CD (pin 8) CTS (pin 5) or DSR (pin 6)
  171. #    all used for this same purpose.  You need to check the doco
  172. #    on your modem,  or better yet, get a breakout box.  Above
  173. #    all, don't believe the LED's on the front of the modem.
  174. #    Usually there are straps between those LEDs and the RS232
  175. #    connector on the back.  Get it working with the breakout
  176. #    box, then build a cable to do the same thing.  If you are
  177. #    lucky, your vendor will have a section in the manual telling
  178. #    about the straps and cable you need.  Some vendors have an
  179. #    application note on the subject.
  180. #
  181. #    As of this writing, both the Altos and Plexus systems where
  182. #    I tested have modem control problems acknowledged by the vendor.
  183. #    These can also complicate your life....
  184. #
  185. #FEEDBACK
  186. #
  187. #    If you find something in the dial subroutine that doesn't fit
  188. #    in with other System V programs, drop me a line, or a bug fix,
  189. #    or something.   I would really like a permanent solution to the
  190. #    System V dial problem.
  191. #
  192. #    I am interested in any comments or suggestions for enhancements.
  193. #
  194. #    If you feel you need to remove the Copyright notice for
  195. #    distribution,  contact me and I will give you permission.
  196. #
  197. #ihnp4!quest!gene
  198. end_README
  199. echo Creating: dial.3
  200. sed -e 's/^#//' >dial.3 <<'end_dial.3'
  201. #.TH DIAL 3
  202. #.SH NAME
  203. #dial \- dial out on a modem
  204. #.SH SYNOPSIS
  205. #.B #include <termio.h>
  206. #.br
  207. #.B #include <dial.h>
  208. #.PP
  209. #.B int dial(call)
  210. #.br
  211. #.B CALL call;
  212. #.PP
  213. #.B void undial(fd)
  214. #.br
  215. #.B int fd;
  216. #.SH DESCRIPTION
  217. #.I Dial\^
  218. #is a modem-independent implementation of the standard
  219. #System V
  220. #.I Dial
  221. #procedure.
  222. #.PP
  223. #.I Dial
  224. #calls out on a modem or a direct terminal
  225. #line, and returns a file-descriptor open for read/write.
  226. #.PP
  227. #When finished with the line, the caller
  228. #must invoke
  229. #.I undial
  230. #to gracefully disconnect.
  231. #.PP
  232. #.I Dial
  233. #reads the uucp
  234. #.I L-devices
  235. #file to determine eligible devices,
  236. #and the
  237. #.I dialinfo
  238. #file to determine the modem dial procedure.
  239. #.I Dial
  240. #is fully compatible with
  241. #.I cu
  242. #and
  243. #.I uucp.
  244. #.PP
  245. #The definition of CALL in the <dial.h> header
  246. #file is:
  247. #.PP
  248. #.nf
  249. #typedef struct {
  250. #.RS
  251. #struct termio  *attr;     /* Final terminal attributes */
  252. #int            baud;      /* Baud rate to use after dialing */
  253. #int            speed;     /* Baud rate to use during dialing */
  254. #char           *line;     /* TTY device name */
  255. #char           *telno;    /* Phone number(s) or system name */
  256. #int            modem;     /* Use modem control on direct lines */
  257. #char           *device;   /* Where to store device name */
  258. #int            dev_len;   /* Sizeof(call.device) */
  259. #.RE
  260. #} CALL;
  261. #.fi
  262. #.PP
  263. #The CALL parameters are as follows:
  264. #.TP 10
  265. #.B attr
  266. #If specified, the tty device is set to use the
  267. #given parity,
  268. #character size,
  269. #and baud rate after connect.
  270. #Before a successful return,
  271. #the remaining tty attributes--except carrier sense--are set.
  272. #Carrier sense is controlled exclusively through
  273. #.I dialinfo
  274. #commands.
  275. #If not given, baud rate defaults to the modem baud rate,
  276. #and in any case is overridden by
  277. #.I baud
  278. #below, or commands in the
  279. #.I dialinfo
  280. #file.
  281. #.TP 10
  282. #.B baud
  283. #If specified,
  284. #the tty device is set to this baud rate after connect.
  285. #This parameter may be overridden by commands in the
  286. #.I dialinfo
  287. #file.
  288. #.TP 10
  289. #.B speed
  290. #If specified,
  291. #only entries with this speed in field 4 of
  292. #.I L-devices
  293. #are considered.
  294. #.TP
  295. #.B line
  296. #If specified,
  297. #only entries with this tty name in field 2 of
  298. #.I L-devices
  299. #are considered.
  300. #.TP
  301. #.B telno
  302. #If not specified, the call is to a DIRect line.
  303. #Otherwise this is the telephone number to be dialed.
  304. #Several alternate numbers may be given, separated
  305. #by commas.
  306. #.I L-dialcodes
  307. #prefix substitution is performed.
  308. #.TP 10
  309. #.B modem
  310. #Modem control is used on direct lines when
  311. #this variable is non-zero, and connect option 2
  312. #(command C2) is selected by the
  313. #.I dialinfo
  314. #procedure.
  315. #.TP 10
  316. #.B device
  317. #If this pointer is non-null,
  318. #the line device pathname (eg /dev/tty12)
  319. #is copied here after a successful dial.
  320. #.TP 10
  321. #.B dev_len
  322. #Length of the array pointed to by
  323. #.I device
  324. #above.
  325. #.PP
  326. #If the global variable
  327. #.I nolock
  328. #is non-zero,
  329. #.I dial
  330. #does not test for or secure the normal uucp lock file,
  331. #and
  332. #.I undial
  333. #does not remove it.
  334. #.SH FILES
  335. #.nf
  336. #.ta 27
  337. #/usr/lib/uucp/dialinfo    Dial procedure data base.
  338. #/usr/lib/uucp/L-devices    UUCP device entries.
  339. #/usr/lib/uucp/L-dialcodes    Dialcode substitutions.
  340. #/usr/lib/uucp/L.sys    UUCP system definitions.
  341. #/usr/spool/uucp/LCK..*    UUCP lock file.
  342. #/dev/tty*    TTY device names.
  343. #.fi
  344. #.SH AUTHOR
  345. #Gene H. Olson, Quest Research, Burnsville MN.
  346. #.SH SEE ALSO
  347. #.nf
  348. #.ta 17
  349. #cu(1C)    Calls another system.
  350. #dialprint(1)    Prints a dialer entry.
  351. #dialer(1)    Modem dial-out program.
  352. #uucp(1)    UUCP interface.
  353. #dialinfo(4)    Dial procedure data base.
  354. #termio(7)    TTY device information.
  355. #.SH DIAGNOSTICS
  356. #On failure, a negative error code is returned.
  357. #Possible error codes--as listed in <dial.h>--include:
  358. #.PP
  359. #.RS
  360. #.nf
  361. #INTRPT   -1   /* Interrupt during dial */
  362. #D_HUNG   -2   /* Dialer hung */
  363. #NO_ANS   -3   /* Busy or no answer */
  364. #ILL_BD   -4   /* Illegal/unknown baud rate */
  365. #A_PROB   -5   /* Dialinfo(4) configuration error */
  366. #L_PROB   -6   /* TTY device error */
  367. #NO_Ldv   -7   /* L-devices file unreadable */
  368. #DV_NT_A  -8   /* Requested device not available */
  369. #DV_NT_K  -9   /* Requested device unknown */
  370. #NO_BD_A  -10  /* Nothing available at requested speed */
  371. #NO_BD_K  -11  /* No device known at requested speed */
  372. #.RE
  373. #.fi
  374. #.PP
  375. #If the environment variable DIALINFO exists, it specifies
  376. #a pathname to be used instead of /usr/lib/uucp/dialinfo.
  377. #.PP
  378. #If
  379. #.I dial
  380. #discovers a corrupted or improperly configured file
  381. #or device, diagnostic information is written to
  382. #.I stderr.
  383. #.PP
  384. #Debugging output is written to
  385. #.I stderr
  386. #when the environment
  387. #variable
  388. #.I DIALDEBUG
  389. #exists,
  390. #and contains one or more of the characters listed below.
  391. #.TP 10
  392. #.B d
  393. #Show data and decisions related to the
  394. #.I L-devices
  395. #file, plus creation and deletion of the
  396. #uucp lockfile.
  397. #.TP 10
  398. #.B s
  399. #Show dialer state definitions and transitions.
  400. #.TP 10
  401. #.B m
  402. #Show matching of dialer
  403. #transition strings against the incoming data stream.
  404. #.TP 10
  405. #.B l
  406. #Show all device operations other than character I/O
  407. #to the communications device.
  408. #.TP 10
  409. #.B c
  410. #Show all transmitted and received communication.
  411. #.TP 10
  412. #.B a
  413. #Show all of the above.
  414. #.PP
  415. #The
  416. #.I dialinfo
  417. #file may also contain commands which write user specified
  418. #diagnostics to
  419. #.I stderr.
  420. #.SH WARNING
  421. #On some systems, a UUCP daemon periodically removes UUCP
  422. #lockfiles older than (for example) 90 minutes, without first
  423. #checking for activity on the corresponding communication line.
  424. #.I Dial
  425. #takes no precautions against that.
  426. end_dial.3
  427. echo Creating: dialer.1
  428. sed -e 's/^#//' >dialer.1 <<'end_dialer.1'
  429. #.TH DIALER 1 
  430. #.SH NAME
  431. #dialer \- General purpose dialer program.
  432. #.SH SYNOPSIS
  433. #\fBdialer
  434. #[-cenorw]
  435. #[-l \fRline\fB]
  436. #[-b \fRbaud\fB]
  437. #[-e \fRspeed\fB]
  438. #[\fRtelno\fB]
  439. #.SH DESCRIPTION
  440. #.I Dialer
  441. #is a modem-independent dialer program.
  442. #.I Dialer
  443. #is normally executed by programs such as
  444. #.I cu
  445. #and
  446. #.I uucp
  447. #to perform dialing functions,
  448. #or in an
  449. #.I lp
  450. #interface script to spool output to a remote printer.
  451. #The program is also useful in debugging
  452. #.I dialinfo
  453. #entries.
  454. #.PP
  455. #If
  456. #.I telno
  457. #is present,
  458. #the program uses
  459. #the first available
  460. #.I L-device
  461. #entry which begins with
  462. #.B ACU,
  463. #and otherwise uses the first
  464. #.B DIR
  465. #entry.
  466. #Communications are 8 bits/no parity, carrier sense disabled.
  467. #No retries are performed if all lines are busy,
  468. #or the remote does not answer.
  469. #The following options change all that:
  470. #.TP 10
  471. #.B -c
  472. #After a successful dial, copy standard input to the
  473. #remote
  474. #.TP 10
  475. #.B \-e
  476. #Switch to even parity after connect.
  477. #.TP 10
  478. #.B \-o
  479. #Switch to odd parity after connect.
  480. #.TP 10
  481. #.B \-n
  482. #Do not create the
  483. #.I uucp
  484. #lock file before dialing,
  485. #and do not delete it when the dial is complete.
  486. #This is useful when the caller has already selected
  487. #the dial-out line,
  488. #and secured the corresponding lock file.
  489. #.TP 10
  490. #.B \-w
  491. #If all outgoing lines are busy, wait until one becomes
  492. #available.
  493. #.TP 10
  494. #.B \-r
  495. #If the remote does not answer, redial every 30 seconds
  496. #until he does.
  497. #.TP 10
  498. #.BI \-l line
  499. #Dial out on the tty device /dev/\fIline\fR.
  500. #.TP 10
  501. #.BI \-s speed
  502. #Connect to the remote at baud rate
  503. #.I speed.
  504. #.TP 10
  505. #.BI \-b baud
  506. #Switch to communication speed
  507. #.I baud
  508. #after connect.
  509. #.SH FILES
  510. #.nf
  511. #.ta 29
  512. #/usr/lib/uucp/L-devices    For uucp devices entries.
  513. #/usr/lib/uucp/dialinfo    For dialer definitions.
  514. #/usr/spool/uucp/LCK..*    TTY lock files.
  515. #.SH AUTHOR
  516. #Gene H. Olson, Quest Research, Burnsville MN.
  517. #.SH SEE ALSO
  518. #.nf
  519. #.ta 17
  520. #dialprint(1)    Prints out a dialer entry.
  521. #uucp(1)    UUCP interface.
  522. #lp(1)    Line printer spooler.
  523. #dial(3)    Dial-out procedure.
  524. #dialinfo(4)    Dial procedure data base.
  525. #.SH DIAGNOSTICS
  526. #Exit code 0 is returned for success,
  527. #the absolute value of an error code
  528. #described in \fIdial\fR(1) for failure.
  529. end_dialer.1
  530. echo Creating: dialinfo.4
  531. sed -e 's/^#//' >dialinfo.4 <<'end_dialinfo.4'
  532. #.TH DIALINFO 4
  533. #.SH NAME
  534. #dialinfo - dial procedure data base
  535. #.SH SYNOPSIS
  536. #/usr/lib/uucp/dialinfo
  537. #.SH DESCRIPTION
  538. #The
  539. #.I dialinfo
  540. #file is a database of
  541. #.I dialers.
  542. #Each dialer is 
  543. #a procedure for connecting
  544. #a terminal line to some kind of remote computer system.
  545. #Most
  546. #.I dialer
  547. #entries dial out on a
  548. #modem with built-in auto-dial capability.
  549. #Some more esoteric entries resolve
  550. #baud rate switching with a remote
  551. #.I getty,
  552. #perform auto-login,
  553. #and even detect/defeat remote dialback modems.
  554. #.PP
  555. #Each
  556. #.I dialer
  557. #entry describes the operation of a state machine.
  558. #This state machine is capable of sending characters to
  559. #the remote, controlling the switchook, sending break,
  560. #adjusting baud-rate,
  561. #and printing user messages on
  562. #.I stderr.
  563. #State transition decisions are made according
  564. #to responses from the remote, response timeout,
  565. #carrier detection, and retry count.
  566. #The state machine may be
  567. #partially or fully customized
  568. #with user environment variables.
  569. #.PP
  570. #.I Dialinfo
  571. #contains an extensive diagnostic capability both to
  572. #support initial debugging,
  573. #and to deal with day-to-day problems on real
  574. #telephone lines and down systems.
  575. #.PP
  576. #The entry format of
  577. #.I dialinfo
  578. #is modeled after
  579. #.I terminfo.
  580. #.nf
  581. #Entries have the general form:
  582. #
  583. #    name1|name2|...,
  584. #        key1=str1, key2=str2, ...
  585. #        ...
  586. #        keyn=strn, ...
  587. #.fi
  588. #.PP
  589. #Where:
  590. #.TP 12
  591. #name?
  592. #Descriptive dialer name.
  593. #For an auto-dial modem this is usually manufacturer name
  594. #and model number.
  595. #For a dialer to be used,
  596. #this name must appear in field 3 of a corresponding entry in the
  597. #.I L-devices
  598. #file.
  599. #.TP
  600. #key?
  601. #Dialinfo keyword.
  602. #.TP 12
  603. #str?
  604. #Keyword definition string.
  605. #A definition may span several lines.
  606. #Only commas need be escaped.
  607. #.PP
  608. #The name entry must begin in column 1.
  609. #Keyword entries may immediately follow the first comma,
  610. #or may be indented and placed on subsequent lines.
  611. #Blank lines, and comment lines beginning with
  612. #.B #
  613. #are ignored.
  614. #.PP
  615. #Keywords include:
  616. #.TP 12
  617. #.B delay
  618. #Modem string to get a 2 second dial delay.
  619. #.TP 12
  620. #.B wait
  621. #Modem string to wait for dial tone or secondary dial tone.
  622. #.TP 12
  623. #.B star
  624. #Modem string for the
  625. #.B *
  626. #key on a touch tone phone.
  627. #.TP 12
  628. #.B pound
  629. #Modem string for the
  630. #.B #
  631. #key on a touch tone phone.
  632. #.TP 12
  633. #.B flash
  634. #Modem string to flash off hook for 1 second.
  635. #.TP 12
  636. #.B retry
  637. #Initial retry count.
  638. #Specifies the number of retries to be performed before
  639. #announcing failure.
  640. #.TP 12
  641. #.BI s n
  642. #Definition of machine state
  643. #.I n.
  644. #There are 100 possible states numbered 0 to 99.
  645. #.TP 12
  646. #.B use
  647. #The specified string is a dialer entry
  648. #from which remaining undefined keywords may be taken.
  649. #Presently defined keywords are not affected.
  650. #Any keyword definitions which follow in
  651. #the current dialer entry are ignored.
  652. #.PP
  653. #An environment variable string may be placed anywhere
  654. #in a
  655. #.I dialinfo
  656. #definition.
  657. #the form
  658. #\fB${\fIname\fB}\fR
  659. #inserts the value of the environment variable
  660. #.I name.
  661. #The form
  662. #\fB${\fIname-default\fB}\fR
  663. #inserts the value of
  664. #.I name
  665. #if it exists,
  666. #and otherwise literally inserts the
  667. #.I default
  668. #string.
  669. #.PP
  670. #Machine state definitions contain a sequence of commands
  671. #performed in order from left to right.
  672. #Possible commands include:
  673. #.TP 12
  674. #.B B
  675. #Transmit 250 millisecond break signal.
  676. #.TP 12
  677. #.BI C n
  678. #Set connect option.
  679. #If
  680. #.I n
  681. #is 0, use
  682. #8 bits, no parity, L-devices baud rate and
  683. #.I clocal
  684. #mode for modem communication.
  685. #If
  686. #.I n
  687. #is 1,
  688. #switch parity,
  689. #character size and baud rate
  690. #for communication with the remote system;
  691. #carrier detect is still disabled.
  692. #If
  693. #.I n
  694. #is 2,
  695. #proceed as with 1, but enable carrier detect if
  696. #this is an ACU line or
  697. #.I call.modem
  698. #is non-zero.
  699. #If
  700. #.I n
  701. #is 3, set options as with 1, but always enable carrier detect.
  702. #If
  703. #.I n
  704. #is 4, set options as with 1, but enable carrier detect
  705. #and wait for carrier to be established.
  706. #If carrier is not seen within the timeout period set
  707. #by the last
  708. #.B S
  709. #command,
  710. #take action according to the last
  711. #.B H
  712. #command.
  713. #.TP 12
  714. #.BI D n
  715. #Drop DTR (hang up line) for
  716. #.I n
  717. #seconds.
  718. #When DTR is restored, baud rate, parity etc is set as if
  719. #.I C0
  720. #was executed.
  721. #.TP 12
  722. #\fBE\fI"string"\fR
  723. #Write
  724. #.I string
  725. #to
  726. #.I stderr.
  727. #Presumably
  728. #.I stderr
  729. #is directed to a user terminal, or a log file.
  730. #.TP 12
  731. #\fBF\fI"string"\fR
  732. #Declare that
  733. #.I string
  734. #should be sent to
  735. #.I stderr
  736. #on any subsequent dial failure.
  737. #Remains in effect until canceled.
  738. #.TP 12
  739. #.BI G s
  740. #Immediately transfer control to state
  741. #.I s.
  742. #.TP 12
  743. #.BI H s
  744. #Declare that the carrier lost error recovery state is
  745. #.I s.
  746. #If a subsequent read of the communication line fails
  747. #because carrier sense is enabled and DCD is false,
  748. #control will be transferred to state
  749. #.I s.
  750. #.TP 12
  751. #\fBM\fI"string"\fR
  752. #Write
  753. #.I string
  754. #to the communication line.
  755. #.TP 12
  756. #.BI N b
  757. #Change the communication line
  758. #baud rate to speed
  759. #.I b.
  760. #.TP 12
  761. #.BI P n
  762. #Pause for
  763. #.I n
  764. #seconds.
  765. #.TP 12
  766. #.BI R n
  767. #Decrement the retry count,
  768. #and fail if the result is negative.
  769. #.TP 12
  770. #.BI S n
  771. #Declare that the timeout used when
  772. #waiting for carrier,
  773. #or a communication line response is
  774. #.I n
  775. #seconds.
  776. #.TP 12
  777. #.BI T s
  778. #Declare that the timeout recovery state is
  779. #.I s.
  780. #Any subsequent timeout will cause a transfer
  781. #to this state.
  782. #.TP 12
  783. #.BI U n
  784. #Execute (use) the text of state definition
  785. #.I n
  786. #as a subroutine.
  787. #This command nests up to 10 deep.
  788. #.TP 12
  789. #\fB[\fIstring\fB]\fIs\fR
  790. #Declare that a transfer to state
  791. #.I s
  792. #should be performed when
  793. #.I string
  794. #is received from the remote.
  795. #.PP
  796. #The
  797. #state
  798. #parameter denoted as
  799. #.I s
  800. #in the above entries is one of the following:
  801. #.TP 12
  802. #.I n
  803. #Transfer control to state
  804. #.I n,
  805. #where
  806. #.I n
  807. #is a decimal number in the range 0 to 99.
  808. #.TP 12
  809. #.B \+
  810. #Exit, returning success.
  811. #.TP 12
  812. #.B \-
  813. #Exit, returning the error code
  814. #.I NO_ANS
  815. #(no answer).
  816. #.TP 12
  817. #.BI \- n
  818. #Exit,
  819. #returning the error code
  820. #.I \-n.
  821. #.PP
  822. #The following escapes are recognised in
  823. #\fBE\fR,
  824. #\fBF\fR,
  825. #\fBM\fR,
  826. #and
  827. #\fB[]\fR
  828. #command
  829. #.I strings:
  830. #.TP 12
  831. #\fB\\\\\\\\\fInnn\fR
  832. #The octal character
  833. #.I nnn.
  834. #.TP 12
  835. #.BI ^ c
  836. #The control character derived by
  837. #the logical and of the ASCII character
  838. #.I c
  839. #and the octal mask 037.
  840. #This is the character transmitted by a standard
  841. #ASCII keyboard when the control key is held down,
  842. #and the character
  843. #.I c
  844. #is depressed.
  845. #.TP 12
  846. #\fB\\\\\\\\\fIc\fR
  847. #Standard C language escapes
  848. #\\b (backspace),
  849. #\\f (formfeed),
  850. #\\t (tab),
  851. #\\n (newline),
  852. #and
  853. #\\r (return).
  854. #.TP 12
  855. #.BI % n
  856. #Field number
  857. #.I n
  858. #of the current L-devices entry.
  859. #.TP 12
  860. #\fB%{\fIvar\fB}\fR
  861. #The user environment variable
  862. #.I var.
  863. #.TP 12
  864. #.B %n
  865. #The unmodified telephone number string.
  866. #.TP 12
  867. #.B %N
  868. #Converted telephone number described below.
  869. #.PP
  870. #The following characters have special meaning in the
  871. #.B %N
  872. #character strings,
  873. #and are replaced with corresponding
  874. #.I dialinfo
  875. #strings as described below.
  876. #.TP 12
  877. #\fB*\fR or \fB:\fR
  878. #.I (star)
  879. #Dials the
  880. #.B *
  881. #on a touch-tone telephone.
  882. #.TP 12
  883. #\fB#\fR or \fB;\fR
  884. #.I (pound)
  885. #Dials the
  886. #.B #
  887. #on a touch-tone telephone.
  888. #.TP 12
  889. #.B \-
  890. #.I (pause)
  891. #Pauses 2 seconds.
  892. #.TP 12
  893. #\fB=\fR or \fBw\fR
  894. #.I (wait)
  895. #Wait for secondary dial tone.
  896. #.TP 12
  897. #\fBf\fR
  898. #.I (flash)
  899. #Flash off hook for one second.
  900. #.SH "DIALER OPERATION"
  901. #The state machine is initialized to "C0 H- S10 T-",
  902. #and execution begins at state 0.
  903. #.PP
  904. #As each state is entered,
  905. #any previous
  906. #.B []
  907. #command strings are cleared.
  908. #Command execution then proceeds in order from left to right.
  909. #.PP
  910. #If a command
  911. #(eg \fBG\fR)
  912. #is encountered which causes a change of state,
  913. #remaining commands in the current state are not performed,
  914. #and execution continues in the new state.
  915. #.PP
  916. #Otherwise, when all the commands in a state have been
  917. #executed,
  918. #a read operation is performed on the communication line.
  919. #Incoming characters are then matched
  920. #against previously declared
  921. #.B []
  922. #command strings.
  923. #If a match is found,
  924. #the corresponding state transfer occurs.
  925. #If carrier sense was enabled by a previous
  926. #.B C
  927. #command,
  928. #and carrier is lost,
  929. #the last
  930. #.B H
  931. #command is honored.
  932. #If neither of these events occur within the timeout
  933. #specified by the last
  934. #.B S
  935. #command, a timeout is detected.
  936. #Action is then taken according to the last
  937. #.B T
  938. #command.
  939. #.SH EXAMPLES
  940. #The following is a stripped-down definition for a Hayes Smartmodem.
  941. #.PP
  942. #.nf
  943. #    hayes,
  944. #        star=*, pound=#, flash=H0\\,H1,
  945. #        delay=\\,, wait=\\,, retry=2,
  946. #        s0=M"\\rAT DT%N\\r" S60 [CONNECT]+,
  947. #.fi
  948. #.PP
  949. #Below is a more complicated entry to handle a Vadic 3451.
  950. #.PP
  951. #.nf
  952. #.ta 5 9
  953. #    vadic|va3451,
  954. #        delay=K, wait=KK, retry=5,
  955. #        s0=P1 M"^E\\r" [*]1 S2 T10,
  956. #        s1=P1 M"D\\r" [NUMBER]2,
  957. #        s2=P1 M"%N\\r" P1 "\\r" [DIALING]3,
  958. #        s3=E"Dialing %n ..." S30 H11 C4 [CONNECT]4 T11,
  959. #        s4=E"Connected." G+,
  960. #        s10=F"No response from modem." R1 D1 G0,
  961. #        s11=F"Dial failed." R1 E"No Carrier, retrying ..." D1 G0,
  962. #.fi
  963. #.PP
  964. #The next entry gets its complete definition from
  965. #the DIALCUSTOM environment variable,
  966. #and defaults to hayes if that variable is undefined.
  967. #.PP
  968. #.nf
  969. #custom,
  970. #    ${DIALCUSTOM-use=hayes},
  971. #.fi
  972. #.SH FILES
  973. #.nf
  974. #.ta 29
  975. #/usr/lib/uucp/dialinfo    Dial procedure data base.
  976. #/usr/lib/uucp/L-devices    UUCP device file.
  977. #.SH AUTHOR
  978. #Gene H. Olson, Quest Research, Burnsville MN.
  979. #.SH SEE ALSO
  980. #.nf
  981. #.ta 17
  982. #dialer(1)    Modem dial-out program.
  983. #dialprint(1)    Prints dialer entries.
  984. #getty(1)    For information on dial-in lines.
  985. #uucp(1)    UUCP interface information.
  986. #dial(3)    C library dial procedure.
  987. #terminfo(4)    Terminal capability data base.
  988. #acu(7)    For System V phone number conventions.
  989. #term(7)    Terminal device information.
  990. end_dialinfo.4
  991. echo Creating: dialprint.1
  992. sed -e 's/^#//' >dialprint.1 <<'end_dialprint.1'
  993. #.TH DIALPRINT 1
  994. #.SH NAME
  995. #dialprint \- Print dialinfo entry.
  996. #.SH SYNOPSIS
  997. #\fBdialprint \fRdialer
  998. #.SH DESCRIPTION
  999. #.I dialprint
  1000. #prints out entry
  1001. #.I dialer
  1002. #from the dialer configuration data base
  1003. #.I dialinfo.
  1004. #All
  1005. #.I use
  1006. #keywords are evaluated
  1007. #and all
  1008. #\fB${\fIenv\fB}\fR
  1009. #environment substitutions are shown.
  1010. #.SH FILES
  1011. #.nf
  1012. #.ta 27
  1013. #/usr/lib/uucp/dialinfo    Dial procedure data base.
  1014. #.SH AUTHOR
  1015. #Gene H. Olson, Quest Research, Burnsville MN.
  1016. #.SH SEE ALSO
  1017. #.nf
  1018. #.ta 17
  1019. #dialer(1)    Modem dial-out program.
  1020. #uucp(1)    For info on UNIX communications.
  1021. #dial(3)    Dial-out procedure.
  1022. #dialinfo(4)    Dial procedure data base.
  1023. #.SH BUGS
  1024. #No verification of dialer state strings is performed.
  1025. end_dialprint.1
  1026.  
  1027.  
  1028.  
  1029.