DoxigAlpha

statistics

Resets or collects the statistics on a network interface.

Function parameters

Parameters

#
self:*SimpleNetwork
reset_flag:bool

Type definitions in this namespace

Types

#

Source

Implementation

#
pub fn statistics(self: *SimpleNetwork, reset_flag: bool) StatisticsError!Statistics {
    var stats: Statistics = undefined;
    var stats_size: usize = @sizeOf(Statistics);
    switch (self._statistics(self, reset_flag, &stats_size, &stats)) {
        .success => {},
        .not_started => return Error.NotStarted,
        .invalid_parameter => return Error.InvalidParameter,
        .device_error => return Error.DeviceError,
        .unsupported => return Error.Unsupported,
        else => |status| return uefi.unexpectedStatus(status),
    }

    if (stats_size != @sizeOf(Statistics))
        return error.Unexpected
    else
        return stats;
}