PixelByProxy.Asus.Router 1.0.42

dotnet add package PixelByProxy.Asus.Router --version 1.0.42
NuGet\Install-Package PixelByProxy.Asus.Router -Version 1.0.42
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PixelByProxy.Asus.Router" Version="1.0.42" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PixelByProxy.Asus.Router --version 1.0.42
#r "nuget: PixelByProxy.Asus.Router, 1.0.42"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PixelByProxy.Asus.Router as a Cake Addin
#addin nuget:?package=PixelByProxy.Asus.Router&version=1.0.42

// Install PixelByProxy.Asus.Router as a Cake Tool
#tool nuget:?package=PixelByProxy.Asus.Router&version=1.0.42

AsusRouterTools

A class to access functionality from your Asus router.

Usage

var config = new AsusConfiguration
{
    HostName = "router.asus.com",
    UserName = userName,
    Password = password
};

var httpClient = new HttpClient();
var asusService = new AsusService(config, httpClient);
var firewallService = new FirewallService(config, httpClient);

var clients = await asusService.GetClientsAsync();
Console.WriteLine($"Clients: {clients.Count}");

var firewallSettings = await firewallService.GetFirewallSettingsAsync();
Console.WriteLine($"Firewall Enabled: {firewallSettings.Enabled}");

Write Access

Note that the write methods will throw an exception unless you set EnableWrite on the AsusConfiguration to true. Write access is currently experiemental, use at your own risk.

AsusService Methods

GetTokenAsync            - Gets the authentication token.
GetUptimeAsync           - Gets the uptime and time of last boot.
GetMemoryUsageAsync      - Gets memory usage statistics.
GetCpuUsageAsync         - Gets CPU usage statistics.
GetClientsAsync          - Gets info for all of the connected clients.
GetTrafficAsync          - Gets the current and total network usage.
GetWanStatusAsync        - Gets WAN status information.
GetRouterSettingsAsync   - Gets various router settings.
GetLanStatusAsync        - Gets LAN status information.
GetDhcpLeaseMacListAsync - Gets a list of DHCP leases given out.
GetWebHistory            - Gets the web history for the clients, note this requires QoS to be enabled.

FirewallService Methods

GetFirewallSettingsAsync - Gets the current firewall settings.
SetFirewallSettingsAsync - Set the firewall settings to the defined values.

Testing

Last tested on an ASUS RT-AX86U with firmware version 3.0.0.4.388_22068.

Credits

This work is based on the AsusRouterMonitor python library by Leo van der Meulen re-written in C#.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.42 589 1/8/2023
1.0.36 774 12/7/2022
1.0.33 382 9/1/2022
1.0.30 388 6/30/2022