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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
use crate::backend::c;
use bitflags::bitflags;
bitflags! {
/// `MSG_*` flags for use with [`send`], [`sendto`], and related
/// functions.
///
/// [`send`]: crate::net::send
/// [`sendto`]: crate::net::sendto
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct SendFlags: u32 {
/// `MSG_CONFIRM`
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "cygwin",
target_os = "espidf",
target_os = "nto",
target_os = "haiku",
target_os = "horizon",
target_os = "hurd",
target_os = "redox",
target_os = "vita",
)))]
const CONFIRM = bitcast!(c::MSG_CONFIRM);
/// `MSG_DONTROUTE`
const DONTROUTE = bitcast!(c::MSG_DONTROUTE);
/// `MSG_DONTWAIT`
#[cfg(not(windows))]
const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
/// `MSG_EOR`
#[cfg(not(any(windows, target_os = "horizon")))]
const EOR = bitcast!(c::MSG_EOR);
/// `MSG_MORE`
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "cygwin",
target_os = "haiku",
target_os = "hurd",
target_os = "nto",
target_os = "redox",
target_os = "vita",
)))]
const MORE = bitcast!(c::MSG_MORE);
#[cfg(not(any(apple, windows, target_os = "redox", target_os = "vita")))]
/// `MSG_NOSIGNAL`
const NOSIGNAL = bitcast!(c::MSG_NOSIGNAL);
/// `MSG_OOB`
const OOB = bitcast!(c::MSG_OOB);
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
}
bitflags! {
/// `MSG_*` flags for use with [`recv`], [`recvfrom`], and related
/// functions.
///
/// [`recv`]: crate::net::recv
/// [`recvfrom`]: crate::net::recvfrom
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct RecvFlags: u32 {
/// `MSG_CMSG_CLOEXEC`
#[cfg(not(any(
apple,
solarish,
windows,
target_os = "aix",
target_os = "espidf",
target_os = "haiku",
target_os = "horizon",
target_os = "nto",
target_os = "redox",
target_os = "vita",
)))]
const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC);
/// `MSG_DONTWAIT`
#[cfg(not(windows))]
const DONTWAIT = bitcast!(c::MSG_DONTWAIT);
/// `MSG_ERRQUEUE`
#[cfg(not(any(
bsd,
solarish,
windows,
target_os = "aix",
target_os = "cygwin",
target_os = "espidf",
target_os = "haiku",
target_os = "horizon",
target_os = "hurd",
target_os = "nto",
target_os = "redox",
target_os = "vita",
)))]
const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE);
/// `MSG_OOB`
const OOB = bitcast!(c::MSG_OOB);
/// `MSG_PEEK`
const PEEK = bitcast!(c::MSG_PEEK);
/// `MSG_TRUNC`
// Apple, illumos, and NetBSD have `MSG_TRUNC` but it's not documented
// for use with `recv` and friends, and in practice appears to be
// ignored.
#[cfg(not(any(apple, solarish, target_os = "horizon", target_os = "netbsd")))]
const TRUNC = bitcast!(c::MSG_TRUNC);
/// `MSG_WAITALL`
const WAITALL = bitcast!(c::MSG_WAITALL);
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
}
bitflags! {
/// `MSG_*` flags returned from [`recvmsg`], in the `flags` field of
/// [`RecvMsg`]
///
/// [`recvmsg`]: crate::net::recvmsg
/// [`RecvMsg`]: crate::net::RecvMsg
#[repr(transparent)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub struct ReturnFlags: u32 {
/// `MSG_OOB`
const OOB = bitcast!(c::MSG_OOB);
/// `MSG_EOR`
#[cfg(not(any(windows, target_os = "horizon")))]
const EOR = bitcast!(c::MSG_EOR);
/// `MSG_TRUNC`
#[cfg(not(target_os = "horizon"))]
const TRUNC = bitcast!(c::MSG_TRUNC);
/// `MSG_CTRUNC`
#[cfg(not(target_os = "horizon"))]
const CTRUNC = bitcast!(c::MSG_CTRUNC);
/// `MSG_CMSG_CLOEXEC`
#[cfg(linux_kernel)]
const CMSG_CLOEXEC = bitcast!(c::MSG_CMSG_CLOEXEC);
/// `MSG_ERRQUEUE`
#[cfg(linux_kernel)]
const ERRQUEUE = bitcast!(c::MSG_ERRQUEUE);
/// <https://docs.rs/bitflags/*/bitflags/#externally-defined-flags>
const _ = !0;
}
}