]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/mgetty/mgetty-1.1.30/policy.h
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / mgetty / mgetty-1.1.30 / policy.h
1 #ident "@(#)policy.h    4.3 97/06/05 Copyright (c) Gert Doering"
2
3 /* this is the file where all configuration defaults for mgetty / sendfax
4  * are specified.
5  *
6  * defaults are used if no values are given in the config file(s).
7  * config file values can be overridden by command line options.
8  *
9  * see mgetty.texi/mgetty.info for a description of the configuration files.
10  */
11
12 /* main mgetty configuration file
13  */
14 #define MGETTY_CONFIG "mgetty.config"
15
16 /* sendfax configuration file
17  *
18  * if path doesn't start with "/", it's relative to CONFDIR (Makefile)
19  * if not defined, no configuration file is read (saves a few kbytes)
20  */
21 #define SENDFAX_CONFIG "sendfax.config"
22
23
24 /* login dispatcher config file (for mgetty)
25  *
26  * In this file, you can configure which "login" program (default /bin/login)
27  * to call for what user name.
28  *
29  * You could use it to call "uucico" for all users starting with "U*"
30  * (works only with Taylor UUCP 1.04 with my patch), or to call a fido
31  * mailer for fido calls (only if -DFIDO defined)...
32  * See the samples in the example login.config file (built from login.cfg.in).
33  *
34  * WARNING: make sure that this file isn't world-accessable (SECURITY!)
35  *
36  * If you want to call /bin/login in any case, do not define this
37  *
38  * If this doesn't start with "/", it's relative to CONFDIR.
39  */
40 #define LOGIN_CFG_FILE "login.config"
41
42 /* default login program
43  *
44  * If LOGIN_CFG_FILE is not defined, or does not exist, or doesn't
45  * have a default entry, this program is called for user logins.
46  * Normally, this is "/bin/login", just a few systems put "login"
47  * elsewhere (e.g. Free/NetBSD in "/usr/bin/login").
48  */
49 #define DEFAULT_LOGIN_PROGRAM "/bin/login"
50
51
52 /* callback config file
53  *
54  * this file controls the operation of the optional "callback" program.
55  * how callback works, is explained in detail in mgetty.texi. You need
56  * to set LOGIN_CFG_FILE (see above) to use callback from mgetty. 
57  *
58  * If this path does not start with "/", it's relative to CONFDIR.
59  */
60 #define CALLBACK_CONFIG "callback.config"
61
62
63 /* if this file exists, it can be used to control what callers
64  * are allowed in.  If undefined, the functionality is omitted.
65  * It will work only if your modem supports it. Check the modem manual.
66  * For Rockwell-Based modems, add #CID=1 to MODEM_INIT_STRING, for
67  * ZyXELs use S40.2=1.
68  * If the path doesn't start with "/", it's relative to CONFDIR.
69  */
70 #define CNDFILE "dialin.config"
71
72
73 /* If you want to use /etc/gettydefs to set tty flags, define this
74  * I recommend against it, I suspect some bugs lingering in that code
75  * (and one doesn't really need it in a normal setup anyway).
76  */
77 /* #define USE_GETTYDEFS */
78
79 /* Name of the "gettydefs" file (used only if USE_GETTYDEFS is set)
80  */
81 #define GETTYDEFS "/etc/gettydefs"
82
83 /* If no gettydefs "tag" is specified on the command line, use
84  * this setting (from GETTYDEFS) as default (only if compiled with
85  * USE_GETTYDEFS set)
86  */
87 #define GETTYDEFS_DEFAULT_TAG "n"
88
89
90 /* access modes */
91
92 /* user id of the "uucp" user. The tty device will be owned by this user,
93  * so parallel dial-out of uucico will be possible
94  */
95 #define DEVICE_OWNER    "root"
96 /* group id that the device is chown()ed to. If not defined, the
97  * primary group of "DEVICE_OWNER" is used.
98  */
99 #define DEVICE_GROUP    "dialout"
100
101 /* access mode for the line while getty has it - it should be accessible
102  * by uucp / uucp, but not by others (imagine someone dialing into your
103  * system and using another modem to dial to another country...)
104  */
105 #define FILE_MODE 0660
106
107 /* security: optionally, mgetty can system() this, to kill any dangling
108  * processes on the current tty. A %s is replaced with the tty device.
109  * NOT NEEDED on SCO, SunOS 4 or Linux!
110  */
111 /* #define EXEC_FUSER "exec fuser -k -f %s >/dev/null 2>&1" */
112
113
114 /* logging */
115
116 /* system console - if a severe error happens at startup, mgetty writes
117  * a message to this file and aborts
118  * On SCO, this may be /dev/syscon!
119  */
120 #define CONSOLE "/dev/console"
121
122 /* Name of the mgetty log file
123  * e.g. "/usr/spool/log/mgetty.log.%s" or "/tmp/log_mg.%s"
124  * a "%s" will be replaced by the device name, e.g. "tty2a"
125  *
126  * if the directory does not exist, the log file goes to CONSOLE (!)
127  */
128 #define LOG_PATH "/var/log/mgetty/mg_%s.log"
129
130 /* Default log error level threshold. Possible error levels are
131  * L_FATAL, L_ERROR, L_WARN, L_AUDIT, L_MESG, L_NOISE, L_JUNK (see mgetty.h)
132  */
133 #define LOG_LEVEL L_MESG
134
135 /* Whether "\n"s in the modem response should start a new line
136  * in the logfile
137  */
138 /* #define LOG_CR_NEWLINE */
139
140 /* System administrator - if a severe error happens (lprintf called
141  * with log_level L_FATAL) and writing to CONSOLE is not possible,
142  * the logfile will be mailed to him
143  */
144 #define ADMIN   "root"
145
146 /* Syslog
147  *
148  * If you want logging messages of type L_AUDIT, L_ERROR and L_FATAL
149  * to go to the "syslog", define this.
150  * mgetty will use the facility "LOG_AUTH", and the priorities
151  * LOG_NOTICE, LOG_ERR and LOG_ALERT, respectively.
152  */
153 #define SYSLOG 
154
155 /* Syslog facility
156  *
157  * This is the facility mgetty uses for logging. Ususally, this will be
158  * LOG_AUTH, but on some systems, this may not exist, try LOG_DAEMON
159  * instead (or look into the syslog manpage for available options)
160  */
161 #define SYSLOG_FC LOG_AUTH
162
163 /* login stuff */
164
165 /* System name - printed at login prompt
166  * If you do not define this, the uname() call will be used
167  */
168 /* #define SYSTEM       "greenie" */
169
170 /* Login prompt
171  * The "@", "\\D" and "\\T" escapes will be replaced by SYSTEM, the
172  * current date and time, respectively.
173  * override with "-p <prompt>" switch
174  */
175 #define LOGIN_PROMPT    "@ login: "
176
177 /* On SVR4, maybe on other systems too, you can cause the 'login' program
178  * to prompt with the same string as mgetty did, instead of the standard
179  * "login:" prompt. The string will be passed to the 'login' program
180  * in the environment variable TTYPROMPT.
181  * This is done by putting "login" into a special (brain-dead) "ttymon"-
182  * compatibility mode. In that mode, mgetty doesn't ask for a login name
183  * at all, so mgetty won't work if you enable that feature and your
184  * login program doesn't support it. (You can see if it doesn't work
185  * if the user gets a double login prompt or none at all).
186  *
187  * This feature automatically disables FIDO and AutoPPP support!
188  *
189  * To use this feature, define ENV_TTYPROMPT.
190  */
191 /* #define ENV_TTYPROMPT */
192
193 /* Maximum time before login name has to be entered (in seconds)
194  * (after that time a warning will be issued, after that, the call is
195  * dropped). To disable that feature, do not define it.
196  */
197 #define MAX_LOGIN_TIME  240
198
199 /* nologin file
200  *
201  * If that file exists, a ringing phone won't be answered (see manual).
202  * "%s" will be replaced by the device name.
203  */
204 #define NOLOGIN_FILE "/etc/nologin.%s"
205
206
207 /* misc */
208
209 /* how to find mgetty..
210  *
211  * If you define this, mgetty will create a file with the given name and
212  * put its process ID in it. A "%s" will be replaced by the device id.
213  *
214  * Depending on your system, "/var/run/mgetty.%d" might be a good place.
215  */
216 #define MGETTY_PID_FILE "/var/run/mg-pid.%s"
217
218 /* Path for the lock files. A %s will be replaced with the device name,
219  * e.g. tty2a -> /usr/spool/uucp/LCK..tty2a
220  * Make sure that this is the same file that your uucico uses for
221  * locking!
222  */
223
224 /* for a few systems, you can just take those defaults and be happy */
225 #if defined (SVR4) || defined(sunos4)
226 # define LOCK_PATH "/var/spool/locks"
227 # define LOCK      "/var/spool/locks/LCK..%s"
228 #else
229 # ifdef sgi
230 #  define LOCK  "/usr/spool/locks/LCK..%s"
231 # endif
232 # ifdef _AIX
233 #  define LOCK  "/etc/locks/LCK..%s"
234 # endif
235 # ifdef NeXT
236 #  define LOCK "/usr/spool/uucp/LCK/LCK..%s"
237 # endif
238 # ifdef linux
239 #  define LOCK  "/var/lock/LCK..%s"
240 # endif
241 #endif
242
243 /* if your system isn't listed above, change that line here */
244 #ifndef LOCK
245 #define LOCK "/var/lock/LCK..%s"
246 #endif
247   
248 /* Set this to "1" if your system uses binary lock files (i.e., the pid
249  * as four byte integer in host byte order written to the lock file)
250  * If it is "0", HDB locking will be used - the PID will be written as
251  * 10 byte ascii, with a trailing newline
252  * (Just check "LOCK" while uucico or pcomm or ... are running to find
253  * out what lock files are used on your system)
254  * On NeXT systems, you must set this to "1".
255  */
256 #define LOCKS_BINARY 0
257
258 /* Lower case locks - change the last character of the device name
259  *                    to lowercase for locking purposes.
260  *
261  * If you're using a SCO Unix system with those "tty1a/tty1A" device
262  * pairs, you'll have to define this.
263  */
264 /* #define LOCKS_LOWERCASE */
265
266 /* Change _all_ characters to lowercase (currently no system uses this) */
267 /* #define LOCKS_ALL_LOWERCASE */
268
269
270 /* the default speed used by mgetty - override it with "-s <speed>"
271  *
272  * WARNING: this is a bit tricky, since some modems insist on going to
273  * 19200 bps when in fax mode. So, if fax receiving with a port speed of
274  * something else doesn't work, try experimenting with FAX_RECV_SWITCHBD,
275  * and if that doesn't help, try DEFAULT_PORTSPEED 19200
276  *
277  * WARNING2: Speeds higher than 38400 aren't supported on all platforms,
278  * and sometimes you have to use "50" to get 57600 or so!
279  */
280 #define DEFAULT_PORTSPEED       38400
281
282 /* the modem initialization string
283  *
284  * the default string should set up most hayes compatible modems into a
285  * fairly sane state (echo on, verbose reports on, quiet off, reset on
286  * DTR toggle on), but it doesn't set any flow control options (because
287  * that's done differently on each modem, look into your manual for commands
288  * like &H3, &K4, \Q6 or similar things) or protocols.
289  *
290  * You can change the initialization sequence with the "init-chat" keyword
291  * in "mgetty.config".
292  *
293  * If you need delays, specify them as "\\d", if you want to send a
294  * backslash ('\'), give it as "\\\\".
295  *
296  * Very IMPORTANT: make sure that the modem assigns the DCD line properly,
297  * usually this is done with the AT&C1 command!
298  *
299  * The modem must answer with "OK" (!!!) - otherwise, use "init-chat".
300  */
301 #define MODEM_INIT_STRING       "AT"
302
303 /* command termination string
304  *
305  * for most modems, terminating the AT... command with "\r" is
306  * sufficient and "\r\n" also works without doing harm.
307  * Unfortunately, for the Courier HST, you've to use *only* \r,
308  * otherwise ATA won't work (immediate NO CARRIER), and for some
309  * (old) ZyXELs, you have to use \r\n (no OK otherwise).
310  * So, try one, and if it doesn't work, try the other.
311  */
312 #define MODEM_CMD_SUFFIX "\r"
313
314 /* "keep alive"
315  *
316  * mgetty can periodically check whether the modem is still alive
317  * by issueing an "AT\r" command and checking for the "OK"
318  * Define here, in seconds, how often mgetty should check. For normal
319  * reliable modems, once an hour should be sufficient...
320  * If you use "-1", or don't define this at all, mgetty won't check.
321  */
322 #define MODEM_CHECK_TIME 3600
323
324
325 /* modem mode
326  *
327  * DEFAULT_MODEMTYPE specifies the default way mgetty+sendfax handle a
328  * faxmodem. You have four choices:
329  *   "data" - data only, no faxing available (for sendfax, equal to "auto")
330  *   "cls2" - use AT+FCLASS=2
331  *   "c2.0" - use AT+FCLASS=2.0
332  *   "auto" - try "2.0", then "2", then fall to "data".
333  *
334  * Normally, you can leave this to "auto", but if you have a modem that
335  * can do class 2.0 and class 2, and 2.0 doesn't work, then you could try
336  * setting it to "cls2".
337  * You can override this define with the "-C <mode>" switch.
338  */
339 #define DEFAULT_MODEMTYPE "auto"
340
341
342 /* some modems are a little bit slow - after sending a response (OK)
343  * to the host, it will take some time before they can accept the next
344  * command - specify the amount needed in data mode here (in
345  * milliseconds). Normally, 50 ms should be sufficient. (On a slow
346  * machine it may even work without any delay at all)
347  *
348  * Be warned: if your machine isn't able to sleep for less than one
349  * second, this may cause problems.
350  */
351 #define DO_CHAT_SEND_DELAY 50
352  /* and this is the delay before sending each command while in fax mode
353   */
354 #define FAX_COMMAND_DELAY 50
355
356 /* incoming faxes will be chown()ed to this uid and gid.
357  * if FAX_IN_GROUP is undefined, the group of ...OWNER is used.
358  */
359 #define FAX_IN_OWNER    "root"
360 #define FAX_IN_GROUP    "fax"
361
362 /* incoming faxes will be chmod()ed to this mode
363  * (if you do not define this, the file mode will be controlled by
364  * mgetty's umask)
365  */
366 #define FAX_FILE_MODE 0660
367
368 /* FLOW CONTROL
369  *
370  * There are basically two types of flow control:
371  * - hardware flow control: pull the RTS/CTS lines low to stop the other
372  *   side from spilling out data too fast
373  * - sofware flow control: send an Xoff-Character to tell the other
374  *   side to stop sending, send an Xon to restart
375  * obviously, use of Xon/Xoff has the disadvantage that you cannot send
376  * those characters in your data anymore, but additionally, hardware flow
377  * control is normally faster and more reliable
378  *
379  * mgetty can use multiple flow control variants:
380  * FLOW_NONE  - no flow control at all (absolutely not recommended)
381  * FLOW_HARD  - use RTS/CTS flow control (if available on your machine)
382  * FLOW_SOFT  - use Xon/Xoff flow control, leave HW lines alone
383  * FLOW_BOTH  - use both types simultaneously, if possible
384  *
385  * Note that few operating systems allow both types to be used together.
386  *
387  * mgetty won't (cannot!) notice if your settings don't work, but you'll
388  * see it yourself: you'll experience character losses, garbled faxes,
389  * low data throughput,..., if the flow control settings are wrong
390  *
391  * If in doubt what to use, try both and compare results.
392  * (if you use FAS or SAS with the recommended settings, FLOW_HARD is a
393  * "don't care" since the driver will use RTS/CTS anyway)
394  *
395  * If you use an atypical system, check whether tio_set_flow_control in
396  * tio.c does the right thing for your system.
397  */
398
399 /* This is the flow control used for normal data (login) connections
400  * Set it to FLOW_HARD except in very special cases.
401  */
402 #define DATA_FLOW       FLOW_HARD
403
404 /* This is the flow control used for incoming fax connections
405  * Wrong settings will result in missing lines or erroneous lines
406  * in most of the received faxes.
407  * Most faxmodems expect Xon/Xoff, few honour the RTS line.
408  */
409 #define FAXREC_FLOW     FLOW_HARD | FLOW_SOFT
410
411 /* And this is for sending faxes
412  *
413  * Wrong settings here will typically result in that the first few
414  * centimeters of a transmitted fax look perfect, and then (the buffer
415  * has filled up), the rest is more or less illegible junk.
416  * For most faxes, this has to be FLOW_SOFT, though the Supra and ZyXEL
417  * modems will (sometimes) do hardware flow control, too. Try it.
418  *
419  * If you see a large number of [11] and [13] characters in the sendfax
420  * log file, your modem is propably doing software flow control - and
421  * you've definitely set FAXSEND_FLOW to FLOW_HARD...
422  *
423  * Some versions of SCO Unix have a "weird" serial driver that will only
424  * do half duplex hardware flow control. You will then run into the problem
425  * that fax sending will time out after the first page sent (no ACK received)
426  * and fail if FLOW_HARD is used. Use FLOW_SOFT instead.
427  */
428 #define FAXSEND_FLOW    FLOW_HARD | FLOW_SOFT
429  
430 /* if your faxmodem switches port bit rate just after sending the "+FCON"
431  * message to the host, define this to contain the baudrate used. (Not
432  * important if you have the portspeed set to this value anyway).
433  *
434  * Most Rockwell-based modems need FAX_RECV_SWITCHBD 19200.
435  * ZyXELs do *not* need this, except if explicitely told to do so.
436  *
437  * You can see if this is set wrong if mgetty gets the "+FCON" response,
438  * starts the fax receiver, and times out waiting for OK, receiving
439  * nothing or just junk.
440  */
441 /* #define FAX_RECV_SWITCHBD 19200 */
442
443 /* some genius at US Robotics obviously decided that the above method
444  * of switching baud rates is broken, and came up with something new
445  * --- broken as well (why bother switching rates at all?) --- this
446  * and other USR Courier Fax follies will be handled by enabling the
447  * following define (if you have an USR faxmodem that does *not* need
448  * this, please send me a mail!)
449  * It seems as if the newest V.34 modems do not need this anymore, please
450  * try it out...
451  */
452 /* #define FAX_USRobotics */
453
454 /* name of the logfile for outgoing faxes (e.g. /var/log/sendfax.log)
455  */
456 #define FAX_LOG         "/var/log/mgetty/fax/sendfax.log"
457
458 /* local station ID (your fax number)
459  * 20 character string, most faxmodem allow all ascii characters 32..127,
460  * but some do only allow digits and blank
461  * AT+FLID=? should tell you what's allowed and what not.
462  */
463 #define FAX_STATION_ID  " "
464
465 /* ------ sendfax-specific stuff follows here -------- */
466
467 /* the baudrate used for *sending* faxes. ZyXELs can handle 38400,
468  * SUPRAs (and many other rockwell-based faxmodems) can not.
469  * I recommend 38400, since 19200 may be to slow for 14400 bps faxmodems!
470  */
471 #define FAX_SEND_BAUD 38400
472
473 /* switch baud rate after +FCLASS=2
474  *
475  * some weird modems require that you initialize the modem with one
476  * baud rate (e.g. 2400 or 9600 for cheap 2400+fax modems, or `smart'
477  * modems that insist on staying locked to 38400 (ELSA!)), but switch
478  * to another baud rate, typically 19200, immediately after receiving
479  * the "AT+FCLASS=2" command.
480  *
481  * If the following is defined, sendfax will switch to the speed given
482  * here after sending AT+FCLASS=2.
483  *
484  * Only try fiddling with this if sendfax times out during modem
485  * initialization, receiving junk instead of "OK" or "ERROR" (logfile!)
486  */
487 /* #define FAX_SEND_SWITCHBD 19200 */
488
489 /* this is the command to set the modem to use the desired flow control.
490  * For hardware handshake, this could be AT&H3 for the ZyXEL, &K3 for
491  * Rockwell-Based modems or AT\\Q3&S0 for Exar-Based Modems (i.e. some GVC's)
492  * If you don't want extra initalization, do not define it.
493  * Don't forget the "AT"!
494  */
495 /* #define FAX_MODEM_HANDSHAKE "AT&H3" */
496
497 /* This is the modem command used for dialing. The phone number will
498  * get appended right after the string. Normally, "ATD" or "ATDP" should
499  * suffice, but in some situations (company telephone systems) you might
500  * need something like "ATx0DT0wP" (switch of dial-tone recognition, tone-
501  * dial a "0", wait for dial-tone, pulse dial the rest)
502  */
503 #define FAX_DIAL_PREFIX "ATD"
504
505 /* When sending a fax, if the other side says "page bad, retrain
506  * requested", sendfax will retry the page. Specifiy here the maximum
507  * number of retries (I recommend 3) before hanging up.
508  *
509  * If you set it to "0", sendfax will *never* retransmit a page (only
510  * do this if you know that your modem returns +FPTS:2 even if the
511  * page arrived properly, but be warned - you wont' be able to react
512  * properly to transmission errors!)
513  *
514  * See also the description of the "max-tries" and "max-tries-continue"
515  * settings in the sendfax config file.
516  */
517 #define FAX_SEND_MAX_TRIES 3
518
519 /* the device(s) used for faxing
520  * multiple devices can be separated by ":", e.g. "tty1a:tty2a"
521  * (with or without leading /dev/)
522  * If you don't adapt this for your needs, sendfax won't run (you can
523  * set it from the sendfax.config file, though)!
524  */
525 #define FAX_MODEM_TTYS  "ttyS1"
526
527 /* some modems, notably some GVC modems, all USR models, and the german
528  * telecom approved ZyXEL EG+ have the annoying behaviour of lowering
529  * and raising the DCD line during the pre- and post-page handshake
530  * (when sending faxes).
531  *
532  * If your modem does this, sendfax will terminate immediately after
533  * starting to send the first page, or between the first and second
534  * page, and the fax log file will show something like
535  * "read failed, I/O error".
536  *
537  * If you define this, sendfax will (try to) ignore that line
538  */
539
540 /* #define FAX_SEND_IGNORE_CARRIER */
541
542 /* Xon or not?
543  *
544  * the first issues of the class 2 drafts required that the program waits
545  * for an Xon character before sending the page data. Later versions
546  * removed that. Sendfax can do both, default is to wait for it.
547  *
548  * If you get an error message "... waiting for XON" when trying to
549  * send a fax, try this one. Some ELSA modems are know to need it.
550  */
551 /* #define FAXSEND_NO_XON */
552
553
554 /* define mailer that accepts destination on command line and mail text
555  * on stdin. For mailers with user friendly interfaces, (such as mail,
556  * mailx, elm), include an appropriate subject line in the command
557  * definition. If using a mail agent (such as sendmail), that reads
558  * mail headers, define NEED_MAIL_HEADERS.
559  */
560 #ifdef SVR4
561 # define MAILER         "/usr/bin/mailx -s 'Incoming facsimile message'"
562 #else
563 # ifdef _AIX
564 #  define MAILER        "/usr/sbin/sendmail"
565 #  define NEED_MAIL_HEADERS
566 # endif
567 # ifdef M_UNIX          /* SCO */
568 #  define MAILER        "/usr/lib/mail/execmail"
569 #  define NEED_MAIL_HEADERS
570 # endif
571 #endif
572
573 #ifndef MAILER
574 # define MAILER         "/usr/sbin/sendmail"
575 # define NEED_MAIL_HEADERS
576 #endif
577
578 /* where to send notify mail about incoming faxes to
579  * (remember to create an mail alias if no such user exists!)
580  */
581 #define MAIL_TO         "root"
582
583 /* after a fax has arrived, mgetty can call a program for further
584  * processing of this fax.
585  *
586  * (e.g.: printing of the fax, sending as MIME mail, displaying in an X
587  * window (the latter one could be tricky) ...)
588  *
589  * It will be called as:
590  * <program> <result code> "<sender_id>" <#pgs> <pg1> <pg2>...
591  * 
592  * Define the name of this program here
593  * If you don't want this type of service, do not define it at all
594  * Absolute path name has to be used here!
595  */
596 #define FAX_NOTIFY_PROGRAM "/etc/mgetty/new_fax"
597
598 /* default minimum space required on spooling partition for receiving a FAX
599  * (in KILObytes)
600  */
601 #define MINFREESPACE 1024
602