4
* rtp interface for srtp reference implementation
11
* rtp_msg_t an rtp message (the data that goes on the wire)
12
* rtp_sender_t sender side socket and rtp info
13
* rtp_receiver_t receiver side socket and rtp info
19
* Copyright (c) 2001-2006, Cisco Systems, Inc.
20
* All rights reserved.
22
* Redistribution and use in source and binary forms, with or without
23
* modification, are permitted provided that the following conditions
26
* Redistributions of source code must retain the above copyright
27
* notice, this list of conditions and the following disclaimer.
29
* Redistributions in binary form must reproduce the above
30
* copyright notice, this list of conditions and the following
31
* disclaimer in the documentation and/or other materials provided
32
* with the distribution.
34
* Neither the name of the Cisco Systems, Inc. nor the names of its
35
* contributors may be used to endorse or promote products derived
36
* from this software without specific prior written permission.
38
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
39
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
40
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
41
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
42
* COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
43
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
44
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
45
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49
* OF THE POSSIBILITY OF SUCH DAMAGE.
57
#ifdef HAVE_NETINET_IN_H
58
# include <netinet/in.h>
59
#elif defined HAVE_WINSOCK2_H
60
# include <winsock2.h>
65
typedef struct rtp_sender_ctx_t *rtp_sender_t;
67
typedef struct rtp_receiver_ctx_t *rtp_receiver_t;
70
rtp_sendto(rtp_sender_t sender, const void* msg, int len);
73
rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
76
rtp_receiver_init(rtp_receiver_t rcvr, int socket,
77
struct sockaddr_in addr, unsigned int ssrc);
80
rtp_sender_init(rtp_sender_t sender, int socket,
81
struct sockaddr_in addr, unsigned int ssrc);
84
* srtp_sender_init(...) initializes an rtp_sender_t
88
srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
89
struct sockaddr_in name, /* socket name */
90
sec_serv_t security_services, /* sec. servs. to be used */
91
unsigned char *input_key /* master key/salt in hex */
95
srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
96
struct sockaddr_in name, /* socket name */
97
sec_serv_t security_services, /* sec. servs. to be used */
98
unsigned char *input_key /* master key/salt in hex */
103
rtp_sender_init_srtp(rtp_sender_t sender, const srtp_policy_t *policy);
106
rtp_receiver_init_srtp(rtp_receiver_t sender, const srtp_policy_t *policy);
113
rtp_receiver_alloc();
117
* RTP_HEADER_LEN indicates the size of an RTP header
119
#define RTP_HEADER_LEN 12
122
* RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
124
#define RTP_MAX_BUF_LEN 16384