SatCat5
satcat5::udp::TftpServerSimple Class Reference

Detailed Description

TFTP server with a simple streaming source and sink.

  • Client-provided filenames are ignored.
  • Fixed Readable source is used for each read/download. Note: Use "ArrayRead" to repeatedly serve the same file.
  • Fixed Writeable destination is used for each write/upload.
  • If either is null, requests of that type are disabled.

Definition at line 180 of file udp_tftp.h.

#include <udp_tftp.h>

Inheritance diagram for satcat5::udp::TftpServerSimple:
[legend]
Collaboration diagram for satcat5::udp::TftpServerSimple:
[legend]

Public Member Functions

 TftpServerSimple (satcat5::udp::Dispatch *iface, satcat5::io::Readable *src, satcat5::io::Writeable *dst)
 Attach this server to a network interface, and to a source and sink for transfered data.
 
bool active () const
 Is there an active transfer?
 

Protected Member Functions

satcat5::io::Readableread (const char *filename) override
 Child class MUST override these methods.
 
satcat5::io::Writeablewrite (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

satcat5::io::Readable *const m_src
 
satcat5::io::Writeable *const m_dst
 
satcat5::udp::Dispatch *const m_iface
 
satcat5::udp::TftpTransfer m_xfer
 
satcat5::net::Type m_filter
 Incoming packet filter.
 

Private Attributes

satcat5::net::Protocolm_next
 Linked list of Protocols.
 

Member Function Documentation

◆ frame_rcvd()

void TftpServerCore::frame_rcvd ( satcat5::io::LimitedRead src)
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:

  • Call m_iface->open_reply() to obtain a Writable object. (This also writes out any applicable frame headers.)
  • Write frame contents, then call write_finalize().

The child class MUST override this method.

Implements satcat5::net::Protocol.

Definition at line 454 of file udp_tftp.cc.


The documentation for this class was generated from the following files: