#include "curl_setup.h"
#include "urldata.h"
#include <curl/curl.h>
#include "transfer.h"
#include "sendf.h"
#include "telnet.h"
#include "connect.h"
#include "progress.h"
#include "system_win32.h"
#include "arpa_telnet.h"
#include "select.h"
#include "strcase.h"
#include "warnless.h"
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
Go to the source code of this file.
Classes | |
struct | TELNET |
Defines | |
#define | bufferflush() startskipping() |
#define | CURL_EMPTY 0 |
#define | CURL_NO 0 |
#define | CURL_OPPOSITE 1 |
#define | CURL_SB_ACCUM(x, c) |
#define | CURL_SB_CLEAR(x) x->subpointer = x->subbuffer |
#define | CURL_SB_EOF(x) (x->subpointer >= x->subend) |
#define | CURL_SB_GET(x) ((*x->subpointer++)&0xff) |
#define | CURL_SB_LEN(x) (x->subend - x->subpointer) |
#define | CURL_SB_PEEK(x) ((*x->subpointer)&0xff) |
#define | CURL_SB_TERM(x) |
#define | CURL_WANTNO 3 |
#define | CURL_WANTYES 2 |
#define | CURL_YES 1 |
#define | startskipping() |
#define | SUBBUFSIZE 512 |
#define | TELCMDS |
#define | TELOPTS |
#define | writebyte() |
Enumerations | |
enum | TelnetReceive { CURL_TS_DATA = 0, CURL_TS_IAC, CURL_TS_WILL, CURL_TS_WONT, CURL_TS_DO, CURL_TS_DONT, CURL_TS_CR, CURL_TS_SB, CURL_TS_SE } |
Functions | |
static CURLcode | check_telnet_options (struct connectdata *conn) |
static CURLcode | init_telnet (struct connectdata *conn) |
static void | negotiate (struct connectdata *) |
static void | printoption (struct Curl_easy *data, const char *direction, int cmd, int option) |
static void | printsub (struct Curl_easy *data, int direction, unsigned char *pointer, size_t length) |
static void | rec_do (struct connectdata *conn, int option) |
static void | rec_dont (struct connectdata *conn, int option) |
static void | rec_will (struct connectdata *conn, int option) |
static void | rec_wont (struct connectdata *conn, int option) |
static void | send_negotiation (struct connectdata *, int cmd, int option) |
static CURLcode | send_telnet_data (struct connectdata *conn, char *buffer, ssize_t nread) |
static void | sendsuboption (struct connectdata *conn, int option) |
static void | set_local_option (struct connectdata *, int cmd, int option) |
static void | set_remote_option (struct connectdata *, int cmd, int option) |
static void | suboption (struct connectdata *) |
static CURLcode | telnet_do (struct connectdata *conn, bool *done) |
static CURLcode | telnet_done (struct connectdata *conn, CURLcode, bool premature) |
static CURLcode | telrcv (struct connectdata *, const unsigned char *inbuf, ssize_t count) |
Variables | |
struct Curl_handler | Curl_handler_telnet |
#define bufferflush | ( | ) | startskipping() |
#define CURL_EMPTY 0 |
#define CURL_OPPOSITE 1 |
#define CURL_SB_ACCUM | ( | x, | |
c | |||
) |
#define CURL_SB_GET | ( | x | ) | ((*x->subpointer++)&0xff) |
#define CURL_SB_PEEK | ( | x | ) | ((*x->subpointer)&0xff) |
#define CURL_SB_TERM | ( | x | ) |
do { \ x->subend = x->subpointer; \ CURL_SB_CLEAR(x); \ } WHILE_FALSE
#define CURL_WANTNO 3 |
#define CURL_WANTYES 2 |
#define startskipping | ( | ) |
if(startwrite >= 0) { \ result = Curl_client_write(conn, \ CLIENTWRITE_BODY, \ (char *)&inbuf[startwrite], \ in-startwrite); \ if(result) \ return result; \ } \ startwrite = -1
#define SUBBUFSIZE 512 |
#define writebyte | ( | ) |
if(startwrite < 0) \
startwrite = in
enum TelnetReceive |
static CURLcode check_telnet_options | ( | struct connectdata * | conn | ) | [static] |
static CURLcode init_telnet | ( | struct connectdata * | conn | ) | [static] |
static void negotiate | ( | struct connectdata * | conn | ) | [static] |
static void printoption | ( | struct Curl_easy * | data, |
const char * | direction, | ||
int | cmd, | ||
int | option | ||
) | [static] |
static void rec_do | ( | struct connectdata * | conn, |
int | option | ||
) | [static] |
static void rec_dont | ( | struct connectdata * | conn, |
int | option | ||
) | [static] |
static void rec_will | ( | struct connectdata * | conn, |
int | option | ||
) | [static] |
static void rec_wont | ( | struct connectdata * | conn, |
int | option | ||
) | [static] |
static void send_negotiation | ( | struct connectdata * | conn, |
int | cmd, | ||
int | option | ||
) | [static] |
static CURLcode send_telnet_data | ( | struct connectdata * | conn, |
char * | buffer, | ||
ssize_t | nread | ||
) | [static] |
static void sendsuboption | ( | struct connectdata * | conn, |
int | option | ||
) | [static] |
static void set_local_option | ( | struct connectdata * | conn, |
int | cmd, | ||
int | option | ||
) | [static] |
static void set_remote_option | ( | struct connectdata * | conn, |
int | cmd, | ||
int | option | ||
) | [static] |
static void suboption | ( | struct connectdata * | conn | ) | [static] |
static CURLcode telnet_do | ( | struct connectdata * | conn, |
bool * | done | ||
) | [static] |
static CURLcode telnet_done | ( | struct connectdata * | conn, |
CURLcode | status, | ||
bool | premature | ||
) | [static] |
static CURLcode telrcv | ( | struct connectdata * | conn, |
const unsigned char * | inbuf, | ||
ssize_t | count | ||
) | [static] |
struct Curl_handler Curl_handler_telnet |
{ "TELNET", ZERO_NULL, telnet_do, telnet_done, ZERO_NULL, ZERO_NULL, ZERO_NULL, ZERO_NULL, ZERO_NULL, ZERO_NULL, ZERO_NULL, ZERO_NULL, ZERO_NULL, ZERO_NULL, PORT_TELNET, CURLPROTO_TELNET, PROTOPT_NONE | PROTOPT_NOURLQUERY }