RTEMS 6.1-rc7
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
tftpfs_udp_network_fake.h File Reference

This header file provides interfaces and functions used to implement the UDP network fake for tftpfs tests. More...

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  Tftp_Action
 
struct  Tftp_Interaction
 
struct  Tftp_Packet
 

Macros

#define _TFTPFS_UDP_NETWORK_FAKE_H
 
#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
 

Typedefs

typedef enum Tftp_Action_kind Tftp_Action_kind
 
typedef struct Tftp_Action Tftp_Action
 
typedef bool(* Tftp_Interaction_fn) (Tftp_Action *act, void *data)
 Carry out interactions with TFTP client.
 
typedef struct Tftp_Interaction Tftp_Interaction
 
typedef enum Tftp_Opcode Tftp_Opcode
 
typedef enum Tftp_Error_code Tftp_Error_code
 
typedef struct Tftp_Packet Tftp_Packet
 

Enumerations

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
}
 

Functions

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.
 

Detailed Description

This header file provides interfaces and functions used to implement the UDP network fake for tftpfs tests.

Definitions and declarations of data structures and functions.