Go to the latest version of this document.

# ``twisted`.`names`.`dns`.`_OPTVariableOption``

class documentation

`class _OPTVariableOption(tputil.FancyStrMixin, tputil.FancyEqMixin): (source)`

Constructor: `_OPTVariableOption(code, data)`

Implements interfaces: `twisted.names.dns.IEncodable`

View In Hierarchy

A class to represent OPT record variable options.

See Also
`_OPTVariableOption.__init__` for documentation of public instance attributes.
https://tools.ietf.org/html/rfc6891#section-6.1.2

Present Since
13.2

Method | `__init__` | No summary
Method | `decode` | Decode bytes into an `_OPTVariableOption` instance.
Method | `encode` | Encode this `_OPTVariableOption` to bytes.
Class Variable | `compareAttributes` | Undocumented
Class Variable | `showAttributes` | Undocumented
Instance Variable | `code` | Undocumented
Instance Variable | `data` | Undocumented
Class Variable | `_fmt` | Undocumented

Inherited from `FancyStrMixin`:

Method | `__str__` | Undocumented

Inherited from `FancyEqMixin` (via `FancyStrMixin`):

Method | `__eq__` | Undocumented
Method | `__ne__` | Undocumented

def __init__(self, code=0, data=b''): (source)

Parameters
code:`int` | The option code
data:`bytes` | The option data

def decode(self, strio, length=None): (source)
from `twisted.names.dns.IEncodable`

Decode bytes into an `_OPTVariableOption` instance.

Parameters
strio:file | Bytes will be read from this file until the full `_OPTVariableOption` is decoded.
length:`int` or `None` | Not used.

def encode(self, strio, compDict=None): (source)
from `twisted.names.dns.IEncodable`

Encode this `_OPTVariableOption` to bytes.

Parameters
strio:file | the byte representation of this `_OPTVariableOption` will be written to this file.
compDict:`dict` or `None` | A dictionary of backreference addresses that have already been written to this stream and that may be used for DNS name compression.

compareAttributes: `tuple[str, ...]` = (source)
overrides `twisted.python.util.FancyEqMixin.compareAttributes`

Undocumented

showAttributes = (source)
overrides `twisted.python.util.FancyStrMixin.showAttributes`

Undocumented

code = (source)

Undocumented

data = (source)

Undocumented

_fmt: `str` = (source)

Undocumented