feat(ubridge): probe iol_bridge's TAP-port support

Whether an IOU port can terminate on a persistent TAP (iol_bridge
add_nio_tap) is a capability of its own: the tap module and that command
land independently, so a build may have one without the other. Probed on
a scratch IOL bridge with a scratch TAP — one add/delete cycle, no
iol_bridge start needed (attaching a NIO works on a stopped bridge) —
cached by binary identity, with the scratch bridge id above the per-node
id space the fabric locks (513..1024) so a probe cannot collide with a
running node. Any failure, including an old build's "Unknown command",
means unknown: IOU stays on the relay datapath.

Reported through /capabilities as ubridge_iol_tap, next to ubridge_tap.
This commit is contained in:
YueGuobin committed 2026-10-06 00:21:09 +08:00
1 parent 9a14a91293
commit 200c946eef
7 files changed
+178 -4

No files matched your search

@@ -25,7 +25,7 @@ from fastapi import APIRouter, Request
from gns3server import schemas
from gns3server.compute import MODULES
from gns3server.compute.ubridge.tc_probe import probe_tc_capabilities, probe_tap_support
from gns3server.compute.ubridge.tc_probe import probe_iol_tap_support, probe_tc_capabilities, probe_tap_support
from gns3server.utils.path import get_default_project_directory
from gns3server.utils.tc_capabilities import usable_ebpf_modes
from gns3server.version import __version__
@@ -56,6 +56,10 @@ async def get_capabilities(request: Request) -> dict:
# datapath. None = unknown (probe failed or uBridge too old).
ubridge_tap = await probe_tap_support()
# IOL-port TAP termination (iol_bridge add_nio_tap): the anchor IOU's
# Ethernet ports need for the kernel datapath. None = unknown.
ubridge_iol_tap = await probe_iol_tap_support()
# record the controller hostname or IP address
if request.client:
request.app.state.controller_host = request.client.host
@@ -69,4 +73,5 @@ async def get_capabilities(request: Request) -> dict:
"node_types": node_types,
"ubridge_tc": ubridge_tc,
"ubridge_tap": ubridge_tap,
"ubridge_iol_tap": ubridge_iol_tap,
}