#include "server_setup.h"
#include "tftp.h"
#include <setjmp.h>
#include "curlx.h"
#include "getpart.h"
#include "util.h"
#include "server_sockaddr.h"
#include "memdebug.h"
Go to the source code of this file.
|
| static int | do_tftp (struct testcase *test, struct tftphdr *tp, ssize_t size) |
| |
| static RETSIGTYPE | exit_signal_handler (int signum) |
| |
| static void | install_signal_handlers (void) |
| |
| int | main (int argc, char **argv) |
| |
| static void | nak (int error) |
| |
| static int | parse_servercmd (struct testcase *req) |
| |
| static struct tftphdr * | r_init (void) |
| |
| static void | read_ahead (struct testcase *test, int convert) |
| |
| static int | readit (struct testcase *test, struct tftphdr **dpp, int convert) |
| |
| static void | recvtftp (struct testcase *test, struct formats *pf) |
| |
| static void | restore_signal_handlers (void) |
| |
| static struct tftphdr * | rw_init (int) |
| |
| static void | sendtftp (struct testcase *test, struct formats *pf) |
| |
| static int | synchnet (curl_socket_t) |
| |
| static int | validate_access (struct testcase *test, const char *fname, int mode) |
| |
| static struct tftphdr * | w_init (void) |
| |
| static ssize_t | write_behind (struct testcase *test, int convert) |
| |
| static int | writeit (struct testcase *test, struct tftphdr *volatile *dpp, int ct, int convert) |
| |
◆ BF_ALLOC
| #define BF_ALLOC -3 /* alloc'd but not yet filled */ |
◆ BF_FREE
| #define BF_FREE -2 /* free */ |
◆ DEFAULT_LOGFILE
| #define DEFAULT_LOGFILE "log/tftpd.log" |
◆ DEFAULT_PORT
| #define DEFAULT_PORT 8999 /* UDP */ |
◆ ENABLE_CURLX_PRINTF
| #define ENABLE_CURLX_PRINTF |
◆ MIN
| #define MIN |
( |
|
x, |
|
|
|
y |
|
) |
| ((x)<(y)?(x):(y)) |
◆ opcode_ACK
◆ opcode_DATA
◆ opcode_ERROR
◆ opcode_RRQ
◆ opcode_WRQ
◆ PKTSIZE
◆ REQUEST_DUMP
| #define REQUEST_DUMP "log/server.input" |
◆ siginterrupt
| #define siginterrupt |
( |
|
x, |
|
|
|
y |
|
) |
| do {} while(0) |
◆ TIMEOUT
◆ SIGHANDLER_T
◆ do_tftp()
◆ exit_signal_handler()
| static RETSIGTYPE exit_signal_handler |
( |
int |
signum | ) |
|
|
static |
◆ install_signal_handlers()
| static void install_signal_handlers |
( |
void |
| ) |
|
|
static |
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
◆ nak()
| static void nak |
( |
int |
error | ) |
|
|
static |
◆ parse_servercmd()
| static int parse_servercmd |
( |
struct testcase * |
req | ) |
|
|
static |
◆ r_init()
| static struct tftphdr * r_init |
( |
void |
| ) |
|
|
static |
◆ read_ahead()
| static void read_ahead |
( |
struct testcase * |
test, |
|
|
int |
convert |
|
) |
| |
|
static |
◆ readit()
| static int readit |
( |
struct testcase * |
test, |
|
|
struct tftphdr ** |
dpp, |
|
|
int |
convert |
|
) |
| |
|
static |
◆ recvtftp()
◆ restore_signal_handlers()
| static void restore_signal_handlers |
( |
void |
| ) |
|
|
static |
◆ rw_init()
| static struct tftphdr * rw_init |
( |
int |
x | ) |
|
|
static |
◆ sendtftp()
◆ synchnet()
◆ validate_access()
| static int validate_access |
( |
struct testcase * |
test, |
|
|
const char * |
fname, |
|
|
int |
mode |
|
) |
| |
|
static |
◆ w_init()
| static struct tftphdr * w_init |
( |
void |
| ) |
|
|
static |
◆ write_behind()
◆ writeit()
| static int writeit |
( |
struct testcase * |
test, |
|
|
struct tftphdr *volatile * |
dpp, |
|
|
int |
ct, |
|
|
int |
convert |
|
) |
| |
|
static |
◆ ackbuf
◆ bfs
◆ buf
◆ current
◆ errmsgs
Initial value:= {
{
EUNDEF,
"Undefined error code" },
{
ENOSPACE,
"Disk full or allocation exceeded" },
{
EBADOP,
"Illegal TFTP operation" },
{
EBADID,
"Unknown transfer ID" },
{
EEXISTS,
"File already exists" },
{ -1, 0 }
}
Definition at line 167 of file tftpd.c.
◆ exit_signal
| volatile int exit_signal = 0 |
|
static |
◆ formata
Initial value:= {
{ "netascii", 1 },
{ "octet", 0 },
{ NULL, 0 }
}
Definition at line 179 of file tftpd.c.
◆ from
◆ fromlen
◆ got_exit_signal
◆ ipv_inuse
| const char* ipv_inuse = "IPv4" |
|
static |
◆ maxtimeout
| unsigned int maxtimeout = 5 * TIMEOUT |
|
static |
◆ newline
◆ nextone
◆ peer
◆ pidname
| const char* pidname = ".tftpd.pid" |
|
static |
◆ prevchar
◆ serverlogfile
◆ serverlogslocked
◆ timeout
◆ wrotepidfile