LibSmi.Net 0.2.1-dev

This is a prerelease version of LibSmi.Net.
dotnet add package LibSmi.Net --version 0.2.1-dev
NuGet\Install-Package LibSmi.Net -Version 0.2.1-dev
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="LibSmi.Net" Version="0.2.1-dev" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add LibSmi.Net --version 0.2.1-dev
#r "nuget: LibSmi.Net, 0.2.1-dev"
#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 LibSmi.Net as a Cake Addin
#addin nuget:?package=LibSmi.Net&version=0.2.1-dev&prerelease

// Install LibSmi.Net as a Cake Tool
#tool nuget:?package=LibSmi.Net&version=0.2.1-dev&prerelease

LibSmi.Net

.NET wrapper for libsmi

NuGet packages

alternate text is missing from this package README image alternate text is missing from this package README image

Examples

using LibSmi.Net;

Smi.Initialize("hello-world");

const string INDENT = "  ";

try
{
    // if SMIPATH env var is not set 
    // the mibs path must be manually set
    // Smi.SetPath("path/to/mibs/dir")
    
    // retrieve the module object
    var module = Smi.GetModule("SNMPV2-SMI");
    
    // get the 'org' node
    var node = module.GetNode("org");
    
    // alternatively module.GetFirstNode could
    // have been used to retrieve the first node
    // var node = module.GetFirstNode();

    var baseLevel = (int) node.OidLen;
    var level = 0;
    
    // traverse the subtree in lexicographic order
    while (node != null)
    {
        level = (int)node.OidLen - baseLevel;

        var indent = level > 0 
            ? Enumerable.Repeat(INDENT, level).Aggregate((a,b) => a + b)
            : string.Empty;

        Console.WriteLine($"{indent}{node.Name} ({node.ToOidString()})");

        node = node.GetNextNode();
    }
}
finally
{
    Smi.Cleanup();
}

Output

org (.1.3)
  dod (.1.3.6)
    internet (.1.3.6.1)
      directory (.1.3.6.1.1)
      mgmt (.1.3.6.1.2)
        mib-2 (.1.3.6.1.2.1)
          transmission (.1.3.6.1.2.1.10)
      experimental (.1.3.6.1.3)
      private (.1.3.6.1.4)
        enterprises (.1.3.6.1.4.1)
      security (.1.3.6.1.5)
      snmpV2 (.1.3.6.1.6)
        snmpDomains (.1.3.6.1.6.1)
        snmpProxys (.1.3.6.1.6.2)
        snmpModules (.1.3.6.1.6.3)
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.
  • net6.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on LibSmi.Net:

Package Downloads
LibSmi.Net.Helpers

Helper classes for LibSmi.Net

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.1-dev 97 12/8/2022
0.2.0-dev 84 12/6/2022