class NIDRecordValidator implements DnsRecordValidatorInterface (View source)

NID (Node Identifier) Record Validator

Validates NID records according to RFC 6742 (ILNP DNS Resource Records).

NID records are used for Node Identifier in Identifier-Locator Network Protocol (ILNP). The NID record contains a 16-bit preference value followed by a 64-bit Node Identifier value in the EUI-64 format.

Format: , the form PowerDNS reads. A bare node id takes its preference from the prio field.

  • Preference: 16-bit unsigned integer (0-65535)
  • NodeID: 64-bit value in EUI-64 format, represented as 4 groups of 4 hex digits separated by colons (xxxx:xxxx:xxxx:xxxx)

According to RFC 6742:

  • The NodeID MUST be in the modified EUI-64 format
  • The NodeID MUST NOT be in the compressed format
  • The u/l bit (universal/local bit, 7th bit of first byte) indicates if the ID is globally unique
  • The g bit (Group bit, least significant bit of first byte) MUST be 0 in ILNP

Example NID record: 10 1000:0000:0000:0001

Note: ILNP is an experimental protocol (RFC 6740) that provides identifier-locator separation to enhance multihoming capabilities.

Methods

__construct(HostnameValidator|null $hostnameValidator = null)

No description

validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)

Validate an NID record according to RFC 6742

static string
contentWithPreference(string $content, int $prio)

An older NID row kept its preference only in prio, which PowerDNS never reads.

Details

__construct(HostnameValidator|null $hostnameValidator = null)

No description

Parameters

HostnameValidator|null $hostnameValidator

ValidationResult validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)

Validate an NID record according to RFC 6742

Parameters

string $content

The content part of the record

string $name

The name part of the record

mixed $prio

The priority value (if applicable)

int|string|null $ttl

The TTL value

int $defaultTTL

The default TTL to use if not specified

mixed ...$args

Additional validator-specific parameters

Return Value

ValidationResult

ValidationResult containing validated data or error messages

static string contentWithPreference(string $content, int $prio)

An older NID row kept its preference only in prio, which PowerDNS never reads.

Returns a bare node id with that preference in front, or the content unchanged.

Parameters

string $content
int $prio

Return Value

string