From 89553d9932fc40278dc8abf7546589075d2f46a9 Mon Sep 17 00:00:00 2001 From: "Arvid E. Picciani" Date: Tue, 23 Mar 2021 09:18:09 +0100 Subject: [PATCH] mesh --- doopenwrt.sh | 2 +- src/ast.zz | 2 ++ src/openwrt.zz | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) mode change 100644 => 100755 doopenwrt.sh diff --git a/doopenwrt.sh b/doopenwrt.sh old mode 100644 new mode 100755 index 3d7429f..3e14d40 --- a/doopenwrt.sh +++ b/doopenwrt.sh @@ -10,5 +10,5 @@ cp -a target/gen target/c/ target/make/ target/release ~/proj/captif/openwrt/pac cd ~/proj/captif/openwrt/ make V=s CONFIG_DEBUG=y -j20 package/devguard/genesis/{clean,compile} -scp ~/proj/captif/openwrt/build_dir/target-mips_24kc_musl/genesis-0.13/genesis root@192.168.0.246:/tmp/genesis +scp ~/proj/captif/openwrt/build_dir/target-mips_24kc_musl/genesis-0.13/genesis root@192.168.0.117:/tmp/genesis diff --git a/src/ast.zz b/src/ast.zz index 1b07e3f..89216cf 100644 --- a/src/ast.zz +++ b/src/ast.zz @@ -34,11 +34,13 @@ pub enum WifiMode @json::from() { ap, sta, monitor, + mesh, } export struct WifiInterface @json::from() { WifiMode mode; slice::Slice ssid; + slice::Slice mesh_id; slice::Slice key; WifiAuth auth; } diff --git a/src/openwrt.zz b/src/openwrt.zz index 3d12457..cae0fe7 100644 --- a/src/openwrt.zz +++ b/src/openwrt.zz @@ -269,6 +269,9 @@ pub fn emit(ast::Genesis *gst, bool notify_openwrt) if iff->wifi != 0 { static_attest(safe(iff->wifi)); switch iff->wifi->mode { + ast::WifiMode::mesh => { + fprintf(fo, " option mode 'mesh'\n"); + } ast::WifiMode::ap => { fprintf(fo, " option mode 'ap'\n"); } @@ -279,6 +282,9 @@ pub fn emit(ast::Genesis *gst, bool notify_openwrt) fprintf(fo, " option mode 'monitor'\n"); } } + if iff->wifi->mesh_id.mem != 0 { + fprintf(fo, " option mesh_id '%.*s'\n", (int)iff->wifi->mesh_id.size, iff->wifi->mesh_id.mem); + } if iff->wifi->ssid.mem != 0 { fprintf(fo, " option ssid '%.*s'\n", (int)iff->wifi->ssid.size, iff->wifi->ssid.mem); }