Netlink: Add stats support (#308)

Adds support for grabbing stats for an iface. This will be surfaced in a
coming change to get container level statistics from the guest, where
one field will be network stats.
This commit is contained in:
Danny Canter
2025-10-03 12:53:35 -07:00
committed by GitHub
parent f9ae8f7801
commit 80e2813bcf
9 changed files with 673 additions and 3 deletions
@@ -68,6 +68,7 @@ public protocol VirtualMachineAgent: Sendable {
func routeAddDefault(name: String, gateway: String) async throws
func configureDNS(config: DNS, location: String) async throws
func configureHosts(config: Hosts, location: String) async throws
func interfaceStatistics(name: String) async throws -> InterfaceStatistics
}
extension VirtualMachineAgent {
@@ -82,4 +83,8 @@ extension VirtualMachineAgent {
public func writeFile(path: String, data: Data, flags: WriteFileFlags, mode: UInt32) async throws {
throw ContainerizationError(.unsupported, message: "writeFile")
}
public func interfaceStatistics(name: String) async throws -> InterfaceStatistics {
throw ContainerizationError(.unsupported, message: "interfaceStatistics")
}
}