summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorvenaas <venaas>2008-09-17 12:03:44 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-09-17 12:03:44 +0000
commit04e007ddc3e3669458f094436989237d488942d2 (patch)
treeba1e83aa57742df0e183f96ee242560a21f2c17f /util.h
parent9565d5287c057a4ec08708ad893ea558b78917fa (diff)
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
Diffstat (limited to 'util.h')
-rw-r--r--util.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/util.h b/util.h
index 936c2de..8b37210 100644
--- a/util.h
+++ b/util.h
@@ -1,8 +1,17 @@
#include <sys/socket.h>
#include <netdb.h>
+#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);