rice_c/
bindings.rs

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