Skip to main content

nice_sys/
lib.rs

1// Generated by gir (https://github.com/gtk-rs/gir @ 5bbf6cb)
2// from ../../gir-files (@ 8e47c67)
3// DO NOT EDIT
4
5#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
6#![allow(
7  clippy::approx_constant,
8  clippy::type_complexity,
9  clippy::unreadable_literal,
10  clippy::upper_case_acronyms
11)]
12#![cfg_attr(feature = "dox", feature(doc_cfg))]
13
14#[allow(unused_imports)]
15use glib::ffi::{gboolean, gconstpointer, gpointer, GType};
16#[allow(unused_imports)]
17use libc::{
18  c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
19  intptr_t, size_t, sockaddr, sockaddr_in, sockaddr_in6, ssize_t, time_t, uintptr_t, FILE,
20};
21
22// Enums
23pub type NiceCandidateTransport = c_int;
24pub const NICE_CANDIDATE_TRANSPORT_UDP: NiceCandidateTransport = 0;
25pub const NICE_CANDIDATE_TRANSPORT_TCP_ACTIVE: NiceCandidateTransport = 1;
26pub const NICE_CANDIDATE_TRANSPORT_TCP_PASSIVE: NiceCandidateTransport = 2;
27pub const NICE_CANDIDATE_TRANSPORT_TCP_SO: NiceCandidateTransport = 3;
28
29pub type NiceCandidateType = c_int;
30pub const NICE_CANDIDATE_TYPE_HOST: NiceCandidateType = 0;
31pub const NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE: NiceCandidateType = 1;
32pub const NICE_CANDIDATE_TYPE_PEER_REFLEXIVE: NiceCandidateType = 2;
33pub const NICE_CANDIDATE_TYPE_RELAYED: NiceCandidateType = 3;
34
35pub type NiceCompatibility = c_int;
36pub const NICE_COMPATIBILITY_RFC5245: NiceCompatibility = 0;
37pub const NICE_COMPATIBILITY_DRAFT19: NiceCompatibility = 0;
38pub const NICE_COMPATIBILITY_GOOGLE: NiceCompatibility = 1;
39pub const NICE_COMPATIBILITY_MSN: NiceCompatibility = 2;
40pub const NICE_COMPATIBILITY_WLM2009: NiceCompatibility = 3;
41pub const NICE_COMPATIBILITY_OC2007: NiceCompatibility = 4;
42pub const NICE_COMPATIBILITY_OC2007R2: NiceCompatibility = 5;
43pub const NICE_COMPATIBILITY_LAST: NiceCompatibility = 5;
44
45pub type NiceComponentState = c_int;
46pub const NICE_COMPONENT_STATE_DISCONNECTED: NiceComponentState = 0;
47pub const NICE_COMPONENT_STATE_GATHERING: NiceComponentState = 1;
48pub const NICE_COMPONENT_STATE_CONNECTING: NiceComponentState = 2;
49pub const NICE_COMPONENT_STATE_CONNECTED: NiceComponentState = 3;
50pub const NICE_COMPONENT_STATE_READY: NiceComponentState = 4;
51pub const NICE_COMPONENT_STATE_FAILED: NiceComponentState = 5;
52pub const NICE_COMPONENT_STATE_LAST: NiceComponentState = 6;
53
54pub type NiceComponentType = c_int;
55pub const NICE_COMPONENT_TYPE_RTP: NiceComponentType = 1;
56pub const NICE_COMPONENT_TYPE_RTCP: NiceComponentType = 2;
57
58pub type NiceNominationMode = c_int;
59pub const NICE_NOMINATION_MODE_REGULAR: NiceNominationMode = 0;
60pub const NICE_NOMINATION_MODE_AGGRESSIVE: NiceNominationMode = 1;
61
62pub type NiceProxyType = c_int;
63pub const NICE_PROXY_TYPE_NONE: NiceProxyType = 0;
64pub const NICE_PROXY_TYPE_SOCKS5: NiceProxyType = 1;
65pub const NICE_PROXY_TYPE_HTTP: NiceProxyType = 2;
66pub const NICE_PROXY_TYPE_LAST: NiceProxyType = 2;
67
68pub type NiceRelayType = c_int;
69pub const NICE_RELAY_TYPE_TURN_UDP: NiceRelayType = 0;
70pub const NICE_RELAY_TYPE_TURN_TCP: NiceRelayType = 1;
71pub const NICE_RELAY_TYPE_TURN_TLS: NiceRelayType = 2;
72
73pub type PseudoTcpDebugLevel = c_int;
74pub const PSEUDO_TCP_DEBUG_NONE: PseudoTcpDebugLevel = 0;
75pub const PSEUDO_TCP_DEBUG_NORMAL: PseudoTcpDebugLevel = 1;
76pub const PSEUDO_TCP_DEBUG_VERBOSE: PseudoTcpDebugLevel = 2;
77
78pub type PseudoTcpShutdown = c_int;
79pub const PSEUDO_TCP_SHUTDOWN_RD: PseudoTcpShutdown = 0;
80pub const PSEUDO_TCP_SHUTDOWN_WR: PseudoTcpShutdown = 1;
81pub const PSEUDO_TCP_SHUTDOWN_RDWR: PseudoTcpShutdown = 2;
82
83pub type PseudoTcpState = c_int;
84pub const PSEUDO_TCP_LISTEN: PseudoTcpState = 0;
85pub const PSEUDO_TCP_SYN_SENT: PseudoTcpState = 1;
86pub const PSEUDO_TCP_SYN_RECEIVED: PseudoTcpState = 2;
87pub const PSEUDO_TCP_ESTABLISHED: PseudoTcpState = 3;
88pub const PSEUDO_TCP_CLOSED: PseudoTcpState = 4;
89pub const PSEUDO_TCP_FIN_WAIT_1: PseudoTcpState = 5;
90pub const PSEUDO_TCP_FIN_WAIT_2: PseudoTcpState = 6;
91pub const PSEUDO_TCP_CLOSING: PseudoTcpState = 7;
92pub const PSEUDO_TCP_TIME_WAIT: PseudoTcpState = 8;
93pub const PSEUDO_TCP_CLOSE_WAIT: PseudoTcpState = 9;
94pub const PSEUDO_TCP_LAST_ACK: PseudoTcpState = 10;
95
96pub type PseudoTcpWriteResult = c_int;
97pub const WR_SUCCESS: PseudoTcpWriteResult = 0;
98pub const WR_TOO_LARGE: PseudoTcpWriteResult = 1;
99pub const WR_FAIL: PseudoTcpWriteResult = 2;
100
101// Constants
102pub const NICE_AGENT_MAX_REMOTE_CANDIDATES: c_int = 25;
103pub const NICE_CANDIDATE_MAX_FOUNDATION: c_int = 33;
104pub const NICE_CANDIDATE_MAX_LOCAL_ADDRESSES: c_int = 64;
105pub const NICE_CANDIDATE_MAX_TURN_SERVERS: c_int = 8;
106
107// Flags
108pub type NiceAgentOption = c_uint;
109pub const NICE_AGENT_OPTION_REGULAR_NOMINATION: NiceAgentOption = 1;
110pub const NICE_AGENT_OPTION_RELIABLE: NiceAgentOption = 2;
111pub const NICE_AGENT_OPTION_LITE_MODE: NiceAgentOption = 4;
112pub const NICE_AGENT_OPTION_ICE_TRICKLE: NiceAgentOption = 8;
113pub const NICE_AGENT_OPTION_SUPPORT_RENOMINATION: NiceAgentOption = 16;
114pub const NICE_AGENT_OPTION_CONSENT_FRESHNESS: NiceAgentOption = 32;
115
116// Unions
117#[repr(C)]
118#[derive(Copy, Clone)]
119pub union NiceAddress_s {
120  pub addr: sockaddr,
121  pub ip4: sockaddr_in,
122  pub ip6: sockaddr_in6,
123}
124
125impl ::std::fmt::Debug for NiceAddress_s {
126  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
127    f.debug_struct(&format!("NiceAddress_s @ {:p}", self))
128      .finish()
129  }
130}
131
132// Callbacks
133pub type NiceAgentRecvFunc =
134  Option<unsafe extern "C" fn(*mut NiceAgent, c_uint, c_uint, c_uint, *mut c_char, gpointer)>;
135
136// Records
137#[repr(C)]
138#[derive(Copy, Clone)]
139pub struct NiceAddress {
140  pub s: NiceAddress_s,
141}
142
143impl ::std::fmt::Debug for NiceAddress {
144  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
145    f.debug_struct(&format!("NiceAddress @ {:p}", self))
146      .field("s", &self.s)
147      .finish()
148  }
149}
150
151#[repr(C)]
152#[derive(Clone)]
153pub struct NiceAgentClass {
154  pub parent_class: gobject_sys::GObjectClass,
155}
156
157impl ::std::fmt::Debug for NiceAgentClass {
158  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
159    f.debug_struct(&format!("NiceAgentClass @ {:p}", self))
160      .field("parent_class", &self.parent_class)
161      .finish()
162  }
163}
164
165#[repr(C)]
166#[derive(Copy, Clone)]
167pub struct NiceCandidate {
168  pub type_: NiceCandidateType,
169  pub transport: NiceCandidateTransport,
170  pub addr: NiceAddress,
171  pub base_addr: NiceAddress,
172  pub priority: u32,
173  pub stream_id: c_uint,
174  pub component_id: c_uint,
175  pub foundation: [c_char; 33],
176  pub username: *mut c_char,
177  pub password: *mut c_char,
178}
179
180impl ::std::fmt::Debug for NiceCandidate {
181  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
182    f.debug_struct(&format!("NiceCandidate @ {:p}", self))
183      .field("type_", &self.type_)
184      .field("transport", &self.transport)
185      .field("addr", &self.addr)
186      .field("base_addr", &self.base_addr)
187      .field("priority", &self.priority)
188      .field("stream_id", &self.stream_id)
189      .field("component_id", &self.component_id)
190      .field("username", &self.username)
191      .field("password", &self.password)
192      .finish()
193  }
194}
195
196#[repr(C)]
197#[derive(Copy, Clone)]
198pub struct NiceInputMessage {
199  pub buffers: *mut gio::ffi::GInputVector,
200  pub n_buffers: c_int,
201  pub from: *mut NiceAddress,
202  pub length: size_t,
203}
204
205impl ::std::fmt::Debug for NiceInputMessage {
206  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
207    f.debug_struct(&format!("NiceInputMessage @ {:p}", self))
208      .field("buffers", &self.buffers)
209      .field("n_buffers", &self.n_buffers)
210      .field("from", &self.from)
211      .field("length", &self.length)
212      .finish()
213  }
214}
215
216#[repr(C)]
217#[derive(Copy, Clone)]
218pub struct NiceOutputMessage {
219  pub buffers: *mut gio::ffi::GOutputVector,
220  pub n_buffers: c_int,
221}
222
223impl ::std::fmt::Debug for NiceOutputMessage {
224  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
225    f.debug_struct(&format!("NiceOutputMessage @ {:p}", self))
226      .field("buffers", &self.buffers)
227      .field("n_buffers", &self.n_buffers)
228      .finish()
229  }
230}
231
232#[repr(C)]
233#[derive(Copy, Clone)]
234pub struct PseudoTcpCallbacks {
235  pub user_data: gpointer,
236  pub PseudoTcpOpened: Option<unsafe extern "C" fn(*mut PseudoTcpSocket, gpointer)>,
237  pub PseudoTcpReadable: Option<unsafe extern "C" fn(*mut PseudoTcpSocket, gpointer)>,
238  pub PseudoTcpWritable: Option<unsafe extern "C" fn(*mut PseudoTcpSocket, gpointer)>,
239  pub PseudoTcpClosed: Option<unsafe extern "C" fn(*mut PseudoTcpSocket, u32, gpointer)>,
240  pub WritePacket: Option<
241    unsafe extern "C" fn(
242      *mut PseudoTcpSocket,
243      *const c_char,
244      u32,
245      gpointer,
246    ) -> PseudoTcpWriteResult,
247  >,
248}
249
250impl ::std::fmt::Debug for PseudoTcpCallbacks {
251  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
252    f.debug_struct(&format!("PseudoTcpCallbacks @ {:p}", self))
253      .field("user_data", &self.user_data)
254      .field("PseudoTcpOpened", &self.PseudoTcpOpened)
255      .field("PseudoTcpReadable", &self.PseudoTcpReadable)
256      .field("PseudoTcpWritable", &self.PseudoTcpWritable)
257      .field("PseudoTcpClosed", &self.PseudoTcpClosed)
258      .field("WritePacket", &self.WritePacket)
259      .finish()
260  }
261}
262
263#[repr(C)]
264pub struct _PseudoTcpSocketClass(c_void);
265
266pub type PseudoTcpSocketClass = *mut _PseudoTcpSocketClass;
267
268// Classes
269#[repr(C)]
270pub struct NiceAgent(c_void);
271
272impl ::std::fmt::Debug for NiceAgent {
273  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
274    f.debug_struct(&format!("NiceAgent @ {:p}", self)).finish()
275  }
276}
277
278#[repr(C)]
279pub struct PseudoTcpSocket(c_void);
280
281impl ::std::fmt::Debug for PseudoTcpSocket {
282  fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
283    f.debug_struct(&format!("PseudoTcpSocket @ {:p}", self))
284      .finish()
285  }
286}
287
288#[link(name = "nice")]
289extern "C" {
290
291  //=========================================================================
292  // NiceAddress
293  //=========================================================================
294  pub fn nice_address_copy_to_sockaddr(addr: *const NiceAddress, sin: *mut sockaddr);
295  pub fn nice_address_dup(addr: *const NiceAddress) -> *mut NiceAddress;
296  pub fn nice_address_equal(a: *const NiceAddress, b: *const NiceAddress) -> gboolean;
297  #[cfg(any(feature = "v0_1_8", feature = "dox"))]
298  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_8")))]
299  pub fn nice_address_equal_no_port(a: *const NiceAddress, b: *const NiceAddress) -> gboolean;
300  pub fn nice_address_free(addr: *mut NiceAddress);
301  pub fn nice_address_get_port(addr: *const NiceAddress) -> c_uint;
302  pub fn nice_address_init(addr: *mut NiceAddress);
303  pub fn nice_address_ip_version(addr: *const NiceAddress) -> c_int;
304  pub fn nice_address_is_private(addr: *const NiceAddress) -> gboolean;
305  pub fn nice_address_is_valid(addr: *const NiceAddress) -> gboolean;
306  pub fn nice_address_set_from_sockaddr(addr: *mut NiceAddress, sin: *const sockaddr);
307  pub fn nice_address_set_from_string(addr: *mut NiceAddress, str: *const c_char) -> gboolean;
308  pub fn nice_address_set_ipv4(addr: *mut NiceAddress, addr_ipv4: u32);
309  pub fn nice_address_set_ipv6(addr: *mut NiceAddress, addr_ipv6: *const u8);
310  pub fn nice_address_set_port(addr: *mut NiceAddress, port: c_uint);
311  pub fn nice_address_to_string(addr: *const NiceAddress, dst: *mut c_char);
312  pub fn nice_address_new() -> *mut NiceAddress;
313
314  //=========================================================================
315  // NiceCandidate
316  //=========================================================================
317  pub fn nice_candidate_get_type() -> GType;
318  pub fn nice_candidate_new(type_: NiceCandidateType) -> *mut NiceCandidate;
319  pub fn nice_candidate_copy(candidate: *const NiceCandidate) -> *mut NiceCandidate;
320  #[cfg(any(feature = "v0_1_15", feature = "dox"))]
321  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_15")))]
322  pub fn nice_candidate_equal_target(
323    candidate1: *const NiceCandidate,
324    candidate2: *const NiceCandidate,
325  ) -> gboolean;
326  pub fn nice_candidate_free(candidate: *mut NiceCandidate);
327  #[cfg(any(feature = "v0_1_18", feature = "dox"))]
328  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_18")))]
329  pub fn nice_candidate_transport_to_string(transport: NiceCandidateTransport) -> *const c_char;
330  #[cfg(any(feature = "v0_1_18", feature = "dox"))]
331  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_18")))]
332  pub fn nice_candidate_type_to_string(type_: NiceCandidateType) -> *const c_char;
333
334  //=========================================================================
335  // NiceAgent
336  //=========================================================================
337  pub fn nice_agent_get_type() -> GType;
338  pub fn nice_agent_new(
339    ctx: *mut glib::ffi::GMainContext,
340    compat: NiceCompatibility,
341  ) -> *mut NiceAgent;
342  #[cfg(any(feature = "v0_1_15", feature = "dox"))]
343  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_15")))]
344  pub fn nice_agent_new_full(
345    ctx: *mut glib::ffi::GMainContext,
346    compat: NiceCompatibility,
347    flags: NiceAgentOption,
348  ) -> *mut NiceAgent;
349  pub fn nice_agent_new_reliable(
350    ctx: *mut glib::ffi::GMainContext,
351    compat: NiceCompatibility,
352  ) -> *mut NiceAgent;
353  pub fn nice_agent_add_local_address(agent: *mut NiceAgent, addr: *mut NiceAddress) -> gboolean;
354  pub fn nice_agent_add_stream(agent: *mut NiceAgent, n_components: c_uint) -> c_uint;
355  pub fn nice_agent_attach_recv(
356    agent: *mut NiceAgent,
357    stream_id: c_uint,
358    component_id: c_uint,
359    ctx: *mut glib::ffi::GMainContext,
360    func: NiceAgentRecvFunc,
361    data: gpointer,
362  ) -> gboolean;
363  #[cfg(any(feature = "v0_1_16", feature = "dox"))]
364  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_16")))]
365  pub fn nice_agent_close_async(
366    agent: *mut NiceAgent,
367    callback: gio::ffi::GAsyncReadyCallback,
368    callback_data: gpointer,
369  );
370  #[cfg(any(feature = "v0_1_20", feature = "dox"))]
371  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_20")))]
372  pub fn nice_agent_consent_lost(
373    agent: *mut NiceAgent,
374    stream_id: c_uint,
375    component_id: c_uint,
376  ) -> gboolean;
377  #[cfg(any(feature = "v0_1_6", feature = "dox"))]
378  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_6")))]
379  pub fn nice_agent_forget_relays(
380    agent: *mut NiceAgent,
381    stream_id: c_uint,
382    component_id: c_uint,
383  ) -> gboolean;
384  pub fn nice_agent_gather_candidates(agent: *mut NiceAgent, stream_id: c_uint) -> gboolean;
385  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
386  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
387  pub fn nice_agent_generate_local_candidate_sdp(
388    agent: *mut NiceAgent,
389    candidate: *mut NiceCandidate,
390  ) -> *mut c_char;
391  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
392  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
393  pub fn nice_agent_generate_local_sdp(agent: *mut NiceAgent) -> *mut c_char;
394  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
395  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
396  pub fn nice_agent_generate_local_stream_sdp(
397    agent: *mut NiceAgent,
398    stream_id: c_uint,
399    include_non_ice: gboolean,
400  ) -> *mut c_char;
401  #[cfg(any(feature = "v0_1_8", feature = "dox"))]
402  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_8")))]
403  pub fn nice_agent_get_component_state(
404    agent: *mut NiceAgent,
405    stream_id: c_uint,
406    component_id: c_uint,
407  ) -> NiceComponentState;
408  pub fn nice_agent_get_default_local_candidate(
409    agent: *mut NiceAgent,
410    stream_id: c_uint,
411    component_id: c_uint,
412  ) -> *mut NiceCandidate;
413  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
414  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
415  pub fn nice_agent_get_io_stream(
416    agent: *mut NiceAgent,
417    stream_id: c_uint,
418    component_id: c_uint,
419  ) -> *mut gio::ffi::GIOStream;
420  pub fn nice_agent_get_local_candidates(
421    agent: *mut NiceAgent,
422    stream_id: c_uint,
423    component_id: c_uint,
424  ) -> *mut glib::ffi::GSList;
425  pub fn nice_agent_get_local_credentials(
426    agent: *mut NiceAgent,
427    stream_id: c_uint,
428    ufrag: *mut *mut c_char,
429    pwd: *mut *mut c_char,
430  ) -> gboolean;
431  pub fn nice_agent_get_remote_candidates(
432    agent: *mut NiceAgent,
433    stream_id: c_uint,
434    component_id: c_uint,
435  ) -> *mut glib::ffi::GSList;
436  pub fn nice_agent_get_selected_pair(
437    agent: *mut NiceAgent,
438    stream_id: c_uint,
439    component_id: c_uint,
440    local: *mut *mut NiceCandidate,
441    remote: *mut *mut NiceCandidate,
442  ) -> gboolean;
443  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
444  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
445  pub fn nice_agent_get_selected_socket(
446    agent: *mut NiceAgent,
447    stream_id: c_uint,
448    component_id: c_uint,
449  ) -> *mut gio::ffi::GSocket;
450  #[cfg(any(feature = "v0_1_17", feature = "dox"))]
451  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_17")))]
452  pub fn nice_agent_get_sockets(
453    agent: *mut NiceAgent,
454    stream_id: c_uint,
455    component_id: c_uint,
456  ) -> *mut glib::ffi::GPtrArray;
457  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
458  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
459  pub fn nice_agent_get_stream_name(agent: *mut NiceAgent, stream_id: c_uint) -> *const c_char;
460  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
461  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
462  pub fn nice_agent_parse_remote_candidate_sdp(
463    agent: *mut NiceAgent,
464    stream_id: c_uint,
465    sdp: *const c_char,
466  ) -> *mut NiceCandidate;
467  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
468  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
469  pub fn nice_agent_parse_remote_sdp(agent: *mut NiceAgent, sdp: *const c_char) -> c_int;
470  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
471  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
472  pub fn nice_agent_parse_remote_stream_sdp(
473    agent: *mut NiceAgent,
474    stream_id: c_uint,
475    sdp: *const c_char,
476    ufrag: *mut *mut c_char,
477    pwd: *mut *mut c_char,
478  ) -> *mut glib::ffi::GSList;
479  #[cfg(any(feature = "v0_1_16", feature = "dox"))]
480  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_16")))]
481  pub fn nice_agent_peer_candidate_gathering_done(
482    agent: *mut NiceAgent,
483    stream_id: c_uint,
484  ) -> gboolean;
485  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
486  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
487  pub fn nice_agent_recv(
488    agent: *mut NiceAgent,
489    stream_id: c_uint,
490    component_id: c_uint,
491    buf: *mut u8,
492    buf_len: size_t,
493    cancellable: *mut gio::ffi::GCancellable,
494    error: *mut *mut glib::ffi::GError,
495  ) -> ssize_t;
496  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
497  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
498  pub fn nice_agent_recv_messages(
499    agent: *mut NiceAgent,
500    stream_id: c_uint,
501    component_id: c_uint,
502    messages: *mut NiceInputMessage,
503    n_messages: c_uint,
504    cancellable: *mut gio::ffi::GCancellable,
505    error: *mut *mut glib::ffi::GError,
506  ) -> c_int;
507  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
508  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
509  pub fn nice_agent_recv_messages_nonblocking(
510    agent: *mut NiceAgent,
511    stream_id: c_uint,
512    component_id: c_uint,
513    messages: *mut NiceInputMessage,
514    n_messages: c_uint,
515    cancellable: *mut gio::ffi::GCancellable,
516    error: *mut *mut glib::ffi::GError,
517  ) -> c_int;
518  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
519  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
520  pub fn nice_agent_recv_nonblocking(
521    agent: *mut NiceAgent,
522    stream_id: c_uint,
523    component_id: c_uint,
524    buf: *mut u8,
525    buf_len: size_t,
526    cancellable: *mut gio::ffi::GCancellable,
527    error: *mut *mut glib::ffi::GError,
528  ) -> ssize_t;
529  pub fn nice_agent_remove_stream(agent: *mut NiceAgent, stream_id: c_uint);
530  pub fn nice_agent_restart(agent: *mut NiceAgent) -> gboolean;
531  #[cfg(any(feature = "v0_1_6", feature = "dox"))]
532  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_6")))]
533  pub fn nice_agent_restart_stream(agent: *mut NiceAgent, stream_id: c_uint) -> gboolean;
534  pub fn nice_agent_send(
535    agent: *mut NiceAgent,
536    stream_id: c_uint,
537    component_id: c_uint,
538    len: c_uint,
539    buf: *const c_char,
540  ) -> c_int;
541  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
542  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
543  pub fn nice_agent_send_messages_nonblocking(
544    agent: *mut NiceAgent,
545    stream_id: c_uint,
546    component_id: c_uint,
547    messages: *const NiceOutputMessage,
548    n_messages: c_uint,
549    cancellable: *mut gio::ffi::GCancellable,
550    error: *mut *mut glib::ffi::GError,
551  ) -> c_int;
552  pub fn nice_agent_set_local_credentials(
553    agent: *mut NiceAgent,
554    stream_id: c_uint,
555    ufrag: *const c_char,
556    pwd: *const c_char,
557  ) -> gboolean;
558  pub fn nice_agent_set_port_range(
559    agent: *mut NiceAgent,
560    stream_id: c_uint,
561    component_id: c_uint,
562    min_port: c_uint,
563    max_port: c_uint,
564  );
565  pub fn nice_agent_set_relay_info(
566    agent: *mut NiceAgent,
567    stream_id: c_uint,
568    component_id: c_uint,
569    server_ip: *const c_char,
570    server_port: c_uint,
571    username: *const c_char,
572    password: *const c_char,
573    type_: NiceRelayType,
574  ) -> gboolean;
575  pub fn nice_agent_set_remote_candidates(
576    agent: *mut NiceAgent,
577    stream_id: c_uint,
578    component_id: c_uint,
579    candidates: *const glib::ffi::GSList,
580  ) -> c_int;
581  pub fn nice_agent_set_remote_credentials(
582    agent: *mut NiceAgent,
583    stream_id: c_uint,
584    ufrag: *const c_char,
585    pwd: *const c_char,
586  ) -> gboolean;
587  pub fn nice_agent_set_selected_pair(
588    agent: *mut NiceAgent,
589    stream_id: c_uint,
590    component_id: c_uint,
591    lfoundation: *const c_char,
592    rfoundation: *const c_char,
593  ) -> gboolean;
594  pub fn nice_agent_set_selected_remote_candidate(
595    agent: *mut NiceAgent,
596    stream_id: c_uint,
597    component_id: c_uint,
598    candidate: *mut NiceCandidate,
599  ) -> gboolean;
600  pub fn nice_agent_set_software(agent: *mut NiceAgent, software: *const c_char);
601  #[cfg(any(feature = "v0_1_4", feature = "dox"))]
602  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_4")))]
603  pub fn nice_agent_set_stream_name(
604    agent: *mut NiceAgent,
605    stream_id: c_uint,
606    name: *const c_char,
607  ) -> gboolean;
608  pub fn nice_agent_set_stream_tos(agent: *mut NiceAgent, stream_id: c_uint, tos: c_int);
609
610  //=========================================================================
611  // PseudoTcpSocket
612  //=========================================================================
613  pub fn pseudo_tcp_socket_get_type() -> GType;
614  pub fn pseudo_tcp_socket_new(
615    conversation: u32,
616    callbacks: *mut PseudoTcpCallbacks,
617  ) -> *mut PseudoTcpSocket;
618  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
619  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
620  pub fn pseudo_tcp_socket_can_send(self_: *mut PseudoTcpSocket) -> gboolean;
621  pub fn pseudo_tcp_socket_close(self_: *mut PseudoTcpSocket, force: gboolean);
622  pub fn pseudo_tcp_socket_connect(self_: *mut PseudoTcpSocket) -> gboolean;
623  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
624  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
625  pub fn pseudo_tcp_socket_get_available_bytes(self_: *mut PseudoTcpSocket) -> c_int;
626  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
627  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
628  pub fn pseudo_tcp_socket_get_available_send_space(self_: *mut PseudoTcpSocket) -> size_t;
629  pub fn pseudo_tcp_socket_get_error(self_: *mut PseudoTcpSocket) -> c_int;
630  pub fn pseudo_tcp_socket_get_next_clock(
631    self_: *mut PseudoTcpSocket,
632    timeout: *mut u64,
633  ) -> gboolean;
634  #[cfg(any(feature = "v0_1_8", feature = "dox"))]
635  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_8")))]
636  pub fn pseudo_tcp_socket_is_closed(self_: *mut PseudoTcpSocket) -> gboolean;
637  #[cfg(any(feature = "v0_1_8", feature = "dox"))]
638  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_8")))]
639  pub fn pseudo_tcp_socket_is_closed_remotely(self_: *mut PseudoTcpSocket) -> gboolean;
640  pub fn pseudo_tcp_socket_notify_clock(self_: *mut PseudoTcpSocket);
641  #[cfg(any(feature = "v0_1_5", feature = "dox"))]
642  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_5")))]
643  pub fn pseudo_tcp_socket_notify_message(
644    self_: *mut PseudoTcpSocket,
645    message: *mut NiceInputMessage,
646  ) -> gboolean;
647  pub fn pseudo_tcp_socket_notify_mtu(self_: *mut PseudoTcpSocket, mtu: u16);
648  pub fn pseudo_tcp_socket_notify_packet(
649    self_: *mut PseudoTcpSocket,
650    buffer: *const c_char,
651    len: u32,
652  ) -> gboolean;
653  pub fn pseudo_tcp_socket_recv(
654    self_: *mut PseudoTcpSocket,
655    buffer: *mut c_char,
656    len: size_t,
657  ) -> c_int;
658  pub fn pseudo_tcp_socket_send(
659    self_: *mut PseudoTcpSocket,
660    buffer: *const c_char,
661    len: u32,
662  ) -> c_int;
663  #[cfg(any(feature = "v0_1_8", feature = "dox"))]
664  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_8")))]
665  pub fn pseudo_tcp_socket_set_time(self_: *mut PseudoTcpSocket, current_time: u32);
666  #[cfg(any(feature = "v0_1_8", feature = "dox"))]
667  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_8")))]
668  pub fn pseudo_tcp_socket_shutdown(self_: *mut PseudoTcpSocket, how: PseudoTcpShutdown);
669
670  //=========================================================================
671  // Other functions
672  //=========================================================================
673  #[cfg(any(feature = "v0_1_6", feature = "dox"))]
674  #[cfg_attr(feature = "dox", doc(cfg(feature = "v0_1_6")))]
675  pub fn nice_component_state_to_string(state: NiceComponentState) -> *const c_char;
676  pub fn nice_debug_disable(with_stun: gboolean);
677  pub fn nice_debug_enable(with_stun: gboolean);
678  pub fn nice_interfaces_get_ip_for_interface(interface_name: *mut c_char) -> *mut c_char;
679  pub fn nice_interfaces_get_local_interfaces() -> *mut glib::ffi::GList;
680  pub fn nice_interfaces_get_local_ips(include_loopback: gboolean) -> *mut glib::ffi::GList;
681  pub fn pseudo_tcp_set_debug_level(level: PseudoTcpDebugLevel);
682
683}