feat: F4.6g5 the switch and NAT tables and "Pakete verwerfen", measured against Java's
ViewersRun takes the rows of Java's viewers from the firmware: a switch's table, a home router's NAT table, each after its reset, and the frames "Pakete verwerfen" drops while it is held. The core writes a frame as Java does and resets the NAT's dynamic entries; the room sends both tables as views, drops while any client holds the button, and sends the dropped frames, begun anew with each start, with the clock their times of day are written from; the editor opens a table with a tap on a switch or home router and holds "Pakete verwerfen" in its toolbar, which now wraps on a phone. This completes F4.6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -276,6 +276,8 @@ export interface SwitchSatEntry {
|
||||
readonly macAddress: string;
|
||||
readonly portId: Id;
|
||||
readonly portLabel: string;
|
||||
/** The port's place among the switch's, from 1 (SwitchFirmware.holeSAT: "Port <n>"). */
|
||||
readonly portNumber: number;
|
||||
readonly updatedAtMilliseconds: number;
|
||||
}
|
||||
|
||||
@@ -4060,6 +4062,12 @@ export class NetworkRuntimeEngine {
|
||||
}
|
||||
}
|
||||
|
||||
/** GatewayFirmware.loescheNAT (the NAT viewer's "reset"): the dynamic entries go, the port forwarding's stay. */
|
||||
clearDynamicNatEntries(nodeId: Id): void {
|
||||
const table = this.stateValue.natTablesByNodeId.get(nodeId);
|
||||
if (table !== undefined) this.stateValue.natTablesByNodeId.set(nodeId, table.filter((entry) => entry.type === 'static'));
|
||||
}
|
||||
|
||||
/** The home router's NAT table as it stands: static entries, then the dynamic ones that have not expired. */
|
||||
natEntries(nodeId: Id): readonly NatEntry[] {
|
||||
this.expireNatEntries(nodeId);
|
||||
@@ -4729,6 +4737,7 @@ export class NetworkRuntimeEngine {
|
||||
const node = this.nodeSnapshot(nodeId);
|
||||
if (node === undefined || node.kind !== 'networkSwitch') return [];
|
||||
const labelsByPortId = new Map(node.ports.map((port) => [port.id, port.label]));
|
||||
const numbersByPortId = new Map(node.ports.map((port, index) => [port.id, index + 1]));
|
||||
const updatedAtByMac = this.stateValue.switchForwardingUpdatedAtMillisecondsByNodeId.get(nodeId) ?? new Map();
|
||||
const table = this.stateValue.switchForwardingTablesByNodeId.get(nodeId) ?? new Map<string, Id>();
|
||||
return [...table]
|
||||
@@ -4736,6 +4745,7 @@ export class NetworkRuntimeEngine {
|
||||
macAddress,
|
||||
portId,
|
||||
portLabel: labelsByPortId.get(portId) ?? '?',
|
||||
portNumber: numbersByPortId.get(portId) ?? 0,
|
||||
updatedAtMilliseconds: updatedAtByMac.get(macAddress) ?? 0,
|
||||
}))
|
||||
.sort((lhs, rhs) =>
|
||||
|
||||
Reference in New Issue
Block a user