NetworkInspector.Plugins 0.19.0

dotnet add package NetworkInspector.Plugins --version 0.19.0
                    
NuGet\Install-Package NetworkInspector.Plugins -Version 0.19.0
                    
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="NetworkInspector.Plugins" Version="0.19.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetworkInspector.Plugins" Version="0.19.0" />
                    
Directory.Packages.props
<PackageReference Include="NetworkInspector.Plugins" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetworkInspector.Plugins --version 0.19.0
                    
#r "nuget: NetworkInspector.Plugins, 0.19.0"
                    
#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.
#:package NetworkInspector.Plugins@0.19.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetworkInspector.Plugins&version=0.19.0
                    
Install as a Cake Addin
#tool nuget:?package=NetworkInspector.Plugins&version=0.19.0
                    
Install as a Cake Tool

NetworkInspector.Plugins

NuGet .NET 10 License: MIT

The core-tier plugin contract of NetworkInspector. A plugin is a class library with one entry class that implements IPlugin. It adds protocols, heuristic parsers, post-parsers, sources, exporters, and settings to every application that loads it, such as the ni command-line tool or your own application with NetworkInspector.Plugins.Loader. Sources and exporters are the Core types (IFrameSource, IFrameListener, IPacketListener), and options and settings are Core settings, so there is no second set of interfaces to learn.

Install

dotnet add package NetworkInspector.Plugins

The application that loads your plugin already contains this package and NetworkInspector.Core, so reference them with Private="false" in a project reference (or exclude their runtime assets in a package reference). That keeps both assemblies out of your plugin folder; a second copy next to your plugin would be ignored by the loader anyway.

Write a plugin

public sealed class MyPlugin : IPlugin
{
    public PluginInfo Info { get; } = new("My.Plugin", "1.0.0", "MIT", "My protocol on UDP 40000.", []);

    public void Configure(IPluginBuilder builder)
    {
        // Runs for every stack the application builds: create fresh protocol objects in every call.
        builder.AddStackContribution(static stack =>
        {
            MyProtocol protocol = new();
            ProtocolId id = stack.RegisterProtocol(protocol);
            protocol.RegisterFields(stack, id);
            stack.WhenProtocolTableRegistered("udp.port", table => stack.RegisterParserInU64Table(table, 40000, id));
        });
        builder.AddSettings(SettingScope.Application, static registrar =>
        {
            registrar.RegisterGroup("my", "My plugin", "Settings of My.Plugin.");
            registrar.RegisterStringSetting("my.greeting", "Greeting", "my", "Hello");
        });
    }
}

The entry class must be public, non-abstract, non-generic, have a public parameterless constructor, and list IPlugin in its own interface list (a class that only inherits the interface from a base class is not found). Build the plugin against the same or an older NetworkInspector version than the application that loads it. Register the folder with ni settings set plugins.paths <folder> --scope application and check the result with ni plugins list:

My.Plugin  1.0.0  core  Loaded  -  /opt/ni-plugins/my/My.Plugin.dll  MIT  load 6.0 ms  Protocol 1, Setting 1

From then on every ni command decodes the protocol, filters on its fields, and lists the setting in ni settings.

What the contract contains

Type Purpose
IPlugin, PluginInfo, PluginDependency entry point, name, version, license, private dependencies
IPluginBuilder declares stack contributions, settings, sources, and exporters while the plugin is configured
IPluginContext, IPluginLog what a started plugin gets: log, data folder, settings, stop signal
SourceRegistration, SourceCreate, SourceRequest a source kind that creates a Core IFrameSource
ExporterRegistration<TListener>, ExporterCreate<TListener>, ExportRequest an export format that creates a Core listener
PluginError, PluginErrorCode expected failures of registrations, returned instead of thrown

The sample plugin samples/Sample.Protocol uses every part of the contract. Read the plugin guide for the steps from project setup to distribution, the protocol chapter for writing protocols, and the contract reference for one entry per type.

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

NuGet packages (2)

Showing the top 2 NuGet packages that depend on NetworkInspector.Plugins:

Package Downloads
NetworkInspector.BuiltInPlugins

Built-in core-tier plugins: standard protocols, file and random sources, and the nine exporters on the plugin contract.

NetworkInspector.Plugins.Loader

Plugin pre-scan, scan cache, load contexts, registry, and lifecycle for NetworkInspector applications.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.19.0 44 10/29/2026