From 04e007ddc3e3669458f094436989237d488942d2 Mon Sep 17 00:00:00 2001 From: venaas Date: Wed, 17 Sep 2008 12:03:44 +0000 Subject: better logging. not requiring server configs to run git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@388 e88ac4ed-0b26-0410-9574-a7f39faa03bf --- util.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'util.h') diff --git a/util.h b/util.h index 936c2de..8b37210 100644 --- a/util.h +++ b/util.h @@ -1,8 +1,17 @@ #include #include +#define SOCKADDR_SIZE(addr) ((addr).ss_family == AF_INET ? \ + sizeof(struct sockaddr_in) : \ + sizeof(struct sockaddr_in6)) + +#define SOCKADDRP_SIZE(addr) ((addr)->sa_family == AF_INET ? \ + sizeof(struct sockaddr_in) : \ + sizeof(struct sockaddr_in6)) + char *stringcopy(const char *s, int len); -char *addr2string(struct sockaddr *addr, socklen_t len); +char *addr2string(struct sockaddr *addr); +struct sockaddr *addr_copy(struct sockaddr *in); uint16_t port_get(struct sockaddr *sa); void port_set(struct sockaddr *sa, uint16_t port); -- cgit v1.1