-/* $OpenBSD: rebound.c,v 1.15 2015/10/16 01:37:14 tedu Exp $ */
+/* $OpenBSD: rebound.c,v 1.16 2015/10/16 01:50:39 tedu Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
uint16_t randomid(void);
-struct timespec now;
-int debug;
+static struct timespec now;
+static int debug;
struct dnspacket {
uint16_t id;
size_t resplen;
struct timespec ts;
};
-TAILQ_HEAD(, dnscache) cache;
+static TAILQ_HEAD(, dnscache) cache;
struct request {
int s;
uint16_t reqid;
struct dnscache *cacheent;
};
-TAILQ_HEAD(, request) reqfifo;
+static TAILQ_HEAD(, request) reqfifo;
-void
+static void
logmsg(int prio, const char *msg, ...)
{
va_list ap;
va_end(ap);
}
-void __dead
+static void __dead
logerr(int prio, const char *msg, ...)
{
va_list ap;
exit(1);
}
-struct dnscache *
+static struct dnscache *
cachelookup(struct dnspacket *dnsreq, size_t reqlen)
{
struct dnscache *hit;
return hit;
}
-struct request *
+static struct request *
newrequest(int ud, struct sockaddr *remoteaddr)
{
struct sockaddr from;
return NULL;
}
-void
+static void
sendreply(int ud, struct request *req)
{
uint8_t buf[65536];
}
}
-void
+static void
freerequest(struct request *req)
{
struct dnscache *ent;
free(req);
}
-void
+static void
freecacheent(struct dnscache *ent)
{
TAILQ_REMOVE(&cache, ent, cache);
free(ent);
}
-struct request *
+static struct request *
newtcprequest(int ld, struct sockaddr *remoteaddr)
{
struct request *req;
return NULL;
}
-int
+static int
readconfig(FILE *conf, struct sockaddr_storage *remoteaddr)
{
char buf[1024];
}
}
-int
+static int
launch(const char *confname, int ud, int ld, int kq)
{
struct sockaddr_storage remoteaddr;