1pub const RICE_PROTO_MAJOR: u32 = 0;
4pub const RICE_PROTO_MINOR: u32 = 1;
5pub const RICE_PROTO_PATCH: u32 = 0;
6#[doc = " Component is in initial state and no connectivity checks are in progress."]
7pub const RICE_COMPONENT_CONNECTION_STATE_NEW: RiceComponentConnectionState = 0;
8#[doc = " Connectivity checks are in progress for this candidate"]
9pub const RICE_COMPONENT_CONNECTION_STATE_CONNECTING: RiceComponentConnectionState = 1;
10#[doc = " A [`CandidatePair`](crate::candidate::CandidatePair`) has been selected for this component"]
11pub const RICE_COMPONENT_CONNECTION_STATE_CONNECTED: RiceComponentConnectionState = 2;
12#[doc = " No connection could be found for this Component"]
13pub const RICE_COMPONENT_CONNECTION_STATE_FAILED: RiceComponentConnectionState = 3;
14#[doc = " The state of a component"]
15pub type RiceComponentConnectionState = ::core::ffi::c_uint;
16pub const RICE_ADDRESS_FAMILY_IPV4: RiceAddressFamily = 1;
17pub const RICE_ADDRESS_FAMILY_IPV6: RiceAddressFamily = 2;
18pub type RiceAddressFamily = u32;
19#[doc = " The candidate is a local network interface"]
20pub const RICE_CANDIDATE_TYPE_HOST: RiceCandidateType = 0;
21#[doc = " The candidate was discovered from incoming data"]
22pub const RICE_CANDIDATE_TYPE_PEER_REFLEXIVE: RiceCandidateType = 1;
23#[doc = " The candidate was discovered by asking an external server (STUN/TURN)"]
24pub const RICE_CANDIDATE_TYPE_SERVER_REFLEXIVE: RiceCandidateType = 2;
25#[doc = " The candidate will relay all data through an external server (TURN)."]
26pub const RICE_CANDIDATE_TYPE_RELAYED: RiceCandidateType = 3;
27pub type RiceCandidateType = u32;
28pub const RICE_ERROR_SUCCESS: RiceError = 0;
29pub const RICE_ERROR_FAILED: RiceError = -1;
30pub const RICE_ERROR_RESOURCE_NOT_FOUND: RiceError = -2;
31pub const RICE_ERROR_ALREADY_IN_PROGRESS: RiceError = -3;
32pub type RiceError = i32;
33#[doc = " Not a TCP candidate."]
34pub const RICE_TCP_TYPE_NONE: RiceTcpType = 0;
35#[doc = " The candidate address will connect to a remote address."]
36pub const RICE_TCP_TYPE_ACTIVE: RiceTcpType = 1;
37#[doc = " The candidate will listen for incominng TCP connections."]
38pub const RICE_TCP_TYPE_PASSIVE: RiceTcpType = 2;
39#[doc = " Simultaneous open. The candidate will both listen for incoming connections, and connect to\n remote addresses."]
40pub const RICE_TCP_TYPE_SO: RiceTcpType = 3;
41pub type RiceTcpType = u32;
42#[doc = " The UDP transport"]
43pub const RICE_TRANSPORT_TYPE_UDP: RiceTransportType = 0;
44#[doc = " The TCP transport"]
45pub const RICE_TRANSPORT_TYPE_TCP: RiceTransportType = 1;
46pub type RiceTransportType = u32;
47#[repr(C)]
48#[derive(Debug, Copy, Clone)]
49pub struct Credentials {
50 _unused: [u8; 0],
51}
52#[repr(C)]
53#[derive(Debug, Copy, Clone)]
54pub struct RiceAddress {
55 _unused: [u8; 0],
56}
57#[repr(C)]
58#[derive(Debug, Copy, Clone)]
59pub struct RiceAgent {
60 _unused: [u8; 0],
61}
62#[repr(C)]
63#[derive(Debug, Copy, Clone)]
64pub struct RiceComponent {
65 _unused: [u8; 0],
66}
67#[repr(C)]
68#[derive(Debug, Copy, Clone)]
69pub struct RiceStream {
70 _unused: [u8; 0],
71}
72#[doc = " A pointer to a sequence of bytes and the associated size."]
73#[repr(C)]
74#[derive(Debug)]
75pub struct RiceDataImpl {
76 #[doc = " A pointer to a sequence of bytes."]
77 pub ptr: *mut u8,
78 #[doc = " Number of bytes pointed to in `ptr`."]
79 pub size: usize,
80}
81#[allow(clippy::unnecessary_operation, clippy::identity_op)]
82const _: () = {
83 ["Size of RiceDataImpl"][::core::mem::size_of::<RiceDataImpl>() - 16usize];
84 ["Alignment of RiceDataImpl"][::core::mem::align_of::<RiceDataImpl>() - 8usize];
85 ["Offset of field: RiceDataImpl::ptr"][::core::mem::offset_of!(RiceDataImpl, ptr) - 0usize];
86 ["Offset of field: RiceDataImpl::size"][::core::mem::offset_of!(RiceDataImpl, size) - 8usize];
87};
88#[doc = " The data is borrowed and will not be freed on destruction."]
89pub const RICE_DATA_BORROWED: RiceData_Tag = 0;
90#[doc = " The data is owned and will be freed on destruction."]
91pub const RICE_DATA_OWNED: RiceData_Tag = 1;
92#[doc = " A pointer to a sequence of bytes and size."]
93pub type RiceData_Tag = ::core::ffi::c_uint;
94#[repr(C)]
95pub struct RiceData {
96 pub tag: RiceData_Tag,
97 pub field1: RiceData__bindgen_ty_1,
98}
99#[repr(C)]
100pub union RiceData__bindgen_ty_1 {
101 pub field1: ::core::mem::ManuallyDrop<RiceData__bindgen_ty_1__bindgen_ty_1>,
102 pub field2: ::core::mem::ManuallyDrop<RiceData__bindgen_ty_1__bindgen_ty_2>,
103}
104#[repr(C)]
105#[derive(Debug)]
106pub struct RiceData__bindgen_ty_1__bindgen_ty_1 {
107 pub borrowed: RiceDataImpl,
108}
109#[allow(clippy::unnecessary_operation, clippy::identity_op)]
110const _: () = {
111 ["Size of RiceData__bindgen_ty_1__bindgen_ty_1"]
112 [::core::mem::size_of::<RiceData__bindgen_ty_1__bindgen_ty_1>() - 16usize];
113 ["Alignment of RiceData__bindgen_ty_1__bindgen_ty_1"]
114 [::core::mem::align_of::<RiceData__bindgen_ty_1__bindgen_ty_1>() - 8usize];
115 ["Offset of field: RiceData__bindgen_ty_1__bindgen_ty_1::borrowed"]
116 [::core::mem::offset_of!(RiceData__bindgen_ty_1__bindgen_ty_1, borrowed) - 0usize];
117};
118#[repr(C)]
119#[derive(Debug)]
120pub struct RiceData__bindgen_ty_1__bindgen_ty_2 {
121 pub owned: RiceDataImpl,
122}
123#[allow(clippy::unnecessary_operation, clippy::identity_op)]
124const _: () = {
125 ["Size of RiceData__bindgen_ty_1__bindgen_ty_2"]
126 [::core::mem::size_of::<RiceData__bindgen_ty_1__bindgen_ty_2>() - 16usize];
127 ["Alignment of RiceData__bindgen_ty_1__bindgen_ty_2"]
128 [::core::mem::align_of::<RiceData__bindgen_ty_1__bindgen_ty_2>() - 8usize];
129 ["Offset of field: RiceData__bindgen_ty_1__bindgen_ty_2::owned"]
130 [::core::mem::offset_of!(RiceData__bindgen_ty_1__bindgen_ty_2, owned) - 0usize];
131};
132#[allow(clippy::unnecessary_operation, clippy::identity_op)]
133const _: () = {
134 ["Size of RiceData__bindgen_ty_1"][::core::mem::size_of::<RiceData__bindgen_ty_1>() - 16usize];
135 ["Alignment of RiceData__bindgen_ty_1"]
136 [::core::mem::align_of::<RiceData__bindgen_ty_1>() - 8usize];
137};
138#[allow(clippy::unnecessary_operation, clippy::identity_op)]
139const _: () = {
140 ["Size of RiceData"][::core::mem::size_of::<RiceData>() - 24usize];
141 ["Alignment of RiceData"][::core::mem::align_of::<RiceData>() - 8usize];
142 ["Offset of field: RiceData::tag"][::core::mem::offset_of!(RiceData, tag) - 0usize];
143};
144#[doc = " Transmit the data using the specified 5-tuple."]
145#[repr(C)]
146#[derive(Debug)]
147pub struct RiceTransmit {
148 #[doc = " The associated stream identifier."]
149 pub stream_id: usize,
150 #[doc = " The transport type for the transmission."]
151 pub transport: RiceTransportType,
152 #[doc = " The socket source address to send from."]
153 pub from: *const RiceAddress,
154 #[doc = " The socket destination address to send to."]
155 pub to: *const RiceAddress,
156 #[doc = " The data to send."]
157 pub data: RiceDataImpl,
158}
159#[allow(clippy::unnecessary_operation, clippy::identity_op)]
160const _: () = {
161 ["Size of RiceTransmit"][::core::mem::size_of::<RiceTransmit>() - 48usize];
162 ["Alignment of RiceTransmit"][::core::mem::align_of::<RiceTransmit>() - 8usize];
163 ["Offset of field: RiceTransmit::stream_id"]
164 [::core::mem::offset_of!(RiceTransmit, stream_id) - 0usize];
165 ["Offset of field: RiceTransmit::transport"]
166 [::core::mem::offset_of!(RiceTransmit, transport) - 8usize];
167 ["Offset of field: RiceTransmit::from"][::core::mem::offset_of!(RiceTransmit, from) - 16usize];
168 ["Offset of field: RiceTransmit::to"][::core::mem::offset_of!(RiceTransmit, to) - 24usize];
169 ["Offset of field: RiceTransmit::data"][::core::mem::offset_of!(RiceTransmit, data) - 32usize];
170};
171#[doc = " A socket with the specified network 5-tuple."]
172#[repr(C)]
173#[derive(Debug)]
174pub struct RiceAgentSocket {
175 #[doc = " The ICE stream id."]
176 pub stream_id: usize,
177 #[doc = " The ICE component id."]
178 pub component_id: usize,
179 #[doc = " The transport type to allocate."]
180 pub transport: RiceTransportType,
181 #[doc = " The source address to allocate from."]
182 pub from: *const RiceAddress,
183 #[doc = " The destination address to connect to."]
184 pub to: *const RiceAddress,
185}
186#[allow(clippy::unnecessary_operation, clippy::identity_op)]
187const _: () = {
188 ["Size of RiceAgentSocket"][::core::mem::size_of::<RiceAgentSocket>() - 40usize];
189 ["Alignment of RiceAgentSocket"][::core::mem::align_of::<RiceAgentSocket>() - 8usize];
190 ["Offset of field: RiceAgentSocket::stream_id"]
191 [::core::mem::offset_of!(RiceAgentSocket, stream_id) - 0usize];
192 ["Offset of field: RiceAgentSocket::component_id"]
193 [::core::mem::offset_of!(RiceAgentSocket, component_id) - 8usize];
194 ["Offset of field: RiceAgentSocket::transport"]
195 [::core::mem::offset_of!(RiceAgentSocket, transport) - 16usize];
196 ["Offset of field: RiceAgentSocket::from"]
197 [::core::mem::offset_of!(RiceAgentSocket, from) - 24usize];
198 ["Offset of field: RiceAgentSocket::to"]
199 [::core::mem::offset_of!(RiceAgentSocket, to) - 32usize];
200};
201#[doc = " An ICE candidate."]
202#[repr(C)]
203#[derive(Debug)]
204pub struct RiceCandidate {
205 pub component_id: usize,
206 pub candidate_type: RiceCandidateType,
207 pub transport_type: RiceTransportType,
208 pub foundation: *const ::core::ffi::c_char,
209 pub priority: u32,
210 pub address: *const RiceAddress,
211 pub base_address: *const RiceAddress,
212 pub related_address: *const RiceAddress,
213 pub tcp_type: RiceTcpType,
214 pub extensions: *mut *mut ::core::ffi::c_char,
215 pub extensions_len: usize,
216}
217#[allow(clippy::unnecessary_operation, clippy::identity_op)]
218const _: () = {
219 ["Size of RiceCandidate"][::core::mem::size_of::<RiceCandidate>() - 80usize];
220 ["Alignment of RiceCandidate"][::core::mem::align_of::<RiceCandidate>() - 8usize];
221 ["Offset of field: RiceCandidate::component_id"]
222 [::core::mem::offset_of!(RiceCandidate, component_id) - 0usize];
223 ["Offset of field: RiceCandidate::candidate_type"]
224 [::core::mem::offset_of!(RiceCandidate, candidate_type) - 8usize];
225 ["Offset of field: RiceCandidate::transport_type"]
226 [::core::mem::offset_of!(RiceCandidate, transport_type) - 12usize];
227 ["Offset of field: RiceCandidate::foundation"]
228 [::core::mem::offset_of!(RiceCandidate, foundation) - 16usize];
229 ["Offset of field: RiceCandidate::priority"]
230 [::core::mem::offset_of!(RiceCandidate, priority) - 24usize];
231 ["Offset of field: RiceCandidate::address"]
232 [::core::mem::offset_of!(RiceCandidate, address) - 32usize];
233 ["Offset of field: RiceCandidate::base_address"]
234 [::core::mem::offset_of!(RiceCandidate, base_address) - 40usize];
235 ["Offset of field: RiceCandidate::related_address"]
236 [::core::mem::offset_of!(RiceCandidate, related_address) - 48usize];
237 ["Offset of field: RiceCandidate::tcp_type"]
238 [::core::mem::offset_of!(RiceCandidate, tcp_type) - 56usize];
239 ["Offset of field: RiceCandidate::extensions"]
240 [::core::mem::offset_of!(RiceCandidate, extensions) - 64usize];
241 ["Offset of field: RiceCandidate::extensions_len"]
242 [::core::mem::offset_of!(RiceCandidate, extensions_len) - 72usize];
243};
244#[doc = " A new pair has been selected for a component."]
245#[repr(C)]
246#[derive(Debug)]
247pub struct RiceAgentSelectedPair {
248 #[doc = " The ICE stream id."]
249 pub stream_id: usize,
250 #[doc = " The ICE component id."]
251 pub component_id: usize,
252 #[doc = " The local candidate of a selected pair."]
253 pub local: RiceCandidate,
254 #[doc = " The remote candidate of a selected pair."]
255 pub remote: RiceCandidate,
256}
257#[allow(clippy::unnecessary_operation, clippy::identity_op)]
258const _: () = {
259 ["Size of RiceAgentSelectedPair"][::core::mem::size_of::<RiceAgentSelectedPair>() - 176usize];
260 ["Alignment of RiceAgentSelectedPair"]
261 [::core::mem::align_of::<RiceAgentSelectedPair>() - 8usize];
262 ["Offset of field: RiceAgentSelectedPair::stream_id"]
263 [::core::mem::offset_of!(RiceAgentSelectedPair, stream_id) - 0usize];
264 ["Offset of field: RiceAgentSelectedPair::component_id"]
265 [::core::mem::offset_of!(RiceAgentSelectedPair, component_id) - 8usize];
266 ["Offset of field: RiceAgentSelectedPair::local"]
267 [::core::mem::offset_of!(RiceAgentSelectedPair, local) - 16usize];
268 ["Offset of field: RiceAgentSelectedPair::remote"]
269 [::core::mem::offset_of!(RiceAgentSelectedPair, remote) - 96usize];
270};
271#[doc = " A [`Component`](crate::component::Component) has changed state."]
272#[repr(C)]
273#[derive(Debug, Copy, Clone)]
274pub struct RiceAgentComponentStateChange {
275 #[doc = " The ICE stream id."]
276 pub stream_id: usize,
277 #[doc = " The ICE component id."]
278 pub component_id: usize,
279 #[doc = " The new state of the component."]
280 pub state: RiceComponentConnectionState,
281}
282#[allow(clippy::unnecessary_operation, clippy::identity_op)]
283const _: () = {
284 ["Size of RiceAgentComponentStateChange"]
285 [::core::mem::size_of::<RiceAgentComponentStateChange>() - 24usize];
286 ["Alignment of RiceAgentComponentStateChange"]
287 [::core::mem::align_of::<RiceAgentComponentStateChange>() - 8usize];
288 ["Offset of field: RiceAgentComponentStateChange::stream_id"]
289 [::core::mem::offset_of!(RiceAgentComponentStateChange, stream_id) - 0usize];
290 ["Offset of field: RiceAgentComponentStateChange::component_id"]
291 [::core::mem::offset_of!(RiceAgentComponentStateChange, component_id) - 8usize];
292 ["Offset of field: RiceAgentComponentStateChange::state"]
293 [::core::mem::offset_of!(RiceAgentComponentStateChange, state) - 16usize];
294};
295#[doc = " A local candidate that has been gathered."]
296#[repr(C)]
297#[derive(Debug)]
298pub struct RiceGatheredCandidate {
299 pub candidate: RiceCandidate,
300 pub turn_agent: *mut ::core::ffi::c_void,
301}
302#[allow(clippy::unnecessary_operation, clippy::identity_op)]
303const _: () = {
304 ["Size of RiceGatheredCandidate"][::core::mem::size_of::<RiceGatheredCandidate>() - 88usize];
305 ["Alignment of RiceGatheredCandidate"]
306 [::core::mem::align_of::<RiceGatheredCandidate>() - 8usize];
307 ["Offset of field: RiceGatheredCandidate::candidate"]
308 [::core::mem::offset_of!(RiceGatheredCandidate, candidate) - 0usize];
309 ["Offset of field: RiceGatheredCandidate::turn_agent"]
310 [::core::mem::offset_of!(RiceGatheredCandidate, turn_agent) - 80usize];
311};
312#[doc = " A [`Component`](crate::component::Component) has gathered a candidate."]
313#[repr(C)]
314#[derive(Debug)]
315pub struct RiceAgentGatheredCandidate {
316 #[doc = " The ICE stream id."]
317 pub stream_id: usize,
318 #[doc = " The candidate gathered."]
319 pub gathered: RiceGatheredCandidate,
320}
321#[allow(clippy::unnecessary_operation, clippy::identity_op)]
322const _: () = {
323 ["Size of RiceAgentGatheredCandidate"]
324 [::core::mem::size_of::<RiceAgentGatheredCandidate>() - 96usize];
325 ["Alignment of RiceAgentGatheredCandidate"]
326 [::core::mem::align_of::<RiceAgentGatheredCandidate>() - 8usize];
327 ["Offset of field: RiceAgentGatheredCandidate::stream_id"]
328 [::core::mem::offset_of!(RiceAgentGatheredCandidate, stream_id) - 0usize];
329 ["Offset of field: RiceAgentGatheredCandidate::gathered"]
330 [::core::mem::offset_of!(RiceAgentGatheredCandidate, gathered) - 8usize];
331};
332#[doc = " A [`Component`](crate::component::Component) has completed gathering."]
333#[repr(C)]
334#[derive(Debug, Copy, Clone)]
335pub struct RiceAgentGatheringComplete {
336 #[doc = " The ICE stream id."]
337 pub stream_id: usize,
338 #[doc = " The ICE component id."]
339 pub component_id: usize,
340}
341#[allow(clippy::unnecessary_operation, clippy::identity_op)]
342const _: () = {
343 ["Size of RiceAgentGatheringComplete"]
344 [::core::mem::size_of::<RiceAgentGatheringComplete>() - 16usize];
345 ["Alignment of RiceAgentGatheringComplete"]
346 [::core::mem::align_of::<RiceAgentGatheringComplete>() - 8usize];
347 ["Offset of field: RiceAgentGatheringComplete::stream_id"]
348 [::core::mem::offset_of!(RiceAgentGatheringComplete, stream_id) - 0usize];
349 ["Offset of field: RiceAgentGatheringComplete::component_id"]
350 [::core::mem::offset_of!(RiceAgentGatheringComplete, component_id) - 8usize];
351};
352#[doc = " The Agent is closed. No further progress will be made."]
353pub const RICE_AGENT_POLL_CLOSED: RiceAgentPoll_Tag = 0;
354#[doc = " Wait until the specified `Instant` has been reached (or an external event)"]
355pub const RICE_AGENT_POLL_WAIT_UNTIL_MICROS: RiceAgentPoll_Tag = 1;
356#[doc = " Connect from the specified interface to the specified address. Reply (success or failure)\n should be notified using `rice_agent_allocated_socket()` with the same parameters."]
357pub const RICE_AGENT_POLL_ALLOCATE_SOCKET: RiceAgentPoll_Tag = 2;
358#[doc = " It is posible to remove the specified 5-tuple. The socket will not be referenced any\n further."]
359pub const RICE_AGENT_POLL_REMOVE_SOCKET: RiceAgentPoll_Tag = 3;
360#[doc = " A new pair has been selected for a component."]
361pub const RICE_AGENT_POLL_SELECTED_PAIR: RiceAgentPoll_Tag = 4;
362#[doc = " A [`Component`](crate::component::Component) has changed state."]
363pub const RICE_AGENT_POLL_COMPONENT_STATE_CHANGE: RiceAgentPoll_Tag = 5;
364#[doc = " A [`Component`](crate::component::Component) has gathered a candidate."]
365pub const RICE_AGENT_POLL_GATHERED_CANDIDATE: RiceAgentPoll_Tag = 6;
366#[doc = " A [`Component`](crate::component::Component) has completed gathering."]
367pub const RICE_AGENT_POLL_GATHERING_COMPLETE: RiceAgentPoll_Tag = 7;
368#[doc = " Return value of `rice_agent_poll()`."]
369pub type RiceAgentPoll_Tag = ::core::ffi::c_uint;
370#[repr(C)]
371pub struct RiceAgentPoll {
372 pub tag: RiceAgentPoll_Tag,
373 pub field1: RiceAgentPoll__bindgen_ty_1,
374}
375#[repr(C)]
376pub union RiceAgentPoll__bindgen_ty_1 {
377 pub field1: ::core::mem::ManuallyDrop<RiceAgentPoll__bindgen_ty_1__bindgen_ty_1>,
378 pub field2: ::core::mem::ManuallyDrop<RiceAgentPoll__bindgen_ty_1__bindgen_ty_2>,
379 pub field3: ::core::mem::ManuallyDrop<RiceAgentPoll__bindgen_ty_1__bindgen_ty_3>,
380 pub field4: ::core::mem::ManuallyDrop<RiceAgentPoll__bindgen_ty_1__bindgen_ty_4>,
381 pub field5: ::core::mem::ManuallyDrop<RiceAgentPoll__bindgen_ty_1__bindgen_ty_5>,
382 pub field6: ::core::mem::ManuallyDrop<RiceAgentPoll__bindgen_ty_1__bindgen_ty_6>,
383 pub field7: ::core::mem::ManuallyDrop<RiceAgentPoll__bindgen_ty_1__bindgen_ty_7>,
384}
385#[repr(C)]
386#[derive(Debug, Copy, Clone)]
387pub struct RiceAgentPoll__bindgen_ty_1__bindgen_ty_1 {
388 pub wait_until_micros: u64,
389}
390#[allow(clippy::unnecessary_operation, clippy::identity_op)]
391const _: () = {
392 ["Size of RiceAgentPoll__bindgen_ty_1__bindgen_ty_1"]
393 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_1>() - 8usize];
394 ["Alignment of RiceAgentPoll__bindgen_ty_1__bindgen_ty_1"]
395 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_1>() - 8usize];
396 ["Offset of field: RiceAgentPoll__bindgen_ty_1__bindgen_ty_1::wait_until_micros"][::core::mem::offset_of!(
397 RiceAgentPoll__bindgen_ty_1__bindgen_ty_1,
398 wait_until_micros
399 ) - 0usize];
400};
401#[repr(C)]
402#[derive(Debug)]
403pub struct RiceAgentPoll__bindgen_ty_1__bindgen_ty_2 {
404 pub allocate_socket: RiceAgentSocket,
405}
406#[allow(clippy::unnecessary_operation, clippy::identity_op)]
407const _: () = {
408 ["Size of RiceAgentPoll__bindgen_ty_1__bindgen_ty_2"]
409 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_2>() - 40usize];
410 ["Alignment of RiceAgentPoll__bindgen_ty_1__bindgen_ty_2"]
411 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_2>() - 8usize];
412 ["Offset of field: RiceAgentPoll__bindgen_ty_1__bindgen_ty_2::allocate_socket"][::core::mem::offset_of!(
413 RiceAgentPoll__bindgen_ty_1__bindgen_ty_2,
414 allocate_socket
415 ) - 0usize];
416};
417#[repr(C)]
418#[derive(Debug)]
419pub struct RiceAgentPoll__bindgen_ty_1__bindgen_ty_3 {
420 pub remove_socket: RiceAgentSocket,
421}
422#[allow(clippy::unnecessary_operation, clippy::identity_op)]
423const _: () = {
424 ["Size of RiceAgentPoll__bindgen_ty_1__bindgen_ty_3"]
425 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_3>() - 40usize];
426 ["Alignment of RiceAgentPoll__bindgen_ty_1__bindgen_ty_3"]
427 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_3>() - 8usize];
428 ["Offset of field: RiceAgentPoll__bindgen_ty_1__bindgen_ty_3::remove_socket"][::core::mem::offset_of!(
429 RiceAgentPoll__bindgen_ty_1__bindgen_ty_3,
430 remove_socket
431 ) - 0usize];
432};
433#[repr(C)]
434#[derive(Debug)]
435pub struct RiceAgentPoll__bindgen_ty_1__bindgen_ty_4 {
436 pub selected_pair: RiceAgentSelectedPair,
437}
438#[allow(clippy::unnecessary_operation, clippy::identity_op)]
439const _: () = {
440 ["Size of RiceAgentPoll__bindgen_ty_1__bindgen_ty_4"]
441 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_4>() - 176usize];
442 ["Alignment of RiceAgentPoll__bindgen_ty_1__bindgen_ty_4"]
443 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_4>() - 8usize];
444 ["Offset of field: RiceAgentPoll__bindgen_ty_1__bindgen_ty_4::selected_pair"][::core::mem::offset_of!(
445 RiceAgentPoll__bindgen_ty_1__bindgen_ty_4,
446 selected_pair
447 ) - 0usize];
448};
449#[repr(C)]
450#[derive(Debug, Copy, Clone)]
451pub struct RiceAgentPoll__bindgen_ty_1__bindgen_ty_5 {
452 pub component_state_change: RiceAgentComponentStateChange,
453}
454#[allow(clippy::unnecessary_operation, clippy::identity_op)]
455const _: () = {
456 ["Size of RiceAgentPoll__bindgen_ty_1__bindgen_ty_5"]
457 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_5>() - 24usize];
458 ["Alignment of RiceAgentPoll__bindgen_ty_1__bindgen_ty_5"]
459 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_5>() - 8usize];
460 ["Offset of field: RiceAgentPoll__bindgen_ty_1__bindgen_ty_5::component_state_change"][::core::mem::offset_of!(
461 RiceAgentPoll__bindgen_ty_1__bindgen_ty_5,
462 component_state_change
463 )
464 - 0usize];
465};
466#[repr(C)]
467#[derive(Debug)]
468pub struct RiceAgentPoll__bindgen_ty_1__bindgen_ty_6 {
469 pub gathered_candidate: RiceAgentGatheredCandidate,
470}
471#[allow(clippy::unnecessary_operation, clippy::identity_op)]
472const _: () = {
473 ["Size of RiceAgentPoll__bindgen_ty_1__bindgen_ty_6"]
474 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_6>() - 96usize];
475 ["Alignment of RiceAgentPoll__bindgen_ty_1__bindgen_ty_6"]
476 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_6>() - 8usize];
477 ["Offset of field: RiceAgentPoll__bindgen_ty_1__bindgen_ty_6::gathered_candidate"][::core::mem::offset_of!(
478 RiceAgentPoll__bindgen_ty_1__bindgen_ty_6,
479 gathered_candidate
480 ) - 0usize];
481};
482#[repr(C)]
483#[derive(Debug, Copy, Clone)]
484pub struct RiceAgentPoll__bindgen_ty_1__bindgen_ty_7 {
485 pub gathering_complete: RiceAgentGatheringComplete,
486}
487#[allow(clippy::unnecessary_operation, clippy::identity_op)]
488const _: () = {
489 ["Size of RiceAgentPoll__bindgen_ty_1__bindgen_ty_7"]
490 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_7>() - 16usize];
491 ["Alignment of RiceAgentPoll__bindgen_ty_1__bindgen_ty_7"]
492 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1__bindgen_ty_7>() - 8usize];
493 ["Offset of field: RiceAgentPoll__bindgen_ty_1__bindgen_ty_7::gathering_complete"][::core::mem::offset_of!(
494 RiceAgentPoll__bindgen_ty_1__bindgen_ty_7,
495 gathering_complete
496 ) - 0usize];
497};
498#[allow(clippy::unnecessary_operation, clippy::identity_op)]
499const _: () = {
500 ["Size of RiceAgentPoll__bindgen_ty_1"]
501 [::core::mem::size_of::<RiceAgentPoll__bindgen_ty_1>() - 176usize];
502 ["Alignment of RiceAgentPoll__bindgen_ty_1"]
503 [::core::mem::align_of::<RiceAgentPoll__bindgen_ty_1>() - 8usize];
504};
505#[allow(clippy::unnecessary_operation, clippy::identity_op)]
506const _: () = {
507 ["Size of RiceAgentPoll"][::core::mem::size_of::<RiceAgentPoll>() - 184usize];
508 ["Alignment of RiceAgentPoll"][::core::mem::align_of::<RiceAgentPoll>() - 8usize];
509 ["Offset of field: RiceAgentPoll::tag"][::core::mem::offset_of!(RiceAgentPoll, tag) - 0usize];
510};
511#[doc = " ICE/TURN credentials."]
512pub type RiceCredentials = Credentials;
513#[doc = " Return value for `rice_stream_handle_incoming_data()`."]
514#[repr(C)]
515#[derive(Debug)]
516pub struct RiceStreamIncomingData {
517 #[doc = " The data was handled internally. `rice_agent_poll()` should be called at the\n next earliest opportunity."]
518 pub handled: bool,
519 #[doc = " Whether there is more data to pull using `rice_stream_poll_recv()`."]
520 pub have_more_data: bool,
521 #[doc = " The data pointer."]
522 pub data: RiceDataImpl,
523}
524#[allow(clippy::unnecessary_operation, clippy::identity_op)]
525const _: () = {
526 ["Size of RiceStreamIncomingData"][::core::mem::size_of::<RiceStreamIncomingData>() - 24usize];
527 ["Alignment of RiceStreamIncomingData"]
528 [::core::mem::align_of::<RiceStreamIncomingData>() - 8usize];
529 ["Offset of field: RiceStreamIncomingData::handled"]
530 [::core::mem::offset_of!(RiceStreamIncomingData, handled) - 0usize];
531 ["Offset of field: RiceStreamIncomingData::have_more_data"]
532 [::core::mem::offset_of!(RiceStreamIncomingData, have_more_data) - 1usize];
533 ["Offset of field: RiceStreamIncomingData::data"]
534 [::core::mem::offset_of!(RiceStreamIncomingData, data) - 8usize];
535};
536unsafe extern "C" {
537 #[doc = " Query the built version of `rice-proto`."]
538 pub fn rice_version(major: *mut u32, minor: *mut u32, patch: *mut u32);
539}
540unsafe extern "C" {
541 #[doc = " Create a new ICE Agent."]
542 pub fn rice_agent_new(controlling: bool, trickle_ice: bool) -> *mut RiceAgent;
543}
544unsafe extern "C" {
545 #[doc = " Increase the reference count of the `RiceAgent`.\n\n This function is multi-threading safe."]
546 pub fn rice_agent_ref(agent: *mut RiceAgent) -> *mut RiceAgent;
547}
548unsafe extern "C" {
549 #[doc = " Decrease the reference count of the `RiceAgent`.\n\n If this is the last reference, then the `RiceAgent` is freed.\n\n This function is multi-threading safe."]
550 pub fn rice_agent_unref(agent: *mut RiceAgent);
551}
552unsafe extern "C" {
553 #[doc = " Close the `RiceAgent`.\n\n Closure does involve closing network resources (signalled through calls to\n `rice_agent_poll()`) and will only succesfully complete once `rice_agent_poll`() returns\n `Closed`."]
554 pub fn rice_agent_close(agent: *mut RiceAgent, now_micros: u64);
555}
556unsafe extern "C" {
557 #[doc = " Return the process-local unique id for this agent."]
558 pub fn rice_agent_id(agent: *mut RiceAgent) -> u64;
559}
560unsafe extern "C" {
561 #[doc = " Get the controlling state of the `RiceAgent`.\n\n A return value of `true` indicates the `RiceAgent` is in controlling mode, false the controlled\n mode. This value can change during ICE processing."]
562 pub fn rice_agent_get_controlling(agent: *mut RiceAgent) -> bool;
563}
564unsafe extern "C" {
565 #[doc = " The number of bytes in a `RiceData`."]
566 pub fn rice_data_len(data: *const RiceData) -> usize;
567}
568unsafe extern "C" {
569 #[doc = " The data pointer for a `RiceData`."]
570 pub fn rice_data_ptr(data: *const RiceData) -> *mut u8;
571}
572unsafe extern "C" {
573 #[doc = " Free any resources allocated within a `RiceTransmit`.\n\n The `RiceTransmit` must have been previously initialized with `rice_transmit_init()`."]
574 pub fn rice_transmit_clear(transmit: *mut RiceTransmit);
575}
576unsafe extern "C" {
577 #[doc = " Initialize a `RiceTransmit` with default values."]
578 pub fn rice_transmit_init(transmit: *mut RiceTransmit);
579}
580unsafe extern "C" {
581 #[doc = " Initialize a `RiceAgentPoll` with a default value."]
582 pub fn rice_agent_poll_init(poll: *mut RiceAgentPoll);
583}
584unsafe extern "C" {
585 #[doc = " Clear a `RiceAgentPoll` of any allocated values.\n\n `rice_agent_poll_init()` must have been called previously."]
586 pub fn rice_agent_poll_clear(poll: *mut RiceAgentPoll);
587}
588unsafe extern "C" {
589 #[doc = " Poll the `RiceAgent` for further progress.\n\n The returned value indicates what should be done to continue making progress."]
590 pub fn rice_agent_poll(agent: *mut RiceAgent, now_micros: u64, poll: *mut RiceAgentPoll);
591}
592unsafe extern "C" {
593 #[doc = " Poll the `RiceAgent` for a transmission to send.\n\n If there is no transmission, then `transmit` will be filled with empty data.\n\n `rice_transmit_init()` or `rice_transmit_clear()` must be called before this function."]
594 pub fn rice_agent_poll_transmit(
595 agent: *mut RiceAgent,
596 now_micros: u64,
597 transmit: *mut RiceTransmit,
598 );
599}
600unsafe extern "C" {
601 #[doc = " Add a STUN server to this `RiceAgent`."]
602 pub fn rice_agent_add_stun_server(
603 agent: *mut RiceAgent,
604 transport: RiceTransportType,
605 addr: *const RiceAddress,
606 );
607}
608unsafe extern "C" {
609 #[doc = " Add a TURN server to this `RiceAgent`."]
610 pub fn rice_agent_add_turn_server(
611 agent: *mut RiceAgent,
612 transport: RiceTransportType,
613 addr: *const RiceAddress,
614 credentials: *const RiceCredentials,
615 );
616}
617unsafe extern "C" {
618 #[doc = " Get the current time in microseconds of the `RiceAgent`.\n\n The returned value can be passed to functions that require the current time.\n\n This value is the same as `rice_stream_now()`."]
619 pub fn rice_agent_now(agent: *mut RiceAgent) -> u64;
620}
621unsafe extern "C" {
622 #[doc = " Add an ICE stream to the `RiceAgent`."]
623 pub fn rice_agent_add_stream(agent: *mut RiceAgent) -> *mut RiceStream;
624}
625unsafe extern "C" {
626 #[doc = " Retrieve a previously added stream from the `RiceAgent`.\n\n Will return `NULL` if the stream does not exist."]
627 pub fn rice_agent_get_stream(agent: *mut RiceAgent, stream_id: usize) -> *mut RiceStream;
628}
629unsafe extern "C" {
630 #[doc = " Increase the reference count of the `RiceStream`.\n\n This function is multi-threading safe."]
631 pub fn rice_stream_ref(stream: *mut RiceStream) -> *mut RiceStream;
632}
633unsafe extern "C" {
634 #[doc = " Decrease the reference count of the `RiceStream`.\n\n If this is the last reference, then the `RiceStream` is freed (but will still be referenced by\n the `RiceAgent`).\n\n This function is multi-threading safe."]
635 pub fn rice_stream_unref(stream: *mut RiceStream);
636}
637unsafe extern "C" {
638 #[doc = " Retrieve the stream id of the `RiceStream`."]
639 pub fn rice_stream_get_id(stream: *mut RiceStream) -> usize;
640}
641unsafe extern "C" {
642 #[doc = " Notify success or failure to create a socket to the `RiceStream`.\n\n `socket_addr` can be `NULL` to indicate failure."]
643 pub fn rice_stream_handle_allocated_socket(
644 stream: *mut RiceStream,
645 component_id: usize,
646 transport: RiceTransportType,
647 from: *const RiceAddress,
648 to: *const RiceAddress,
649 socket_addr: *mut RiceAddress,
650 );
651}
652unsafe extern "C" {
653 #[doc = " Get the current time in microseconds of the `RiceStream`.\n\n The returned value can be passed to functions that require the current time.\n\n This value produces the same values as `rice_agent_now()`."]
654 pub fn rice_stream_now(stream: *mut RiceStream) -> u64;
655}
656unsafe extern "C" {
657 #[doc = " Construct a new set of ICE/TURN credentials."]
658 pub fn rice_credentials_new(
659 ufrag: *const ::core::ffi::c_char,
660 passwd: *const ::core::ffi::c_char,
661 ) -> *mut RiceCredentials;
662}
663unsafe extern "C" {
664 #[doc = " Construct a new set of ICE/TURN credentials."]
665 pub fn rice_credentials_copy(creds: *const RiceCredentials) -> *mut RiceCredentials;
666}
667unsafe extern "C" {
668 #[doc = " Free a set of ICE/TURN credentials."]
669 pub fn rice_credentials_free(credentials: *mut RiceCredentials);
670}
671unsafe extern "C" {
672 #[doc = " Compare two sets of Credentials.\n\n This function is NULL safe."]
673 pub fn rice_credentials_eq(
674 creds1: *const RiceCredentials,
675 creds2: *const RiceCredentials,
676 ) -> bool;
677}
678unsafe extern "C" {
679 #[doc = " Retrieve the local ICE credentials currently set on the `RiceStream`."]
680 pub fn rice_stream_get_local_credentials(stream: *mut RiceStream) -> *mut RiceCredentials;
681}
682unsafe extern "C" {
683 #[doc = " Retrieve the remote ICE credentials currently set on the `RiceStream`."]
684 pub fn rice_stream_get_remote_credentials(stream: *mut RiceStream) -> *mut RiceCredentials;
685}
686unsafe extern "C" {
687 #[doc = " Set the local credentials to use for this `RiceStream`."]
688 pub fn rice_stream_set_local_credentials(
689 stream: *mut RiceStream,
690 credentials: *const RiceCredentials,
691 );
692}
693unsafe extern "C" {
694 #[doc = " Set the remote credentials to use for this `RiceStream`."]
695 pub fn rice_stream_set_remote_credentials(
696 stream: *mut RiceStream,
697 credentials: *const RiceCredentials,
698 );
699}
700unsafe extern "C" {
701 #[doc = " Construct a `RiceCandidate` from a string as formatted in an SDP and specified in RFC5245\n Section 15.1.\n\n Takes the form 'a=candidate:foundation 1 UDP 12345 127.0.0.1 23456 typ host'."]
702 pub fn rice_candidate_new_from_sdp_string(
703 cand_str: *const ::core::ffi::c_char,
704 ) -> *mut RiceCandidate;
705}
706unsafe extern "C" {
707 #[doc = " Construct a `RiceCandidate` from a string as formatted in an SDP and specified in RFC5245\n Section 15.1.\n\n Takes the form 'a=candidate:foundation 1 UDP 12345 127.0.0.1 23456 typ host'."]
708 pub fn rice_candidate_init_from_sdp_string(
709 candidate: *mut RiceCandidate,
710 cand_str: *const ::core::ffi::c_char,
711 ) -> RiceError;
712}
713unsafe extern "C" {
714 #[doc = " Return a SDP candidate string as specified in RFC5245 Section 15.1."]
715 pub fn rice_candidate_to_sdp_string(
716 candidate: *const RiceCandidate,
717 ) -> *mut ::core::ffi::c_char;
718}
719unsafe extern "C" {
720 #[doc = " Free an allocated string."]
721 pub fn rice_string_free(string: *mut ::core::ffi::c_char);
722}
723unsafe extern "C" {
724 #[doc = " Construct a new `RiceCandidate` with the provided values.\n\n Will return NULL on error."]
725 pub fn rice_candidate_new(
726 component_id: usize,
727 ctype: RiceCandidateType,
728 ttype: RiceTransportType,
729 foundation: *const ::core::ffi::c_char,
730 address: *mut RiceAddress,
731 ) -> *mut RiceCandidate;
732}
733unsafe extern "C" {
734 #[doc = " Construct a new `RiceCandidate` with the provided values."]
735 pub fn rice_candidate_init(
736 candidate: *mut RiceCandidate,
737 component_id: usize,
738 ctype: RiceCandidateType,
739 ttype: RiceTransportType,
740 foundation: *const ::core::ffi::c_char,
741 address: *mut RiceAddress,
742 ) -> RiceError;
743}
744unsafe extern "C" {
745 #[doc = " Set the base address of a `RiceCandidate`."]
746 pub fn rice_candidate_set_priority(candidate: *mut RiceCandidate, priority: u32);
747}
748unsafe extern "C" {
749 #[doc = " Set the base address of a `RiceCandidate`."]
750 pub fn rice_candidate_set_base_address(
751 candidate: *mut RiceCandidate,
752 base_address: *mut RiceAddress,
753 );
754}
755unsafe extern "C" {
756 #[doc = " Set the related address of a `RiceCandidate`."]
757 pub fn rice_candidate_set_related_address(
758 candidate: *mut RiceCandidate,
759 related_address: *mut RiceAddress,
760 );
761}
762unsafe extern "C" {
763 #[doc = " Set the tcp type of a `RiceCandidate`."]
764 pub fn rice_candidate_set_tcp_type(candidate: *mut RiceCandidate, tcp_type: RiceTcpType);
765}
766unsafe extern "C" {
767 #[doc = " Perform a deep copy of a `RiceCandidate`."]
768 pub fn rice_candidate_copy(candidate: *const RiceCandidate) -> *mut RiceCandidate;
769}
770unsafe extern "C" {
771 #[doc = " Perform a deep copy of a `RiceCandidate`."]
772 pub fn rice_candidate_copy_into(candidate: *const RiceCandidate, ret: *mut RiceCandidate);
773}
774unsafe extern "C" {
775 #[doc = " Clear any resources allocated within a `RiceCandidate`.\n\n Useful for stack-allocated `RiceCandidate`s or when embedded in other structures.\n\n This function is NULL safe."]
776 pub fn rice_candidate_clear(candidate: *mut RiceCandidate);
777}
778unsafe extern "C" {
779 #[doc = " Free a `RiceCandidate`.\n\n This function is NULL safe."]
780 pub fn rice_candidate_free(candidate: *mut RiceCandidate);
781}
782unsafe extern "C" {
783 #[doc = " Free a `RiceCandidate`."]
784 pub fn rice_candidate_eq(candidate: *const RiceCandidate, other: *const RiceCandidate) -> bool;
785}
786unsafe extern "C" {
787 #[doc = " Add a local `RiceGatheredCandidate` to a `RiceStream`."]
788 pub fn rice_stream_add_local_gathered_candidate(
789 stream: *mut RiceStream,
790 candidate: *const RiceGatheredCandidate,
791 ) -> bool;
792}
793unsafe extern "C" {
794 #[doc = " Add a remote candidate to the `RiceStream`."]
795 pub fn rice_stream_add_remote_candidate(
796 stream: *mut RiceStream,
797 candidate: *const RiceCandidate,
798 );
799}
800unsafe extern "C" {
801 #[doc = " Signal the end of a set of local candidates.\n\n Any local candidates provided after calling this function will result in an error."]
802 pub fn rice_stream_end_of_local_candidates(stream: *mut RiceStream);
803}
804unsafe extern "C" {
805 #[doc = " Signal the end of a set of remote candidates.\n\n Any remote candidates provided after calling this function will result in an error."]
806 pub fn rice_stream_end_of_remote_candidates(stream: *mut RiceStream);
807}
808unsafe extern "C" {
809 #[doc = " Provide data to the `RiceStream` for processing.\n\n The returned value contains what processing was completed on the provided data and any\n application data that needs to be handled."]
810 pub fn rice_stream_handle_incoming_data(
811 stream: *mut RiceStream,
812 component_id: usize,
813 transport: RiceTransportType,
814 from: *const RiceAddress,
815 to: *const RiceAddress,
816 data: *const u8,
817 data_len: usize,
818 now_micros: u64,
819 ret: *mut RiceStreamIncomingData,
820 );
821}
822unsafe extern "C" {
823 #[doc = " Poll for further application data that has been received.\n\n Free the returned data with `rice_free_data()`."]
824 pub fn rice_stream_poll_recv(
825 stream: *mut RiceStream,
826 component_id: *mut usize,
827 data_len: *mut usize,
828 ) -> *mut u8;
829}
830unsafe extern "C" {
831 #[doc = " Free allocated data."]
832 pub fn rice_free_data(data: *mut u8);
833}
834unsafe extern "C" {
835 #[doc = " Return the component ids currently in use by a `RiceStream`.\n\n `ret` can be NULL to discover the length of the data that would be provided."]
836 pub fn rice_stream_component_ids(stream: *mut RiceStream, len: *mut usize, ret: *mut usize);
837}
838unsafe extern "C" {
839 #[doc = " Add an ICE component to a `RiceStream`."]
840 pub fn rice_stream_add_component(stream: *mut RiceStream) -> *mut RiceComponent;
841}
842unsafe extern "C" {
843 #[doc = " Increase the reference count of the `RiceComponent`.\n\n This function is multi-threading safe."]
844 pub fn rice_component_ref(component: *mut RiceComponent) -> *mut RiceComponent;
845}
846unsafe extern "C" {
847 #[doc = " Decrease the reference count of the `RiceComponent`.\n\n If this is the last reference, then the `RiceComponent` is freed (but will still be referenced by\n the `RiceStream`).\n\n This function is multi-threading safe."]
848 pub fn rice_component_unref(component: *mut RiceComponent);
849}
850unsafe extern "C" {
851 #[doc = " Retrieve the component id of the `RiceComponent`."]
852 pub fn rice_component_get_id(component: *const RiceComponent) -> usize;
853}
854unsafe extern "C" {
855 #[doc = " Retrieve the component id of the `RiceComponent`."]
856 pub fn rice_component_get_state(
857 component: *const RiceComponent,
858 ) -> RiceComponentConnectionState;
859}
860unsafe extern "C" {
861 #[doc = " Retrieve the component id of the `RiceComponent`."]
862 pub fn rice_component_selected_pair(
863 component: *const RiceComponent,
864 local: *mut RiceCandidate,
865 remote: *mut RiceCandidate,
866 );
867}
868unsafe extern "C" {
869 #[doc = " Retrieve a previously added `RiceComponent`.\n\n If the `RiceComponent` does not exist, `NULL` is returned."]
870 pub fn rice_stream_get_component(
871 stream: *mut RiceStream,
872 component_id: usize,
873 ) -> *mut RiceComponent;
874}
875unsafe extern "C" {
876 #[doc = " Start gathering candidates for a component with the provided local socket addresses."]
877 pub fn rice_component_gather_candidates(
878 component: *mut RiceComponent,
879 sockets_len: usize,
880 sockets_addr: *const *const RiceAddress,
881 sockets_transports: *const RiceTransportType,
882 ) -> RiceError;
883}
884unsafe extern "C" {
885 #[doc = " Send data to the connected peer.\n\n This will fail before a connection is successfully completed."]
886 pub fn rice_component_send(
887 component: *mut RiceComponent,
888 data: *mut u8,
889 len: usize,
890 now_micros: u64,
891 transmit: *mut RiceTransmit,
892 ) -> RiceError;
893}
894unsafe extern "C" {
895 #[doc = " Start gathering candidates for a component with the provided local socket addresses."]
896 pub fn rice_component_set_selected_pair(
897 component: *mut RiceComponent,
898 local: *const RiceCandidate,
899 remote: *const RiceCandidate,
900 ) -> RiceError;
901}
902unsafe extern "C" {
903 #[doc = " Create a `RiceAddress` from a string representation of the socket address."]
904 pub fn rice_address_new_from_string(string: *const ::core::ffi::c_char) -> *mut RiceAddress;
905}
906unsafe extern "C" {
907 #[doc = " Construct a `RiceAddress` from a sequence of bytes.\n\n The number of bytes required depends on the address family being constructed:\n - IPv4 -> 4.\n - IPv6 -> 16."]
908 pub fn rice_address_new_from_bytes(
909 family: RiceAddressFamily,
910 bytes: *const u8,
911 port: u16,
912 ) -> *mut RiceAddress;
913}
914unsafe extern "C" {
915 #[doc = " The address family of the `RiceAddress`."]
916 pub fn rice_address_get_family(addr: *const RiceAddress) -> RiceAddressFamily;
917}
918unsafe extern "C" {
919 #[doc = " Retrieve the bytes of a `RiceAddress`.\n\n The number of bytes required depends on the address family being constructed:\n - IPv4 -> 4.\n - IPv6 -> 16."]
920 pub fn rice_address_get_address_bytes(addr: *const RiceAddress, bytes: *mut u8) -> usize;
921}
922unsafe extern "C" {
923 #[doc = " Retrieve the port of a `RiceAddress`."]
924 pub fn rice_address_get_port(addr: *const RiceAddress) -> u16;
925}
926unsafe extern "C" {
927 #[doc = " Compare whether two `RiceAddress`es are equal."]
928 pub fn rice_address_cmp(
929 addr: *const RiceAddress,
930 other: *const RiceAddress,
931 ) -> ::core::ffi::c_int;
932}
933unsafe extern "C" {
934 #[doc = " Copy a `RiceAddress`."]
935 pub fn rice_address_copy(addr: *const RiceAddress) -> *mut RiceAddress;
936}
937unsafe extern "C" {
938 #[doc = " Free a `RiceAddress`."]
939 pub fn rice_address_free(addr: *mut RiceAddress);
940}