fixed bug in attaching nics to hosts, changed documentation format and generator (buggy but usable)

This commit is contained in:
2025-09-14 00:40:53 -04:00
parent 9ab64e18a4
commit c4141cd683
40 changed files with 5223 additions and 577 deletions

View File

@@ -1,10 +1,32 @@
# core/host.h
## `Host::Host`
`Host(Simulator *const sim, NodeId id) noexcept`
## class NetworkNic — public interface
Binds a host to a simulator under the `NodeId` id.
### `Host(Simulator *const sim, NodeId id) noexcept;`
### `virtual ~Host() = default;`
### `NetworkNic *nic() const noexcept { ... }`
### `void attach_nic(NetworkNic* nic) noexcept;`
### `void detach_nic(NetworkNic* nic) noexcept;`
### `Host(const Host &) = delete;`
## `Host::Host`
`Host(const Host &) = delete`
Binds a host to a simulator under the `NodeId` id.
## `Host::attach_nic`
`void attach_nic(NetworkNic *nic) noexcept`
Attaches a `NetworkNic` to the host.
## `Host::detach_nic`
`void detach_nic(NetworkNic *nic) noexcept`
Detaches a `NetworkNic` to the host.
## `Host::nic`
`NetworkNic *nic() const noexcept`
## `Host::operator=`
`Host &operator=(const Host &) = delete`
## `Host::recv_flow`
`virtual void recv_flow(NodeId src, FlowId flow, FlowPriority priority, Bytes flow_size) = 0`
## `Host::recv_frame`
`virtual void recv_frame(const Packet &frame) = 0`
## `Host::recv_mgmt_msg`
`virtual void recv_mgmt_msg(std::unique_ptr<struct MgmtMsg> msg) = 0`
## `Host::~Host`
`virtual ~Host() = default`