Go to the latest version of this document.

# ``twisted`.`names`.`dns`.`Record_NAPTR``

class documentation

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

Constructor: `Record_NAPTR(order, preference, flags, service, ...)`

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

View In Hierarchy

The location of the server(s) for a specific protocol and domain.

See Also
http://www.faqs.org/rfcs/rfc2915.html

Method | `__hash__` | Undocumented
Method | `__init__` | No summary
Method | `decode` | Reconstruct an object from data read from the given file object.
Method | `encode` | Write a representation of this object to the given file object.
Class Variable | `compareAttributes` | Undocumented
Class Variable | `fancybasename` | Undocumented
Class Variable | `showAttributes` | Undocumented
Instance Variable | `flag` | A <character-string> containing flags to control aspects of the rewriting and interpretation of the fields in the record. Flags are single characters from the set [A-Z0-9]. The case of the alphabetic characters is not significant.
Instance Variable | `flags` | Undocumented
Instance Variable | `order` | An integer specifying the order in which the NAPTR records MUST be processed to ensure the correct ordering of rules. Low numbers are processed before high numbers.
Instance Variable | `preference` | An integer that specifies the order in which NAPTR records with equal "order" values SHOULD be processed, low numbers being processed before high numbers.
Instance Variable | `regexp` | A STRING containing a substitution expression that is applied to the original string held by the client in order to construct the next domain name to lookup.
Instance Variable | `replacement` | The next NAME to query for NAPTR, SRV, or address records depending on the value of the flags field. This MUST be a fully qualified domain-name.
Instance Variable | `service` | Specifies the service(s) available down this rewrite path. It may also specify the particular protocol that is used to talk with a service. A protocol MUST be specified if the flags field states that the NAPTR is terminal.
Instance Variable | `ttl` | The maximum number of seconds which this record should be cached.

Inherited from `FancyEqMixin`:

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

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

Method | `__str__` | Undocumented

def __hash__(self): (source)

Undocumented

def __init__(self, order=0, preference=0, flags=b'', service=b'', regexp=b'', replacement=b'', ttl=None): (source)

Parameters
order | Undocumented
preference | Undocumented
flags | Undocumented
service | Undocumented
regexp | Undocumented
replacement:`bytes` or `str` | See `Record_NAPTR.replacement`
ttl | Undocumented

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

Reconstruct an object from data read from the given file object.

Parameters
strio:File-like object | A seekable buffer from which bytes may be read.
length:`int` or `None` | The number of bytes in this RDATA field. Most implementations can ignore this value. Only in the case of records similar to TXT where the total length is in no way encoded in the data is it necessary.

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

Write a representation of this object to the given file object.

Parameters
strio:File-like object | The buffer to write to. It must have a `tell()` method.
compDict:`dict` of `bytes` to `int` r `None` | A mapping of names to byte offsets that have already been written to the buffer, which may be used for compression (see RFC 1035 section 4.1.4). When `None`, encode without compression.

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

Undocumented

fancybasename: `str` = (source)

Undocumented

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

Undocumented

flag: `Charstr` = (source)

A <character-string> containing flags to control aspects of the rewriting and interpretation of the fields in the record. Flags are single characters from the set [A-Z0-9]. The case of the alphabetic characters is not significant.

At this time only four flags, "S", "A", "U", and "P", are defined.

flags = (source)

Undocumented

order: `int` = (source)

An integer specifying the order in which the NAPTR records MUST be processed to ensure the correct ordering of rules. Low numbers are processed before high numbers.

preference: `int` = (source)

An integer that specifies the order in which NAPTR records with equal "order" values SHOULD be processed, low numbers being processed before high numbers.

regexp: `Charstr` = (source)

A STRING containing a substitution expression that is applied to the original string held by the client in order to construct the next domain name to lookup.

replacement: `Name` = (source)

The next NAME to query for NAPTR, SRV, or address records depending on the value of the flags field. This MUST be a fully qualified domain-name.

service: `Charstr` = (source)

Specifies the service(s) available down this rewrite path. It may also specify the particular protocol that is used to talk with a service. A protocol MUST be specified if the flags field states that the NAPTR is terminal.

ttl: `int` = (source)

The maximum number of seconds which this record should be cached.