Lines Matching refs:header
184 static inline int dns_header_id(uint8_t *header) in dns_header_id() argument
186 return htons(UNALIGNED_GET((uint16_t *)(header))); in dns_header_id()
193 static inline int dns_unpack_header_id(uint8_t *header) in dns_unpack_header_id() argument
195 return ntohs(UNALIGNED_GET((uint16_t *)(header))); in dns_unpack_header_id()
199 static inline int dns_header_qr(uint8_t *header) in dns_header_qr() argument
201 return ((*(header + 2)) & 0x80) ? 1 : 0; in dns_header_qr()
205 static inline int dns_header_opcode(uint8_t *header) in dns_header_opcode() argument
207 return ((*(header + 2)) & 0x70) >> 1; in dns_header_opcode()
211 static inline int dns_header_aa(uint8_t *header) in dns_header_aa() argument
213 return ((*(header + 2)) & 0x04) ? 1 : 0; in dns_header_aa()
217 static inline int dns_header_tc(uint8_t *header) in dns_header_tc() argument
219 return ((*(header + 2)) & 0x02) ? 1 : 0; in dns_header_tc()
223 static inline int dns_header_rd(uint8_t *header) in dns_header_rd() argument
225 return ((*(header + 2)) & 0x01) ? 1 : 0; in dns_header_rd()
229 static inline int dns_header_ra(uint8_t *header) in dns_header_ra() argument
231 return ((*(header + 3)) & 0x80) >> 7; in dns_header_ra()
235 static inline int dns_header_z(uint8_t *header) in dns_header_z() argument
237 return ((*(header + 3)) & 0x70) >> 4; in dns_header_z()
241 static inline int dns_header_rcode(uint8_t *header) in dns_header_rcode() argument
243 return ((*(header + 3)) & 0x0F); in dns_header_rcode()
247 static inline int dns_header_qdcount(uint8_t *header) in dns_header_qdcount() argument
249 return htons(UNALIGNED_GET((uint16_t *)(header + 4))); in dns_header_qdcount()
252 static inline int dns_unpack_header_qdcount(uint8_t *header) in dns_unpack_header_qdcount() argument
254 return ntohs(UNALIGNED_GET((uint16_t *)(header + 4))); in dns_unpack_header_qdcount()
258 static inline int dns_header_ancount(uint8_t *header) in dns_header_ancount() argument
260 return htons(UNALIGNED_GET((uint16_t *)(header + 6))); in dns_header_ancount()
263 static inline int dns_unpack_header_ancount(uint8_t *header) in dns_unpack_header_ancount() argument
265 return ntohs(UNALIGNED_GET((uint16_t *)(header + 6))); in dns_unpack_header_ancount()
269 static inline int dns_header_nscount(uint8_t *header) in dns_header_nscount() argument
271 return htons(UNALIGNED_GET((uint16_t *)(header + 8))); in dns_header_nscount()
275 static inline int dns_header_arcount(uint8_t *header) in dns_header_arcount() argument
277 return htons(UNALIGNED_GET((uint16_t *)(header + 10))); in dns_header_arcount()