1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1982, 1986, 1990, 1993, 1994 5 * The Regents of the University of California. All rights reserved. 6 * (c) UNIX System Laboratories, Inc. 7 * All or some portions of this file are derived from material licensed 8 * to the University of California by American Telephone and Telegraph 9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 10 * the permission of UNIX System Laboratories, Inc. 11 * 12 * Redistribution and use in source and binary forms, with or without 13 * modification, are permitted provided that the following conditions 14 * are met: 15 * 1. Redistributions of source code must retain the above copyright 16 * notice, this list of conditions and the following disclaimer. 17 * 2. Redistributions in binary form must reproduce the above copyright 18 * notice, this list of conditions and the following disclaimer in the 19 * documentation and/or other materials provided with the distribution. 20 * 3. Neither the name of the University nor the names of its contributors 21 * may be used to endorse or promote products derived from this software 22 * without specific prior written permission. 23 * 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)ttycom.h 8.1 (Berkeley) 3/28/94 37 * $FreeBSD$ 38 */ 39 40#ifndef _SYS_TTYCOM_H_ 41#define _SYS_TTYCOM_H_ 42 43#include <sys/ioccom.h> 44#include <sys/_winsize.h> 45 46/* 47 * Tty ioctl's except for those supported only for backwards compatibility 48 * with the old tty driver. 49 */ 50 51 /* 0-2 compat */ 52 /* 3-7 unused */ 53 /* 8-10 compat */ 54 /* 11-12 unused */ 55#define TIOCEXCL _IO('t', 13) /* set exclusive use of tty */ 56#define TIOCNXCL _IO('t', 14) /* reset exclusive use of tty */ 57#define TIOCGPTN _IOR('t', 15, int) /* Get pts number. */ 58#define TIOCFLUSH _IOW('t', 16, int) /* flush buffers */ 59 /* 17-18 compat */ 60#define TIOCGETA _IOR('t', 19, struct termios) /* get termios struct */ 61#define TIOCSETA _IOW('t', 20, struct termios) /* set termios struct */ 62#define TIOCSETAW _IOW('t', 21, struct termios) /* drain output, set */ 63#define TIOCSETAF _IOW('t', 22, struct termios) /* drn out, fls in, set */ 64 /* 23-25 unused */ 65#define TIOCGETD _IOR('t', 26, int) /* get line discipline */ 66#define TIOCSETD _IOW('t', 27, int) /* set line discipline */ 67#define TIOCPTMASTER _IO('t', 28) /* pts master validation */ 68 /* 29-85 unused */ 69#define TIOCGDRAINWAIT _IOR('t', 86, int) /* get ttywait timeout */ 70#define TIOCSDRAINWAIT _IOW('t', 87, int) /* set ttywait timeout */ 71 /* 88 unused */ 72 /* 89-91 conflicts: tun and tap */ 73#define TIOCTIMESTAMP _IOR('t', 89, struct timeval) /* enable/get timestamp 74 * of last input event */ 75#define TIOCMGDTRWAIT _IOR('t', 90, int) /* modem: get wait on close */ 76#define TIOCMSDTRWAIT _IOW('t', 91, int) /* modem: set wait on close */ 77 /* 92-93 tun and tap */ 78 /* 94-97 conflicts: tun and tap */ 79#define TIOCDRAIN _IO('t', 94) /* wait till output drained */ 80#define TIOCSIG _IOWINT('t', 95) /* pty: generate signal */ 81#define TIOCEXT _IOW('t', 96, int) /* pty: external processing */ 82#define TIOCSCTTY _IO('t', 97) /* become controlling tty */ 83#define TIOCCONS _IOW('t', 98, int) /* become virtual console */ 84#define TIOCGSID _IOR('t', 99, int) /* get session id */ 85 /* 100 unused */ 86#define TIOCSTAT _IO('t', 101) /* simulate ^T status message */ 87#define TIOCUCNTL _IOW('t', 102, int) /* pty: set/clr usr cntl mode */ 88#define UIOCCMD(n) _IO('u', n) /* usr cntl op "n" */ 89#define TIOCSWINSZ _IOW('t', 103, struct winsize) /* set window size */ 90#define TIOCGWINSZ _IOR('t', 104, struct winsize) /* get window size */ 91 /* 105 unused */ 92#define TIOCMGET _IOR('t', 106, int) /* get all modem bits */ 93#define TIOCM_LE 0001 /* line enable */ 94#define TIOCM_DTR 0002 /* data terminal ready */ 95#define TIOCM_RTS 0004 /* request to send */ 96#define TIOCM_ST 0010 /* secondary transmit */ 97#define TIOCM_SR 0020 /* secondary receive */ 98#define TIOCM_CTS 0040 /* clear to send */ 99#define TIOCM_DCD 0100 /* data carrier detect */ 100#define TIOCM_RI 0200 /* ring indicate */ 101#define TIOCM_DSR 0400 /* data set ready */ 102#define TIOCM_CD TIOCM_DCD 103#define TIOCM_CAR TIOCM_DCD 104#define TIOCM_RNG TIOCM_RI 105#define TIOCMBIC _IOW('t', 107, int) /* bic modem bits */ 106#define TIOCMBIS _IOW('t', 108, int) /* bis modem bits */ 107#define TIOCMSET _IOW('t', 109, int) /* set all modem bits */ 108#define TIOCSTART _IO('t', 110) /* start output, like ^Q */ 109#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ 110#define TIOCPKT _IOW('t', 112, int) /* pty: set/clear packet mode */ 111#define TIOCPKT_DATA 0x00 /* data packet */ 112#define TIOCPKT_FLUSHREAD 0x01 /* flush packet */ 113#define TIOCPKT_FLUSHWRITE 0x02 /* flush packet */ 114#define TIOCPKT_STOP 0x04 /* stop output */ 115#define TIOCPKT_START 0x08 /* start output */ 116#define TIOCPKT_NOSTOP 0x10 /* no more ^S, ^Q */ 117#define TIOCPKT_DOSTOP 0x20 /* now do ^S ^Q */ 118#define TIOCPKT_IOCTL 0x40 /* state change of pty driver */ 119#define TIOCNOTTY _IO('t', 113) /* void tty association */ 120#define TIOCSTI _IOW('t', 114, char) /* simulate terminal input */ 121#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ 122 /* 116-117 compat */ 123#define TIOCSPGRP _IOW('t', 118, int) /* set pgrp of tty */ 124#define TIOCGPGRP _IOR('t', 119, int) /* get pgrp of tty */ 125#define TIOCCDTR _IO('t', 120) /* clear data terminal ready */ 126#define TIOCSDTR _IO('t', 121) /* set data terminal ready */ 127#define TIOCCBRK _IO('t', 122) /* clear break bit */ 128#define TIOCSBRK _IO('t', 123) /* set break bit */ 129 /* 124-127 compat */ 130 131#define TTYDISC 0 /* termios tty line discipline */ 132#define SLIPDISC 4 /* serial IP discipline */ 133#define PPPDISC 5 /* PPP discipline */ 134#define NETGRAPHDISC 6 /* Netgraph tty node discipline */ 135#define H4DISC 7 /* Netgraph Bluetooth H4 discipline */ 136 137#endif /* !_SYS_TTYCOM_H_ */ 138