Ring Daemon
16.0.0
Loading...
Searching...
No Matches
srtp.h
Go to the documentation of this file.
1
/*
2
* SRTP encryption/decryption
3
* Copyright (c) 2012 Martin Storsjo
4
*
5
* This file is part of Libav.
6
*
7
* Libav is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
11
*
12
* Libav is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
16
*
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with Libav; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
*/
21
22
#ifndef SRTP_H
23
#define SRTP_H
24
25
#include <stdint.h>
26
27
struct
AVAES;
28
struct
AVHMAC;
29
30
struct
SRTPContext
31
{
32
struct
AVAES*
aes
;
33
struct
AVHMAC*
hmac
;
34
int
rtp_hmac_size
,
rtcp_hmac_size
;
35
uint8_t
master_key
[16];
36
uint8_t
master_salt
[14];
37
uint8_t
rtp_key
[16],
rtcp_key
[16];
38
uint8_t
rtp_salt
[14],
rtcp_salt
[14];
39
uint8_t
rtp_auth
[20],
rtcp_auth
[20];
40
int
seq_largest
,
seq_initialized
;
41
uint32_t
roc
;
42
43
uint32_t
rtcp_index
;
44
};
45
46
int
ff_srtp_set_crypto
(
struct
SRTPContext
* s,
const
char
* suite,
const
char
* params);
47
void
ff_srtp_free
(
struct
SRTPContext
* s);
48
int
ff_srtp_decrypt
(
struct
SRTPContext
* s, uint8_t* buf,
int
* lenptr);
49
int
ff_srtp_encrypt
(
struct
SRTPContext
* s,
const
uint8_t* in,
int
len, uint8_t* out,
int
outlen);
50
51
/* RTCP packet types */
52
enum
RTCPType
{
RTCP_FIR
= 192,
RTCP_IJ
= 195,
RTCP_SR
= 200,
RTCP_TOKEN
= 210,
RTCP_REMB
= 206 };
53
54
#define RTP_PT_IS_RTCP(x) \
55
(((x) >= RTCP_FIR && (x) <= RTCP_IJ) || ((x) >= RTCP_SR && (x) <= RTCP_TOKEN))
56
57
#endif
/* SRTP_H */
ff_srtp_encrypt
int ff_srtp_encrypt(struct SRTPContext *s, const uint8_t *in, int len, uint8_t *out, int outlen)
ff_srtp_set_crypto
int ff_srtp_set_crypto(struct SRTPContext *s, const char *suite, const char *params)
RTCPType
RTCPType
Definition
srtp.h:52
RTCP_SR
@ RTCP_SR
Definition
srtp.h:52
RTCP_IJ
@ RTCP_IJ
Definition
srtp.h:52
RTCP_FIR
@ RTCP_FIR
Definition
srtp.h:52
RTCP_REMB
@ RTCP_REMB
Definition
srtp.h:52
RTCP_TOKEN
@ RTCP_TOKEN
Definition
srtp.h:52
ff_srtp_decrypt
int ff_srtp_decrypt(struct SRTPContext *s, uint8_t *buf, int *lenptr)
ff_srtp_free
void ff_srtp_free(struct SRTPContext *s)
SRTPContext
Definition
srtp.h:31
SRTPContext::rtcp_auth
uint8_t rtcp_auth[20]
Definition
srtp.h:39
SRTPContext::rtcp_key
uint8_t rtcp_key[16]
Definition
srtp.h:37
SRTPContext::rtcp_index
uint32_t rtcp_index
Definition
srtp.h:43
SRTPContext::aes
struct AVAES * aes
Definition
srtp.h:32
SRTPContext::rtcp_salt
uint8_t rtcp_salt[14]
Definition
srtp.h:38
SRTPContext::master_key
uint8_t master_key[16]
Definition
srtp.h:35
SRTPContext::rtp_hmac_size
int rtp_hmac_size
Definition
srtp.h:34
SRTPContext::roc
uint32_t roc
Definition
srtp.h:41
SRTPContext::rtp_auth
uint8_t rtp_auth[20]
Definition
srtp.h:39
SRTPContext::hmac
struct AVHMAC * hmac
Definition
srtp.h:33
SRTPContext::rtcp_hmac_size
int rtcp_hmac_size
Definition
srtp.h:34
SRTPContext::master_salt
uint8_t master_salt[14]
Definition
srtp.h:36
SRTPContext::rtp_key
uint8_t rtp_key[16]
Definition
srtp.h:37
SRTPContext::rtp_salt
uint8_t rtp_salt[14]
Definition
srtp.h:38
SRTPContext::seq_largest
int seq_largest
Definition
srtp.h:40
SRTPContext::seq_initialized
int seq_initialized
Definition
srtp.h:40
src
media
srtp.h
Generated on Thu Jun 19 2025 15:50:37 for Ring Daemon by
1.9.8