20 #include <boost/asio.hpp>
21 #include <boost/bind.hpp>
50 Receiver(
const std::string& iface,
const std::string& address,
51 short port, uint64_t tsi,
52 boost::asio::io_service& io_service);
65 void enable_ipsec( uint32_t spi,
const std::string& aes_key);
72 std::vector<std::shared_ptr<LibFlute::File>>
file_list();
87 void handle_receive_from(
const boost::system::error_code& error,
89 boost::asio::ip::udp::socket _socket;
90 boost::asio::ip::udp::endpoint _sender_endpoint;
92 enum { max_length = 2048 };
93 char _data[max_length];
95 std::unique_ptr<LibFlute::FileDeliveryTable> _fdt;
96 std::map<uint64_t, std::shared_ptr<LibFlute::File>> _files;
97 std::mutex _files_mutex;
98 std::string _mcast_address;
void register_completion_callback(completion_callback_t cb)
Register a callback for file reception notifications.
Receiver(const std::string &iface, const std::string &address, short port, uint64_t tsi, boost::asio::io_service &io_service)
Default constructor.
virtual ~Receiver()
Default destructor.
std::vector< std::shared_ptr< LibFlute::File > > file_list()
List all current files.
void enable_ipsec(uint32_t spi, const std::string &aes_key)
Enable IPSEC ESP decryption of FLUTE payloads.
void remove_expired_files(unsigned max_age)
Remove files from the list that are older than max_age seconds.
std::function< void(std::shared_ptr< LibFlute::File >)> completion_callback_t
Definition of a file reception completion callback function that can be registered through ::register...