MCPcopy Create free account
hub / github.com/rthalley/dnspython / classify

Method classify

dns/node.py:291–310  ·  view source on GitHub ↗

Classify a node. A node which contains a CNAME or RRSIG(CNAME) is a ``NodeKind.CNAME`` node. A node which contains only "neutral" types, i.e. types allowed to co-exist with a CNAME, is a ``NodeKind.NEUTRAL`` node. The neutral types are NSEC, NSEC3, KEY, and

(self)

Source from the content-addressed store, hash-verified

289 self._append_rdataset(replacement)
290
291 def classify(self) -> NodeKind:
292 """Classify a node.
293
294 A node which contains a CNAME or RRSIG(CNAME) is a
295 ``NodeKind.CNAME`` node.
296
297 A node which contains only "neutral" types, i.e. types allowed to
298 co-exist with a CNAME, is a ``NodeKind.NEUTRAL`` node. The neutral
299 types are NSEC, NSEC3, KEY, and their associated RRSIGS. An empty node
300 is also considered neutral.
301
302 A node which contains some rdataset which is not a CNAME, RRSIG(CNAME),
303 or a neutral type is a a ``NodeKind.REGULAR`` node. Regular nodes are
304 also commonly referred to as "other data".
305 """
306 for rdataset in self.rdatasets:
307 kind = NodeKind.classify(rdataset.rdtype, rdataset.covers)
308 if kind != NodeKind.NEUTRAL:
309 return kind
310 return NodeKind.NEUTRAL
311
312 def is_immutable(self) -> bool:
313 return False

Callers 2

classify_rdatasetMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected