11592Srgrimes/*
215645Sjoerg * Copyright (c) 1983, 1993
315645Sjoerg *	The Regents of the University of California.  All rights reserved.
41592Srgrimes *
51592Srgrimes * Redistribution and use in source and binary forms, with or without
61592Srgrimes * modification, are permitted provided that the following conditions
71592Srgrimes * are met:
81592Srgrimes * 1. Redistributions of source code must retain the above copyright
91592Srgrimes *    notice, this list of conditions and the following disclaimer.
101592Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111592Srgrimes *    notice, this list of conditions and the following disclaimer in the
121592Srgrimes *    documentation and/or other materials provided with the distribution.
13262435Sbrueffer * 3. Neither the name of the University nor the names of its contributors
141592Srgrimes *    may be used to endorse or promote products derived from this software
151592Srgrimes *    without specific prior written permission.
161592Srgrimes *
171592Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
181592Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191592Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201592Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
211592Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221592Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231592Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241592Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251592Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261592Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271592Srgrimes * SUCH DAMAGE.
281592Srgrimes */
291592Srgrimes
301592Srgrimes#ifndef lint
3131331Scharnier#if 0
3231331Scharnierstatic char sccsid[] = "@(#)from: init.c	8.1 (Berkeley) 6/4/93";
3331331Scharnier#endif
3431331Scharnierstatic const char rcsid[] =
3550476Speter  "$FreeBSD$";
361592Srgrimes#endif /* not lint */
371592Srgrimes
381592Srgrimes/*
391592Srgrimes * Getty table initializations.
401592Srgrimes *
411592Srgrimes * Melbourne getty.
421592Srgrimes */
4315645Sjoerg#include <termios.h>
44144716Sstefanf#include "gettytab.h"
4515645Sjoerg#include "extern.h"
461592Srgrimes#include "pathnames.h"
471592Srgrimes
4815645Sjoergstatic char loginmsg[] = "login: ";
4915645Sjoergstatic char nullstr[] = "";
5015645Sjoergstatic char loginprg[] = _PATH_LOGIN;
5177874Syarstatic char datefmt[] = "%+";
521592Srgrimes
531592Srgrimesstruct	gettystrs gettystrs[] = {
541592Srgrimes	{ "nx" },			/* next table */
551592Srgrimes	{ "cl" },			/* screen clear characters */
561592Srgrimes	{ "im" },			/* initial message */
5715645Sjoerg	{ "lm", loginmsg },		/* login message */
58116533Syar	{ "er", &omode.c_cc[VERASE] },	/* erase character */
59116533Syar	{ "kl", &omode.c_cc[VKILL] },	/* kill character */
60116533Syar	{ "et", &omode.c_cc[VEOF] },	/* eof chatacter (eot) */
6115645Sjoerg	{ "pc", nullstr },		/* pad character */
621592Srgrimes	{ "tt" },			/* terminal type */
63229780Suqs	{ "ev" },			/* environment */
6415645Sjoerg	{ "lo", loginprg },		/* login program */
651592Srgrimes	{ "hn", hostname },		/* host name */
661592Srgrimes	{ "he" },			/* host name edit */
67116533Syar	{ "in", &omode.c_cc[VINTR] },	/* interrupt char */
68116533Syar	{ "qu", &omode.c_cc[VQUIT] },	/* quit char */
69116533Syar	{ "xn", &omode.c_cc[VSTART] },	/* XON (start) char */
70116533Syar	{ "xf", &omode.c_cc[VSTOP] },	/* XOFF (stop) char */
71116533Syar	{ "bk", &omode.c_cc[VEOL] },	/* brk char (alt \n) */
72116533Syar	{ "su", &omode.c_cc[VSUSP] },	/* suspend char */
73116533Syar	{ "ds", &omode.c_cc[VDSUSP] },	/* delayed suspend */
74116533Syar	{ "rp", &omode.c_cc[VREPRINT] },/* reprint char */
75116533Syar	{ "fl", &omode.c_cc[VDISCARD] },/* flush output */
76116533Syar	{ "we", &omode.c_cc[VWERASE] },	/* word erase */
77116533Syar	{ "ln", &omode.c_cc[VLNEXT] },	/* literal next */
7815645Sjoerg	{ "Lo" },			/* locale for strftime() */
7919697Spst	{ "pp" },			/* ppp login program */
8022208Sdavidn	{ "if" },			/* sysv-like 'issue' filename */
8122208Sdavidn	{ "ic" },			/* modem init-chat */
8222208Sdavidn	{ "ac" },			/* modem answer-chat */
8345291Speter	{ "al" },			/* user to auto-login */
8477874Syar	{ "df", datefmt},		/* format for strftime() */
851592Srgrimes	{ 0 }
861592Srgrimes};
871592Srgrimes
881592Srgrimesstruct	gettynums gettynums[] = {
891592Srgrimes	{ "is" },			/* input speed */
901592Srgrimes	{ "os" },			/* output speed */
911592Srgrimes	{ "sp" },			/* both speeds */
921592Srgrimes	{ "nd" },			/* newline delay */
931592Srgrimes	{ "cd" },			/* carriage-return delay */
941592Srgrimes	{ "td" },			/* tab delay */
951592Srgrimes	{ "fd" },			/* form-feed delay */
961592Srgrimes	{ "bd" },			/* backspace delay */
971592Srgrimes	{ "to" },			/* timeout */
981592Srgrimes	{ "f0" },			/* output flags */
991592Srgrimes	{ "f1" },			/* input flags */
1001592Srgrimes	{ "f2" },			/* user mode flags */
1011592Srgrimes	{ "pf" },			/* delay before flush at 1st prompt */
10215645Sjoerg	{ "c0" },			/* output c_flags */
10315645Sjoerg	{ "c1" },			/* input c_flags */
10415645Sjoerg	{ "c2" },			/* user mode c_flags */
10515645Sjoerg	{ "i0" },			/* output i_flags */
10615645Sjoerg	{ "i1" },			/* input i_flags */
10715645Sjoerg	{ "i2" },			/* user mode i_flags */
10815645Sjoerg	{ "l0" },			/* output l_flags */
10915645Sjoerg	{ "l1" },			/* input l_flags */
11015645Sjoerg	{ "l2" },			/* user mode l_flags */
11115645Sjoerg	{ "o0" },			/* output o_flags */
11215645Sjoerg	{ "o1" },			/* input o_flags */
11315645Sjoerg	{ "o2" },			/* user mode o_flags */
11421120Smsmith 	{ "de" },   	    	    	/* delay before sending 1st prompt */
11522208Sdavidn	{ "rt" },			/* reset timeout */
11622208Sdavidn	{ "ct" },			/* chat script timeout */
11722208Sdavidn	{ "dc" },			/* debug chat script value */
11821120Smsmith  	{ 0 }
1191592Srgrimes};
12021120Smsmith
1211592Srgrimes
1221592Srgrimesstruct	gettyflags gettyflags[] = {
1231592Srgrimes	{ "ht",	0 },			/* has tabs */
1241592Srgrimes	{ "nl",	1 },			/* has newline char */
1251592Srgrimes	{ "ep",	0 },			/* even parity */
1261592Srgrimes	{ "op",	0 },			/* odd parity */
1271592Srgrimes	{ "ap",	0 },			/* any parity */
1281592Srgrimes	{ "ec",	1 },			/* no echo */
1291592Srgrimes	{ "co",	0 },			/* console special */
1301592Srgrimes	{ "cb",	0 },			/* crt backspace */
1311592Srgrimes	{ "ck",	0 },			/* crt kill */
1321592Srgrimes	{ "ce",	0 },			/* crt erase */
1331592Srgrimes	{ "pe",	0 },			/* printer erase */
1341592Srgrimes	{ "rw",	1 },			/* don't use raw */
1351592Srgrimes	{ "xc",	1 },			/* don't ^X ctl chars */
1361592Srgrimes	{ "lc",	0 },			/* terminal las lower case */
1371592Srgrimes	{ "uc",	0 },			/* terminal has no lower case */
1381592Srgrimes	{ "ig",	0 },			/* ignore garbage */
1391592Srgrimes	{ "ps",	0 },			/* do port selector speed select */
1401592Srgrimes	{ "hc",	1 },			/* don't set hangup on close */
1411592Srgrimes	{ "ub", 0 },			/* unbuffered output */
1421592Srgrimes	{ "ab", 0 },			/* auto-baud detect with '\r' */
1431592Srgrimes	{ "dx", 0 },			/* set decctlq */
1441592Srgrimes	{ "np", 0 },			/* no parity at all (8bit chars) */
14515645Sjoerg	{ "mb", 0 },			/* do MDMBUF flow control */
14622208Sdavidn	{ "hw", 0 },			/* do CTSRTS flow control */
14764076Snsayer	{ "nc", 0 },			/* set clocal (no carrier) */
148109540Ssobomax	{ "pl", 0 },			/* use PPP instead of login(1) */
1491592Srgrimes	{ 0 }
1501592Srgrimes};
151