summaryrefslogtreecommitdiff
path: root/src/libs6dns/s6dns_message_parse_answer_a.c
blob: 152b947673a13ecab3d963f4697b76078a63b33a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* ISC license. */

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

int s6dns_message_parse_answer_a (s6dns_message_rr_t const *rr, char const *packet, unsigned int packetlen, unsigned int pos, unsigned int section, void *stuff)
{
  if ((section == 2) && (rr->rtype == S6DNS_T_A) && (rr->rdlength == 4))
  {
    stralloc *data = stuff ;
    if (!stralloc_catb(data, packet+pos, 4)) return -1 ;
  }
  (void)packetlen ;
  return 1 ;
}