// This subclass of the RtpTransport is used for SRTP which is reponsible for // protecting/unprotecting the packets. It provides interfaces to set the crypto // parameters for the SrtpSession underneath. class SrtpTransport : public RtpTransport { public:
SrtpTransport(bool rtcp_mux_enabled, const FieldTrialsView& field_trials);
~SrtpTransport() override = default;
bool SendRtpPacket(CopyOnWriteBuffer* packet, const AsyncSocketPacketOptions& options,
int flags) override;
bool SendRtcpPacket(CopyOnWriteBuffer* packet, const AsyncSocketPacketOptions& options,
int flags) override;
// The transport becomes active if the send_session_ and recv_session_ are // created. bool IsSrtpActive() const override;
bool IsWritable(bool rtcp) const override;
// Create new send/recv sessions and set the negotiated crypto keys for RTP // packet encryption. The keys can either come from SDES negotiation or DTLS // handshake. bool SetRtpParams(int send_crypto_suite, const ZeroOnFreeBuffer<uint8_t>& send_key, const std::vector<int>& send_extension_ids,
int recv_crypto_suite, const ZeroOnFreeBuffer<uint8_t>& recv_key, const std::vector<int>& recv_extension_ids);
// Create new send/recv sessions and set the negotiated crypto keys for RTCP // packet encryption. The keys can either come from SDES negotiation or DTLS // handshake. bool SetRtcpParams(int send_crypto_suite, const ZeroOnFreeBuffer<uint8_t>& send_key, const std::vector<int>& send_extension_ids,
int recv_crypto_suite, const ZeroOnFreeBuffer<uint8_t>& recv_key, const std::vector<int>& recv_extension_ids);
// In addition to unregistering the sink, the SRTP transport // disassociates all SSRCs of the sink from libSRTP. bool UnregisterRtpDemuxerSink(RtpPacketSinkInterface* sink) override;
protected: // If the writable state changed, fire the SignalWritableState. void MaybeUpdateWritableState();
// Decrypts/verifies an invidiual RTP/RTCP packet. // If an HMAC is used, this will decrease the packet size. bool UnprotectRtp(CopyOnWriteBuffer& buffer); bool UnprotectRtcp(CopyOnWriteBuffer& buffer);
const std::string content_name_;
std::unique_ptr<SrtpSession> send_session_;
std::unique_ptr<SrtpSession> recv_session_; // Non-muxed RTCP requires different SRTP sessions as it leads to // separate DTLS handshakes.
std::unique_ptr<SrtpSession> send_rtcp_session_;
std::unique_ptr<SrtpSession> recv_rtcp_session_;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.