summaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorvenaas <venaas>2008-09-17 12:02:22 +0000
committervenaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf>2008-09-17 12:02:22 +0000
commit403fafa13e85fa0e647b81313341cdb7d7aed68e (patch)
treeace8e26f2d6a4a81065a22c96176a71295d97ee1 /util.h
parent1e46e5030af79fae82a15a4d25f5e09d5a092719 (diff)
better logging, fixed bug with crash when removing client
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@387 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'util.h')
-rw-r--r--util.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/util.h b/util.h
index 732902e..3280379 100644
--- a/util.h
+++ b/util.h
@@ -1,8 +1,16 @@
#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);
int addr_equal(struct sockaddr *a, struct sockaddr *b);
struct sockaddr *addr_copy(struct sockaddr *in);
uint16_t port_get(struct sockaddr *sa);