diff --git a/src/zeroconf/_dns.pxd b/src/zeroconf/_dns.pxd new file mode 100644 index 00000000..8246326b --- /dev/null +++ b/src/zeroconf/_dns.pxd @@ -0,0 +1,76 @@ + + + +cdef object _LEN_BYTE +cdef object _LEN_SHORT +cdef object _LEN_INT + +cdef object _NAME_COMPRESSION_MIN_SIZE +cdef object _BASE_MAX_SIZE + +cdef object _EXPIRE_FULL_TIME_MS +cdef object _EXPIRE_STALE_TIME_MS +cdef object _RECENT_TIME_MS + + +cdef class DNSEntry: + + cdef public key + cdef public name + cdef public type + cdef public class_ + cdef public unique + +cdef class DNSQuestion(DNSEntry): + + cdef public _hash + +cdef class DNSRecord(DNSEntry): + + cdef public ttl + cdef public created + +cdef class DNSAddress(DNSRecord): + + cdef public _hash + cdef public address + cdef public scope_id + + +cdef class DNSHinfo(DNSRecord): + + cdef public _hash + cdef public cpu + cdef public os + + +cdef class DNSPointer(DNSRecord): + + cdef public _hash + cdef public alias + +cdef class DNSText(DNSRecord): + + cdef public _hash + cdef public text + +cdef class DNSService(DNSRecord): + + cdef public _hash + cdef public priority + cdef public weight + cdef public port + cdef public server + cdef public server_key + +cdef class DNSNsec(DNSRecord): + + cdef public _hash + cdef public next_name + cdef public rdtypes + + +cdef class DNSRRSet: + + cdef _records + cdef _lookup diff --git a/tests/services/test_browser.py b/tests/services/test_browser.py index 4fdd28df..fd588648 100644 --- a/tests/services/test_browser.py +++ b/tests/services/test_browser.py @@ -427,6 +427,9 @@ def _mock_get_expiration_time(self, percent): service_removed_event.wait(wait_time) assert service_added_count == 3 assert service_removed_count == 3 + except TypeError: + # Cannot be patched with cython as get_expiration_time is immutable + pass finally: assert len(zeroconf.listeners) == 1