xref: /freebsd/contrib/telnet/telnet/baud.h (revision a0ee8cc6)
1 /*
2  * Copyright (c) 2014 EMC Corporation
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  * $FreeBSD$
27  */
28 
29 /*
30  * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD).
31  */
32 #if B4800 != 4800
33 #define	DECODE_BAUD
34 #endif
35 
36 #ifdef	DECODE_BAUD
37 #ifndef	B7200
38 #define B7200   B4800
39 #endif
40 
41 #ifndef	B14400
42 #define B14400  B9600
43 #endif
44 
45 #ifndef	B19200
46 #define B19200  B14400
47 #endif
48 
49 #ifndef	B28800
50 #define B28800  B19200
51 #endif
52 
53 #ifndef	B38400
54 #define B38400  B28800
55 #endif
56 
57 #ifndef B57600
58 #define B57600  B38400
59 #endif
60 
61 #ifndef B76800
62 #define B76800  B57600
63 #endif
64 
65 #ifndef B115200
66 #define B115200 B76800
67 #endif
68 
69 #ifndef B115200
70 #define B115200 B76800
71 #endif
72 #endif
73 
74 #ifndef B230400
75 #define B230400 B115200
76 #endif
77 
78 /*
79  * A table of available terminal speeds
80  */
81 struct termspeeds termspeeds[] = {
82 	{ 0,      B0 },
83 	{ 50,     B50 },
84 	{ 75,     B75 },
85 	{ 110,    B110 },
86 	{ 134,    B134 },
87 	{ 150,    B150 },
88 	{ 200,    B200 },
89 	{ 300,    B300 },
90 	{ 600,    B600 },
91 	{ 1200,   B1200 },
92 	{ 1800,   B1800 },
93 	{ 2400,   B2400 },
94 	{ 4800,   B4800 },
95 #ifdef	B7200
96 	{ 7200,   B7200 },
97 #endif
98 	{ 9600,   B9600 },
99 #ifdef	B14400
100 	{ 14400,  B14400 },
101 #endif
102 #ifdef	B19200
103 	{ 19200,  B19200 },
104 #endif
105 #ifdef	B28800
106 	{ 28800,  B28800 },
107 #endif
108 #ifdef	B38400
109 	{ 38400,  B38400 },
110 #endif
111 #ifdef	B57600
112 	{ 57600,  B57600 },
113 #endif
114 #ifdef	B115200
115 	{ 115200, B115200 },
116 #endif
117 #ifdef	B230400
118 	{ 230400, B230400 },
119 #endif
120 	{ -1,     0 }
121 };
122