Skip to main content

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 = 3;
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;
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_stream_handle_allocated_socket()`."]
411pub const RICE_AGENT_POLL_ALLOCATE_SOCKET: RiceAgentPoll_Tag = 2;
412#[doc = " It is possible 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        allocation_transport: RiceTransportType,
669        n_families: usize,
670        families: *const RiceAddressFamily,
671        tls_config: *mut RiceTlsConfig,
672    ) -> *mut RiceTurnConfig;
673}
674unsafe extern "C" {
675    #[doc = " Increase the reference count of the [`RiceTurnConfig`].\n\n This function is multi-threading safe."]
676    pub fn rice_turn_config_ref(config: *const RiceTurnConfig) -> *mut RiceTurnConfig;
677}
678unsafe extern "C" {
679    #[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."]
680    pub fn rice_turn_config_unref(config: *mut RiceTurnConfig);
681}
682unsafe extern "C" {
683    #[doc = " The address of the TURN server."]
684    pub fn rice_turn_config_get_addr(config: *const RiceTurnConfig) -> *mut RiceAddress;
685}
686unsafe extern "C" {
687    #[doc = " The transport to connect to the TURN server."]
688    pub fn rice_turn_config_get_client_transport(
689        config: *const RiceTurnConfig,
690    ) -> RiceTransportType;
691}
692unsafe extern "C" {
693    #[doc = " The credentials to use for accessing the TURN server."]
694    pub fn rice_turn_config_get_credentials(config: *const RiceTurnConfig) -> *mut RiceCredentials;
695}
696unsafe extern "C" {
697    #[doc = " The transport to connect to the TURN server."]
698    pub fn rice_turn_config_get_address_families(
699        config: *const RiceTurnConfig,
700        n_families: *mut usize,
701        families: *mut RiceAddressFamily,
702    );
703}
704unsafe extern "C" {
705    #[doc = " The TLS config associated with this TURN configuration."]
706    pub fn rice_turn_config_get_tls_config(config: *const RiceTurnConfig) -> *mut RiceTlsConfig;
707}
708unsafe extern "C" {
709    #[doc = " Increase the reference count of the `RiceTlsConfig`.\n\n This function is multi-threading safe."]
710    pub fn rice_tls_config_ref(config: *const RiceTlsConfig) -> *mut RiceTlsConfig;
711}
712unsafe extern "C" {
713    #[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."]
714    pub fn rice_tls_config_unref(config: *mut RiceTlsConfig);
715}
716unsafe extern "C" {
717    #[doc = " The TLS variant for a [`RiceTlsConfig`]"]
718    pub fn rice_tls_config_variant(config: *const RiceTlsConfig) -> RiceTlsVariant;
719}
720unsafe extern "C" {
721    #[doc = " Construct a new TLS configuration using Openssl."]
722    pub fn rice_tls_config_new_openssl(transport: RiceTransportType) -> *mut RiceTlsConfig;
723}
724unsafe extern "C" {
725    #[doc = " Construct a new TLS configuration using Rustls."]
726    pub fn rice_tls_config_new_rustls_with_dns(
727        server_name: *const ::core::ffi::c_char,
728    ) -> *mut RiceTlsConfig;
729}
730unsafe extern "C" {
731    #[doc = " Construct a new TLS configuration using Rustls."]
732    pub fn rice_tls_config_new_rustls_with_ip(addr: *const RiceAddress) -> *mut RiceTlsConfig;
733}
734unsafe extern "C" {
735    #[doc = " Add an ICE stream to the `RiceAgent`."]
736    pub fn rice_agent_add_stream(agent: *mut RiceAgent) -> *mut RiceStream;
737}
738unsafe extern "C" {
739    #[doc = " Retrieve a previously added stream from the `RiceAgent`.\n\n Will return `NULL` if the stream does not exist."]
740    pub fn rice_agent_get_stream(agent: *const RiceAgent, stream_id: usize) -> *mut RiceStream;
741}
742unsafe extern "C" {
743    #[doc = " Increase the reference count of the `RiceStream`.\n\n This function is multi-threading safe."]
744    pub fn rice_stream_ref(stream: *const RiceStream) -> *mut RiceStream;
745}
746unsafe extern "C" {
747    #[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."]
748    pub fn rice_stream_unref(stream: *mut RiceStream);
749}
750unsafe extern "C" {
751    #[doc = " Retrieve the stream id of the `RiceStream`."]
752    pub fn rice_stream_get_id(stream: *const RiceStream) -> usize;
753}
754unsafe extern "C" {
755    #[doc = " Retrieve the `RiceAgent` of the `RiceStream`."]
756    pub fn rice_stream_get_agent(stream: *const RiceStream) -> *mut RiceAgent;
757}
758unsafe extern "C" {
759    #[doc = " Notify success or failure to create a socket to the `RiceStream`.\n\n `socket_addr` can be `NULL` to indicate failure."]
760    pub fn rice_stream_handle_allocated_socket(
761        stream: *mut RiceStream,
762        component_id: usize,
763        transport: RiceTransportType,
764        from: *const RiceAddress,
765        to: *const RiceAddress,
766        socket_addr: *mut RiceAddress,
767        now_nanos: i64,
768    );
769}
770unsafe extern "C" {
771    #[doc = " Construct a new set of ICE/TURN credentials."]
772    pub fn rice_credentials_new(
773        ufrag: *const ::core::ffi::c_char,
774        passwd: *const ::core::ffi::c_char,
775    ) -> *mut RiceCredentials;
776}
777unsafe extern "C" {
778    #[doc = " Construct a new set of ICE/TURN credentials."]
779    pub fn rice_credentials_copy(creds: *const RiceCredentials) -> *mut RiceCredentials;
780}
781unsafe extern "C" {
782    #[doc = " Free a set of ICE/TURN credentials."]
783    pub fn rice_credentials_free(credentials: *mut RiceCredentials);
784}
785unsafe extern "C" {
786    #[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."]
787    pub fn rice_credentials_get_ufrag_bytes(
788        credentials: *const RiceCredentials,
789        ptr: *mut ::core::ffi::c_char,
790    ) -> usize;
791}
792unsafe extern "C" {
793    #[doc = " Compare two sets of Credentials.\n\n This function is NULL safe."]
794    pub fn rice_credentials_eq(
795        creds1: *const RiceCredentials,
796        creds2: *const RiceCredentials,
797    ) -> bool;
798}
799unsafe extern "C" {
800    #[doc = " Retrieve the local ICE credentials currently set on the `RiceStream`."]
801    pub fn rice_stream_get_local_credentials(stream: *const RiceStream) -> *mut RiceCredentials;
802}
803unsafe extern "C" {
804    #[doc = " Retrieve the remote ICE credentials currently set on the `RiceStream`."]
805    pub fn rice_stream_get_remote_credentials(stream: *const RiceStream) -> *mut RiceCredentials;
806}
807unsafe extern "C" {
808    #[doc = " Set the local credentials to use for this `RiceStream`."]
809    pub fn rice_stream_set_local_credentials(
810        stream: *mut RiceStream,
811        credentials: *const RiceCredentials,
812    );
813}
814unsafe extern "C" {
815    #[doc = " Set the remote credentials to use for this `RiceStream`."]
816    pub fn rice_stream_set_remote_credentials(
817        stream: *mut RiceStream,
818        credentials: *const RiceCredentials,
819    );
820}
821unsafe extern "C" {
822    #[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'."]
823    pub fn rice_candidate_new_from_sdp_string(
824        cand_str: *const ::core::ffi::c_char,
825    ) -> *mut RiceCandidate;
826}
827unsafe extern "C" {
828    #[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'."]
829    pub fn rice_candidate_init_from_sdp_string(
830        candidate: *mut RiceCandidate,
831        cand_str: *const ::core::ffi::c_char,
832    ) -> RiceParseCandidateError;
833}
834unsafe extern "C" {
835    #[doc = " Return a SDP candidate string as specified in RFC5245 Section 15.1."]
836    pub fn rice_candidate_to_sdp_string(
837        candidate: *const RiceCandidate,
838    ) -> *mut ::core::ffi::c_char;
839}
840unsafe extern "C" {
841    #[doc = " Free an allocated string."]
842    pub fn rice_string_free(string: *mut ::core::ffi::c_char);
843}
844unsafe extern "C" {
845    #[doc = " Construct a new `RiceCandidate` with the provided values.\n\n Will return NULL on error."]
846    pub fn rice_candidate_new(
847        component_id: usize,
848        ctype: RiceCandidateType,
849        ttype: RiceTransportType,
850        foundation: *const ::core::ffi::c_char,
851        address: *mut RiceAddress,
852    ) -> *mut RiceCandidate;
853}
854unsafe extern "C" {
855    #[doc = " Construct a new `RiceCandidate` with the provided values."]
856    pub fn rice_candidate_init(
857        candidate: *mut RiceCandidate,
858        component_id: usize,
859        ctype: RiceCandidateType,
860        ttype: RiceTransportType,
861        foundation: *const ::core::ffi::c_char,
862        address: *mut RiceAddress,
863    ) -> RiceError;
864}
865unsafe extern "C" {
866    #[doc = " Set the base address of a `RiceCandidate`."]
867    pub fn rice_candidate_set_priority(candidate: *mut RiceCandidate, priority: u32);
868}
869unsafe extern "C" {
870    #[doc = " Set the base address of a `RiceCandidate`."]
871    pub fn rice_candidate_set_base_address(
872        candidate: *mut RiceCandidate,
873        base_address: *mut RiceAddress,
874    );
875}
876unsafe extern "C" {
877    #[doc = " Set the related address of a `RiceCandidate`."]
878    pub fn rice_candidate_set_related_address(
879        candidate: *mut RiceCandidate,
880        related_address: *mut RiceAddress,
881    );
882}
883unsafe extern "C" {
884    #[doc = " Set the tcp type of a `RiceCandidate`."]
885    pub fn rice_candidate_set_tcp_type(candidate: *mut RiceCandidate, tcp_type: RiceTcpType);
886}
887unsafe extern "C" {
888    #[doc = " Perform a deep copy of a `RiceCandidate`."]
889    pub fn rice_candidate_copy(candidate: *const RiceCandidate) -> *mut RiceCandidate;
890}
891unsafe extern "C" {
892    #[doc = " Perform a deep copy of a `RiceCandidate`."]
893    pub fn rice_candidate_copy_into(candidate: *const RiceCandidate, ret: *mut RiceCandidate);
894}
895unsafe extern "C" {
896    #[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."]
897    pub fn rice_candidate_clear(candidate: *mut RiceCandidate);
898}
899unsafe extern "C" {
900    #[doc = " Free a `RiceCandidate`.\n\n This function is NULL safe."]
901    pub fn rice_candidate_free(candidate: *mut RiceCandidate);
902}
903unsafe extern "C" {
904    #[doc = " Free a `RiceCandidate`."]
905    pub fn rice_candidate_eq(candidate: *const RiceCandidate, other: *const RiceCandidate) -> bool;
906}
907unsafe extern "C" {
908    #[doc = " Add a local `RiceGatheredCandidate` to a `RiceStream`."]
909    pub fn rice_stream_add_local_gathered_candidate(
910        stream: *mut RiceStream,
911        candidate: *const RiceGatheredCandidate,
912    ) -> bool;
913}
914unsafe extern "C" {
915    #[doc = " Add a remote candidate to the `RiceStream`."]
916    pub fn rice_stream_add_remote_candidate(
917        stream: *mut RiceStream,
918        candidate: *const RiceCandidate,
919    );
920}
921unsafe extern "C" {
922    #[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."]
923    pub fn rice_stream_end_of_local_candidates(stream: *mut RiceStream);
924}
925unsafe extern "C" {
926    #[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."]
927    pub fn rice_stream_end_of_remote_candidates(stream: *mut RiceStream);
928}
929unsafe extern "C" {
930    #[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."]
931    pub fn rice_stream_handle_incoming_data(
932        stream: *mut RiceStream,
933        component_id: usize,
934        transport: RiceTransportType,
935        from: *const RiceAddress,
936        to: *const RiceAddress,
937        data: *const u8,
938        data_len: usize,
939        now_nanos: i64,
940        ret: *mut RiceStreamIncomingData,
941    );
942}
943unsafe extern "C" {
944    #[doc = " Poll for further application data that has been received.\n\n Free the returned data with `rice_free_data()`."]
945    pub fn rice_stream_poll_recv(
946        stream: *mut RiceStream,
947        component_id: *mut usize,
948        data_len: *mut usize,
949    ) -> *mut u8;
950}
951unsafe extern "C" {
952    #[doc = " Free allocated data."]
953    pub fn rice_free_data(data: *mut u8);
954}
955unsafe extern "C" {
956    #[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."]
957    pub fn rice_stream_component_ids(stream: *mut RiceStream, len: *mut usize, ret: *mut usize);
958}
959unsafe extern "C" {
960    #[doc = " Add an ICE component to a `RiceStream`."]
961    pub fn rice_stream_add_component(stream: *mut RiceStream) -> *mut RiceComponent;
962}
963unsafe extern "C" {
964    #[doc = " Increase the reference count of the `RiceComponent`.\n\n This function is multi-threading safe."]
965    pub fn rice_component_ref(component: *const RiceComponent) -> *mut RiceComponent;
966}
967unsafe extern "C" {
968    #[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."]
969    pub fn rice_component_unref(component: *mut RiceComponent);
970}
971unsafe extern "C" {
972    #[doc = " Retrieve the component id of the `RiceComponent`."]
973    pub fn rice_component_get_id(component: *const RiceComponent) -> usize;
974}
975unsafe extern "C" {
976    #[doc = " Retrieve the component id of the `RiceComponent`."]
977    pub fn rice_component_get_stream(component: *const RiceComponent) -> *mut RiceStream;
978}
979unsafe extern "C" {
980    #[doc = " Retrieve the component connection state of the `RiceComponent`."]
981    pub fn rice_component_get_state(
982        component: *const RiceComponent,
983    ) -> RiceComponentConnectionState;
984}
985unsafe extern "C" {
986    #[doc = " Retrieve the ICE candidates selected pair of the `RiceComponent`.\n\n Before the pair has been selected through ICE, `local` and `remote` will be zeroed to signal\n unset."]
987    pub fn rice_component_selected_pair(
988        component: *const RiceComponent,
989        local: *mut RiceCandidate,
990        remote: *mut RiceCandidate,
991    );
992}
993unsafe extern "C" {
994    #[doc = " Retrieve a previously added `RiceComponent`.\n\n If the `RiceComponent` does not exist, `NULL` is returned."]
995    pub fn rice_stream_get_component(
996        stream: *const RiceStream,
997        component_id: usize,
998    ) -> *mut RiceComponent;
999}
1000unsafe extern "C" {
1001    #[doc = " Start gathering candidates for a component with the provided local socket addresses.\n\n - `component`: The component to start gathering.\n - `sockets_len`: The number of entries in both `sockets_addr` and `sockets_transports`.\n - `sockets_addr`: An array of addresses for producing host and STUN server-reflexive\n   candidates.\n - `sockets_transports`: An array of transport types for producing host and STUN\n   server-reflexive candidates.\n - `turn_len`: the number of entries in both `turn_sockets` and `turn_config`.\n - `turn_sockets`: An array of local addresses for producing TURN candidates.\n - `turn_config`: An array of TURN server configurations.\n\n Candidates will be generated as follows (if they succeed):\n\n 1. A host candidate for each `(sockets_transports[i], socket_addr[i])`. If TCP, then both an\n    active and passive host candidate will be generated.\n 2. For each configured STUN server, a reflexive candidate for each\n    `(sockets_transports[i], socket_addr[i])` if different from any other candidate\n    produced. The local address for each STUN server connection will be one of the entries\n    provided in `sockets_addr`.\n 3. For each `(turn_sockets[i], turn_config[i])` a TURN allocation will be attempted and a\n    relayed candidate produced on success.  If you would like multiple options for relayed\n    candidates, e.g. UDP, TCP, TCP/TLS, then provide each options as different entries in the\n    provided array. The `turn_sockets[i]` value is the local address to communicate with the\n    TURN server in `turn_config[i]` and should be different than any value provided through\n    `sockets_addr`."]
1002    pub fn rice_component_gather_candidates(
1003        component: *mut RiceComponent,
1004        sockets_len: usize,
1005        sockets_addr: *const *const RiceAddress,
1006        sockets_transports: *const RiceTransportType,
1007        turn_len: usize,
1008        turn_sockets: *const *const RiceAddress,
1009        turn_config: *const *mut RiceTurnConfig,
1010    ) -> RiceError;
1011}
1012unsafe extern "C" {
1013    #[doc = " Send data to the connected peer.\n\n This will fail before a connection is successfully completed."]
1014    pub fn rice_component_send(
1015        component: *mut RiceComponent,
1016        data: *mut u8,
1017        len: usize,
1018        now_nanos: i64,
1019        transmit: *mut RiceTransmit,
1020    ) -> RiceError;
1021}
1022unsafe extern "C" {
1023    #[doc = " Start gathering candidates for a component with the provided local socket addresses."]
1024    pub fn rice_component_set_selected_pair(
1025        component: *mut RiceComponent,
1026        local: *const RiceCandidate,
1027        remote: *const RiceCandidate,
1028    ) -> RiceError;
1029}
1030unsafe extern "C" {
1031    #[doc = " Create a `RiceAddress` from a string representation of the socket address."]
1032    pub fn rice_address_new_from_string(string: *const ::core::ffi::c_char) -> *mut RiceAddress;
1033}
1034unsafe extern "C" {
1035    #[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."]
1036    pub fn rice_address_new_from_bytes(
1037        family: RiceAddressFamily,
1038        bytes: *const u8,
1039        port: u16,
1040    ) -> *mut RiceAddress;
1041}
1042unsafe extern "C" {
1043    #[doc = " The address family of the `RiceAddress`."]
1044    pub fn rice_address_get_family(addr: *const RiceAddress) -> RiceAddressFamily;
1045}
1046unsafe extern "C" {
1047    #[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."]
1048    pub fn rice_address_get_address_bytes(addr: *const RiceAddress, bytes: *mut u8) -> usize;
1049}
1050unsafe extern "C" {
1051    #[doc = " Retrieve the port of a `RiceAddress`."]
1052    pub fn rice_address_get_port(addr: *const RiceAddress) -> u16;
1053}
1054unsafe extern "C" {
1055    #[doc = " Compare whether two `RiceAddress`es are equal."]
1056    pub fn rice_address_cmp(
1057        addr: *const RiceAddress,
1058        other: *const RiceAddress,
1059    ) -> ::core::ffi::c_int;
1060}
1061unsafe extern "C" {
1062    #[doc = " Copy a `RiceAddress`."]
1063    pub fn rice_address_copy(addr: *const RiceAddress) -> *mut RiceAddress;
1064}
1065unsafe extern "C" {
1066    #[doc = " Free a `RiceAddress`."]
1067    pub fn rice_address_free(addr: *mut RiceAddress);
1068}
1069unsafe extern "C" {
1070    #[doc = " Generate a random sequence of characters suitable for username fragments and passwords."]
1071    pub fn rice_random_string(length: usize) -> *mut ::core::ffi::c_char;
1072}