Improve source tree

This commit is contained in:
Igor Socec 2017-01-11 17:30:13 +01:00
parent 61d4e2fc64
commit efc292af2c
17 changed files with 77 additions and 35 deletions

29
moxerver/telnet.h Normal file
View file

@ -0,0 +1,29 @@
/* Handles details related to telnet protocol. */
#pragma once
#include <common.h>
#define TELNET_MSG_LEN_CHARMODE 9
/**
* Creates a telnet protocol message that tells client to go into "character"
* mode. The passed data buffer must be big enough to hold the message payload
* with the size defined by TELNET_MSG_LEN_CHARMODE.
* Operates directly on the passed data buffer.
*/
void telnet_message_set_character_mode(char *databuf);
/**
* Handles special characters in the data buffer after receiving them from the
* client. Used to filter out the handshake commands of telnet protocol.
* Operates directly on the passed data buffer and modifies the payload length.
*/
void telnet_filter_client_read(char *databuf, int *datalen);
/**
* Handles special characters in the data buffer before sending them to the
* client. Used to correctly echo the characters to the telnet client.
* Operates directly on the passed data buffer and modifies the payload length.
*/
void telnet_filter_client_write(char *databuf, int *datalen);