- def generate_rrs(self, owner: str, zone: 'Zone') -> Iterator:
- if self._address is not None:
- for rr in self._address.generate_rrs(owner, zone):
- yield rr
- # TODO
+ def generate_rr(self, owner: str, zone: 'Zone') -> Any:
+ return zone.RR('_{0}._{1}.{2}'.format(self._service, self._protocol, owner), 'SRV',
+ '{0} {1} {2} {3}'.format(self._priority, self._weight, self._port, zone.abs_hostname(self._name)))
+
+
+class TLSA:
+ def __init__(self, protocol: str, port: int, key: str) -> None:
+ # TODO: fix key stuff
+ self._port = int(port)
+ self._protocol = str(protocol)
+ self._key = str(key)
+
+ def generate_rr(self, owner: str, zone: 'Zone') -> Any:
+ return zone.RR('_{0}._{1}.{2}'.format(self._port, self._protocol, owner), 'TLSA', self._key)