network_framework_sys/
connection.rs1use crate::*;
2
3use libc::c_int;
4use libc::c_char;
5
6
7pub enum nw_connection {}
8pub type nw_connection_t = *mut nw_connection;
9
10pub type nw_connection_state_t = c_int;
11pub const nw_connection_state_invalid: nw_connection_state_t = 0;
12pub const nw_connection_state_waiting: nw_connection_state_t = 1;
13pub const nw_connection_state_preparing: nw_connection_state_t = 2;
14pub const nw_connection_state_ready: nw_connection_state_t = 3;
15pub const nw_connection_state_failed: nw_connection_state_t = 4;
16pub const nw_connection_state_cancelled: nw_connection_state_t = 5;
17
18
19extern "C" {
20 pub fn nw_connection_create(endpoint: nw_endpoint_t, parameters: nw_parameters_t) -> nw_connection_t;
21 pub fn nw_connection_copy_endpoint(connection: nw_connection_t) -> nw_endpoint_t;
22 pub fn nw_connection_copy_parameters(connection: nw_connection_t) -> nw_parameters_t;
23
24 pub fn nw_connection_set_queue(connection: nw_connection_t, queue: dispatch_queue_t);
25 pub fn nw_connection_start(connection: nw_connection_t);
26 pub fn nw_connection_restart(connection: nw_connection_t);
27 pub fn nw_connection_cancel(connection: nw_connection_t);
28 pub fn nw_connection_force_cancel(connection: nw_connection_t);
29 pub fn nw_connection_cancel_current_endpoint(connection: nw_connection_t);
30
31 pub fn nw_connection_batch(connection: nw_connection_t, batch_block: dispatch_block_t);
49 pub fn nw_connection_copy_description(connection: nw_connection_t) -> *mut c_char;
50 pub fn nw_connection_copy_current_path(connection: nw_connection_t) -> nw_path_t;
51
52 pub fn nw_connection_copy_protocol_metadata(connection: nw_connection_t,
53 definition: nw_protocol_definition_t)
54 -> nw_protocol_metadata_t;
55 pub fn nw_connection_get_maximum_datagram_size(connection: nw_connection_t) -> u32;
56}
57