xref: /freebsd/libexec/getty/init.c (revision afe61c15161c324a7af299a9b8457aba5afc92db)
1 /*
2  * Copyright (c) 1983, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. All advertising materials mentioning features or use of this software
14  *    must display the following acknowledgement:
15  *	This product includes software developed by the University of
16  *	California, Berkeley and its contributors.
17  * 4. Neither the name of the University nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  */
33 
34 #ifndef lint
35 static char sccsid[] = "@(#)init.c	8.1 (Berkeley) 6/4/93";
36 #endif /* not lint */
37 
38 /*
39  * Getty table initializations.
40  *
41  * Melbourne getty.
42  */
43 #include <sgtty.h>
44 #include "gettytab.h"
45 #include "pathnames.h"
46 
47 extern	struct sgttyb tmode;
48 extern	struct tchars tc;
49 extern	struct ltchars ltc;
50 extern	char hostname[];
51 
52 struct	gettystrs gettystrs[] = {
53 	{ "nx" },			/* next table */
54 	{ "cl" },			/* screen clear characters */
55 	{ "im" },			/* initial message */
56 	{ "lm", "login: " },		/* login message */
57 	{ "er", &tmode.sg_erase },	/* erase character */
58 	{ "kl", &tmode.sg_kill },	/* kill character */
59 	{ "et", &tc.t_eofc },		/* eof chatacter (eot) */
60 	{ "pc", "" },			/* pad character */
61 	{ "tt" },			/* terminal type */
62 	{ "ev" },			/* enviroment */
63 	{ "lo", _PATH_LOGIN },		/* login program */
64 	{ "hn", hostname },		/* host name */
65 	{ "he" },			/* host name edit */
66 	{ "in", &tc.t_intrc },		/* interrupt char */
67 	{ "qu", &tc.t_quitc },		/* quit char */
68 	{ "xn", &tc.t_startc },		/* XON (start) char */
69 	{ "xf", &tc.t_stopc },		/* XOFF (stop) char */
70 	{ "bk", &tc.t_brkc },		/* brk char (alt \n) */
71 	{ "su", &ltc.t_suspc },		/* suspend char */
72 	{ "ds", &ltc.t_dsuspc },	/* delayed suspend */
73 	{ "rp", &ltc.t_rprntc },	/* reprint char */
74 	{ "fl", &ltc.t_flushc },	/* flush output */
75 	{ "we", &ltc.t_werasc },	/* word erase */
76 	{ "ln", &ltc.t_lnextc },	/* literal next */
77 	{ 0 }
78 };
79 
80 struct	gettynums gettynums[] = {
81 	{ "is" },			/* input speed */
82 	{ "os" },			/* output speed */
83 	{ "sp" },			/* both speeds */
84 	{ "nd" },			/* newline delay */
85 	{ "cd" },			/* carriage-return delay */
86 	{ "td" },			/* tab delay */
87 	{ "fd" },			/* form-feed delay */
88 	{ "bd" },			/* backspace delay */
89 	{ "to" },			/* timeout */
90 	{ "f0" },			/* output flags */
91 	{ "f1" },			/* input flags */
92 	{ "f2" },			/* user mode flags */
93 	{ "pf" },			/* delay before flush at 1st prompt */
94 	{ 0 }
95 };
96 
97 struct	gettyflags gettyflags[] = {
98 	{ "ht",	0 },			/* has tabs */
99 	{ "nl",	1 },			/* has newline char */
100 	{ "ep",	0 },			/* even parity */
101 	{ "op",	0 },			/* odd parity */
102 	{ "ap",	0 },			/* any parity */
103 	{ "ec",	1 },			/* no echo */
104 	{ "co",	0 },			/* console special */
105 	{ "cb",	0 },			/* crt backspace */
106 	{ "ck",	0 },			/* crt kill */
107 	{ "ce",	0 },			/* crt erase */
108 	{ "pe",	0 },			/* printer erase */
109 	{ "rw",	1 },			/* don't use raw */
110 	{ "xc",	1 },			/* don't ^X ctl chars */
111 	{ "lc",	0 },			/* terminal las lower case */
112 	{ "uc",	0 },			/* terminal has no lower case */
113 	{ "ig",	0 },			/* ignore garbage */
114 	{ "ps",	0 },			/* do port selector speed select */
115 	{ "hc",	1 },			/* don't set hangup on close */
116 	{ "ub", 0 },			/* unbuffered output */
117 	{ "ab", 0 },			/* auto-baud detect with '\r' */
118 	{ "dx", 0 },			/* set decctlq */
119 	{ "np", 0 },			/* no parity at all (8bit chars) */
120 	{ 0 }
121 };
122