]> git.sesse.net Git - vlc/blob - libs/srtp/srtp.h
d51427cdbab672a82bf12ec47e5dca994e17aa9d
[vlc] / libs / srtp / srtp.h
1 /*
2  * Secure RTP with libgcrypt
3  * Copyright (C) 2007  RĂ©mi Denis-Courmont <rdenis # simphalempin , com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19
20 #ifndef LIBVLC_SRTP_H
21 # define LIBVLC_SRTP_H 1
22
23 typedef struct srtp_session_t srtp_session_t;
24
25 enum
26 {
27         SRTP_UNENCRYPTED=0x1, // do not encrypt SRTP packets
28         SRTCP_UNENCRYPTED=0x2, // do not encrypt SRTCP packets
29         SRTP_NULL_CIPHER=0x3, // use NULL cipher (encrypt nothing)
30         SRTP_UNAUTHENTICATED=0x4, // do not authenticated SRTP packets
31         SRTP_FLAGS_MASK=0x7
32 };
33
34
35 # ifdef __cplusplus
36 extern "C" {
37 # endif
38
39 srtp_session_t *srtp_create (const char *name, unsigned flags, unsigned kdr,
40                              uint16_t winsize);
41 void srtp_destroy (srtp_session_t *s);
42 int srtp_send (srtp_session_t *s, uint8_t *buf, size_t *lenp, size_t maxsize);
43 int srtp_recv (srtp_session_t *s, uint8_t *buf, size_t *lenp);
44
45 int srtp_setkey (srtp_session_t *s, const void *key, size_t keylen,
46                  const void *salt, size_t saltlen);
47 # ifdef __cplusplus
48 }
49 # endif
50 #endif
51