1 /*- 2 * SPDX-License-Identifier: BSD-3-Clause 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 /* 33 * Getty table initializations. 34 * 35 * Melbourne getty. 36 */ 37 #include <stdio.h> 38 #include <termios.h> 39 #include "gettytab.h" 40 #include "extern.h" 41 #include "pathnames.h" 42 43 static char loginmsg[] = "login: "; 44 static char nullstr[] = ""; 45 static char loginprg[] = _PATH_LOGIN; 46 static char datefmt[] = "%+"; 47 48 #define M(a) (char *)(&omode.c_cc[a]) 49 50 struct gettystrs gettystrs[] = { 51 { "nx", NULL, NULL }, /* next table */ 52 { "cl", NULL, NULL }, /* screen clear characters */ 53 { "im", NULL, NULL }, /* initial message */ 54 { "lm", loginmsg, NULL }, /* login message */ 55 { "er", M(VERASE), NULL }, /* erase character */ 56 { "kl", M(VKILL), NULL }, /* kill character */ 57 { "et", M(VEOF), NULL }, /* eof chatacter (eot) */ 58 { "pc", nullstr, NULL }, /* pad character */ 59 { "tt", NULL, NULL }, /* terminal type */ 60 { "ev", NULL, NULL }, /* environment */ 61 { "lo", loginprg, NULL }, /* login program */ 62 { "hn", hostname, NULL }, /* host name */ 63 { "he", NULL, NULL }, /* host name edit */ 64 { "in", M(VINTR), NULL }, /* interrupt char */ 65 { "qu", M(VQUIT), NULL }, /* quit char */ 66 { "xn", M(VSTART), NULL }, /* XON (start) char */ 67 { "xf", M(VSTOP), NULL }, /* XOFF (stop) char */ 68 { "bk", M(VEOL), NULL }, /* brk char (alt \n) */ 69 { "su", M(VSUSP), NULL }, /* suspend char */ 70 { "ds", M(VDSUSP), NULL }, /* delayed suspend */ 71 { "rp", M(VREPRINT), NULL }, /* reprint char */ 72 { "fl", M(VDISCARD), NULL }, /* flush output */ 73 { "we", M(VWERASE), NULL }, /* word erase */ 74 { "ln", M(VLNEXT), NULL }, /* literal next */ 75 { "Lo", NULL, NULL }, /* locale for strftime() */ 76 { "pp", NULL, NULL }, /* ppp login program */ 77 { "if", NULL, NULL }, /* sysv-like 'issue' filename */ 78 { "ic", NULL, NULL }, /* modem init-chat */ 79 { "ac", NULL, NULL }, /* modem answer-chat */ 80 { "al", NULL, NULL }, /* user to auto-login */ 81 { "df", datefmt, NULL }, /* format for strftime() */ 82 { "iM" , NULL, NULL }, /* initial message program */ 83 { NULL, NULL, NULL } 84 }; 85 86 struct gettynums gettynums[] = { 87 { "is", 0, 0, 0 }, /* input speed */ 88 { "os", 0, 0, 0 }, /* output speed */ 89 { "sp", 0, 0, 0 }, /* both speeds */ 90 { "nd", 0, 0, 0 }, /* newline delay */ 91 { "cd", 0, 0, 0 }, /* carriage-return delay */ 92 { "td", 0, 0, 0 }, /* tab delay */ 93 { "fd", 0, 0, 0 }, /* form-feed delay */ 94 { "bd", 0, 0, 0 }, /* backspace delay */ 95 { "to", 0, 0, 0 }, /* timeout */ 96 { "f0", 0, 0, 0 }, /* output flags */ 97 { "f1", 0, 0, 0 }, /* input flags */ 98 { "f2", 0, 0, 0 }, /* user mode flags */ 99 { "pf", 0, 0, 0 }, /* delay before flush at 1st prompt */ 100 { "c0", 0, 0, 0 }, /* output c_flags */ 101 { "c1", 0, 0, 0 }, /* input c_flags */ 102 { "c2", 0, 0, 0 }, /* user mode c_flags */ 103 { "i0", 0, 0, 0 }, /* output i_flags */ 104 { "i1", 0, 0, 0 }, /* input i_flags */ 105 { "i2", 0, 0, 0 }, /* user mode i_flags */ 106 { "l0", 0, 0, 0 }, /* output l_flags */ 107 { "l1", 0, 0, 0 }, /* input l_flags */ 108 { "l2", 0, 0, 0 }, /* user mode l_flags */ 109 { "o0", 0, 0, 0 }, /* output o_flags */ 110 { "o1", 0, 0, 0 }, /* input o_flags */ 111 { "o2", 0, 0, 0 }, /* user mode o_flags */ 112 { "de", 0, 0, 0 }, /* delay before sending 1st prompt */ 113 { "rt", 0, 0, 0 }, /* reset timeout */ 114 { "ct", 0, 0, 0 }, /* chat script timeout */ 115 { "dc", 0, 0, 0 }, /* debug chat script value */ 116 { NULL, 0, 0, 0 } 117 }; 118 119 120 struct gettyflags gettyflags[] = { 121 { "ht", 0, 0, 0, 0 }, /* has tabs */ 122 { "nl", 1, 0, 0, 0 }, /* has newline char */ 123 { "ep", 0, 0, 0, 0 }, /* even parity */ 124 { "op", 0, 0, 0, 0 }, /* odd parity */ 125 { "ap", 0, 0, 0, 0 }, /* any parity */ 126 { "ec", 1, 0, 0, 0 }, /* no echo */ 127 { "co", 0, 0, 0, 0 }, /* console special */ 128 { "cb", 0, 0, 0, 0 }, /* crt backspace */ 129 { "ck", 0, 0, 0, 0 }, /* crt kill */ 130 { "ce", 0, 0, 0, 0 }, /* crt erase */ 131 { "pe", 0, 0, 0, 0 }, /* printer erase */ 132 { "rw", 1, 0, 0, 0 }, /* don't use raw */ 133 { "xc", 1, 0, 0, 0 }, /* don't ^X ctl chars */ 134 { "lc", 0, 0, 0, 0 }, /* terminal las lower case */ 135 { "uc", 0, 0, 0, 0 }, /* terminal has no lower case */ 136 { "ig", 0, 0, 0, 0 }, /* ignore garbage */ 137 { "ps", 0, 0, 0, 0 }, /* do port selector speed select */ 138 { "hc", 1, 0, 0, 0 }, /* don't set hangup on close */ 139 { "ub", 0, 0, 0, 0 }, /* unbuffered output */ 140 { "ab", 0, 0, 0, 0 }, /* auto-baud detect with '\r' */ 141 { "dx", 0, 0, 0, 0 }, /* set decctlq */ 142 { "np", 0, 0, 0, 0 }, /* no parity at all (8bit chars) */ 143 { "mb", 0, 0, 0, 0 }, /* do MDMBUF flow control */ 144 { "hw", 0, 0, 0, 0 }, /* do CTSRTS flow control */ 145 { "nc", 0, 0, 0, 0 }, /* set clocal (no carrier) */ 146 { "pl", 0, 0, 0, 0 }, /* use PPP instead of login(1) */ 147 { NULL, 0, 0, 0, 0 } 148 }; 149