@gibme/dns
    Preparing search index...

    Class RClassInternal

    Handles encoding and decoding of DNS resource record classes, including the mDNS flush/QU bit in the high bit of the class field.

    Index

    Constructors

    • Constructs a new Resource Record Class

      Parameters

      • nameOrId: number | RCLASS

        the class name or numeric ID

      • OptionalflushOrQu: boolean

        optional override for the flush/QU bit

      Returns RClass

    Properties

    flushOrQu: boolean

    The mDNS flush bit (answers) or QU bit (questions)

    id: number

    The numeric class identifier

    name: RCLASS

    The string name of the class (e.g. IN, CH)

    ID_TO_NAME: Map<number, RCLASS> = ...

    Maps numeric class IDs to their string names

    NAME_TO_ID: Map<RCLASS, number> = ...

    Maps string class names to their numeric IDs

    Accessors

    • get buffer(): Buffer

      Returns the class as a 2-byte big-endian Buffer, with flush/QU bit injected

      Returns Buffer

    Methods

    • Returns the class name as a string

      Returns string

    • Decodes a Resource Record Class from the byte stream

      Parameters

      • buffer: Reader | Buffer<ArrayBufferLike>

        the byte stream or raw buffer

      Returns RClass

    • Converts a numeric class ID to its name

      Parameters

      • type: number

        the numeric class ID

      Returns RCLASS

    • Injects the flush/QU bit into a class ID to produce the raw 16-bit value

      Parameters

      • type: number

        the base class ID

      • flushOrQu: boolean

        whether to set the high bit

      Returns number

    • Converts a class name to its numeric ID

      Parameters

      Returns number

    • Extracts the flush/QU bit and base class ID from a raw 16-bit class value

      Parameters

      • type: number

        the raw 16-bit class field value

      Returns { flushOrQu: boolean; qClass: number }