feat(network): Linux bridge and address management OpenRPC API #40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_hero"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds a Linux-only
network.*OpenRPC namespace (9 methods) on the mycelium Hero UDS socket for managing Linux bridges, 400::/7 IPv6 addresses, and Mycelium listener policies viartnetlink(no shelling out).Related Issue
Closes #39
New methods
network.getStatusnetwork.listBridgesnetwork.ensureBridgenetwork.deleteBridgenetwork.listAddressesnetwork.addAddressnetwork.removeAddressnetwork.getListenersnetwork.setListenerPolicyChanges
mycelium-api/src/rpc/network/:errors.rs—NetworkErrorenum with numeric codes 1001–1900.models.rs—BridgeInfo,AddressInfo,ListenerInfo,NetworkStatus,ListenerPolicy.managed.rs— in-memoryManagedStatewrapped inArc<Mutex<_>>.linux_impl.rs— rtnetlink-based bridge list/ensure/delete, address add/remove/list, 400::/7 validation, listener snapshot from/proc/net/{tcp6,udp6}.stub.rs— non-Linux stubs returningUnsupportedPlatform.mycelium-api/Cargo.toml— Linux-only deps:rtnetlink = 0.20.0,netlink-packet-route = 0.28,futures,libc.mycelium-api/src/lib.rs,rpc.rs,rpc/unix.rs—ManagedStateplumbing and 9 new UDS dispatch arms.myceliumd-common/src/lib.rs— constructsManagedState::new_shared()and passes it into the UDS server spawn.docs/openrpc.json— version bumped 0.7.5 → 0.7.6; 9 new methods + 5 new schemas.Architecture notes
#[cfg(target_os = "linux")]; non-Linux targets compile against the stub.addAddressrequires the target interface to be a bridge; non-bridge interfaces are rejected with error 1202invalid_interface_type.network.*namespace; the TCPjsonrpseeserver at :8990 is unchanged (UDS is the canonical Hero interface).Test Results
cargo build --releasepasses in bothmyceliumd/andmyceliumd-private/sub-workspaces.curlover the UDS socket) exercising all 9 methods — all passed.Adds a Linux-only `network.*` namespace (9 methods) on the mycelium Hero UDS socket for managing Linux bridges, 400::/7 IPv6 addresses, and Mycelium listener policies via rtnetlink — no shelling out. New methods: network.getStatus, network.listBridges, network.ensureBridge, network.deleteBridge, network.listAddresses, network.addAddress, network.removeAddress, network.getListeners, network.setListenerPolicy Implementation: - mycelium-api/src/rpc/network/{errors,models,managed,linux_impl,stub}.rs - in-memory ManagedState behind Arc<Mutex<_>>, no file persistence in v1 - 400::/7 validation, bridge-only addAddress, listener snapshot from /proc/net/{tcp6,udp6} - #[cfg(target_os = "linux")] gate; stub returns UnsupportedPlatform - docs/openrpc.json bumped 0.7.5 -> 0.7.6 UDS is the canonical Hero interface; TCP jsonrpsee parity deferred. #39View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.