Skip to content

Commit 5fd7f84

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 7395ae4 commit 5fd7f84

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

zephyr-sys/build.rs

+9
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,16 @@ fn main() -> Result<()> {
8888
.allowlist_function("sys_.*")
8989
.allowlist_function("z_log.*")
9090
.allowlist_function("bt_.*")
91+
.allowlist_function("zsock_.*")
9192
.allowlist_function("SEGGER.*")
93+
.allowlist_item("AF_.*")
94+
.allowlist_type("net_ip_protocol.*")
95+
.allowlist_type("net_sock_type")
96+
.allowlist_type("sockaddr.*")
97+
.allowlist_type("sa_family_t")
98+
.allowlist_type("socklen_t")
99+
.allowlist_type("in_addr")
100+
.allowlist_type("in6_addr")
92101
.allowlist_item("E.*")
93102
.allowlist_item("K_.*")
94103
.allowlist_item("ZR_.*")

zephyr-sys/wrapper.h

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ extern int errno;
4242
#include <zephyr/logging/log.h>
4343
#include <zephyr/bluetooth/bluetooth.h>
4444
#include <zephyr/drivers/flash.h>
45+
#include <zephyr/net/socket.h>
4546

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

0 commit comments

Comments
 (0)