Generate byte and instance representations of an dns._OPTHeader where all attributes are set to non-default values.

For testing whether attributes have really been read from the byte string during decoding.

Class Method bytes Return bytes representing an encoded OPT record.
Class Method object Return a new dns._OPTHeader instance.
@classmethod
def bytes(cls, excludeName=False, excludeOptions=False):

Return bytes representing an encoded OPT record.

ParametersexcludeNameA flag that controls whether to exclude the name field. This allows a non-standard name to be prepended during the test. (type: bool)
excludeOptionsA flag that controls whether to exclude the RDLEN field. This allows encoded variable options to be appended during the test. (type: bool)
Returnsbytes representing the encoded OPT record returned by object.
@classmethod
def object(cls):

Return a new dns._OPTHeader instance.

ReturnsA dns._OPTHeader instance with attributes that match the encoded record returned by bytes.
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.