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