@@ -15,8 +15,11 @@ cdef cython.uint _FLAGS_TC
1515cdef cython.uint _MAX_MSG_ABSOLUTE
1616cdef cython.uint _MAX_MSG_TYPICAL
1717
18+
1819cdef bint TYPE_CHECKING
1920
21+ cdef unsigned int SHORT_CACHE_MAX
22+
2023cdef object PACK_BYTE
2124cdef object PACK_SHORT
2225cdef object PACK_LONG
@@ -28,6 +31,7 @@ cdef object LOGGING_IS_ENABLED_FOR
2831cdef object LOGGING_DEBUG
2932
3033cdef cython.tuple BYTE_TABLE
34+ cdef cython.tuple SHORT_LOOKUP
3135
3236cdef class DNSOutgoing:
3337
@@ -46,13 +50,15 @@ cdef class DNSOutgoing:
4650 cdef public cython.list authorities
4751 cdef public cython.list additionals
4852
49- cdef _reset_for_next_packet(self )
53+ cpdef _reset_for_next_packet(self )
5054
51- cdef _write_byte(self , object value)
55+ cdef _write_byte(self , cython.uint value)
5256
53- cdef _insert_short_at_start(self , object value)
57+ cdef void _insert_short_at_start(self , unsigned int value)
5458
55- cdef _replace_short(self , object index, object value)
59+ cdef _replace_short(self , cython.uint index, cython.uint value)
60+
61+ cdef _get_short(self , cython.uint value)
5662
5763 cdef _write_int(self , object value)
5864
@@ -61,24 +67,29 @@ cdef class DNSOutgoing:
6167 @ cython.locals (
6268 d = cython.bytes,
6369 data_view = cython.list,
70+ index = cython.uint,
6471 length = cython.uint
6572 )
6673 cdef cython.bint _write_record(self , DNSRecord record, object now)
6774
75+ @ cython.locals (class_ = cython.uint)
6876 cdef _write_record_class(self , DNSEntry record)
6977
7078 @ cython.locals (
7179 start_size_int = object
7280 )
7381 cdef cython.bint _check_data_limit_or_rollback(self , cython.uint start_data_length, cython.uint start_size)
7482
75- cdef _write_questions_from_offset(self , object questions_offset)
83+ @ cython.locals (questions_written = cython.uint)
84+ cdef cython.uint _write_questions_from_offset(self , unsigned int questions_offset)
7685
77- cdef _write_answers_from_offset(self , object answer_offset)
86+ @ cython.locals (answers_written = cython.uint)
87+ cdef cython.uint _write_answers_from_offset(self , unsigned int answer_offset)
7888
79- cdef _write_records_from_offset(self , cython.list records, object offset)
89+ @ cython.locals (records_written = cython.uint)
90+ cdef cython.uint _write_records_from_offset(self , cython.list records, unsigned int offset)
8091
81- cdef _has_more_to_add(self , object questions_offset, object answer_offset, object authority_offset, object additional_offset)
92+ cdef bint _has_more_to_add(self , unsigned int questions_offset, unsigned int answer_offset, unsigned int authority_offset, unsigned int additional_offset)
8293
8394 cdef _write_ttl(self , DNSRecord record, object now)
8495
@@ -93,23 +104,25 @@ cdef class DNSOutgoing:
93104
94105 cdef _write_link_to_name(self , unsigned int index)
95106
96- cpdef write_short(self , object value)
107+ cpdef write_short(self , cython.uint value)
97108
98109 cpdef write_string(self , cython.bytes value)
99110
111+ @ cython.locals (utfstr = bytes)
100112 cpdef _write_utf(self , cython.str value)
101113
102114 @ cython.locals (
103115 debug_enable = bint,
104116 made_progress = bint,
105- questions_offset = object ,
106- answer_offset = object ,
107- authority_offset = object ,
108- additional_offset = object ,
109- questions_written = object ,
110- answers_written = object ,
111- authorities_written = object ,
112- additionals_written = object ,
117+ has_more_to_add = bint,
118+ questions_offset = " unsigned int" ,
119+ answer_offset = " unsigned int" ,
120+ authority_offset = " unsigned int" ,
121+ additional_offset = " unsigned int" ,
122+ questions_written = " unsigned int" ,
123+ answers_written = " unsigned int" ,
124+ authorities_written = " unsigned int" ,
125+ additionals_written = " unsigned int" ,
113126 )
114127 cpdef packets(self )
115128
0 commit comments