1
- /* $OpenBSD: ttymodes.c,v 1.31 2017/04/30 23:13:25 djm Exp $ */
1
+ /* $OpenBSD: ttymodes.c,v 1.32 2017/04/30 23:26:54 djm Exp $ */
2
2
/*
3
3
* Author: Tatu Ylonen <[email protected] >
4
4
* Copyright (c) 1995 Tatu Ylonen <[email protected] >, Espoo, Finland
59
59
60
60
#define TTY_OP_END 0
61
61
/*
62
- * uint32 (u_int) follows speed in SSH1 and SSH2
62
+ * uint32 (u_int) follows speed.
63
63
*/
64
- #define TTY_OP_ISPEED_PROTO1 192
65
- #define TTY_OP_OSPEED_PROTO1 193
66
- #define TTY_OP_ISPEED_PROTO2 128
67
- #define TTY_OP_OSPEED_PROTO2 129
64
+ #define TTY_OP_ISPEED 128
65
+ #define TTY_OP_OSPEED 129
68
66
69
67
/*
70
68
* Converts POSIX speed_t to a baud rate. The values of the
@@ -282,11 +280,8 @@ tty_make_modes(int fd, struct termios *tiop)
282
280
struct termios tio ;
283
281
int baud ;
284
282
Buffer buf ;
285
- int tty_op_ospeed , tty_op_ispeed ;
286
283
287
284
buffer_init (& buf );
288
- tty_op_ospeed = TTY_OP_OSPEED_PROTO2 ;
289
- tty_op_ispeed = TTY_OP_ISPEED_PROTO2 ;
290
285
291
286
if (tiop == NULL ) {
292
287
if (fd == -1 ) {
@@ -302,10 +297,10 @@ tty_make_modes(int fd, struct termios *tiop)
302
297
303
298
/* Store input and output baud rates. */
304
299
baud = speed_to_baud (cfgetospeed (& tio ));
305
- buffer_put_char (& buf , tty_op_ospeed );
300
+ buffer_put_char (& buf , TTY_OP_OSPEED );
306
301
buffer_put_int (& buf , baud );
307
302
baud = speed_to_baud (cfgetispeed (& tio ));
308
- buffer_put_char (& buf , tty_op_ispeed );
303
+ buffer_put_char (& buf , TTY_OP_ISPEED );
309
304
buffer_put_int (& buf , baud );
310
305
311
306
/* Store values of mode flags. */
@@ -362,19 +357,15 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
362
357
case TTY_OP_END :
363
358
goto set ;
364
359
365
- /* XXX: future conflict possible */
366
- case TTY_OP_ISPEED_PROTO1 :
367
- case TTY_OP_ISPEED_PROTO2 :
360
+ case TTY_OP_ISPEED :
368
361
n_bytes += 4 ;
369
362
baud = packet_get_int ();
370
363
if (failure != -1 &&
371
364
cfsetispeed (& tio , baud_to_speed (baud )) == -1 )
372
365
error ("cfsetispeed failed for %d" , baud );
373
366
break ;
374
367
375
- /* XXX: future conflict possible */
376
- case TTY_OP_OSPEED_PROTO1 :
377
- case TTY_OP_OSPEED_PROTO2 :
368
+ case TTY_OP_OSPEED :
378
369
n_bytes += 4 ;
379
370
baud = packet_get_int ();
380
371
if (failure != -1 &&
0 commit comments