Skip to content

Commit eb8dd53

Browse files
zephyr-sys: add network socket API to bindgen
Generate Rust bindings for network socket and IP address symbols Signed-off-by: Matt Rodgers <[email protected]>
1 parent 029a8b1 commit eb8dd53

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

zephyr-sys/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,16 @@ fn main() -> Result<()> {
9090
.allowlist_function("sys_.*")
9191
.allowlist_function("z_log.*")
9292
.allowlist_function("bt_.*")
93+
.allowlist_function("zsock_.*")
9394
.allowlist_function("SEGGER.*")
95+
.allowlist_item("AF_.*")
96+
.allowlist_type("net_ip_protocol.*")
97+
.allowlist_type("net_sock_type")
98+
.allowlist_type("sockaddr.*")
99+
.allowlist_type("sa_family_t")
100+
.allowlist_type("socklen_t")
101+
.allowlist_type("in_addr")
102+
.allowlist_type("in6_addr")
94103
.allowlist_item("E.*")
95104
.allowlist_item("K_.*")
96105
.allowlist_item("ZR_.*")

zephyr-sys/wrapper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ extern int errno;
4343
#include <zephyr/bluetooth/bluetooth.h>
4444
#include <zephyr/drivers/flash.h>
4545
#include <zephyr/irq.h>
46+
#include <zephyr/net/socket.h>
4647

4748
/*
4849
* bindgen will only output #defined constants that resolve to simple numbers. These are some

0 commit comments

Comments
 (0)