Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: include/rtp.h

Issue 2344973002: Update libsrtp to version 2.0 (Closed)
Patch Set: Add '.' back to include_dirs Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/getopt_s.h ('k') | include/rtp_priv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * rtp.h 2 * rtp.h
3 * 3 *
4 * rtp interface for srtp reference implementation 4 * rtp interface for srtp reference implementation
5 * 5 *
6 * David A. McGrew 6 * David A. McGrew
7 * Cisco Systems, Inc. 7 * Cisco Systems, Inc.
8 * 8 *
9 * data types: 9 * data types:
10 * 10 *
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 #ifndef RTP_H 54 #ifndef RTP_H
55 #define RTP_H 55 #define RTP_H
56 56
57 #ifdef HAVE_NETINET_IN_H 57 #ifdef HAVE_NETINET_IN_H
58 # include <netinet/in.h> 58 # include <netinet/in.h>
59 #elif defined HAVE_WINSOCK2_H 59 #elif defined HAVE_WINSOCK2_H
60 # include <winsock2.h> 60 # include <winsock2.h>
61 #endif 61 #endif
62 62
63 //#include "srtp_priv.h"
63 #include "srtp.h" 64 #include "srtp.h"
64 65
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69
70 /*
71 * RTP_HEADER_LEN indicates the size of an RTP header
72 */
73 #define RTP_HEADER_LEN 12
74
75 /*
76 * RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
77 */
78 #define RTP_MAX_BUF_LEN 16384
79
80
81 typedef srtp_hdr_t rtp_hdr_t;
82
83 typedef struct {
84 srtp_hdr_t header;
85 char body[RTP_MAX_BUF_LEN];
86 } rtp_msg_t;
87
88 typedef struct rtp_sender_ctx_t {
89 rtp_msg_t message;
90 int socket;
91 srtp_ctx_t *srtp_ctx;
92 struct sockaddr_in addr; /* reciever's address */
93 } rtp_sender_ctx_t;
94
95 typedef struct rtp_receiver_ctx_t {
96 rtp_msg_t message;
97 int socket;
98 srtp_ctx_t *srtp_ctx;
99 struct sockaddr_in addr; /* receiver's address */
100 } rtp_receiver_ctx_t;
101
102
65 typedef struct rtp_sender_ctx_t *rtp_sender_t; 103 typedef struct rtp_sender_ctx_t *rtp_sender_t;
66 104
67 typedef struct rtp_receiver_ctx_t *rtp_receiver_t; 105 typedef struct rtp_receiver_ctx_t *rtp_receiver_t;
68 106
69 int 107 int
70 rtp_sendto(rtp_sender_t sender, const void* msg, int len); 108 rtp_sendto(rtp_sender_t sender, const void* msg, int len);
71 109
72 int 110 int
73 rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len); 111 rtp_recvfrom(rtp_receiver_t receiver, void *msg, int *len);
74 112
75 int 113 int
76 rtp_receiver_init(rtp_receiver_t rcvr, int sock, 114 rtp_receiver_init(rtp_receiver_t rcvr, int sock,
77 struct sockaddr_in addr, unsigned int ssrc); 115 struct sockaddr_in addr, unsigned int ssrc);
78 116
79 int 117 int
80 rtp_sender_init(rtp_sender_t sender, int sock, 118 rtp_sender_init(rtp_sender_t sender, int sock,
81 struct sockaddr_in addr, unsigned int ssrc); 119 struct sockaddr_in addr, unsigned int ssrc);
82 120
83 /* 121 /*
84 * srtp_sender_init(...) initializes an rtp_sender_t 122 * srtp_sender_init(...) initializes an rtp_sender_t
85 */ 123 */
86 124
87 int 125 int
88 srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */ 126 srtp_sender_init(rtp_sender_t rtp_ctx, /* structure to be init'ed */
89 struct sockaddr_in name, /* socket name */ 127 struct sockaddr_in name, /* socket name */
90 » » sec_serv_t security_services, /* sec. servs. to be used */ 128 » » srtp_sec_serv_t security_services, /* sec. servs. to be used */
91 unsigned char *input_key /* master key/salt in hex */ 129 unsigned char *input_key /* master key/salt in hex */
92 ); 130 );
93 131
94 int 132 int
95 srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */ 133 srtp_receiver_init(rtp_receiver_t rtp_ctx, /* structure to be init'ed */
96 struct sockaddr_in name, /* socket name */ 134 struct sockaddr_in name, /* socket name */
97 » » sec_serv_t security_services, /* sec. servs. to be used */ 135 » » srtp_sec_serv_t security_services, /* sec. servs. to be used */
98 unsigned char *input_key /* master key/salt in hex */ 136 unsigned char *input_key /* master key/salt in hex */
99 ); 137 );
100 138
101 139
102 int 140 int
103 rtp_sender_init_srtp(rtp_sender_t sender, const srtp_policy_t *policy); 141 rtp_sender_init_srtp(rtp_sender_t sender, const srtp_policy_t *policy);
104 142
105 int 143 int
106 rtp_sender_deinit_srtp(rtp_sender_t sender); 144 rtp_sender_deinit_srtp(rtp_sender_t sender);
107 145
(...skipping 10 matching lines...) Expand all
118 void 156 void
119 rtp_sender_dealloc(rtp_sender_t rtp_ctx); 157 rtp_sender_dealloc(rtp_sender_t rtp_ctx);
120 158
121 rtp_receiver_t 159 rtp_receiver_t
122 rtp_receiver_alloc(void); 160 rtp_receiver_alloc(void);
123 161
124 void 162 void
125 rtp_receiver_dealloc(rtp_receiver_t rtp_ctx); 163 rtp_receiver_dealloc(rtp_receiver_t rtp_ctx);
126 164
127 165
128 /* 166 #ifdef __cplusplus
129 * RTP_HEADER_LEN indicates the size of an RTP header 167 }
130 */ 168 #endif
131 #define RTP_HEADER_LEN 12
132
133 /*
134 * RTP_MAX_BUF_LEN defines the largest RTP packet in the rtp.c implementation
135 */
136 #define RTP_MAX_BUF_LEN 16384
137
138 169
139 #endif /* RTP_H */ 170 #endif /* RTP_H */
OLDNEW
« no previous file with comments | « include/getopt_s.h ('k') | include/rtp_priv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698