Send Break to terminal server

Avis avis at speakeasy.net
Thu Jan 22 17:39:40 EST 2004


I found the characters sent by TeraTerm Pro.
It was '0xFF', followed by '0xF3'.

	case 'B':
				if (compat20) {
					snprintf(string, sizeof string,
					    "%cB\r\n", escape_char);
					buffer_append(berr, string,
					    strlen(string));
					channel_request_start(session_ident,
					    "break", 0);
					packet_put_int(1000);
					packet_send();
				} else {
					buffer_put_char(bin, 0xFF);
					buffer_put_char(bin, 0xF3);
                        }
				continue;

Above is the modifications I made for it to work.
What it does is to use the break if using version 2.
And use the break characters if using version 1.

For MRV terminal servers, I'll simply force version 1 when I want to send
breaks.

-----Original Message-----
From: Darren Tucker [mailto:dtucker at zip.com.au] 
Sent: Friday, January 09, 2004 7:58 PM
To: Avis
Cc: openssh-unix-dev at mindrot.org
Subject: Re: Send Break to terminal server

Avis wrote:

> Darren, thanks.
> I did try all combinations of '~b', '~B', '~<ctrl-B>', and even
'~<alt-B>'.
> With the debug, it's obvious that you were right, '~B' was the one that
> triggered the request break.
> However, nothing happen in the request break function.
> Is there something I need to set in the compilation?
> Is there a library that I am missing?

No, there's nothing else to be done at compile time, and according to 
the debugging the break request is being sent just fine.

> bash-2.03# debug2: channel 0: request break
> ~B
> debug2: channel 0: written 4 to efd 7

It's possible that your terminal server does not like the length of the 
break requested (OpenSSH hard-codes that to 1000 ms).  You can fiddle 
with that at compile time, it's in clientloop.c around line 585:

case 'B':
	if (compat20) {
		snprintf(string, sizeof string,
		    "%cB\r\n", escape_char);
		buffer_append(berr, string,
		    strlen(string));
 

channel_request_start(session_ident,
		    "break", 0);
		packet_put_int(1000);
		packet_send();
	}

You can try changing the number inside the packet_put_int (I suggest 
trying "0" first as that the server should use "500ms or the default 
BREAK signal length of the chipset or underlying chipset driver.")

-- 
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
     Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.





More information about the openssh-unix-dev mailing list