1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
mod dns;
mod tcpstream;
pub use tcpstream::*;
mod tcplistener;
pub use tcplistener::*;
mod udp;
pub use udp::*;
// this structure needs to be synchronized with what's in net/src/api.rs
#[repr(C)]
#[derive(Debug)]
enum NetError {
// Ok = 0,
Unaddressable = 1,
SocketInUse = 2,
// AccessDenied = 3,
Invalid = 4,
// Finished = 5,
LibraryError = 6,
// AlreadyUsed = 7,
TimedOut = 8,
WouldBlock = 9,
}
#[repr(C, align(4096))]
struct ConnectRequest {
raw: [u8; 4096],
}
#[repr(C, align(4096))]
struct SendData {
raw: [u8; 4096],
}
#[repr(C, align(4096))]
pub struct ReceiveData {
raw: [u8; 4096],
}
#[repr(C, align(4096))]
pub struct GetAddress {
raw: [u8; 4096],
}
pub use dns::LookupHost;
|