Classes | Defines | Typedefs | Enumerations | Functions | Variables
tftp.c File Reference
#include "curl_setup.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 "multiif.h"
#include "url.h"
#include "strcase.h"
#include "speedcheck.h"
#include "select.h"
#include "escape.h"
#include "curl_printf.h"
#include "curl_memory.h"
#include "memdebug.h"
Include dependency graph for tftp.c:

Go to the source code of this file.

Classes

struct  tftp_packet
struct  tftp_state_data

Defines

#define NEXT_BLOCKNUM(x)   (((x)+1)&0xffff)
#define TFTP_BLKSIZE_DEFAULT   512
#define TFTP_BLKSIZE_MAX   65464
#define TFTP_BLKSIZE_MIN   8
#define TFTP_OPTION_BLKSIZE   "blksize"
#define TFTP_OPTION_INTERVAL   "timeout"
#define TFTP_OPTION_TSIZE   "tsize"

Typedefs

typedef struct tftp_packet tftp_packet_t
typedef struct tftp_state_data tftp_state_data_t

Enumerations

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_NONE = -100, TFTP_ERR_TIMEOUT, TFTP_ERR_NORESPONSE
}
enum  tftp_event_t {
  TFTP_EVENT_NONE = -1, 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_OACK = 6,
  TFTP_EVENT_TIMEOUT
}
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 }

Functions

static size_t Curl_strnlen (const char *string, size_t maxlen)
static unsigned short getrpacketblock (const tftp_packet_t *packet)
static unsigned short getrpacketevent (const tftp_packet_t *packet)
static void setpacketblock (tftp_packet_t *packet, unsigned short num)
static void setpacketevent (tftp_packet_t *packet, unsigned short num)
static CURLcode tftp_connect (struct connectdata *conn, bool *done)
static CURLcode tftp_connect_for_rx (tftp_state_data_t *state, tftp_event_t event)
static CURLcode tftp_connect_for_tx (tftp_state_data_t *state, tftp_event_t event)
static CURLcode tftp_disconnect (struct connectdata *conn, bool dead_connection)
static CURLcode tftp_do (struct connectdata *conn, bool *done)
static CURLcode tftp_doing (struct connectdata *conn, bool *dophase_done)
static CURLcode tftp_done (struct connectdata *conn, CURLcode, bool premature)
static int tftp_getsock (struct connectdata *conn, curl_socket_t *socks, int numsocks)
static CURLcode tftp_multi_statemach (struct connectdata *conn, bool *done)
static size_t tftp_option_add (tftp_state_data_t *state, size_t csize, char *buf, const char *option)
static const char * tftp_option_get (const char *buf, size_t len, const char **option, const char **value)
static CURLcode tftp_parse_option_ack (tftp_state_data_t *state, const char *ptr, int len)
static CURLcode tftp_perform (struct connectdata *conn, bool *dophase_done)
static CURLcode tftp_receive_packet (struct connectdata *conn)
static CURLcode tftp_rx (tftp_state_data_t *state, tftp_event_t event)
static CURLcode tftp_send_first (tftp_state_data_t *state, tftp_event_t event)
static CURLcode tftp_set_timeouts (tftp_state_data_t *state)
static CURLcode tftp_setup_connection (struct connectdata *conn)
static CURLcode tftp_state_machine (tftp_state_data_t *state, tftp_event_t event)
static long tftp_state_timeout (struct connectdata *conn, tftp_event_t *event)
static CURLcode tftp_translate_code (tftp_error_t error)
static CURLcode tftp_tx (tftp_state_data_t *state, tftp_event_t event)

Variables

struct Curl_handler Curl_handler_tftp

Define Documentation

#define NEXT_BLOCKNUM (   x)    (((x)+1)&0xffff)

Definition at line 572 of file tftp.c.

#define TFTP_BLKSIZE_DEFAULT   512

Definition at line 69 of file tftp.c.

#define TFTP_BLKSIZE_MAX   65464

Definition at line 71 of file tftp.c.

#define TFTP_BLKSIZE_MIN   8

Definition at line 70 of file tftp.c.

#define TFTP_OPTION_BLKSIZE   "blksize"

Definition at line 72 of file tftp.c.

#define TFTP_OPTION_INTERVAL   "timeout"

Definition at line 76 of file tftp.c.

#define TFTP_OPTION_TSIZE   "tsize"

Definition at line 75 of file tftp.c.


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_NONE 
TFTP_ERR_TIMEOUT 
TFTP_ERR_NORESPONSE 

Definition at line 102 of file tftp.c.

Enumerator:
TFTP_EVENT_NONE 
TFTP_EVENT_INIT 
TFTP_EVENT_RRQ 
TFTP_EVENT_WRQ 
TFTP_EVENT_DATA 
TFTP_EVENT_ACK 
TFTP_EVENT_ERROR 
TFTP_EVENT_OACK 
TFTP_EVENT_TIMEOUT 

Definition at line 90 of file tftp.c.

Enumerator:
TFTP_MODE_NETASCII 
TFTP_MODE_OCTET 

Definition at line 78 of file tftp.c.

Enumerator:
TFTP_STATE_START 
TFTP_STATE_RX 
TFTP_STATE_TX 
TFTP_STATE_FIN 

Definition at line 83 of file tftp.c.


Function Documentation

static size_t Curl_strnlen ( const char *  string,
size_t  maxlen 
) [static]

Definition at line 305 of file tftp.c.

static unsigned short getrpacketblock ( const tftp_packet_t packet) [static]

Definition at line 300 of file tftp.c.

static unsigned short getrpacketevent ( const tftp_packet_t packet) [static]

Definition at line 295 of file tftp.c.

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

Definition at line 289 of file tftp.c.

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

Definition at line 282 of file tftp.c.

static CURLcode tftp_connect ( struct connectdata conn,
bool done 
) [static]

Definition at line 962 of file tftp.c.

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

Definition at line 431 of file tftp.c.

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

Definition at line 415 of file tftp.c.

static CURLcode tftp_disconnect ( struct connectdata conn,
bool  dead_connection 
) [static]

Definition at line 940 of file tftp.c.

static CURLcode tftp_do ( struct connectdata conn,
bool done 
) [static]

Definition at line 1328 of file tftp.c.

static CURLcode tftp_doing ( struct connectdata conn,
bool dophase_done 
) [static]

Definition at line 1270 of file tftp.c.

static CURLcode tftp_done ( struct connectdata conn,
CURLcode  status,
bool  premature 
) [static]

Definition at line 1048 of file tftp.c.

static int tftp_getsock ( struct connectdata conn,
curl_socket_t socks,
int  numsocks 
) [static]

Definition at line 1074 of file tftp.c.

static CURLcode tftp_multi_statemach ( struct connectdata conn,
bool done 
) [static]

Definition at line 1211 of file tftp.c.

static size_t tftp_option_add ( tftp_state_data_t state,
size_t  csize,
char *  buf,
const char *  option 
) [static]

Definition at line 406 of file tftp.c.

static const char* tftp_option_get ( const char *  buf,
size_t  len,
const char **  option,
const char **  value 
) [static]

Definition at line 311 of file tftp.c.

static CURLcode tftp_parse_option_ack ( tftp_state_data_t state,
const char *  ptr,
int  len 
) [static]

Definition at line 333 of file tftp.c.

static CURLcode tftp_perform ( struct connectdata conn,
bool dophase_done 
) [static]

Definition at line 1297 of file tftp.c.

static CURLcode tftp_receive_packet ( struct connectdata conn) [static]

Definition at line 1092 of file tftp.c.

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

Definition at line 581 of file tftp.c.

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

Definition at line 447 of file tftp.c.

static CURLcode tftp_set_timeouts ( tftp_state_data_t state) [static]

Definition at line 199 of file tftp.c.

static CURLcode tftp_setup_connection ( struct connectdata conn) [static]

Definition at line 1356 of file tftp.c.

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

Definition at line 901 of file tftp.c.

static long tftp_state_timeout ( struct connectdata conn,
tftp_event_t event 
) [static]

Definition at line 1176 of file tftp.c.

static CURLcode tftp_translate_code ( tftp_error_t  error) [static]

Definition at line 849 of file tftp.c.

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

Definition at line 702 of file tftp.c.


Variable Documentation



rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:09