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