summaryrefslogtreecommitdiff
path: root/src/skadns
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-12 15:35:29 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-12 15:35:29 +0000
commit3f9536c5cc9ed6659ad2514859bd1716cbf7b26b (patch)
tree3f01ca46f59b9458c93ace3f07127d1e2bb460e8 /src/skadns
parent3a289d1ca8dd2bce4a8bb6549709ea62262ec786 (diff)
downloads6-dns-3f9536c5cc9ed6659ad2514859bd1716cbf7b26b.tar.xz
Types fix, first pass.
Some places marked XXX for the skalibs API change.
Diffstat (limited to 'src/skadns')
-rw-r--r--src/skadns/skadns_cancel.c3
-rw-r--r--src/skadns/skadns_end.c3
-rw-r--r--src/skadns/skadns_packet.c4
-rw-r--r--src/skadns/skadns_packetlen.c4
-rw-r--r--src/skadns/skadns_release.c4
-rw-r--r--src/skadns/skadns_send.c5
-rw-r--r--src/skadns/skadnsd.c7
7 files changed, 17 insertions, 13 deletions
diff --git a/src/skadns/skadns_cancel.c b/src/skadns/skadns_cancel.c
index 7c76797..a9673ed 100644
--- a/src/skadns/skadns_cancel.c
+++ b/src/skadns/skadns_cancel.c
@@ -5,6 +5,7 @@
#define _BSD_SOURCE
#endif
+#include <stdint.h>
#include <errno.h>
#include <skalibs/uint16.h>
#include <skalibs/error.h>
@@ -13,7 +14,7 @@
#include <skalibs/skaclient.h>
#include <s6-dns/skadns.h>
-int skadns_cancel (skadns_t *a, uint16 id, tain_t const *deadline, tain_t *stamp)
+int skadns_cancel (skadns_t *a, uint16_t id, tain_t const *deadline, tain_t *stamp)
{
char pack[3] = "--q" ;
char err ;
diff --git a/src/skadns/skadns_end.c b/src/skadns/skadns_end.c
index 6f5f01b..e6e8045 100644
--- a/src/skadns/skadns_end.c
+++ b/src/skadns/skadns_end.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <stdint.h>
#include <skalibs/alloc.h>
#include <skalibs/genalloc.h>
#include <skalibs/gensetdyn.h>
@@ -17,7 +18,7 @@ static int skadnsanswer_free (char *p, void *stuff)
void skadns_end (skadns_t *a)
{
skaclient_end(&a->connection) ;
- genalloc_free(uint16, &a->list) ;
+ genalloc_free(uint16_t, &a->list) ;
gensetdyn_iter(&a->q, &skadnsanswer_free, 0) ;
gensetdyn_free(&a->q) ;
*a = skadns_zero ;
diff --git a/src/skadns/skadns_packet.c b/src/skadns/skadns_packet.c
index c34b3a1..8ef8f1d 100644
--- a/src/skadns/skadns_packet.c
+++ b/src/skadns/skadns_packet.c
@@ -1,11 +1,11 @@
/* ISC license. */
+#include <stdint.h>
#include <errno.h>
-#include <skalibs/uint16.h>
#include <skalibs/gensetdyn.h>
#include <s6-dns/skadns.h>
-char const *skadns_packet (skadns_t const *a, uint16 id)
+char const *skadns_packet (skadns_t const *a, uint16_t id)
{
register skadnsanswer_t *p = GENSETDYN_P(skadnsanswer_t, &a->q, id) ;
switch (p->status)
diff --git a/src/skadns/skadns_packetlen.c b/src/skadns/skadns_packetlen.c
index 34cbb28..f69e43f 100644
--- a/src/skadns/skadns_packetlen.c
+++ b/src/skadns/skadns_packetlen.c
@@ -1,11 +1,11 @@
/* ISC license. */
+#include <stdint.h>
#include <errno.h>
-#include <skalibs/uint16.h>
#include <skalibs/gensetdyn.h>
#include <s6-dns/skadns.h>
-int skadns_packetlen (skadns_t const *a, uint16 id)
+int skadns_packetlen (skadns_t const *a, uint16_t id)
{
register skadnsanswer_t *p = GENSETDYN_P(skadnsanswer_t, &a->q, id) ;
switch (p->status)
diff --git a/src/skadns/skadns_release.c b/src/skadns/skadns_release.c
index 0cd4dc0..3ce2fc3 100644
--- a/src/skadns/skadns_release.c
+++ b/src/skadns/skadns_release.c
@@ -5,13 +5,13 @@
#define _BSD_SOURCE
#endif
+#include <stdint.h>
#include <errno.h>
-#include <skalibs/uint16.h>
#include <skalibs/alloc.h>
#include <skalibs/gensetdyn.h>
#include <s6-dns/skadns.h>
-int skadns_release (skadns_t *a, uint16 id)
+int skadns_release (skadns_t *a, uint16_t id)
{
register skadnsanswer_t *p = GENSETDYN_P(skadnsanswer_t, &a->q, id) ;
switch (p->status)
diff --git a/src/skadns/skadns_send.c b/src/skadns/skadns_send.c
index f8152b7..f485c92 100644
--- a/src/skadns/skadns_send.c
+++ b/src/skadns/skadns_send.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <stdint.h>
#include <errno.h>
#include <skalibs/uint16.h>
#include <skalibs/bytestr.h>
@@ -13,14 +14,14 @@
static skadnsanswer_t const skadnsanswer_initial = { .status = EAGAIN, .data = 0, .len = 0 } ;
-int skadns_send (skadns_t *a, uint16 *u, s6dns_domain_t const *d, uint16 qtype, tain_t const *limit, tain_t const *deadline, tain_t *stamp)
+int skadns_send (skadns_t *a, uint16_t *u, s6dns_domain_t const *d, uint16_t qtype, tain_t const *limit, tain_t const *deadline, tain_t *stamp)
{
unsigned int i ;
char tmp[17] = "--Q" ;
char err ;
siovec_t v[2] = { { .s = tmp, .len = 17 }, { .s = (char *)d->s, .len = d->len } } ;
if (!gensetdyn_new(&a->q, &i)) return 0 ;
- uint16_pack_big(tmp, (uint16)i) ;
+ uint16_pack_big(tmp, (uint16_t)i) ;
uint16_pack_big(tmp + 3, qtype) ;
if (limit) tain_pack(tmp + 5, limit) ; else byte_zero(tmp + 5, 12) ;
if (!skaclient_sendv(&a->connection, v, 2, &skaclient_default_cb, &err, deadline, stamp))
diff --git a/src/skadns/skadnsd.c b/src/skadns/skadnsd.c
index 11f52ea..2682ace 100644
--- a/src/skadns/skadnsd.c
+++ b/src/skadns/skadnsd.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <stdint.h>
#include <errno.h>
#include <signal.h>
#include <skalibs/uint16.h>
@@ -19,7 +20,7 @@ struct dnsio_s
{
unsigned int xindex ;
s6dns_engine_t dt ;
- uint16 id ;
+ uint16_t id ;
} ;
#define DNSIO_ZERO { .xindex = SKADNS_MAXCONCURRENCY, .dt = S6DNS_ENGINE_ZERO, .id = 0 }
@@ -55,7 +56,7 @@ static void answer (char c)
static int parse_protocol (unixmessage_t const *m, void *context)
{
- uint16 id ;
+ uint16_t id ;
if (m->len < 3 || m->nfds) strerr_dief1x(100, "invalid client request") ;
uint16_unpack_big(m->s, &id) ;
switch (m->s[2]) /* protocol parsing */
@@ -63,7 +64,7 @@ static int parse_protocol (unixmessage_t const *m, void *context)
case 'Q' : /* send a query */
{
tain_t limit ;
- uint16 qtype ;
+ uint16_t qtype ;
if (m->len < 21) strerr_dief1x(100, "invalid client request") ;
if (sp >= SKADNS_MAXCONCURRENCY)
{