Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ netlink = []
prctl = []
ptrace = []
system = []
vm_sockets = []
xdp = []
default = ["std", "general", "errno"]
std = []
Expand Down
10 changes: 10 additions & 0 deletions gen/modules/vm_sockets.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Code needed for vm_sockets.h

#include "support.h"

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0)
#define sa_family_t uint16_t
#include <linux/socket.h>
#include <linux/vm_sockets.h>
#endif

2 changes: 1 addition & 1 deletion src/aarch64/btrfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ pub dirid: __u64,
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_encoded_io_args {
pub iov: *const iovec,
pub iov: *mut iovec,
pub iovcnt: crate::ctypes::c_ulong,
pub offset: __s64,
pub flags: __u64,
Expand Down
111 changes: 111 additions & 0 deletions src/aarch64/vm_sockets.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/* automatically generated by rust-bindgen 0.72.1 */

pub type __kernel_sa_family_t = crate::ctypes::c_ushort;
pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
pub type __s16 = crate::ctypes::c_short;
pub type __u16 = crate::ctypes::c_ushort;
pub type __s32 = crate::ctypes::c_int;
pub type __u32 = crate::ctypes::c_uint;
pub type __s64 = crate::ctypes::c_longlong;
pub type __u64 = crate::ctypes::c_ulonglong;
pub type __kernel_key_t = crate::ctypes::c_int;
pub type __kernel_mqd_t = crate::ctypes::c_int;
pub type __kernel_old_uid_t = crate::ctypes::c_ushort;
pub type __kernel_old_gid_t = crate::ctypes::c_ushort;
pub type __kernel_long_t = crate::ctypes::c_long;
pub type __kernel_ulong_t = crate::ctypes::c_ulong;
pub type __kernel_ino_t = __kernel_ulong_t;
pub type __kernel_mode_t = crate::ctypes::c_uint;
pub type __kernel_pid_t = crate::ctypes::c_int;
pub type __kernel_ipc_pid_t = crate::ctypes::c_int;
pub type __kernel_uid_t = crate::ctypes::c_uint;
pub type __kernel_gid_t = crate::ctypes::c_uint;
pub type __kernel_suseconds_t = __kernel_long_t;
pub type __kernel_daddr_t = crate::ctypes::c_int;
pub type __kernel_uid32_t = crate::ctypes::c_uint;
pub type __kernel_gid32_t = crate::ctypes::c_uint;
pub type __kernel_old_dev_t = crate::ctypes::c_uint;
pub type __kernel_size_t = __kernel_ulong_t;
pub type __kernel_ssize_t = __kernel_long_t;
pub type __kernel_ptrdiff_t = __kernel_long_t;
pub type __kernel_off_t = __kernel_long_t;
pub type __kernel_loff_t = crate::ctypes::c_longlong;
pub type __kernel_old_time_t = __kernel_long_t;
pub type __kernel_time_t = __kernel_long_t;
pub type __kernel_time64_t = crate::ctypes::c_longlong;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = crate::ctypes::c_int;
pub type __kernel_clockid_t = crate::ctypes::c_int;
pub type __kernel_caddr_t = *mut crate::ctypes::c_char;
pub type __kernel_uid16_t = crate::ctypes::c_ushort;
pub type __kernel_gid16_t = crate::ctypes::c_ushort;
pub type __s128 = i128;
pub type __u128 = u128;
pub type __le16 = __u16;
pub type __be16 = __u16;
pub type __le32 = __u32;
pub type __be32 = __u32;
pub type __le64 = __u64;
pub type __be64 = __u64;
pub type __sum16 = __u16;
pub type __wsum = __u32;
pub type __poll_t = crate::ctypes::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct __kernel_sockaddr_storage {
pub __bindgen_anon_1: __kernel_sockaddr_storage__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1 {
pub ss_family: __kernel_sa_family_t,
pub __data: [crate::ctypes::c_char; 126usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr {
pub __storage: __kernel_sockaddr_storage,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr_vm {
pub svm_family: __kernel_sa_family_t,
pub svm_reserved1: crate::ctypes::c_ushort,
pub svm_port: crate::ctypes::c_uint,
pub svm_cid: crate::ctypes::c_uint,
pub svm_flags: __u8,
pub svm_zero: [crate::ctypes::c_uchar; 115usize],
}
pub const _K_SS_MAXSIZE: u32 = 128;
pub const SOCK_SNDBUF_LOCK: u32 = 1;
pub const SOCK_RCVBUF_LOCK: u32 = 2;
pub const SOCK_BUF_LOCK_MASK: u32 = 3;
pub const SOCK_TXREHASH_DEFAULT: u32 = 255;
pub const SOCK_TXREHASH_DISABLED: u32 = 0;
pub const SOCK_TXREHASH_ENABLED: u32 = 1;
pub const __BITS_PER_LONG_LONG: u32 = 64;
pub const SO_VM_SOCKETS_BUFFER_SIZE: u32 = 0;
pub const SO_VM_SOCKETS_BUFFER_MIN_SIZE: u32 = 1;
pub const SO_VM_SOCKETS_BUFFER_MAX_SIZE: u32 = 2;
pub const SO_VM_SOCKETS_PEER_HOST_VM_ID: u32 = 3;
pub const SO_VM_SOCKETS_TRUSTED: u32 = 5;
pub const SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD: u32 = 6;
pub const SO_VM_SOCKETS_NONBLOCK_TXRX: u32 = 7;
pub const SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW: u32 = 8;
pub const SO_VM_SOCKETS_CONNECT_TIMEOUT: u32 = 6;
pub const VMADDR_CID_ANY: i32 = -1;
pub const VMADDR_PORT_ANY: i32 = -1;
pub const VMADDR_CID_HYPERVISOR: u32 = 0;
pub const VMADDR_CID_LOCAL: u32 = 1;
pub const VMADDR_CID_HOST: u32 = 2;
pub const VMADDR_FLAG_TO_HOST: u32 = 1;
pub const VM_SOCKETS_INVALID_VERSION: i32 = -1;
pub const SOL_VSOCK: u32 = 287;
pub const VSOCK_RECVERR: u32 = 1;
#[repr(C)]
#[derive(Copy, Clone)]
pub union __kernel_sockaddr_storage__bindgen_ty_1 {
pub __bindgen_anon_1: __kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1,
pub __align: *mut crate::ctypes::c_void,
}
2 changes: 1 addition & 1 deletion src/arm/btrfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ pub dirid: __u64,
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_encoded_io_args {
pub iov: *const iovec,
pub iov: *mut iovec,
pub iovcnt: crate::ctypes::c_ulong,
pub offset: __s64,
pub flags: __u64,
Expand Down
108 changes: 108 additions & 0 deletions src/arm/vm_sockets.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/* automatically generated by rust-bindgen 0.72.1 */

pub type __kernel_sa_family_t = crate::ctypes::c_ushort;
pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
pub type __s16 = crate::ctypes::c_short;
pub type __u16 = crate::ctypes::c_ushort;
pub type __s32 = crate::ctypes::c_int;
pub type __u32 = crate::ctypes::c_uint;
pub type __s64 = crate::ctypes::c_longlong;
pub type __u64 = crate::ctypes::c_ulonglong;
pub type __kernel_key_t = crate::ctypes::c_int;
pub type __kernel_mqd_t = crate::ctypes::c_int;
pub type __kernel_mode_t = crate::ctypes::c_ushort;
pub type __kernel_ipc_pid_t = crate::ctypes::c_ushort;
pub type __kernel_uid_t = crate::ctypes::c_ushort;
pub type __kernel_gid_t = crate::ctypes::c_ushort;
pub type __kernel_old_dev_t = crate::ctypes::c_ushort;
pub type __kernel_long_t = crate::ctypes::c_long;
pub type __kernel_ulong_t = crate::ctypes::c_ulong;
pub type __kernel_ino_t = __kernel_ulong_t;
pub type __kernel_pid_t = crate::ctypes::c_int;
pub type __kernel_suseconds_t = __kernel_long_t;
pub type __kernel_daddr_t = crate::ctypes::c_int;
pub type __kernel_uid32_t = crate::ctypes::c_uint;
pub type __kernel_gid32_t = crate::ctypes::c_uint;
pub type __kernel_old_uid_t = __kernel_uid_t;
pub type __kernel_old_gid_t = __kernel_gid_t;
pub type __kernel_size_t = crate::ctypes::c_uint;
pub type __kernel_ssize_t = crate::ctypes::c_int;
pub type __kernel_ptrdiff_t = crate::ctypes::c_int;
pub type __kernel_off_t = __kernel_long_t;
pub type __kernel_loff_t = crate::ctypes::c_longlong;
pub type __kernel_old_time_t = __kernel_long_t;
pub type __kernel_time_t = __kernel_long_t;
pub type __kernel_time64_t = crate::ctypes::c_longlong;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = crate::ctypes::c_int;
pub type __kernel_clockid_t = crate::ctypes::c_int;
pub type __kernel_caddr_t = *mut crate::ctypes::c_char;
pub type __kernel_uid16_t = crate::ctypes::c_ushort;
pub type __kernel_gid16_t = crate::ctypes::c_ushort;
pub type __le16 = __u16;
pub type __be16 = __u16;
pub type __le32 = __u32;
pub type __be32 = __u32;
pub type __le64 = __u64;
pub type __be64 = __u64;
pub type __sum16 = __u16;
pub type __wsum = __u32;
pub type __poll_t = crate::ctypes::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct __kernel_sockaddr_storage {
pub __bindgen_anon_1: __kernel_sockaddr_storage__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1 {
pub ss_family: __kernel_sa_family_t,
pub __data: [crate::ctypes::c_char; 126usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr {
pub __storage: __kernel_sockaddr_storage,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr_vm {
pub svm_family: __kernel_sa_family_t,
pub svm_reserved1: crate::ctypes::c_ushort,
pub svm_port: crate::ctypes::c_uint,
pub svm_cid: crate::ctypes::c_uint,
pub svm_flags: __u8,
pub svm_zero: [crate::ctypes::c_uchar; 115usize],
}
pub const _K_SS_MAXSIZE: u32 = 128;
pub const SOCK_SNDBUF_LOCK: u32 = 1;
pub const SOCK_RCVBUF_LOCK: u32 = 2;
pub const SOCK_BUF_LOCK_MASK: u32 = 3;
pub const SOCK_TXREHASH_DEFAULT: u32 = 255;
pub const SOCK_TXREHASH_DISABLED: u32 = 0;
pub const SOCK_TXREHASH_ENABLED: u32 = 1;
pub const __BITS_PER_LONG_LONG: u32 = 64;
pub const SO_VM_SOCKETS_BUFFER_SIZE: u32 = 0;
pub const SO_VM_SOCKETS_BUFFER_MIN_SIZE: u32 = 1;
pub const SO_VM_SOCKETS_BUFFER_MAX_SIZE: u32 = 2;
pub const SO_VM_SOCKETS_PEER_HOST_VM_ID: u32 = 3;
pub const SO_VM_SOCKETS_TRUSTED: u32 = 5;
pub const SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD: u32 = 6;
pub const SO_VM_SOCKETS_NONBLOCK_TXRX: u32 = 7;
pub const SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW: u32 = 8;
pub const VMADDR_CID_ANY: i32 = -1;
pub const VMADDR_PORT_ANY: i32 = -1;
pub const VMADDR_CID_HYPERVISOR: u32 = 0;
pub const VMADDR_CID_LOCAL: u32 = 1;
pub const VMADDR_CID_HOST: u32 = 2;
pub const VMADDR_FLAG_TO_HOST: u32 = 1;
pub const VM_SOCKETS_INVALID_VERSION: i32 = -1;
pub const SOL_VSOCK: u32 = 287;
pub const VSOCK_RECVERR: u32 = 1;
#[repr(C)]
#[derive(Copy, Clone)]
pub union __kernel_sockaddr_storage__bindgen_ty_1 {
pub __bindgen_anon_1: __kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1,
pub __align: *mut crate::ctypes::c_void,
}
2 changes: 1 addition & 1 deletion src/csky/btrfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ pub dirid: __u64,
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_encoded_io_args {
pub iov: *const iovec,
pub iov: *mut iovec,
pub iovcnt: crate::ctypes::c_ulong,
pub offset: __s64,
pub flags: __u64,
Expand Down
108 changes: 108 additions & 0 deletions src/csky/vm_sockets.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/* automatically generated by rust-bindgen 0.72.1 */

pub type __kernel_sa_family_t = crate::ctypes::c_ushort;
pub type __s8 = crate::ctypes::c_schar;
pub type __u8 = crate::ctypes::c_uchar;
pub type __s16 = crate::ctypes::c_short;
pub type __u16 = crate::ctypes::c_ushort;
pub type __s32 = crate::ctypes::c_int;
pub type __u32 = crate::ctypes::c_uint;
pub type __s64 = crate::ctypes::c_longlong;
pub type __u64 = crate::ctypes::c_ulonglong;
pub type __kernel_key_t = crate::ctypes::c_int;
pub type __kernel_mqd_t = crate::ctypes::c_int;
pub type __kernel_long_t = crate::ctypes::c_long;
pub type __kernel_ulong_t = crate::ctypes::c_ulong;
pub type __kernel_ino_t = __kernel_ulong_t;
pub type __kernel_mode_t = crate::ctypes::c_uint;
pub type __kernel_pid_t = crate::ctypes::c_int;
pub type __kernel_ipc_pid_t = crate::ctypes::c_int;
pub type __kernel_uid_t = crate::ctypes::c_uint;
pub type __kernel_gid_t = crate::ctypes::c_uint;
pub type __kernel_suseconds_t = __kernel_long_t;
pub type __kernel_daddr_t = crate::ctypes::c_int;
pub type __kernel_uid32_t = crate::ctypes::c_uint;
pub type __kernel_gid32_t = crate::ctypes::c_uint;
pub type __kernel_old_uid_t = __kernel_uid_t;
pub type __kernel_old_gid_t = __kernel_gid_t;
pub type __kernel_old_dev_t = crate::ctypes::c_uint;
pub type __kernel_size_t = crate::ctypes::c_uint;
pub type __kernel_ssize_t = crate::ctypes::c_int;
pub type __kernel_ptrdiff_t = crate::ctypes::c_int;
pub type __kernel_off_t = __kernel_long_t;
pub type __kernel_loff_t = crate::ctypes::c_longlong;
pub type __kernel_old_time_t = __kernel_long_t;
pub type __kernel_time_t = __kernel_long_t;
pub type __kernel_time64_t = crate::ctypes::c_longlong;
pub type __kernel_clock_t = __kernel_long_t;
pub type __kernel_timer_t = crate::ctypes::c_int;
pub type __kernel_clockid_t = crate::ctypes::c_int;
pub type __kernel_caddr_t = *mut crate::ctypes::c_char;
pub type __kernel_uid16_t = crate::ctypes::c_ushort;
pub type __kernel_gid16_t = crate::ctypes::c_ushort;
pub type __le16 = __u16;
pub type __be16 = __u16;
pub type __le32 = __u32;
pub type __be32 = __u32;
pub type __le64 = __u64;
pub type __be64 = __u64;
pub type __sum16 = __u16;
pub type __wsum = __u32;
pub type __poll_t = crate::ctypes::c_uint;
#[repr(C)]
#[derive(Copy, Clone)]
pub struct __kernel_sockaddr_storage {
pub __bindgen_anon_1: __kernel_sockaddr_storage__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1 {
pub ss_family: __kernel_sa_family_t,
pub __data: [crate::ctypes::c_char; 126usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct sockaddr {
pub __storage: __kernel_sockaddr_storage,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sockaddr_vm {
pub svm_family: __kernel_sa_family_t,
pub svm_reserved1: crate::ctypes::c_ushort,
pub svm_port: crate::ctypes::c_uint,
pub svm_cid: crate::ctypes::c_uint,
pub svm_flags: __u8,
pub svm_zero: [crate::ctypes::c_uchar; 115usize],
}
pub const _K_SS_MAXSIZE: u32 = 128;
pub const SOCK_SNDBUF_LOCK: u32 = 1;
pub const SOCK_RCVBUF_LOCK: u32 = 2;
pub const SOCK_BUF_LOCK_MASK: u32 = 3;
pub const SOCK_TXREHASH_DEFAULT: u32 = 255;
pub const SOCK_TXREHASH_DISABLED: u32 = 0;
pub const SOCK_TXREHASH_ENABLED: u32 = 1;
pub const __BITS_PER_LONG_LONG: u32 = 64;
pub const SO_VM_SOCKETS_BUFFER_SIZE: u32 = 0;
pub const SO_VM_SOCKETS_BUFFER_MIN_SIZE: u32 = 1;
pub const SO_VM_SOCKETS_BUFFER_MAX_SIZE: u32 = 2;
pub const SO_VM_SOCKETS_PEER_HOST_VM_ID: u32 = 3;
pub const SO_VM_SOCKETS_TRUSTED: u32 = 5;
pub const SO_VM_SOCKETS_CONNECT_TIMEOUT_OLD: u32 = 6;
pub const SO_VM_SOCKETS_NONBLOCK_TXRX: u32 = 7;
pub const SO_VM_SOCKETS_CONNECT_TIMEOUT_NEW: u32 = 8;
pub const VMADDR_CID_ANY: i32 = -1;
pub const VMADDR_PORT_ANY: i32 = -1;
pub const VMADDR_CID_HYPERVISOR: u32 = 0;
pub const VMADDR_CID_LOCAL: u32 = 1;
pub const VMADDR_CID_HOST: u32 = 2;
pub const VMADDR_FLAG_TO_HOST: u32 = 1;
pub const VM_SOCKETS_INVALID_VERSION: i32 = -1;
pub const SOL_VSOCK: u32 = 287;
pub const VSOCK_RECVERR: u32 = 1;
#[repr(C)]
#[derive(Copy, Clone)]
pub union __kernel_sockaddr_storage__bindgen_ty_1 {
pub __bindgen_anon_1: __kernel_sockaddr_storage__bindgen_ty_1__bindgen_ty_1,
pub __align: *mut crate::ctypes::c_void,
}
2 changes: 1 addition & 1 deletion src/hexagon/btrfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ pub dirid: __u64,
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct btrfs_ioctl_encoded_io_args {
pub iov: *const iovec,
pub iov: *mut iovec,
pub iovcnt: crate::ctypes::c_ulong,
pub offset: __s64,
pub flags: __u64,
Expand Down
Loading
Loading