summaryrefslogtreecommitdiff
path: root/src/conn-tools/s6-tcpserver6d.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-01-10 02:17:16 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-01-10 02:17:16 +0000
commit334d807b924427434b42d4fbae745d3d1b38a218 (patch)
tree6daf12c1e2fa07d2ac6255ef4439e2fb95a57f57 /src/conn-tools/s6-tcpserver6d.c
parent43cb3ee4227de70e0225e9ac142b4d397f93cc41 (diff)
downloads6-networking-334d807b924427434b42d4fbae745d3d1b38a218.tar.xz
Types fix, first pass
XXX marks what must change when skalibs changes. Also started writing functions for client certificate support in sbearssl, but it's not working yet (need more high-level support from BearSSL before it can work)
Diffstat (limited to 'src/conn-tools/s6-tcpserver6d.c')
-rw-r--r--src/conn-tools/s6-tcpserver6d.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/conn-tools/s6-tcpserver6d.c b/src/conn-tools/s6-tcpserver6d.c
index 3e535c5..5079d2e 100644
--- a/src/conn-tools/s6-tcpserver6d.c
+++ b/src/conn-tools/s6-tcpserver6d.c
@@ -1,6 +1,7 @@
/* ISC license. */
#include <sys/types.h>
+#include <stdint.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <errno.h>
@@ -96,7 +97,7 @@ static void log_status (void)
strerr_warni3x("status: ", fmt, fmtmaxconn) ;
}
-static void log_deny (char const *ip, uint16 port, unsigned int num)
+static void log_deny (char const *ip, uint16_t port, unsigned int num)
{
char fmtip[IP6_FMT] ;
char fmtport[UINT16_FMT] ;
@@ -107,12 +108,12 @@ static void log_deny (char const *ip, uint16 port, unsigned int num)
strerr_warni7sys("deny ", fmtip, " port ", fmtport, " count ", fmtnum, fmtlocalmaxconn) ;
}
-static void log_accept (unsigned int pid, char const *ip, uint16 port, unsigned int num)
+static void log_accept (unsigned int pid, char const *ip, uint16_t port, unsigned int num)
{
char fmtipport[IP6_FMT + UINT16_FMT + 6] ;
char fmtpid[UINT_FMT] ;
char fmtnum[UINT_FMT] ;
- register unsigned int n ;
+ register size_t n ;
n = ip6_fmt(fmtipport, ip) ;
byte_copy(fmtipport + n, 6, " port ") ; n += 6 ;
n += uint16_fmt(fmtipport + n, port) ;
@@ -216,11 +217,11 @@ static void handle_signals (void)
/* New connection handling */
-static void run_child (int, char const *, uint16, unsigned int, char const *const *, char const *const *) gccattr_noreturn ;
-static void run_child (int s, char const *ip, uint16 port, unsigned int num, char const *const *argv, char const *const *envp)
+static void run_child (int, char const *, uint16_t, unsigned int, char const *const *, char const *const *) gccattr_noreturn ;
+static void run_child (int s, char const *ip, uint16_t port, unsigned int num, char const *const *argv, char const *const *envp)
{
char fmt[98] ;
- unsigned int n = 0 ;
+ size_t n = 0 ;
PROG = "s6-tcpserver6 (child)" ;
if ((fd_move(0, s) < 0) || (fd_copy(1, 0) < 0))
strerr_diefu1sys(111, "move fds") ;
@@ -234,7 +235,7 @@ static void run_child (int s, char const *ip, uint16 port, unsigned int num, cha
strerr_dieexec(111, argv[0]) ;
}
-static void new_connection (int s, char const *ip, uint16 port, char const *const *argv, char const *const *envp)
+static void new_connection (int s, char const *ip, uint16_t port, char const *const *argv, char const *const *envp)
{
unsigned int i = lookup_ip(ip) ;
unsigned int num = (i < iplen) ? ipnum[i].num : 0 ;
@@ -353,7 +354,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (x[1].revents & IOPAUSE_READ)
{
char ip[16] ;
- uint16 port ;
+ uint16_t port ;
register int fd = socket_accept6(x[1].fd, ip, &port) ;
if (fd < 0)
{