D:/opendownloadmanager/ODM-1.x/InetFile/cURL_lib/tftp.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 "tftp.h"
#include "progress.h"
#include "connect.h"
#include "strerror.h"
#include "sockaddr.h"
#include "url.h"
#include <curl/mprintf.h>
#include "memory.h"
#include "select.h"
#include "memdebug.h"

Go to the source code of this file.

Classes

struct  tftp_packet
struct  tftp_state_data

Defines

#define _MPRINTF_REPLACE
#define TFTP_BLOCKSIZE   512

Typedefs

typedef struct tftp_packet tftp_packet_t
typedef struct tftp_state_data tftp_state_data_t

Enumerations

enum  tftp_mode_t { TFTP_MODE_NETASCII = 0, TFTP_MODE_OCTET }
enum  tftp_state_t { TFTP_STATE_START = 0, TFTP_STATE_RX, TFTP_STATE_TX, TFTP_STATE_FIN }
enum  tftp_event_t {
  TFTP_EVENT_INIT = 0, TFTP_EVENT_RRQ = 1, TFTP_EVENT_WRQ = 2, TFTP_EVENT_DATA = 3,
  TFTP_EVENT_ACK = 4, TFTP_EVENT_ERROR = 5, TFTP_EVENT_TIMEOUT
}
enum  tftp_error_t {
  TFTP_ERR_UNDEF = 0, TFTP_ERR_NOTFOUND, TFTP_ERR_PERM, TFTP_ERR_DISKFULL,
  TFTP_ERR_ILLEGAL, TFTP_ERR_UNKNOWNID, TFTP_ERR_EXISTS, TFTP_ERR_NOSUCHUSER,
  TFTP_ERR_TIMEOUT, TFTP_ERR_NORESPONSE
}

Functions

static CURLcode tftp_rx (tftp_state_data_t *state, tftp_event_t event)
static CURLcode tftp_tx (tftp_state_data_t *state, tftp_event_t event)
void tftp_set_timeouts (tftp_state_data_t *state)
static void setpacketevent (tftp_packet_t *packet, unsigned short num)
static void setpacketblock (tftp_packet_t *packet, unsigned short num)
static unsigned short getrpacketevent (tftp_packet_t *packet)
static unsigned short getrpacketblock (tftp_packet_t *packet)
static CURLcode tftp_send_first (tftp_state_data_t *state, tftp_event_t event)
static CURLcode tftp_state_machine (tftp_state_data_t *state, tftp_event_t event)
CURLcode Curl_tftp_connect (struct connectdata *conn, bool *done)
CURLcode Curl_tftp_done (struct connectdata *conn, CURLcode status, bool premature)
CURLcode Curl_tftp (struct connectdata *conn, bool *done)


Define Documentation

#define _MPRINTF_REPLACE

Definition at line 75 of file tftp.c.

#define TFTP_BLOCKSIZE   512

Definition at line 85 of file tftp.c.

Referenced by tftp_send_first(), and tftp_tx().


Typedef Documentation

typedef struct tftp_packet tftp_packet_t


Enumeration Type Documentation

Enumerator:
TFTP_ERR_UNDEF 
TFTP_ERR_NOTFOUND 
TFTP_ERR_PERM 
TFTP_ERR_DISKFULL 
TFTP_ERR_ILLEGAL 
TFTP_ERR_UNKNOWNID 
TFTP_ERR_EXISTS 
TFTP_ERR_NOSUCHUSER 
TFTP_ERR_TIMEOUT 
TFTP_ERR_NORESPONSE 

Definition at line 109 of file tftp.c.

Enumerator:
TFTP_EVENT_INIT 
TFTP_EVENT_RRQ 
TFTP_EVENT_WRQ 
TFTP_EVENT_DATA 
TFTP_EVENT_ACK 
TFTP_EVENT_ERROR 
TFTP_EVENT_TIMEOUT 

Definition at line 99 of file tftp.c.

Enumerator:
TFTP_MODE_NETASCII 
TFTP_MODE_OCTET 

Definition at line 87 of file tftp.c.

Enumerator:
TFTP_STATE_START 
TFTP_STATE_RX 
TFTP_STATE_TX 
TFTP_STATE_FIN 

Definition at line 92 of file tftp.c.


Function Documentation

CURLcode Curl_tftp ( struct connectdata conn,
bool done 
)

CURLcode Curl_tftp_connect ( struct connectdata conn,
bool done 
)

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

static unsigned short getrpacketblock ( tftp_packet_t packet  )  [static]

Definition at line 248 of file tftp.c.

References tftp_packet::data.

Referenced by Curl_tftp(), tftp_rx(), and tftp_tx().

static unsigned short getrpacketevent ( tftp_packet_t packet  )  [static]

Definition at line 243 of file tftp.c.

References tftp_packet::data.

Referenced by Curl_tftp().

static void setpacketblock ( tftp_packet_t packet,
unsigned short  num 
) [static]

Definition at line 237 of file tftp.c.

References tftp_packet::data.

Referenced by tftp_rx(), and tftp_tx().

static void setpacketevent ( tftp_packet_t packet,
unsigned short  num 
) [static]

Definition at line 230 of file tftp.c.

References tftp_packet::data.

Referenced by tftp_rx(), tftp_send_first(), and tftp_tx().

static CURLcode tftp_rx ( tftp_state_data_t state,
tftp_event_t  event 
) [static]

static CURLcode tftp_send_first ( tftp_state_data_t state,
tftp_event_t  event 
) [static]

void tftp_set_timeouts ( tftp_state_data_t state  ) 

static CURLcode tftp_state_machine ( tftp_state_data_t state,
tftp_event_t  event 
) [static]

static CURLcode tftp_tx ( tftp_state_data_t state,
tftp_event_t  event 
) [static]


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