Commit Graph
24 Commits
Author SHA1 Message Date
YueGuobin 7201a870da feat(dynamips): anchor every Ethernet port on a persistent TAP
Dynamips links can now ride the kernel datapath like Docker, QEMU and IOU:
each Ethernet slot/port gets a persistent TAP anchor (gd{id}e{slot}p{port}),
created through uBridge's tap module, and the Dynamips hypervisor opens it
with nio create_tap — the hypervisor holds the fd, exactly QEMU's shape.
Links attach the anchor to their per-link kernel bridge; the legacy UDP
tunnel remains the relay datapath for every other port.

Anchor lifecycle: born at node start (tap module probed with one
create/delete cycle, sweep of stale devices, ownership handed to the server
user, born down); a kernel link opens the anchor in the hypervisor, binds
the slot/port and enslaves it; removing the link releases the fd again
(nio delete) and detaches. A link bound while the router is stopped is
wired by the next start (deferred wiring). Node close follows QEMU's stop
order — the hypervisor's TAP NIOs go before tap delete, since it is
Dynamips, not uBridge, that holds the fds.

Stop is not close: vm stop only halts the emulated router, so the
hypervisor, the TAP fds, the bindings and the per-link bridges all survive
a stop/start untouched (attach skips ports that still hold their TAP NIO).

Port selection follows the adapter registry: ETHERNET_ADAPTERS and
ETHERNET_WICS name the models whose ports carry Ethernet frames (WIC-1ENET
included, at its Dynamips port number); serial, ATM and POS ports never
anchor, and a kernel link there errors with the relay-datapath message
instead of half-wiring. Adapters hot-added to a running router (OIR) get
their anchors at once.

The compute NIO routes accept nio_bridge alongside nio_udp (the same
widening QEMU needed), carry the endpoint's suspend flag on update (it is
the anchor's admin state on a kernel link), skip the hypervisor delete for
a kernel NIO (its TAP NIO was already released by the slot removal), and
the close path leaves NIOBridge instances to _stop_ubridge.
2026-10-06 00:21:09 +08:00
Mark Paronyan 306d8fbde4 refactor: remove unused imports 2026-10-03 19:43:58 +03:00
Mark Paronyan 6d16d923c7 style: sort imports in compute and controller tests 2026-10-02 12:43:26 +03:00
Mark Paronyan 06e98f8b55 style: drop redundant utf-8 coding declarations 2026-10-01 19:57:40 +03:00
Mark Paronyan a0450b6bce refactor: ruff autofixes 2026-09-27 15:55:10 +03:00
grossmj 0aa6566e50 Prevent router to be duplicated when running and add tests 2026-03-17 12:49:38 +08:00
grossmj 86c44cd6e7 Upgrade dev dependencies and fix tests to support pytest-asyncio strict mode 2022-08-24 21:03:16 +02:00
grossmj 74c675d5b0 Drop Windows support 2022-01-19 22:28:36 +10:30
grossmj 30ebae207f Use Pydantic to validate the server config file. 2021-04-12 17:02:23 +09:30
grossmj eb3cb8a41f Migration to FastAPI 2020-10-02 16:07:50 +09:30
grossmj d3ea67da24 Refactor tests
* Use pytest-aiohttp
* Use the async def / await syntax.
* Fix tests to run with Python 3.8
2020-06-16 13:59:03 +09:30
grossmj 343f223a83 Fix tests after deactivating the embedded shell for Ethernet switch. Ref #1424 #1556 2019-03-20 17:04:02 +08:00
grossmj 279b4d7b20 Fix link filters/suspend tests. 2018-03-19 18:25:56 +07:00
ziajka d9a0ec9ff3 Replace asyncio.async with ensure_future because of deprecation, Fixes: #1269 2018-01-24 11:11:53 +01:00
Dušan Dragić 5d86f06390 Rename ethernet switch arp command to mac, also rename in test 2018-01-14 17:50:21 +01:00
Julien Duponchelle 0854c04687 API for duplication a Node
Support:
* VPCS
* Dynamips router
* Ethernet switch

Ref #1065
2017-07-24 10:08:22 +02:00
Julien Duponchelle 536c708c16 Filter implementation for cloud & Nat
Fix #1111
2017-07-17 17:27:07 +02:00
Julien Duponchelle 08423eff96 Support packet filtering for VPCS
https://github.com/GNS3/gns3-gui/issues/765
2017-07-04 15:12:26 +02:00
Julien Duponchelle bcdac6c969 Fix test for ethernet switch show arp 2017-06-23 10:54:05 +02:00
Julien Duponchelle 5616ab0e9a Fake console for simple Ethernet switch
Fix #454
2017-05-31 15:13:29 +02:00
Julien Duponchelle afd46ec010 Fix random error in the dynamips test suite after previous commit 2017-01-10 12:41:14 +01:00
Julien Duponchelle 6150929a5b Support conversion to dynamips new directory layout on remote
Ref https://github.com/GNS3/gns3-gui/issues/1761
2017-01-10 12:15:31 +01:00
Julien Duponchelle ae1e027031 Raise error if using a non linked clone VM twice
Fix https://github.com/GNS3/gns3-gui/issues/1593
2016-10-24 21:39:35 +02:00
Julien Duponchelle 58d4a529d4 Rename hypervisor to compute
Fix #487
2016-04-15 17:59:59 +02:00