mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
feat(compute): probe uBridge's swappable bridge TAP leg
The bridge module gained delete_nio_tap (uBridge's gns3server-integration contract, section 'bridge — generic NIO relay with a swappable TAP leg'): a per-port bridge can swap its topology leg between UDP and a persistent TAP through stop -> delete -> add -> start, which is what lets an IOL runner container's port bridge carry a kernel-link anchor. The probe needs no scratch objects and no capabilities: one command against a bridge that cannot exist — 202 (unknown command) is an old build, 214 (bridge doesn't exist) is a new one. Cached by binary identity like every other probe; any failure reports unknown. GET /v3/compute/capabilities gains ubridge_bridge_tap; the controller's default capability dict carries it too (the single schema definition, per the 1e67fbf12 lesson).
This commit is contained in:
7 files changed
+179
-3
No files matched your search
@@ -25,7 +25,12 @@ from fastapi import APIRouter, Request
|
||||
|
||||
from gns3server import schemas
|
||||
from gns3server.compute import MODULES
|
||||
from gns3server.compute.ubridge.tc_probe import probe_iol_tap_support, probe_tc_capabilities, probe_tap_support
|
||||
from gns3server.compute.ubridge.tc_probe import (
|
||||
probe_bridge_tap_support,
|
||||
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__
|
||||
@@ -60,6 +65,11 @@ async def get_capabilities(request: Request) -> dict:
|
||||
# Ethernet ports need for the kernel datapath. None = unknown.
|
||||
ubridge_iol_tap = await probe_iol_tap_support()
|
||||
|
||||
# Swappable TAP leg on the generic bridge module (bridge delete_nio_tap):
|
||||
# what lets an IOL runner container's per-port bridge carry a kernel-link
|
||||
# anchor. None = unknown (probe failed or uBridge too old).
|
||||
ubridge_bridge_tap = await probe_bridge_tap_support()
|
||||
|
||||
# record the controller hostname or IP address
|
||||
if request.client:
|
||||
request.app.state.controller_host = request.client.host
|
||||
@@ -74,4 +84,5 @@ async def get_capabilities(request: Request) -> dict:
|
||||
"ubridge_tc": ubridge_tc,
|
||||
"ubridge_tap": ubridge_tap,
|
||||
"ubridge_iol_tap": ubridge_iol_tap,
|
||||
"ubridge_bridge_tap": ubridge_bridge_tap,
|
||||
}
|
||||
Reference in new issue
Block a user