Add support for TELNET EXTENDED-OPTIONS-LIST (RFC861) #50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds transparent support for negotiation and subnegotiation of TELNET options on the Extended Options List - see RFC861. This standard extends the maximum possible options number from 255 to 511 by wrapping negotiation/subnegotiation commands for these options inside a subnegotiation command for option 255 (EXOPL). No options utilizing this feature were ever defined, but it is nonetheless an Internet standard, and I happen to have an application that requires it.
The only significant user-facing change is the addition of the
short telopt_extended
member to event structsnegotiate_t
andsubnegotiate_t
. I didn't want to change the type of the existingunsigned char telopt
member as this could break existing user code, so I added the new member. Going forward, though, there should be no need for anyone to usetelopt
- I added a note to that effect in the readme.A few more notes:
unsigned char
toshort
, but I didn't add any checks that the supplied option number is 511 or less. I suppose these are needed intelnet_negotiate
,telnet_begin_sb
, andtelnet_subnegotiation
- anywhere else? Should they just call_error
and return?