abi_application/
network_types.rs1#[cfg(feature = "network")]
2use ::network::{Manager, TcpSocket, UdpSocket};
3
4pub const XILA_NETWORK_CONNECT: u32 = 1;
5pub const XILA_NETWORK_LISTEN: u32 = 2;
6pub const XILA_NETWORK_RESOLVE: u32 = 4;
7pub const XILA_ADDRESS_IPV4: u32 = 4;
8pub const XILA_ADDRESS_IPV6: u32 = 6;
9pub const XILA_SHUTDOWN_WRITE: u32 = 1;
10
11#[repr(C)]
15#[derive(Debug, Clone, Copy, PartialEq, Eq)]
16pub struct NetworkAddress {
17 pub family: u32,
18 pub bytes: [u8; 16],
19 pub port: u16,
20 pub reserved: u16,
21 pub scope_id: u32,
22}
23pub struct Network {
25 #[cfg(not(feature = "network"))]
26 _unavailable: core::convert::Infallible,
27 #[cfg(feature = "network")]
28 pub(crate) manager: &'static Manager,
29 #[cfg(feature = "network")]
30 pub(crate) rights: u8,
31}
32pub struct Tcp {
34 #[cfg(not(feature = "network"))]
35 _unavailable: core::convert::Infallible,
36 #[cfg(feature = "network")]
37 pub(crate) inner: TcpSocket,
38}
39pub struct TcpListener {
41 #[cfg(not(feature = "network"))]
42 _unavailable: core::convert::Infallible,
43 #[cfg(feature = "network")]
44 pub(crate) network: Network,
45 #[cfg(feature = "network")]
46 pub(crate) address: NetworkAddress,
47 #[cfg(feature = "network")]
48 pub(crate) inner: TcpSocket,
49 #[cfg(feature = "network")]
54 pub(crate) reset_deadline: synchronization::blocking_mutex::Mutex<
55 synchronization::blocking_mutex::raw::CriticalSectionRawMutex,
56 core::cell::Cell<u64>,
57 >,
58}
59pub struct Udp {
61 #[cfg(not(feature = "network"))]
62 _unavailable: core::convert::Infallible,
63 #[cfg(feature = "network")]
64 pub(crate) inner: UdpSocket,
65 #[cfg(feature = "network")]
66 pub(crate) rights: u8,
67 #[cfg(feature = "network")]
70 pub(crate) family: u32,
71}