RTEMS 6.1-rc4
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
tftpfs_interactions.c File Reference

This source file contains the implementation of network interaction functions related to the UDP network fake for tftpfs testing. More...

#include <stdio.h>
#include <inttypes.h>
#include <arpa/inet.h>
#include <rtems/test.h>
#include "tftpfs_interactions.h"
#include "tftpfs_udp_network_fake.h"

Data Structures

struct  interaction_data_socket
 
struct  interaction_data_close
 
struct  interaction_data_bind
 
struct  interaction_data_sendto
 
struct  interaction_data_recvfrom
 

Macros

#define TFTP_MAX_FILENAME_STRLEN   12
 

Typedefs

typedef struct interaction_data_socket interaction_data_socket
 
typedef struct interaction_data_close interaction_data_close
 
typedef struct interaction_data_bind interaction_data_bind
 
typedef struct interaction_data_sendto interaction_data_sendto
 
typedef struct interaction_data_recvfrom interaction_data_recvfrom
 

Functions

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)
 

Detailed Description

This source file contains the implementation of network interaction functions related to the UDP network fake for tftpfs testing.

The UDP Network Fake requires interactions between TFTP client and test (which emulates a TFTP server). The idea is that each test defines a sequence of interactions. In a successful test run all interactions must be carried out one-by-one till the last interaction is reached.

Interactions appear when the TFTP client calls functions like sendto(), recvfrom(), or socket(). Here functions are defined which