libflute
|
FLUTE transmitter class. More...
#include <Transmitter.h>
Public Types | |
typedef std::function< void(uint32_t)> | completion_callback_t |
Definition of a file transmission completion callback function that can be registered through ::register_completion_callback. More... | |
Public Member Functions | |
Transmitter (const std::string &address, short port, uint64_t tsi, unsigned short mtu, uint32_t rate_limit, boost::asio::io_service &io_service) | |
Default constructor. More... | |
virtual | ~Transmitter () |
Default destructor. More... | |
void | enable_ipsec (uint32_t spi, const std::string &aes_key) |
Enable IPSEC ESP encryption of FLUTE payloads. More... | |
uint16_t | send (const std::string &content_location, const std::string &content_type, uint32_t expires, char *data, size_t length) |
Transmit a file. More... | |
uint64_t | seconds_since_epoch () |
Convenience function to get the current timestamp for expiry calculation. More... | |
void | register_completion_callback (completion_callback_t cb) |
Register a callback for file transmission completion notifications. More... | |
FLUTE transmitter class.
Construct an instance of this to send data through a FLUTE/ALC session.
Definition at line 34 of file Transmitter.h.
typedef std::function<void(uint32_t)> LibFlute::Transmitter::completion_callback_t |
Definition of a file transmission completion callback function that can be registered through ::register_completion_callback.
toi | TOI of the file that has completed transmission |
Definition at line 42 of file Transmitter.h.
LibFlute::Transmitter::Transmitter | ( | const std::string & | address, |
short | port, | ||
uint64_t | tsi, | ||
unsigned short | mtu, | ||
uint32_t | rate_limit, | ||
boost::asio::io_service & | io_service | ||
) |
Default constructor.
address | Target multicast address |
port | Target port |
tsi | TSI value for the session |
mtu | Path MTU to size FLUTE packets for |
rate_limit | Transmit rate limit (in kbps) |
io_service | Boost io_service to run the socket operations in (must be provided by the caller) |
Definition at line 26 of file Transmitter.cpp.
|
virtualdefault |
Default destructor.
auto LibFlute::Transmitter::enable_ipsec | ( | uint32_t | spi, |
const std::string & | aes_key | ||
) |
Enable IPSEC ESP encryption of FLUTE payloads.
spi | Security Parameter Index value to use |
key | AES key as a hex string (without leading 0x). Must be an even number of characters long. |
Definition at line 60 of file Transmitter.cpp.
|
inline |
Register a callback for file transmission completion notifications.
cb | Function to call on file completion |
Definition at line 103 of file Transmitter.h.
auto LibFlute::Transmitter::seconds_since_epoch | ( | ) |
Convenience function to get the current timestamp for expiry calculation.
Definition at line 71 of file Transmitter.cpp.
auto LibFlute::Transmitter::send | ( | const std::string & | content_location, |
const std::string & | content_type, | ||
uint32_t | expires, | ||
char * | data, | ||
size_t | length | ||
) |
Transmit a file.
The caller must ensure the data buffer passed here remains valid until the completion callback for this file is called.
content_location | URI to set in the content location field of the generated FDT entry |
content_type | MIME type to set in the content type field of the generated FDT entry |
expires | Expiry timestamp (based on NTP epoch) |
data | Pointer to the data buffer (managed by caller) |
length | Length of the data buffer (in bytes) |
Definition at line 93 of file Transmitter.cpp.