D:/opendownloadmanager/ODM-1.x/InetFile/cURL_lib/telnet.c File Reference

#include "setup.h"
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <ctype.h>
#include <netinet/in.h>
#include <netdb.h>
#include <sys/ioctl.h>
#include <signal.h>
#include "urldata.h"
#include <curl/curl.h>
#include "transfer.h"
#include "sendf.h"
#include "telnet.h"
#include "connect.h"
#include <curl/mprintf.h>
#include "arpa_telnet.h"
#include "memory.h"
#include "select.h"
#include "memdebug.h"

Go to the source code of this file.

Classes

struct  TELNET

Defines

#define _MPRINTF_REPLACE
#define TELOPTS
#define TELCMDS
#define SUBBUFSIZE   512
#define CURL_SB_CLEAR(x)   x->subpointer = x->subbuffer;
#define CURL_SB_TERM(x)   { x->subend = x->subpointer; CURL_SB_CLEAR(x); }
#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_EOF(x)   (x->subpointer >= x->subend)
#define CURL_SB_LEN(x)   (x->subend - x->subpointer)
#define CURL_NO   0
#define CURL_YES   1
#define CURL_WANTYES   2
#define CURL_WANTNO   3
#define CURL_EMPTY   0
#define CURL_OPPOSITE   1

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 void telrcv (struct connectdata *, unsigned char *inbuf, ssize_t count)
static void printoption (struct SessionHandle *data, const char *direction, int cmd, int option)
static void negotiate (struct connectdata *)
static void send_negotiation (struct connectdata *, int cmd, 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 printsub (struct SessionHandle *data, int direction, unsigned char *pointer, size_t length)
static void suboption (struct connectdata *)
static CURLcode init_telnet (struct connectdata *conn)
static void rec_will (struct connectdata *conn, int option)
static void rec_wont (struct connectdata *conn, int option)
static void rec_do (struct connectdata *conn, int option)
static void rec_dont (struct connectdata *conn, int option)
static CURLcode check_telnet_options (struct connectdata *conn)
CURLcode Curl_telnet_done (struct connectdata *conn, CURLcode status, bool premature)
CURLcode Curl_telnet (struct connectdata *conn, bool *done)


Define Documentation

#define _MPRINTF_REPLACE

Definition at line 71 of file telnet.c.

#define CURL_EMPTY   0

Definition at line 134 of file telnet.c.

Referenced by rec_do(), rec_dont(), rec_will(), rec_wont(), set_local_option(), and set_remote_option().

#define CURL_NO   0

Definition at line 129 of file telnet.c.

Referenced by rec_do(), rec_dont(), rec_will(), rec_wont(), set_local_option(), and set_remote_option().

#define CURL_OPPOSITE   1

Definition at line 135 of file telnet.c.

Referenced by rec_do(), rec_dont(), rec_will(), rec_wont(), set_local_option(), and set_remote_option().

#define CURL_SB_ACCUM ( x,
c   ) 

Value:

if (x->subpointer < (x->subbuffer+sizeof x->subbuffer)) { \
    *x->subpointer++ = (c); \
  }

Definition at line 88 of file telnet.c.

Referenced by telrcv().

#define CURL_SB_CLEAR (  )     x->subpointer = x->subbuffer;

Definition at line 86 of file telnet.c.

Referenced by init_telnet(), and telrcv().

#define CURL_SB_EOF (  )     (x->subpointer >= x->subend)

Definition at line 95 of file telnet.c.

#define CURL_SB_GET (  )     ((*x->subpointer++)&0xff)

Definition at line 93 of file telnet.c.

Referenced by suboption().

#define CURL_SB_LEN (  )     (x->subend - x->subpointer)

Definition at line 96 of file telnet.c.

Referenced by suboption().

#define CURL_SB_PEEK (  )     ((*x->subpointer)&0xff)

Definition at line 94 of file telnet.c.

#define CURL_SB_TERM (  )     { x->subend = x->subpointer; CURL_SB_CLEAR(x); }

Definition at line 87 of file telnet.c.

Referenced by telrcv().

#define CURL_WANTNO   3

Definition at line 132 of file telnet.c.

Referenced by rec_do(), rec_dont(), rec_will(), rec_wont(), set_local_option(), and set_remote_option().

#define CURL_WANTYES   2

Definition at line 131 of file telnet.c.

Referenced by rec_do(), rec_dont(), rec_will(), rec_wont(), set_local_option(), and set_remote_option().

#define CURL_YES   1

#define SUBBUFSIZE   512

Definition at line 84 of file telnet.c.

#define TELCMDS

Definition at line 75 of file telnet.c.

#define TELOPTS

Definition at line 74 of file telnet.c.


Enumeration Type Documentation

Enumerator:
CURL_TS_DATA 
CURL_TS_IAC 
CURL_TS_WILL 
CURL_TS_WONT 
CURL_TS_DO 
CURL_TS_DONT 
CURL_TS_CR 
CURL_TS_SB 
CURL_TS_SE 

Definition at line 140 of file telnet.c.


Function Documentation

static CURLcode check_telnet_options ( struct connectdata conn  )  [static]

CURLcode Curl_telnet ( struct connectdata conn,
bool done 
)

CURLcode Curl_telnet_done ( struct connectdata conn,
CURLcode  status,
bool  premature 
)

static CURLcode init_telnet ( struct connectdata conn  )  [static]

static void negotiate ( struct connectdata conn  )  [static]

static void printoption ( struct SessionHandle data,
const char *  direction,
int  cmd,
int  option 
) [static]

static void printsub ( struct SessionHandle data,
int  direction,
unsigned char *  pointer,
size_t  length 
) [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 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 void telrcv ( struct connectdata conn,
unsigned char *  inbuf,
ssize_t  count 
) [static]


Generated on Sun May 25 00:20:10 2008 by  doxygen 1.5.6