8 #ifndef COMPONENTS_CPP_UTILS_TFTP_H_
9 #define COMPONENTS_CPP_UTILS_TFTP_H_
10 #define TFTP_DEFAULT_PORT (69)
39 void start(uint16_t port = TFTP_DEFAULT_PORT);
49 void sendAck(uint16_t blockNumber);
50 void sendError(uint16_t code, std::string message);
60 struct sockaddr m_partnerAddress;
62 std::string m_filename;
64 std::string m_baseDir;
69 std::string m_baseDir;
void setBaseDir(std::string baseDir)
Set the base dir for file access. If we are asked to put a file to the file system, this is the base relative directory.
Definition: TFTP.cpp:281
void waitForAck(uint16_t blockNumber)
Wait for an acknowledgment from the client. After having sent data to the client, we expect an acknow...
Definition: TFTP.cpp:291
Encapsulate a socket.
Definition: Socket.h:62
void start(uint16_t port=TFTP_DEFAULT_PORT)
Start being a TFTP server.
Definition: TFTP.cpp:228
void sendError(uint16_t code, std::string message)
Send an error indication to the client.
Definition: TFTP.cpp:382
A TFTP server.
Definition: TFTP.h:35
void sendAck(uint16_t blockNumber)
Send an acknowledgment back to the partner. A TFTP acknowledgment packet contains an opcode (4) and a...
Definition: TFTP.cpp:206
void processWRQ()
Process a client write request.
Definition: TFTP.cpp:151
uint16_t waitForRequest(Socket *pServerSocket)
Wait for a client request. A TFTP server waits for requests to send or receive files. A request can be either WRQ (write request) which is a request from the client to write a new local file or it can be a RRQ (read request) which is a request from the client to read a local file.
Definition: TFTP.cpp:337
void setBaseDir(std::string baseDir)
Set the base dir for file access. If we are asked to put a file to the file system, this is the base relative directory.
Definition: TFTP.cpp:270
TFTP_Transaction()
Start a TFTP transaction.
Definition: TFTP.cpp:73
void processRRQ()
Process a client read request.
Definition: TFTP.cpp:86
Internal class for TFTP processing.
Definition: TFTP.h:44