summaryrefslogtreecommitdiff
path: root/src/server/shibari_packet_init.c
blob: a0aff97d662f09a8abb99ab3eadbb772b07ba0e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* ISC license. */

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

#include <shibari/packet.h>

void shibari_packet_init (shibari_packet *p, char *buf, uint32_t max, int istcp)
{
  p->hdr = s6dns_message_header_zero ;
  p->buf = istcp ? buf + 2 : buf ;
  p->max = istcp ? max - 2 : max ;
  p->pos = 0 ;
  p->flagtcp = !!istcp ;
}