mirror of
https://github.com/openharmony/third_party_rust_linux-raw-sys.git
synced 2026-07-19 21:24:35 -04:00
Add <linux/tcp.h>.
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <linux/signal.h>
|
||||
#include <linux/socket.h>
|
||||
#include <linux/stat.h>
|
||||
#include <linux/tcp.h>
|
||||
#include <linux/termios.h>
|
||||
#include <linux/time.h>
|
||||
#include <linux/types.h>
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -946,6 +1010,25 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TIOCEXCL: u32 = 21516;
|
||||
pub const TIOCNXCL: u32 = 21517;
|
||||
pub const TIOCSCTTY: u32 = 21518;
|
||||
@@ -2115,6 +2198,299 @@ pub _function: ::core::option::Option<unsafe extern "C" fn(arg1: sigval_t)>,
|
||||
pub _attribute: *mut crate::ctypes::c_void,
|
||||
}
|
||||
pub type sigevent_t = sigevent;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -937,6 +1001,25 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2113,6 +2196,299 @@ pub _function: ::core::option::Option<unsafe extern "C" fn(arg1: sigval_t)>,
|
||||
pub _attribute: *mut crate::ctypes::c_void,
|
||||
}
|
||||
pub type sigevent_t = sigevent;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -936,6 +1000,25 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2075,6 +2158,299 @@ pub _function: ::core::option::Option<unsafe extern "C" fn(arg1: sigval_t)>,
|
||||
pub _attribute: *mut crate::ctypes::c_void,
|
||||
}
|
||||
pub type sigevent_t = sigevent;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1002,6 +1066,38 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TIOCEXCL: u32 = 21516;
|
||||
pub const TIOCNXCL: u32 = 21517;
|
||||
pub const TIOCSCTTY: u32 = 21518;
|
||||
@@ -2206,6 +2302,318 @@ pub _function: ::core::option::Option<unsafe extern "C" fn(arg1: sigval_t)>,
|
||||
pub _attribute: *mut crate::ctypes::c_void,
|
||||
}
|
||||
pub type sigevent_t = sigevent;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -972,6 +1036,39 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_COOKIE_TRANSACTIONS: u32 = 15;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_COOKIE_MIN: u32 = 8;
|
||||
pub const TCP_COOKIE_MAX: u32 = 16;
|
||||
pub const TCP_COOKIE_PAIR_SIZE: u32 = 32;
|
||||
pub const TCP_COOKIE_IN_ALWAYS: u32 = 1;
|
||||
pub const TCP_COOKIE_OUT_NEVER: u32 = 2;
|
||||
pub const TCP_S_DATA_IN: u32 = 4;
|
||||
pub const TCP_S_DATA_OUT: u32 = 8;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2216,6 +2313,309 @@ pub _function: ::core::option::Option<unsafe extern "C" fn(arg1: sigval_t)>,
|
||||
pub _attribute: *mut crate::ctypes::c_void,
|
||||
}
|
||||
pub type sigevent_t = sigevent;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_cookie_transactions {
|
||||
pub tcpct_flags: __u16,
|
||||
pub __tcpct_pad1: __u8,
|
||||
pub tcpct_cookie_desired: __u8,
|
||||
pub tcpct_s_data_desired: __u16,
|
||||
pub tcpct_used: __u16,
|
||||
pub tcpct_value: [__u8; 536usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1060,6 +1124,42 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2228,6 +2328,324 @@ pub _function: ::core::option::Option<unsafe extern "C" fn(arg1: sigval_t)>,
|
||||
pub _attribute: *mut crate::ctypes::c_void,
|
||||
}
|
||||
pub type sigevent_t = sigevent;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1202,6 +1266,55 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2530,6 +2643,428 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1072,6 +1136,42 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const EPERM: u32 = 1;
|
||||
pub const ENOENT: u32 = 2;
|
||||
pub const ESRCH: u32 = 3;
|
||||
@@ -2467,6 +2567,324 @@ pub _syscall: crate::ctypes::c_int,
|
||||
pub _arch: crate::ctypes::c_uint,
|
||||
}
|
||||
pub type siginfo_t = siginfo;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1072,6 +1136,42 @@ pub const S_IRWXO: u32 = 7;
|
||||
pub const S_IROTH: u32 = 4;
|
||||
pub const S_IWOTH: u32 = 2;
|
||||
pub const S_IXOTH: u32 = 1;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const EPERM: u32 = 1;
|
||||
pub const ENOENT: u32 = 2;
|
||||
pub const ESRCH: u32 = 3;
|
||||
@@ -2425,6 +2525,324 @@ pub _syscall: crate::ctypes::c_int,
|
||||
pub _arch: crate::ctypes::c_uint,
|
||||
}
|
||||
pub type siginfo_t = siginfo;
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8) -> __BindgenBitfieldUnit<[u8; 1usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 1usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub __tcpm_pad1: __u16,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad2: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1342,6 +1406,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2815,6 +2931,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1329,6 +1393,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2900,6 +3016,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1333,6 +1397,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const EPERM: u32 = 1;
|
||||
pub const ENOENT: u32 = 2;
|
||||
pub const ESRCH: u32 = 3;
|
||||
@@ -3042,6 +3158,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1341,6 +1405,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const EPERM: u32 = 1;
|
||||
pub const ENOENT: u32 = 2;
|
||||
pub const ESRCH: u32 = 3;
|
||||
@@ -2978,6 +3094,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1348,6 +1412,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const TIOCEXCL: u32 = 21516;
|
||||
pub const TIOCNXCL: u32 = 21517;
|
||||
pub const TIOCSCTTY: u32 = 21518;
|
||||
@@ -2939,6 +3055,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1354,6 +1418,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const TIOCEXCL: u32 = 21516;
|
||||
pub const TIOCNXCL: u32 = 21517;
|
||||
pub const TIOCSCTTY: u32 = 21518;
|
||||
@@ -2911,6 +3027,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1333,6 +1397,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2792,6 +2908,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1341,6 +1405,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2813,6 +2929,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1336,6 +1400,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2873,6 +2989,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1582,6 +1646,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const TIOCLINUX: u32 = 21532;
|
||||
pub const TIOCGSERIAL: u32 = 21534;
|
||||
pub const TIOCSSERIAL: u32 = 21535;
|
||||
@@ -3130,6 +3246,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_ulong;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1590,6 +1654,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const TIOCLINUX: u32 = 21532;
|
||||
pub const TIOCGSERIAL: u32 = 21534;
|
||||
pub const TIOCSSERIAL: u32 = 21535;
|
||||
@@ -3100,6 +3216,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1330,6 +1394,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2928,6 +3044,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1337,6 +1401,58 @@ pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const STATX_ATTR_MOUNT_ROOT: u32 = 8192;
|
||||
pub const STATX_ATTR_VERITY: u32 = 1048576;
|
||||
pub const STATX_ATTR_DAX: u32 = 2097152;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TCP_MD5SIG_FLAG_IFINDEX: u32 = 2;
|
||||
pub const TCP_RECEIVE_ZEROCOPY_FLAG_TLB_CLEAN_HINT: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2850,6 +2966,467 @@ pub stx_mnt_id: __u64,
|
||||
pub __spare2: __u64,
|
||||
pub __spare3: [__u64; 12usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_fastopen_client_fail {
|
||||
TFO_STATUS_UNSPEC = 0,
|
||||
TFO_COOKIE_UNAVAILABLE = 1,
|
||||
TFO_DATA_NOT_ACKED = 2,
|
||||
TFO_SYN_RETRANSMITTED = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_fastopen_client_fail(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 2u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_fastopen_client_fail(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 2u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8, tcpi_fastopen_client_fail: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 2u8, {
|
||||
let tcpi_fastopen_client_fail: u8 = unsafe { ::core::mem::transmute(tcpi_fastopen_client_fail) };
|
||||
tcpi_fastopen_client_fail as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
pub const TCP_NLA_TIMEOUT_REHASH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TIMEOUT_REHASH;
|
||||
pub const TCP_NLA_BYTES_NOTSENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_NOTSENT;
|
||||
pub const TCP_NLA_EDT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_EDT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
TCP_NLA_TIMEOUT_REHASH = 23,
|
||||
TCP_NLA_BYTES_NOTSENT = 24,
|
||||
TCP_NLA_EDT = 25,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_ifindex: crate::ctypes::c_int,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
pub inq: __u32,
|
||||
pub err: __s32,
|
||||
pub copybuf_address: __u64,
|
||||
pub copybuf_len: __s32,
|
||||
pub flags: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1297,6 +1361,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2729,6 +2843,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1286,6 +1350,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2817,6 +2931,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1290,6 +1354,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const EPERM: u32 = 1;
|
||||
pub const ENOENT: u32 = 2;
|
||||
pub const ESRCH: u32 = 3;
|
||||
@@ -2959,6 +3073,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1298,6 +1362,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const EPERM: u32 = 1;
|
||||
pub const ENOENT: u32 = 2;
|
||||
pub const ESRCH: u32 = 3;
|
||||
@@ -2895,6 +3009,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1305,6 +1369,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TIOCEXCL: u32 = 21516;
|
||||
pub const TIOCNXCL: u32 = 21517;
|
||||
pub const TIOCSCTTY: u32 = 21518;
|
||||
@@ -2856,6 +2970,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1311,6 +1375,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TIOCEXCL: u32 = 21516;
|
||||
pub const TIOCNXCL: u32 = 21517;
|
||||
pub const TIOCSCTTY: u32 = 21518;
|
||||
@@ -2828,6 +2942,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1283,6 +1347,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2702,6 +2816,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1291,6 +1355,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2723,6 +2837,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1293,6 +1357,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2790,6 +2904,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1538,6 +1602,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TIOCLINUX: u32 = 21532;
|
||||
pub const TIOCGSERIAL: u32 = 21534;
|
||||
pub const TIOCSSERIAL: u32 = 21535;
|
||||
@@ -3046,6 +3160,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_ulong;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1546,6 +1610,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const TIOCLINUX: u32 = 21532;
|
||||
pub const TIOCGSERIAL: u32 = 21534;
|
||||
pub const TIOCSSERIAL: u32 = 21535;
|
||||
@@ -3016,6 +3130,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(doff: __u16, res1: __u16, cwr: __u16, ece: __u16, urg: __u16, ack: __u16, psh: __u16, rst: __u16, syn: __u16, fin: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 8388608,
|
||||
TCP_FLAG_ECE = 4194304,
|
||||
TCP_FLAG_URG = 2097152,
|
||||
TCP_FLAG_ACK = 1048576,
|
||||
TCP_FLAG_PSH = 524288,
|
||||
TCP_FLAG_RST = 262144,
|
||||
TCP_FLAG_SYN = 131072,
|
||||
TCP_FLAG_FIN = 65536,
|
||||
TCP_RESERVED_BITS = 251658240,
|
||||
TCP_DATA_OFFSET = 4026531840,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1287,6 +1351,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2845,6 +2959,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
@@ -1,5 +1,69 @@
|
||||
/* automatically generated by rust-bindgen 0.59.1 */
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
|
||||
pub struct __BindgenBitfieldUnit<Storage> {
|
||||
storage: Storage,
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage> {
|
||||
#[inline]
|
||||
pub const fn new(storage: Storage) -> Self {
|
||||
Self { storage }
|
||||
}
|
||||
}
|
||||
impl<Storage> __BindgenBitfieldUnit<Storage>
|
||||
where
|
||||
Storage: AsRef<[u8]> + AsMut<[u8]>,
|
||||
{
|
||||
#[inline]
|
||||
pub fn get_bit(&self, index: usize) -> bool {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = self.storage.as_ref()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
byte & mask == mask
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_bit(&mut self, index: usize, val: bool) {
|
||||
debug_assert!(index / 8 < self.storage.as_ref().len());
|
||||
let byte_index = index / 8;
|
||||
let byte = &mut self.storage.as_mut()[byte_index];
|
||||
let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { index % 8 };
|
||||
let mask = 1 << bit_index;
|
||||
if val {
|
||||
*byte |= mask;
|
||||
} else {
|
||||
*byte &= !mask;
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
let mut val = 0;
|
||||
for i in 0..(bit_width as usize) {
|
||||
if self.get_bit(i + bit_offset) {
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
val |= 1 << index;
|
||||
}
|
||||
}
|
||||
val
|
||||
}
|
||||
#[inline]
|
||||
pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
|
||||
debug_assert!(bit_width <= 64);
|
||||
debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
|
||||
debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
|
||||
for i in 0..(bit_width as usize) {
|
||||
let mask = 1 << i;
|
||||
let val_bit_is_set = val & mask == mask;
|
||||
let index = if cfg!(target_endian = "big") { bit_width as usize - 1 - i } else { i };
|
||||
self.set_bit(index + bit_offset, val_bit_is_set);
|
||||
}
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Default)]
|
||||
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
|
||||
@@ -1294,6 +1358,56 @@ pub const STATX_ATTR_APPEND: u32 = 32;
|
||||
pub const STATX_ATTR_NODUMP: u32 = 64;
|
||||
pub const STATX_ATTR_ENCRYPTED: u32 = 2048;
|
||||
pub const STATX_ATTR_AUTOMOUNT: u32 = 4096;
|
||||
pub const TCP_MSS_DEFAULT: u32 = 536;
|
||||
pub const TCP_MSS_DESIRED: u32 = 1220;
|
||||
pub const TCP_NODELAY: u32 = 1;
|
||||
pub const TCP_MAXSEG: u32 = 2;
|
||||
pub const TCP_CORK: u32 = 3;
|
||||
pub const TCP_KEEPIDLE: u32 = 4;
|
||||
pub const TCP_KEEPINTVL: u32 = 5;
|
||||
pub const TCP_KEEPCNT: u32 = 6;
|
||||
pub const TCP_SYNCNT: u32 = 7;
|
||||
pub const TCP_LINGER2: u32 = 8;
|
||||
pub const TCP_DEFER_ACCEPT: u32 = 9;
|
||||
pub const TCP_WINDOW_CLAMP: u32 = 10;
|
||||
pub const TCP_INFO: u32 = 11;
|
||||
pub const TCP_QUICKACK: u32 = 12;
|
||||
pub const TCP_CONGESTION: u32 = 13;
|
||||
pub const TCP_MD5SIG: u32 = 14;
|
||||
pub const TCP_THIN_LINEAR_TIMEOUTS: u32 = 16;
|
||||
pub const TCP_THIN_DUPACK: u32 = 17;
|
||||
pub const TCP_USER_TIMEOUT: u32 = 18;
|
||||
pub const TCP_REPAIR: u32 = 19;
|
||||
pub const TCP_REPAIR_QUEUE: u32 = 20;
|
||||
pub const TCP_QUEUE_SEQ: u32 = 21;
|
||||
pub const TCP_REPAIR_OPTIONS: u32 = 22;
|
||||
pub const TCP_FASTOPEN: u32 = 23;
|
||||
pub const TCP_TIMESTAMP: u32 = 24;
|
||||
pub const TCP_NOTSENT_LOWAT: u32 = 25;
|
||||
pub const TCP_CC_INFO: u32 = 26;
|
||||
pub const TCP_SAVE_SYN: u32 = 27;
|
||||
pub const TCP_SAVED_SYN: u32 = 28;
|
||||
pub const TCP_REPAIR_WINDOW: u32 = 29;
|
||||
pub const TCP_FASTOPEN_CONNECT: u32 = 30;
|
||||
pub const TCP_ULP: u32 = 31;
|
||||
pub const TCP_MD5SIG_EXT: u32 = 32;
|
||||
pub const TCP_FASTOPEN_KEY: u32 = 33;
|
||||
pub const TCP_FASTOPEN_NO_COOKIE: u32 = 34;
|
||||
pub const TCP_ZEROCOPY_RECEIVE: u32 = 35;
|
||||
pub const TCP_INQ: u32 = 36;
|
||||
pub const TCP_CM_INQ: u32 = 36;
|
||||
pub const TCP_TX_DELAY: u32 = 37;
|
||||
pub const TCP_REPAIR_ON: u32 = 1;
|
||||
pub const TCP_REPAIR_OFF: u32 = 0;
|
||||
pub const TCP_REPAIR_OFF_NO_WP: i32 = -1;
|
||||
pub const TCPI_OPT_TIMESTAMPS: u32 = 1;
|
||||
pub const TCPI_OPT_SACK: u32 = 2;
|
||||
pub const TCPI_OPT_WSCALE: u32 = 4;
|
||||
pub const TCPI_OPT_ECN: u32 = 8;
|
||||
pub const TCPI_OPT_ECN_SEEN: u32 = 16;
|
||||
pub const TCPI_OPT_SYN_DATA: u32 = 32;
|
||||
pub const TCP_MD5SIG_MAXKEYLEN: u32 = 80;
|
||||
pub const TCP_MD5SIG_FLAG_PREFIX: u32 = 1;
|
||||
pub const NCCS: u32 = 19;
|
||||
pub const VINTR: u32 = 0;
|
||||
pub const VQUIT: u32 = 1;
|
||||
@@ -2767,6 +2881,432 @@ pub stx_dev_major: __u32,
|
||||
pub stx_dev_minor: __u32,
|
||||
pub __spare2: [__u64; 14usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcphdr {
|
||||
pub source: __be16,
|
||||
pub dest: __be16,
|
||||
pub seq: __be32,
|
||||
pub ack_seq: __be32,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub window: __be16,
|
||||
pub check: __sum16,
|
||||
pub urg_ptr: __be16,
|
||||
}
|
||||
impl tcphdr {
|
||||
#[inline]
|
||||
pub fn res1(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_res1(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn doff(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_doff(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn fin(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_fin(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn syn(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_syn(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(9usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn rst(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_rst(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(10usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn psh(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_psh(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(11usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ack(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ack(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(12usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn urg(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_urg(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(13usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn ece(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_ece(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(14usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn cwr(&self) -> __u16 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(15usize, 1u8) as u16) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_cwr(&mut self, val: __u16) {
|
||||
unsafe {
|
||||
let val: u16 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(15usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(res1: __u16, doff: __u16, fin: __u16, syn: __u16, rst: __u16, psh: __u16, ack: __u16, urg: __u16, ece: __u16, cwr: __u16) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let res1: u16 = unsafe { ::core::mem::transmute(res1) };
|
||||
res1 as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let doff: u16 = unsafe { ::core::mem::transmute(doff) };
|
||||
doff as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let fin: u16 = unsafe { ::core::mem::transmute(fin) };
|
||||
fin as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(9usize, 1u8, {
|
||||
let syn: u16 = unsafe { ::core::mem::transmute(syn) };
|
||||
syn as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(10usize, 1u8, {
|
||||
let rst: u16 = unsafe { ::core::mem::transmute(rst) };
|
||||
rst as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(11usize, 1u8, {
|
||||
let psh: u16 = unsafe { ::core::mem::transmute(psh) };
|
||||
psh as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(12usize, 1u8, {
|
||||
let ack: u16 = unsafe { ::core::mem::transmute(ack) };
|
||||
ack as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(13usize, 1u8, {
|
||||
let urg: u16 = unsafe { ::core::mem::transmute(urg) };
|
||||
urg as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(14usize, 1u8, {
|
||||
let ece: u16 = unsafe { ::core::mem::transmute(ece) };
|
||||
ece as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(15usize, 1u8, {
|
||||
let cwr: u16 = unsafe { ::core::mem::transmute(cwr) };
|
||||
cwr as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub union tcp_word_hdr {
|
||||
pub hdr: tcphdr,
|
||||
pub words: [__be32; 5usize],
|
||||
}
|
||||
pub const TCP_FLAG_CWR: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_CWR;
|
||||
pub const TCP_FLAG_ECE: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ECE;
|
||||
pub const TCP_FLAG_URG: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_URG;
|
||||
pub const TCP_FLAG_ACK: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_ACK;
|
||||
pub const TCP_FLAG_PSH: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_PSH;
|
||||
pub const TCP_FLAG_RST: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_RST;
|
||||
pub const TCP_FLAG_SYN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_SYN;
|
||||
pub const TCP_FLAG_FIN: _bindgen_ty_2 = _bindgen_ty_2::TCP_FLAG_FIN;
|
||||
pub const TCP_RESERVED_BITS: _bindgen_ty_2 = _bindgen_ty_2::TCP_RESERVED_BITS;
|
||||
pub const TCP_DATA_OFFSET: _bindgen_ty_2 = _bindgen_ty_2::TCP_DATA_OFFSET;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_2 {
|
||||
TCP_FLAG_CWR = 32768,
|
||||
TCP_FLAG_ECE = 16384,
|
||||
TCP_FLAG_URG = 8192,
|
||||
TCP_FLAG_ACK = 4096,
|
||||
TCP_FLAG_PSH = 2048,
|
||||
TCP_FLAG_RST = 1024,
|
||||
TCP_FLAG_SYN = 512,
|
||||
TCP_FLAG_FIN = 256,
|
||||
TCP_RESERVED_BITS = 15,
|
||||
TCP_DATA_OFFSET = 240,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_opt {
|
||||
pub opt_code: __u32,
|
||||
pub opt_val: __u32,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_repair_window {
|
||||
pub snd_wl1: __u32,
|
||||
pub snd_wnd: __u32,
|
||||
pub max_window: __u32,
|
||||
pub rcv_wnd: __u32,
|
||||
pub rcv_wup: __u32,
|
||||
}
|
||||
pub const TCP_NO_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_NO_QUEUE;
|
||||
pub const TCP_RECV_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_RECV_QUEUE;
|
||||
pub const TCP_SEND_QUEUE: _bindgen_ty_3 = _bindgen_ty_3::TCP_SEND_QUEUE;
|
||||
pub const TCP_QUEUES_NR: _bindgen_ty_3 = _bindgen_ty_3::TCP_QUEUES_NR;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_3 {
|
||||
TCP_NO_QUEUE = 0,
|
||||
TCP_RECV_QUEUE = 1,
|
||||
TCP_SEND_QUEUE = 2,
|
||||
TCP_QUEUES_NR = 3,
|
||||
}
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum tcp_ca_state {
|
||||
TCP_CA_Open = 0,
|
||||
TCP_CA_Disorder = 1,
|
||||
TCP_CA_CWR = 2,
|
||||
TCP_CA_Recovery = 3,
|
||||
TCP_CA_Loss = 4,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_info {
|
||||
pub tcpi_state: __u8,
|
||||
pub tcpi_ca_state: __u8,
|
||||
pub tcpi_retransmits: __u8,
|
||||
pub tcpi_probes: __u8,
|
||||
pub tcpi_backoff: __u8,
|
||||
pub tcpi_options: __u8,
|
||||
pub _bitfield_align_1: [u8; 0],
|
||||
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 2usize]>,
|
||||
pub tcpi_rto: __u32,
|
||||
pub tcpi_ato: __u32,
|
||||
pub tcpi_snd_mss: __u32,
|
||||
pub tcpi_rcv_mss: __u32,
|
||||
pub tcpi_unacked: __u32,
|
||||
pub tcpi_sacked: __u32,
|
||||
pub tcpi_lost: __u32,
|
||||
pub tcpi_retrans: __u32,
|
||||
pub tcpi_fackets: __u32,
|
||||
pub tcpi_last_data_sent: __u32,
|
||||
pub tcpi_last_ack_sent: __u32,
|
||||
pub tcpi_last_data_recv: __u32,
|
||||
pub tcpi_last_ack_recv: __u32,
|
||||
pub tcpi_pmtu: __u32,
|
||||
pub tcpi_rcv_ssthresh: __u32,
|
||||
pub tcpi_rtt: __u32,
|
||||
pub tcpi_rttvar: __u32,
|
||||
pub tcpi_snd_ssthresh: __u32,
|
||||
pub tcpi_snd_cwnd: __u32,
|
||||
pub tcpi_advmss: __u32,
|
||||
pub tcpi_reordering: __u32,
|
||||
pub tcpi_rcv_rtt: __u32,
|
||||
pub tcpi_rcv_space: __u32,
|
||||
pub tcpi_total_retrans: __u32,
|
||||
pub tcpi_pacing_rate: __u64,
|
||||
pub tcpi_max_pacing_rate: __u64,
|
||||
pub tcpi_bytes_acked: __u64,
|
||||
pub tcpi_bytes_received: __u64,
|
||||
pub tcpi_segs_out: __u32,
|
||||
pub tcpi_segs_in: __u32,
|
||||
pub tcpi_notsent_bytes: __u32,
|
||||
pub tcpi_min_rtt: __u32,
|
||||
pub tcpi_data_segs_in: __u32,
|
||||
pub tcpi_data_segs_out: __u32,
|
||||
pub tcpi_delivery_rate: __u64,
|
||||
pub tcpi_busy_time: __u64,
|
||||
pub tcpi_rwnd_limited: __u64,
|
||||
pub tcpi_sndbuf_limited: __u64,
|
||||
pub tcpi_delivered: __u32,
|
||||
pub tcpi_delivered_ce: __u32,
|
||||
pub tcpi_bytes_sent: __u64,
|
||||
pub tcpi_bytes_retrans: __u64,
|
||||
pub tcpi_dsack_dups: __u32,
|
||||
pub tcpi_reord_seen: __u32,
|
||||
pub tcpi_rcv_ooopack: __u32,
|
||||
pub tcpi_snd_wnd: __u32,
|
||||
}
|
||||
impl tcp_info {
|
||||
#[inline]
|
||||
pub fn tcpi_snd_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_snd_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(0usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_rcv_wscale(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 4u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_rcv_wscale(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(4usize, 4u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn tcpi_delivery_rate_app_limited(&self) -> __u8 {
|
||||
unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u8) }
|
||||
}
|
||||
#[inline]
|
||||
pub fn set_tcpi_delivery_rate_app_limited(&mut self, val: __u8) {
|
||||
unsafe {
|
||||
let val: u8 = ::core::mem::transmute(val);
|
||||
self._bitfield_1.set(8usize, 1u8, val as u64)
|
||||
}
|
||||
}
|
||||
#[inline]
|
||||
pub fn new_bitfield_1(tcpi_snd_wscale: __u8, tcpi_rcv_wscale: __u8, tcpi_delivery_rate_app_limited: __u8) -> __BindgenBitfieldUnit<[u8; 2usize]> {
|
||||
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 2usize]> = Default::default();
|
||||
__bindgen_bitfield_unit.set(0usize, 4u8, {
|
||||
let tcpi_snd_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_snd_wscale) };
|
||||
tcpi_snd_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(4usize, 4u8, {
|
||||
let tcpi_rcv_wscale: u8 = unsafe { ::core::mem::transmute(tcpi_rcv_wscale) };
|
||||
tcpi_rcv_wscale as u64
|
||||
});
|
||||
__bindgen_bitfield_unit.set(8usize, 1u8, {
|
||||
let tcpi_delivery_rate_app_limited: u8 = unsafe { ::core::mem::transmute(tcpi_delivery_rate_app_limited) };
|
||||
tcpi_delivery_rate_app_limited as u64
|
||||
});
|
||||
__bindgen_bitfield_unit
|
||||
}
|
||||
}
|
||||
pub const TCP_NLA_PAD: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PAD;
|
||||
pub const TCP_NLA_BUSY: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BUSY;
|
||||
pub const TCP_NLA_RWND_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RWND_LIMITED;
|
||||
pub const TCP_NLA_SNDBUF_LIMITED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDBUF_LIMITED;
|
||||
pub const TCP_NLA_DATA_SEGS_OUT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DATA_SEGS_OUT;
|
||||
pub const TCP_NLA_TOTAL_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_TOTAL_RETRANS;
|
||||
pub const TCP_NLA_PACING_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_PACING_RATE;
|
||||
pub const TCP_NLA_DELIVERY_RATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE;
|
||||
pub const TCP_NLA_SND_CWND: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_CWND;
|
||||
pub const TCP_NLA_REORDERING: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORDERING;
|
||||
pub const TCP_NLA_MIN_RTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_MIN_RTT;
|
||||
pub const TCP_NLA_RECUR_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_RECUR_RETRANS;
|
||||
pub const TCP_NLA_DELIVERY_RATE_APP_LMT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERY_RATE_APP_LMT;
|
||||
pub const TCP_NLA_SNDQ_SIZE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SNDQ_SIZE;
|
||||
pub const TCP_NLA_CA_STATE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_CA_STATE;
|
||||
pub const TCP_NLA_SND_SSTHRESH: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SND_SSTHRESH;
|
||||
pub const TCP_NLA_DELIVERED: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED;
|
||||
pub const TCP_NLA_DELIVERED_CE: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DELIVERED_CE;
|
||||
pub const TCP_NLA_BYTES_SENT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_SENT;
|
||||
pub const TCP_NLA_BYTES_RETRANS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_BYTES_RETRANS;
|
||||
pub const TCP_NLA_DSACK_DUPS: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_DSACK_DUPS;
|
||||
pub const TCP_NLA_REORD_SEEN: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_REORD_SEEN;
|
||||
pub const TCP_NLA_SRTT: _bindgen_ty_4 = _bindgen_ty_4::TCP_NLA_SRTT;
|
||||
#[repr(u32)]
|
||||
#[non_exhaustive]
|
||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||
pub enum _bindgen_ty_4 {
|
||||
TCP_NLA_PAD = 0,
|
||||
TCP_NLA_BUSY = 1,
|
||||
TCP_NLA_RWND_LIMITED = 2,
|
||||
TCP_NLA_SNDBUF_LIMITED = 3,
|
||||
TCP_NLA_DATA_SEGS_OUT = 4,
|
||||
TCP_NLA_TOTAL_RETRANS = 5,
|
||||
TCP_NLA_PACING_RATE = 6,
|
||||
TCP_NLA_DELIVERY_RATE = 7,
|
||||
TCP_NLA_SND_CWND = 8,
|
||||
TCP_NLA_REORDERING = 9,
|
||||
TCP_NLA_MIN_RTT = 10,
|
||||
TCP_NLA_RECUR_RETRANS = 11,
|
||||
TCP_NLA_DELIVERY_RATE_APP_LMT = 12,
|
||||
TCP_NLA_SNDQ_SIZE = 13,
|
||||
TCP_NLA_CA_STATE = 14,
|
||||
TCP_NLA_SND_SSTHRESH = 15,
|
||||
TCP_NLA_DELIVERED = 16,
|
||||
TCP_NLA_DELIVERED_CE = 17,
|
||||
TCP_NLA_BYTES_SENT = 18,
|
||||
TCP_NLA_BYTES_RETRANS = 19,
|
||||
TCP_NLA_DSACK_DUPS = 20,
|
||||
TCP_NLA_REORD_SEEN = 21,
|
||||
TCP_NLA_SRTT = 22,
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub struct tcp_md5sig {
|
||||
pub tcpm_addr: __kernel_sockaddr_storage,
|
||||
pub tcpm_flags: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub __tcpm_pad: __u32,
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_diag_md5sig {
|
||||
pub tcpm_family: __u8,
|
||||
pub tcpm_prefixlen: __u8,
|
||||
pub tcpm_keylen: __u16,
|
||||
pub tcpm_addr: [__be32; 4usize],
|
||||
pub tcpm_key: [__u8; 80usize],
|
||||
}
|
||||
#[repr(C)]
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub struct tcp_zerocopy_receive {
|
||||
pub address: __u64,
|
||||
pub length: __u32,
|
||||
pub recv_skip_hint: __u32,
|
||||
}
|
||||
pub type cc_t = crate::ctypes::c_uchar;
|
||||
pub type speed_t = crate::ctypes::c_uint;
|
||||
pub type tcflag_t = crate::ctypes::c_uint;
|
||||
|
||||
Reference in New Issue
Block a user