init.c revision 21120
11541Srgrimes/* 21541Srgrimes * Copyright (c) 1983, 1993 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * 51541Srgrimes * Redistribution and use in source and binary forms, with or without 61541Srgrimes * modification, are permitted provided that the following conditions 71541Srgrimes * are met: 81541Srgrimes * 1. Redistributions of source code must retain the above copyright 91541Srgrimes * notice, this list of conditions and the following disclaimer. 101541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 111541Srgrimes * notice, this list of conditions and the following disclaimer in the 121541Srgrimes * documentation and/or other materials provided with the distribution. 131541Srgrimes * 3. All advertising materials mentioning features or use of this software 141541Srgrimes * must display the following acknowledgement: 151541Srgrimes * This product includes software developed by the University of 161541Srgrimes * California, Berkeley and its contributors. 171541Srgrimes * 4. Neither the name of the University nor the names of its contributors 181541Srgrimes * may be used to endorse or promote products derived from this software 191541Srgrimes * without specific prior written permission. 201541Srgrimes * 211541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 221541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 231541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 241541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 251541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 261541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 271541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 281541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 291541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 301541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 311541Srgrimes * SUCH DAMAGE. 321541Srgrimes */ 331541Srgrimes 341541Srgrimes#ifndef lint 351541Srgrimes/*static char sccsid[] = "from: @(#)init.c 8.1 (Berkeley) 6/4/93";*/ 361541Srgrimesstatic char rcsid[] = "$Id: init.c,v 1.4 1996/11/13 01:06:39 pst Exp $"; 371541Srgrimes#endif /* not lint */ 381541Srgrimes 3913765Smpp/* 401541Srgrimes * Getty table initializations. 411541Srgrimes * 421541Srgrimes * Melbourne getty. 431541Srgrimes */ 441541Srgrimes#include <termios.h> 451541Srgrimes#include "extern.h" 461541Srgrimes#include "gettytab.h" 471541Srgrimes#include "pathnames.h" 481541Srgrimes 491541Srgrimesstatic char loginmsg[] = "login: "; 5013765Smppstatic char nullstr[] = ""; 511541Srgrimesstatic char loginprg[] = _PATH_LOGIN; 521541Srgrimes 531541Srgrimesstruct gettystrs gettystrs[] = { 541541Srgrimes { "nx" }, /* next table */ 551541Srgrimes { "cl" }, /* screen clear characters */ 561541Srgrimes { "im" }, /* initial message */ 571541Srgrimes { "lm", loginmsg }, /* login message */ 581541Srgrimes { "er", &tmode.c_cc[VERASE] }, /* erase character */ 591541Srgrimes { "kl", &tmode.c_cc[VKILL] }, /* kill character */ 601541Srgrimes { "et", &tmode.c_cc[VEOF] }, /* eof chatacter (eot) */ 611541Srgrimes { "pc", nullstr }, /* pad character */ 621541Srgrimes { "tt" }, /* terminal type */ 631541Srgrimes { "ev" }, /* enviroment */ 641541Srgrimes { "lo", loginprg }, /* login program */ 651541Srgrimes { "hn", hostname }, /* host name */ 661541Srgrimes { "he" }, /* host name edit */ 671541Srgrimes { "in", &tmode.c_cc[VINTR] }, /* interrupt char */ 681541Srgrimes { "qu", &tmode.c_cc[VQUIT] }, /* quit char */ 691541Srgrimes { "xn", &tmode.c_cc[VSTART] }, /* XON (start) char */ 701541Srgrimes { "xf", &tmode.c_cc[VSTOP] }, /* XOFF (stop) char */ 711541Srgrimes { "bk", &tmode.c_cc[VEOL] }, /* brk char (alt \n) */ 721541Srgrimes { "su", &tmode.c_cc[VSUSP] }, /* suspend char */ 731541Srgrimes { "ds", &tmode.c_cc[VDSUSP] }, /* delayed suspend */ 741541Srgrimes { "rp", &tmode.c_cc[VREPRINT] },/* reprint char */ 751541Srgrimes { "fl", &tmode.c_cc[VDISCARD] },/* flush output */ 761541Srgrimes { "we", &tmode.c_cc[VWERASE] }, /* word erase */ 771541Srgrimes { "ln", &tmode.c_cc[VLNEXT] }, /* literal next */ 7813765Smpp { "Lo" }, /* locale for strftime() */ 791541Srgrimes { "pp" }, /* ppp login program */ 801541Srgrimes { 0 } 811541Srgrimes}; 821541Srgrimes 831541Srgrimesstruct gettynums gettynums[] = { 841541Srgrimes { "is" }, /* input speed */ 851541Srgrimes { "os" }, /* output speed */ 86 { "sp" }, /* both speeds */ 87 { "nd" }, /* newline delay */ 88 { "cd" }, /* carriage-return delay */ 89 { "td" }, /* tab delay */ 90 { "fd" }, /* form-feed delay */ 91 { "bd" }, /* backspace delay */ 92 { "to" }, /* timeout */ 93 { "f0" }, /* output flags */ 94 { "f1" }, /* input flags */ 95 { "f2" }, /* user mode flags */ 96 { "pf" }, /* delay before flush at 1st prompt */ 97 { "c0" }, /* output c_flags */ 98 { "c1" }, /* input c_flags */ 99 { "c2" }, /* user mode c_flags */ 100 { "i0" }, /* output i_flags */ 101 { "i1" }, /* input i_flags */ 102 { "i2" }, /* user mode i_flags */ 103 { "l0" }, /* output l_flags */ 104 { "l1" }, /* input l_flags */ 105 { "l2" }, /* user mode l_flags */ 106 { "o0" }, /* output o_flags */ 107 { "o1" }, /* input o_flags */ 108 { "o2" }, /* user mode o_flags */ 109 { "de" }, /* delay before sending 1st prompt */ 110 { 0 } 111}; 112 113 114struct gettyflags gettyflags[] = { 115 { "ht", 0 }, /* has tabs */ 116 { "nl", 1 }, /* has newline char */ 117 { "ep", 0 }, /* even parity */ 118 { "op", 0 }, /* odd parity */ 119 { "ap", 0 }, /* any parity */ 120 { "ec", 1 }, /* no echo */ 121 { "co", 0 }, /* console special */ 122 { "cb", 0 }, /* crt backspace */ 123 { "ck", 0 }, /* crt kill */ 124 { "ce", 0 }, /* crt erase */ 125 { "pe", 0 }, /* printer erase */ 126 { "rw", 1 }, /* don't use raw */ 127 { "xc", 1 }, /* don't ^X ctl chars */ 128 { "lc", 0 }, /* terminal las lower case */ 129 { "uc", 0 }, /* terminal has no lower case */ 130 { "ig", 0 }, /* ignore garbage */ 131 { "ps", 0 }, /* do port selector speed select */ 132 { "hc", 1 }, /* don't set hangup on close */ 133 { "ub", 0 }, /* unbuffered output */ 134 { "ab", 0 }, /* auto-baud detect with '\r' */ 135 { "dx", 0 }, /* set decctlq */ 136 { "np", 0 }, /* no parity at all (8bit chars) */ 137 { "mb", 0 }, /* do MDMBUF flow control */ 138 { 0 } 139}; 140