|
#define | TFTP_STD_PORT 69 |
|
#define | TFTP_MAX_IP_ADDR_STRLEN (16 * 2 + 7 + 1) |
|
#define | TFTP_MAX_ERROR_STRLEN 20 |
|
#define | TFTP_MAX_OPTIONS_SIZE 40 |
|
#define | TFTP_KNOWN_IPV4_ADDR0_STR "127.0.0.1" |
| IP address strings and server names resolved by network fake functions like inet_aton() and gethostbyname().
|
|
#define | TFTP_KNOWN_IPV4_ADDR0_ARRAY 127, 0, 0, 1 |
|
#define | TFTP_KNOWN_SERVER0_NAME "server.tftp" |
|
#define | TFTP_KNOWN_SERVER0_IPV4 "10.7.0.2" |
|
#define | TFTP_KNOWN_SERVER0_ARRAY 10, 7, 0, 2 |
|
#define | TFTP_FIRST_FD 33333 |
| The faked socket() function (i.e. socket interaction) must return a file descriptor equal or larger than TFTP_FIRST_FD or -1.
|
|
#define | TFTP_MODE_NETASCII "netascii" |
|
#define | TFTP_MODE_OCTET "octet" |
|
#define | TFTP_OPTION_BLKSIZE "blksize" |
|
#define | TFTP_OPTION_TIMEOUT "timeout" |
|
#define | TFTP_OPTION_TSIZE "tsize" |
|
#define | TFTP_OPTION_WINDOWSIZE "windowsize" |
|
#define | TFTP_WINDOW_SIZE_MIN 1 |
|
#define | TFTP_BLOCK_SIZE_MIN 8 |
|
#define | TFTP_BLOCK_SIZE_MAX 65464 |
|
|
enum | Tftp_Action_kind {
TFTP_IA_KIND_SOCKET
, TFTP_IA_KIND_CLOSE
, TFTP_IA_KIND_BIND
, TFTP_IA_KIND_SENDTO
,
TFTP_IA_KIND_RECVFROM
} |
|
enum | Tftp_Opcode {
TFTP_OPCODE_RRQ = 1
, TFTP_OPCODE_WRQ = 2
, TFTP_OPCODE_DATA = 3
, TFTP_OPCODE_ACK = 4
,
TFTP_OPCODE_ERROR = 5
, TFTP_OPCODE_OACK = 6
} |
|
enum | Tftp_Error_code {
TFTP_ERROR_CODE_NOT_DEFINED = 0
, TFTP_ERROR_CODE_NOT_FOUND = 1
, TFTP_ERROR_CODE_NO_ACCESS = 2
, TFTP_ERROR_CODE_DISK_FULL = 3
,
TFTP_ERROR_CODE_ILLEGAL = 4
, TFTP_ERROR_CODE_UNKNOWN_ID = 5
, TFTP_ERROR_CODE_FILE_EXISTS = 6
, TFTP_ERROR_CODE_NO_USER = 7
,
TFTP_ERROR_CODE_OPTION_NEGO = 8
} |
|
|
void | _Tftp_Add_interaction_socket (int domain, int type, int protocol, int result) |
|
void | _Tftp_Add_interaction_close (int fd, int result) |
|
void | _Tftp_Add_interaction_bind (int fd, int family, int result) |
|
void | _Tftp_Add_interaction_send_rrq (int fd, const char *filename, uint16_t dest_port, const char *dest_addr_str, uint16_t block_size, uint16_t window_size, bool result) |
|
void | _Tftp_Add_interaction_send_wrq (int fd, const char *filename, uint16_t dest_port, const char *dest_addr_str, uint16_t block_size, uint16_t window_size, bool result) |
|
void | _Tftp_Add_interaction_send_ack (int fd, uint16_t block_num, uint16_t dest_port, const char *dest_addr_str, bool result) |
|
void | _Tftp_Add_interaction_send_data (int fd, uint16_t block_num, size_t start, size_t len, uint8_t(*get_data)(size_t pos), uint16_t dest_port, const char *dest_addr_str, bool result) |
|
void | _Tftp_Add_interaction_send_error (int fd, uint16_t error_code, uint16_t dest_port, const char *dest_addr_str, bool result) |
|
void | _Tftp_Add_interaction_recv_data (int fd, uint32_t timeout_ms, uint16_t src_port, const char *src_addr_str, uint16_t block_num, size_t start, size_t len, uint8_t(*get_data)(size_t pos), bool result) |
|
void | _Tftp_Add_interaction_recv_ack (int fd, uint32_t timeout_ms, uint16_t src_port, const char *src_addr_str, uint16_t block_num, bool result) |
|
void | _Tftp_Add_interaction_recv_oack (int fd, uint32_t timeout_ms, uint16_t src_port, const char *src_addr_str, const char *options, size_t options_size, bool result) |
|
void | _Tftp_Add_interaction_recv_error (int fd, uint32_t timeout_ms, uint16_t src_port, const char *src_addr_str, uint16_t error_code, const char *err_msg, bool result) |
|
void | _Tftp_Add_interaction_recv_raw (int fd, uint32_t timeout_ms, uint16_t src_port, const char *src_addr_str, size_t len, const uint8_t *bytes, bool result) |
|
void | _Tftp_Add_interaction_recv_nothing (int fd, uint32_t timeout_ms) |
|
void | _Tftp_Reset (void) |
| Initialize and free the singleton control object.
|
|
void * | _Tftp_Append_interaction (Tftp_Action_kind kind, Tftp_Interaction_fn fn, size_t size) |
| Create an interaction and append it to the sequence of expected interactions.
|
|
bool | _Tftp_Has_no_more_interactions (void) |
| Have all queued interactions been processed?
|
|
const char * | _Tftp_Get_error_str (uint16_t error_code) |
| Provides a human readable description for an error code from an TFTP error packet.
|
|
This test suite provides a tests for libtftpfs.