|
Home > Archive > Unix Programming > December 2006 > Telnet Window Size Option (NAWS)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Telnet Window Size Option (NAWS)
|
|
| farhnware@gmail.com 2006-12-23, 1:33 pm |
| In the RFC for the Telnet Window Size Option (NAWS), it says that "The
subnegotiation consists of two values, the width and the height of the
window in characters. The values are each sent as two bytes, in the
Internet standard byte and bit order." The syntax for that subnegotion
is the following:
IAC SB NAWS WIDTH[1] WIDTH[0] HEIGHT[1] HEIGHT[0] IAC SE
Which I find strange because [1] comes before [0]. Using that syntax,
the following line gives a width of 80 and a height of 24:
IAC SB NAWS 0 80 0 24 IAC SE
But this line gives a width of 300 and a height of 24:
IAC SB NAWS 1 44 0 24 IAC SE
And that is where I got lost. How does "1 44" equal 300? Thanks in
advance.
| |
| farhnware@gmail.com 2006-12-23, 7:33 pm |
| Nevermind, my question was answered elsewhere. Thanks anyway.
| |
|
| farhnware wrote:
> In the RFC for the Telnet Window Size Option (NAWS), it says that "The
> subnegotiation consists of two values, the width and the height of the
> window in characters. The values are each sent as two bytes, in the
> Internet standard byte and bit order." The syntax for that subnegotion
> is the following:
>
> IAC SB NAWS WIDTH[1] WIDTH[0] HEIGHT[1] HEIGHT[0] IAC SE
>
> Which I find strange because [1] comes before [0]. Using that syntax,
> the following line gives a width of 80 and a height of 24:
>
> IAC SB NAWS 0 80 0 24 IAC SE
>
> But this line gives a width of 300 and a height of 24:
>
> IAC SB NAWS 1 44 0 24 IAC SE
>
> And that is where I got lost. How does "1 44" equal 300?
300 = 1*256^1 + 44*256^0
Therefore "1 44"(base256) = 300(base10)
|
|
|
|
|