Skip to content

Conversation

@OliverKruecken
Copy link

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #368

Description

This PR adds comprehensive support for BATMAN-adv (Better Approach To Mobile Ad-hoc Networking) mesh networking protocol and 802.11s wireless mesh interfaces to the OpenWrt backend.

Changes

New Interface Types

Implements three new interface types for the OpenWrt backend:

  • batadv: Main BATMAN-adv virtual mesh interface

    • Configurable routing algorithm (BATMAN_IV, BATMAN_V)
    • Bridge loop avoidance settings
    • Gateway mode (off, client, server)
    • Hop penalty, MTU, and fragmentation controls
  • batadv_hardif: Physical/hard interfaces for mesh participation

    • Device binding and master interface association
  • mesh: Convenience alias for 802.11s wireless mesh interfaces (equivalent to batadv_hardif)

Schema Extensions

  • Added JSON Schema definitions for all three interface types
  • Added mesh-specific wireless properties (mesh_fwding, mesh_rssi_threshold)
  • Added WPA3 Personal encryption support for mesh networks with CCMP cipher

Converter Implementation

  • Implemented bidirectional conversion (NetJSON ↔ OpenWrt UCI) in the Interfaces converter
  • Added forward conversion methods: _intermediate_batadv, _intermediate_batadv_hardif, _intermediate_mesh
  • Added backward conversion methods: _netjson_batadv, _netjson_batadv_hardif, _netjson_mesh
  • Updated WireguardPeers converter to properly filter blocks by type

Documentation

  • Added comprehensive documentation to docs/source/backends/openwrt.rst (197 lines)
  • Included configuration parameter reference tables
  • Provided multiple working examples (basic and complete mesh setups)

Files Changed

  • docs/source/backends/openwrt.rst (+197 lines)
  • netjsonconfig/backends/openwrt/converters/interfaces.py (+58 lines)
  • netjsonconfig/backends/openwrt/converters/wireguard_peers.py (+7 lines)
  • netjsonconfig/backends/openwrt/schema.py (+116 lines)
  • netjsonconfig/schema.py (+46 lines)

Total: 424 insertions, 1 deletion

Testing

  • All existing tests pass
  • New converter methods tested
  • Schema validation tested
  • Documentation examples verified

Backward Compatibility

  • Maintains full backward compatibility with existing configurations
  • No breaking changes to existing interface types
  • Follows established netjsonconfig converter patterns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BATMAN-adv and 802.11s Mesh Interface Support

1 participant