<commit_before>/* ISC license. */

#include <skalibs/uint16.h>
#include <s6-dns/s6dns-message.h>

void s6dns_message_header_unpack (char const *s, s6dns_message_header_t *h)
{
  uint16_unpack_big(s, &h->id) ;
  h->qr = ((unsigned char *)s)[2] & 0x8000U ? 1 : 0 ;
  h->opcode = (s[2] >> 3) & 15 ;
  h->aa = s[2] & 4 ? 1 : 0 ;
  h->tc = s[2] & 2 ? 1 : 0 ;
  h->rd = s[2] & 1 ;
  h->ra = s[3] & 0x8000U ? 1 : 0 ;
  h->z = (s[3] >> 4) & 7 ;
  h->rcode = s[3] & 15 ;
  s6dns_message_counts_unpack(s+4, &h->counts) ;
}<commit_msg> bugfix: DNS reply header was incorrectly decoded.<commit_after>/* ISC license. */

#include <skalibs/uint16.h>
#include <s6-dns/s6dns-message.h>

void s6dns_message_header_unpack (char const *s, s6dns_message_header_t *h)
{
  uint16_unpack_big(s, &h->id) ;
  h->qr = ((unsigned char *)s)[2] & 0x80U ? 1 : 0 ;
  h->opcode = (s[2] >> 3) & 15 ;
  h->aa = s[2] & 4 ? 1 : 0 ;
  h->tc = s[2] & 2 ? 1 : 0 ;
  h->rd = s[2] & 1 ;
  h->ra = s[3] & 0x80U ? 1 : 0 ;
  h->z = (s[3] >> 4) & 7 ;
  h->rcode = s[3] & 15 ;
  s6dns_message_counts_unpack(s+4, &h->counts) ;
}
{'fraction_non_alphanumeric': 0.22201665124884365, 'fraction_numerical': 0.08140610545790934, 'mean_word_length': 2.9345454545454546, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3737112', 'n_tokens_mistral': 602, 'n_tokens_neox': 545, 'n_words': 115}