/*-1* SPDX-License-Identifier: BSD-3-Clause2*3* Copyright (c) 1983, 19934* The Regents of the University of California. All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions8* are met:9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11* 2. Redistributions in binary form must reproduce the above copyright12* notice, this list of conditions and the following disclaimer in the13* documentation and/or other materials provided with the distribution.14* 3. Neither the name of the University nor the names of its contributors15* may be used to endorse or promote products derived from this software16* without specific prior written permission.17*18* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND19* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE20* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE21* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE22* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL23* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS24* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)25* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT26* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY27* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF28* SUCH DAMAGE.29*/3031/*32* Getty table initializations.33*34* Melbourne getty.35*/36#include <stdio.h>37#include <termios.h>38#include "gettytab.h"39#include "extern.h"40#include "pathnames.h"4142static char loginmsg[] = "login: ";43static char nullstr[] = "";44static char loginprg[] = _PATH_LOGIN;45static char datefmt[] = "%+";4647#define M(a) (char *)(&omode.c_cc[a])4849struct gettystrs gettystrs[] = {50{ "nx", NULL, NULL }, /* next table */51{ "cl", NULL, NULL }, /* screen clear characters */52{ "im", NULL, NULL }, /* initial message */53{ "lm", loginmsg, NULL }, /* login message */54{ "er", M(VERASE), NULL }, /* erase character */55{ "kl", M(VKILL), NULL }, /* kill character */56{ "et", M(VEOF), NULL }, /* eof chatacter (eot) */57{ "pc", nullstr, NULL }, /* pad character */58{ "tt", NULL, NULL }, /* terminal type */59{ "ev", NULL, NULL }, /* environment */60{ "lo", loginprg, NULL }, /* login program */61{ "hn", hostname, NULL }, /* host name */62{ "he", NULL, NULL }, /* host name edit */63{ "in", M(VINTR), NULL }, /* interrupt char */64{ "qu", M(VQUIT), NULL }, /* quit char */65{ "xn", M(VSTART), NULL }, /* XON (start) char */66{ "xf", M(VSTOP), NULL }, /* XOFF (stop) char */67{ "bk", M(VEOL), NULL }, /* brk char (alt \n) */68{ "su", M(VSUSP), NULL }, /* suspend char */69{ "ds", M(VDSUSP), NULL }, /* delayed suspend */70{ "rp", M(VREPRINT), NULL }, /* reprint char */71{ "fl", M(VDISCARD), NULL }, /* flush output */72{ "we", M(VWERASE), NULL }, /* word erase */73{ "ln", M(VLNEXT), NULL }, /* literal next */74{ "Lo", NULL, NULL }, /* locale for strftime() */75{ "pp", NULL, NULL }, /* ppp login program */76{ "if", NULL, NULL }, /* sysv-like 'issue' filename */77{ "ic", NULL, NULL }, /* modem init-chat */78{ "ac", NULL, NULL }, /* modem answer-chat */79{ "al", NULL, NULL }, /* user to auto-login */80{ "df", datefmt, NULL }, /* format for strftime() */81{ "iM" , NULL, NULL }, /* initial message program */82{ NULL, NULL, NULL }83};8485struct gettynums gettynums[] = {86{ "is", 0, 0, 0 }, /* input speed */87{ "os", 0, 0, 0 }, /* output speed */88{ "sp", 0, 0, 0 }, /* both speeds */89{ "nd", 0, 0, 0 }, /* newline delay */90{ "cd", 0, 0, 0 }, /* carriage-return delay */91{ "td", 0, 0, 0 }, /* tab delay */92{ "fd", 0, 0, 0 }, /* form-feed delay */93{ "bd", 0, 0, 0 }, /* backspace delay */94{ "to", 0, 0, 0 }, /* timeout */95{ "f0", 0, 0, 0 }, /* output flags */96{ "f1", 0, 0, 0 }, /* input flags */97{ "f2", 0, 0, 0 }, /* user mode flags */98{ "pf", 0, 0, 0 }, /* delay before flush at 1st prompt */99{ "c0", 0, 0, 0 }, /* output c_flags */100{ "c1", 0, 0, 0 }, /* input c_flags */101{ "c2", 0, 0, 0 }, /* user mode c_flags */102{ "i0", 0, 0, 0 }, /* output i_flags */103{ "i1", 0, 0, 0 }, /* input i_flags */104{ "i2", 0, 0, 0 }, /* user mode i_flags */105{ "l0", 0, 0, 0 }, /* output l_flags */106{ "l1", 0, 0, 0 }, /* input l_flags */107{ "l2", 0, 0, 0 }, /* user mode l_flags */108{ "o0", 0, 0, 0 }, /* output o_flags */109{ "o1", 0, 0, 0 }, /* input o_flags */110{ "o2", 0, 0, 0 }, /* user mode o_flags */111{ "de", 0, 0, 0 }, /* delay before sending 1st prompt */112{ "rt", 0, 0, 0 }, /* reset timeout */113{ "ct", 0, 0, 0 }, /* chat script timeout */114{ "dc", 0, 0, 0 }, /* debug chat script value */115{ NULL, 0, 0, 0 }116};117118119struct gettyflags gettyflags[] = {120{ "ht", 0, 0, 0, 0 }, /* has tabs */121{ "nl", 1, 0, 0, 0 }, /* has newline char */122{ "ep", 0, 0, 0, 0 }, /* even parity */123{ "op", 0, 0, 0, 0 }, /* odd parity */124{ "ap", 0, 0, 0, 0 }, /* any parity */125{ "ec", 1, 0, 0, 0 }, /* no echo */126{ "co", 0, 0, 0, 0 }, /* console special */127{ "cb", 0, 0, 0, 0 }, /* crt backspace */128{ "ck", 0, 0, 0, 0 }, /* crt kill */129{ "ce", 0, 0, 0, 0 }, /* crt erase */130{ "pe", 0, 0, 0, 0 }, /* printer erase */131{ "rw", 1, 0, 0, 0 }, /* don't use raw */132{ "xc", 1, 0, 0, 0 }, /* don't ^X ctl chars */133{ "lc", 0, 0, 0, 0 }, /* terminal las lower case */134{ "uc", 0, 0, 0, 0 }, /* terminal has no lower case */135{ "ig", 0, 0, 0, 0 }, /* ignore garbage */136{ "ps", 0, 0, 0, 0 }, /* do port selector speed select */137{ "hc", 1, 0, 0, 0 }, /* don't set hangup on close */138{ "ub", 0, 0, 0, 0 }, /* unbuffered output */139{ "ab", 0, 0, 0, 0 }, /* auto-baud detect with '\r' */140{ "dx", 0, 0, 0, 0 }, /* set decctlq */141{ "np", 0, 0, 0, 0 }, /* no parity at all (8bit chars) */142{ "mb", 0, 0, 0, 0 }, /* do MDMBUF flow control */143{ "hw", 0, 0, 0, 0 }, /* do CTSRTS flow control */144{ "nc", 0, 0, 0, 0 }, /* set clocal (no carrier) */145{ "pl", 0, 0, 0, 0 }, /* use PPP instead of login(1) */146{ NULL, 0, 0, 0, 0 }147};148149150