| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,7 @@ cdef cython.uint DNS_COMPRESSION_HEADER_LEN | |||
| 6 | 6 | cdef cython.uint MAX_DNS_LABELS | |
| 7 | 7 | cdef cython.uint DNS_COMPRESSION_POINTER_LEN | |
| 8 | 8 | cdef cython.uint MAX_NAME_LENGTH | |
| 9 | + cdef cython.uint MAX_MSG_LEN | ||
| 9 | 10 | ||
| 10 | 11 | cdef cython.uint _TYPE_A | |
| 11 | 12 | cdef cython.uint _TYPE_CNAME | |
@@ -16,7 +17,6 @@ cdef cython.uint _TYPE_HINFO | |||
| 16 | 17 | cdef cython.uint _TYPE_AAAA | |
| 17 | 18 | cdef cython.uint _TYPE_NSEC | |
| 18 | 19 | cdef cython.uint _FLAGS_QR_MASK | |
| 19 | - cdef cython.uint _FLAGS_QR_MASK | ||
| 20 | 20 | cdef cython.uint _FLAGS_TC | |
| 21 | 21 | cdef cython.uint _FLAGS_QR_QUERY | |
| 22 | 22 | cdef cython.uint _FLAGS_QR_RESPONSE | |
@@ -44,10 +44,11 @@ cdef class DNSIncoming: | |||
| 44 | 44 | cdef bint _did_read_others | |
| 45 | 45 | cdef public unsigned int flags | |
| 46 | 46 | cdef cython.uint offset | |
| 47 | - cdef public bytes data | ||
| 48 | - cdef const unsigned char [:] view | ||
| 47 | + cdef readonly bytes data | ||
| 48 | + cdef const unsigned char* _buf | ||
| 49 | 49 | cdef unsigned int _data_len | |
| 50 | 50 | cdef cython.dict _name_cache | |
| 51 | + cdef cython.dict _name_str_cache | ||
| 51 | 52 | cdef cython.list _questions | |
| 52 | 53 | cdef cython.list _answers | |
| 53 | 54 | cdef public cython.uint id | |
@@ -81,30 +82,39 @@ cdef class DNSIncoming: | |||
| 81 | 82 | link="unsigned int", | |
| 82 | 83 | link_data="unsigned int", | |
| 83 | 84 | link_py_int=object, | |
| 84 | - linked_labels=cython.list | ||
| 85 | + linked_labels=cython.list, | ||
| 86 | + buf="const unsigned char *", | ||
| 85 | 87 | ) | |
| 86 | 88 | cdef unsigned int _decode_labels_at_offset(self, unsigned int off, cython.list labels, cython.set seen_pointers, unsigned int depth) | |
| 87 | 89 | ||
| 88 | - @cython.locals(offset="unsigned int") | ||
| 90 | + @cython.locals(offset="unsigned int", buf="const unsigned char *") | ||
| 89 | 91 | cdef void _read_header(self) | |
| 90 | 92 | ||
| 91 | 93 | cdef void _initial_parse(self) | |
| 92 | 94 | ||
| 93 | 95 | @cython.locals( | |
| 94 | 96 | end="unsigned int", | |
| 95 | 97 | length="unsigned int", | |
| 96 | - offset="unsigned int" | ||
| 98 | + offset="unsigned int", | ||
| 99 | + answers=cython.list, | ||
| 100 | + buf="const unsigned char *", | ||
| 97 | 101 | ) | |
| 98 | 102 | cdef void _read_others(self) | |
| 99 | 103 | ||
| 100 | - @cython.locals(offset="unsigned int", question=DNSQuestion) | ||
| 104 | + @cython.locals(offset="unsigned int", question=DNSQuestion, buf="const unsigned char *") | ||
| 101 | 105 | cdef _read_questions(self) | |
| 102 | 106 | ||
| 103 | 107 | @cython.locals( | |
| 104 | 108 | length="unsigned int", | |
| 109 | + start="unsigned int", | ||
| 110 | + end="unsigned int", | ||
| 105 | 111 | ) | |
| 106 | 112 | cdef str _read_character_string(self) | |
| 107 | 113 | ||
| 114 | + @cython.locals( | ||
| 115 | + start="unsigned int", | ||
| 116 | + end="unsigned int", | ||
| 117 | + ) | ||
| 108 | 118 | cdef bytes _read_string(self, unsigned int length) | |
| 109 | 119 | ||
| 110 | 120 | @cython.locals( | |
@@ -116,20 +126,32 @@ cdef class DNSIncoming: | |||
| 116 | 126 | srv_rec=DNSService, | |
| 117 | 127 | hinfo_rec=DNSHinfo, | |
| 118 | 128 | nsec_rec=DNSNsec, | |
| 129 | + buf="const unsigned char *", | ||
| 119 | 130 | ) | |
| 120 | 131 | cdef _read_record(self, str domain, unsigned int type_, unsigned int class_, unsigned int ttl, unsigned int length) | |
| 121 | 132 | ||
| 122 | 133 | @cython.locals( | |
| 123 | 134 | offset="unsigned int", | |
| 124 | 135 | offset_plus_one="unsigned int", | |
| 125 | 136 | offset_plus_two="unsigned int", | |
| 126 | - window="unsigned int", | ||
| 127 | 137 | bit="unsigned int", | |
| 128 | 138 | byte="unsigned int", | |
| 129 | 139 | i="unsigned int", | |
| 130 | 140 | bitmap_length="unsigned int", | |
| 131 | 141 | bitmap_end="unsigned int", | |
| 142 | + window_base="unsigned int", | ||
| 143 | + bit_base="unsigned int", | ||
| 144 | + buf="const unsigned char *", | ||
| 132 | 145 | ) | |
| 133 | 146 | cdef list _read_bitmap(self, unsigned int end) | |
| 134 | 147 | ||
| 148 | + @cython.locals( | ||
| 149 | + original_offset="unsigned int", | ||
| 150 | + length="unsigned int", | ||
| 151 | + link="unsigned int", | ||
| 152 | + is_pure_pointer=cython.bint, | ||
| 153 | + name=str, | ||
| 154 | + cached_name=str, | ||
| 155 | + name_str_cache=cython.dict, | ||
| 156 | + ) | ||
| 135 | 157 | cdef str _read_name(self) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments