-
Notifications
You must be signed in to change notification settings - Fork 133
Add support for TELNET EXTENDED-OPTIONS-LIST (RFC861) #50
base: develop
Are you sure you want to change the base?
Conversation
I did not completed with a review, but one point I don't like is the introduction of another usage of "short" - it has a "slightly antiquated flavor". Why not just use ''int''? |
Changed. I was sort of imitating the |
The CI Windows failure looks like a Travis problem, I need to move this all to Azure Pipelines anyway.
The key gist of PROXY mode is to act as a transparent passthru. It can be useful for Wireshark-like tools, for example. Basically, PROXY won't automatically respond to negotiation, and assumes some other layer (e.g. another remote end) is doing the actual negotiation, and that libtelnet is effectively just working as a protocol parser only. Everything else looks good to me. Did you want to add yourself to the AUTHORS file, especially as this is a significant feature? |
Done, thanks for the reminder. I added input validation on the three functions that take a telopt as an argument to make sure it's within the valid range. |
This is awesome, are we getting this merged soon? |
Ack, sorry, I'm terrible at paying attention to GH notifications! :/ I'll figure out what's up with the Travis CI and then merge this. |
merged as fluffos@e9c2128 |
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?