diff options
author | venaas <venaas> | 2008-09-17 12:02:22 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-09-17 12:02:22 +0000 |
commit | 403fafa13e85fa0e647b81313341cdb7d7aed68e (patch) | |
tree | ace8e26f2d6a4a81065a22c96176a71295d97ee1 /util.h | |
parent | 1e46e5030af79fae82a15a4d25f5e09d5a092719 (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.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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); |