libtelnet | Simple RFC-complient TELNET implementation as a C library | Telnet library
kandi X-RAY | libtelnet Summary
kandi X-RAY | libtelnet Summary
libtelnet provides safe and correct handling of the core TELNET protocol. In addition to the base TELNET protocol, libtelnet also implements the Q method of TELNET option negotiation. libtelnet can be used for writing servers, clients, or proxies.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libtelnet
libtelnet Key Features
libtelnet Examples and Code Snippets
Community Discussions
Trending Discussions on libtelnet
QUESTION
My goal is to use the C/C++ readline library on the telnet server-side as it delivers all necessary terminal functionality out of the box. Readline is already connected to the telnet socket, read and write to the socket works fine. I'm using libtelnet by Sean Middleditch.
The problem is that the readline outputs '\n' instead of '\n\r' which is a telnet standard to go to a new line = New Line + Carriage Return.
Current output on the client-side:
...ANSWER
Answered 2021-Mar-12 at 16:38It's not readline that should be changing its behaviour IMO, but libtelnet that should be performing the appropriate translation.
The documentation for libtelnet mentions
void telnet_send_text(telnet_t *telnet, const char *buffer, size_t size);
Sends text characters with translation of C newlines (\n) into CR LF and C carriage returns (\r) into CR NUL, as required by RFC854, unless transmission in BINARY mode has been negotiated.
so it should be able to handle this. You'll have to show how readline is talking to libtelnet if you need more detailed help.
Edit - it looks like you're using libtelnet to handle input from the telnet client, but allowing readline to put characters directly on the socket back to the client. This is a mistake. Per the libtelnet documentation:
Note: it is very important that ALL data sent to the remote end of the connection be passed through libtelnet. All user input or process output that you wish to send over the wire should be given to one of the following functions. Do NOT send or buffer unprocessed output data directly!
That is, you need
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install libtelnet
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page