Skip to content

Commit 7841796

Browse files
authored
Add bindings for LINUX_REBOOT_* and SO_ORIGINAL_DST. (#82)
1 parent 33452a2 commit 7841796

40 files changed

Lines changed: 10880 additions & 7 deletions

File tree

gen/include/limits.h

Whitespace-only changes.

gen/include/sys/socket.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Define `sockaddr` ourselves because the uapi headers don't define it but
2+
// some use it.
3+
struct sockaddr {
4+
struct __kernel_sockaddr_storage __storage;
5+
};

gen/modules/general.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/mman.h>
2020
#include <linux/poll.h>
2121
#include <linux/random.h>
22+
#include <linux/reboot.h>
2223
#include <linux/resource.h>
2324
#include <linux/sched.h>
2425
#include <linux/signal.h>

gen/modules/net.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <linux/socket.h>
1414
#include <linux/tcp.h>
1515
#include <linux/un.h>
16+
#include <linux/netfilter_ipv6/ip6_tables.h>
17+
#include <linux/netfilter_ipv4.h>
1618

1719
// Miscellaneous definitions which don't appear to be defined in Linux's public
1820
// headers, but which are nonetheless part of the ABI, and necessary for
@@ -31,13 +33,6 @@
3133
// which are ABI-incompatible with the Linux kernel ABI. This file should
3234
// only describe the kernel ABI.
3335

34-
struct sockaddr {
35-
struct __kernel_sockaddr_storage __storage;
36-
};
37-
#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,32)
38-
typedef uint16_t __kernel_sa_family_t;
39-
#endif
40-
4136
struct linger {
4237
int l_onoff;
4338
int l_linger;

src/aarch64/general.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,19 @@ pub const POLLRDHUP: u32 = 8192;
15691569
pub const GRND_NONBLOCK: u32 = 1;
15701570
pub const GRND_RANDOM: u32 = 2;
15711571
pub const GRND_INSECURE: u32 = 4;
1572+
pub const LINUX_REBOOT_MAGIC1: u32 = 4276215469;
1573+
pub const LINUX_REBOOT_MAGIC2: u32 = 672274793;
1574+
pub const LINUX_REBOOT_MAGIC2A: u32 = 85072278;
1575+
pub const LINUX_REBOOT_MAGIC2B: u32 = 369367448;
1576+
pub const LINUX_REBOOT_MAGIC2C: u32 = 537993216;
1577+
pub const LINUX_REBOOT_CMD_RESTART: u32 = 19088743;
1578+
pub const LINUX_REBOOT_CMD_HALT: u32 = 3454992675;
1579+
pub const LINUX_REBOOT_CMD_CAD_ON: u32 = 2309737967;
1580+
pub const LINUX_REBOOT_CMD_CAD_OFF: u32 = 0;
1581+
pub const LINUX_REBOOT_CMD_POWER_OFF: u32 = 1126301404;
1582+
pub const LINUX_REBOOT_CMD_RESTART2: u32 = 2712847316;
1583+
pub const LINUX_REBOOT_CMD_SW_SUSPEND: u32 = 3489725666;
1584+
pub const LINUX_REBOOT_CMD_KEXEC: u32 = 1163412803;
15721585
pub const ITIMER_REAL: u32 = 0;
15731586
pub const ITIMER_VIRTUAL: u32 = 1;
15741587
pub const ITIMER_PROF: u32 = 2;

0 commit comments

Comments
 (0)