Add src files

This commit is contained in:
Vibe Myass
2026-03-11 01:40:27 +00:00
parent b6617bb221
commit 05fda54da2
32 changed files with 2852 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
using System;
namespace LibNftables;
/// <summary>
/// Base exception for managed nftables failures.
/// </summary>
public class NftException : InvalidOperationException
{
/// <summary>
/// Initializes a new exception instance.
/// </summary>
/// <param name="message">Error message.</param>
/// <param name="nativeErrorCode">Native error code, when available.</param>
/// <param name="nativeErrorOutput">Native error output, when available.</param>
/// <param name="innerException">Optional inner exception.</param>
public NftException(string message, int nativeErrorCode = 0, string? nativeErrorOutput = null, Exception? innerException = null)
: base(message, innerException)
{
NativeErrorCode = nativeErrorCode;
NativeErrorOutput = nativeErrorOutput;
}
/// <summary>
/// Gets the native error code.
/// </summary>
public int NativeErrorCode { get; }
/// <summary>
/// Gets native error output text.
/// </summary>
public string? NativeErrorOutput { get; }
}