Files
libnftables-dotnet/src/LibNftables/NftMap.cs
2026-03-16 04:07:08 +00:00

50 lines
1.5 KiB
C#

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>();
}