|
SatCat5
|
A TFTP server handles requests from remote clients.
File I/O is provided through FileReader and FileWriter. For safety reasons, file operations are limited to the designated working folder. Use "/" at your own risk.
Definition at line 57 of file file_tftp.h.
#include <file_tftp.h>
Public Member Functions | |
| TftpServerPosix (satcat5::udp::Dispatch *iface, const char *work_folder) | |
| Attach this TFTP server to a network interface. | |
| bool | active () const |
| Is there an active transfer? | |
Protected Member Functions | |
| std::string | check_path (const char *filename) |
| Check if a user-supplied path is safe to use. | |
| satcat5::io::Readable * | read (const char *filename) override |
| Child class MUST override these methods. | |
| satcat5::io::Writeable * | write (const char *filename) override |
| void | frame_rcvd (satcat5::io::LimitedRead &src) override |
| Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value. More... | |
Protected Attributes | |
| const std::string | m_work_folder |
| satcat5::io::FileWriter | m_dst |
| satcat5::io::FileReader | m_src |
| satcat5::udp::Dispatch *const | m_iface |
| satcat5::udp::TftpTransfer | m_xfer |
| satcat5::net::Type | m_filter |
| Incoming packet filter. | |
Private Attributes | |
| satcat5::net::Protocol * | m_next |
| Linked list of Protocols. | |
|
overrideprotectedvirtualinherited |
Dispatch calls frame_rcvd(...) for each incoming frame with with a matching net::Type value.
The child class SHOULD read the frame contents from the provided "src" object, which is only valid until the function returns.
To send a reply:
The child class MUST override this method.
Implements satcat5::net::Protocol.
Definition at line 454 of file udp_tftp.cc.