The handler should never return RTP_OK because the packet should
be dispatched to lower layers after authenticity has been verified/
payload has been decrypted.
Auxiliary handlers may need access to the original block of memory
(such as SRTP) so instead of relaying that parameter to every handler,
store pointer to the block inside the RTP frame. The pointer is valid
as long as the packet is being processed and the last handler should
set it to nullptr.
Some changes to the public frame should be made because a lot of
the fields in the frames used by uvgRTP are not important outside
the library.
By default uvgRTP assumes that the memory it gets from user is not
writable and if user doesn't explictly specify that the memory
is writable (RCE_SRTP_INPLACE_ENCRYPTION) or that encryption is
not necessary (RCE_SRTP_NULL_CIPHER), a copy of the memory block is
made before it is pushed into the frame queue.
Create separate classes for SRTP and SRTCP because even though
they are quite similar, they require some different actions when
en/decrypting the packets and create a whole bunch of if-elses
is ugly
Operate on a raw block of memory, extract interesting fields from the
packet and create user-friendly struct for the APP packet that
can be queried using SSRC
Caller must remember to free the memory occupied by the APP payload
Operate on a raw block of memory, extract interesting fields from the
packet and create user-friendly struct for the SDES packet that
can be queried using SSRC
Caller must remember to free the memory occupied by the SDES items
Operate on a raw block of memory, extract interesting fields from the
packet and create user-friendly struct for the Sender Report that
can be queried using SSRC
PACKED_STRUCT is quite an ugly hack if it must be cross-platform
so better to process the incoming (and soon outgoing) RTCP data
as raw memory and craft user-friendly RTCP packets from those
memory blocks which do not including strict padding or truncated fields.
The frame (de)allocation is handled internally by each message
handler and include/frame.hh shall only provide the structure
format for RTCP Receive Report.
This makes it a little simpler to add support Secure RTCP later on,
enables us to deprecate the Receiver Report interface from src/frame.cc
and makes it automatically cross-platform (previously PACKED_STRUCT
was a GCC-only feature)
The authentication tag for each packet is stored inside the active
transaction and they are destroyed when the transaction is deallocated.
This way neither Socket nor SRTP needs to worry about (de)allocation
of those tags.
The authentication tag occupies the last slot in the pkt_vec structure
of each packet so it's easily accessible for the security layer when
calculating the checksum and guaranteed to be there if
RCE_SRTP_AUTHENTICATE_RTP has been provided.
Move frame queue to Media object and implement the generic push API
using a frame queue
This change temporarily disable the fragmentation of generic frames
Introduce buf_vec and pkt_vec structures which enable cross-platform
scatter/gather I/O. This supersedes the previous Linux-only mmsghdr
hack. Buf_vec contains buffers of a single RTP frame
whereas pkt_vec contains multiple buf_vec structures that are sent
all at once when flush_queue() is called.
From now on all media formats should use frame queue to implement
RTP frame sending. This is because internally the frame queue
updates RTP header information and it can inject additional fields
to the RTP frame such as an authentication tag.