Expand typed firewall and map API
This commit is contained in:
49
src/LibNftables/NftMap.cs
Normal file
49
src/LibNftables/NftMap.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
namespace LibNftables;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a typed nftables map definition backed by native C# collections.
|
||||
/// </summary>
|
||||
public sealed class NftMap
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the map name.
|
||||
/// </summary>
|
||||
public string? Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a common typed key type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Set either <see cref="KeyType"/> or <see cref="CustomKeyTypeExpression"/>.
|
||||
/// </remarks>
|
||||
public NftMapType? KeyType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a custom nftables key-type expression for the map.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Set either <see cref="KeyType"/> or <see cref="CustomKeyTypeExpression"/>.
|
||||
/// </remarks>
|
||||
public string? CustomKeyTypeExpression { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a common typed value type.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Set either <see cref="ValueType"/> or <see cref="CustomValueTypeExpression"/>.
|
||||
/// </remarks>
|
||||
public NftMapType? ValueType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a custom nftables value-type expression for the map.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Set either <see cref="ValueType"/> or <see cref="CustomValueTypeExpression"/>.
|
||||
/// </remarks>
|
||||
public string? CustomValueTypeExpression { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the entries declared inline with the map definition.
|
||||
/// </summary>
|
||||
public IList<NftMapEntry> Entries { get; } = new List<NftMapEntry>();
|
||||
}
|
||||
Reference in New Issue
Block a user