diff options
author | Stef Walter <stef@memberwebs.com> | 2004-04-28 20:59:48 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2004-04-28 20:59:48 +0000 |
commit | dbbf162dc9be0aef47f2d1f1fcddb7ae4e074d47 (patch) | |
tree | c06b131bc9f249557d9891d07977c4f0f3d0f15b /common/sock_any.h | |
parent | 8368de7830f336533f9fe6369641070239bf739c (diff) |
Tons of fixes, debugging, changes, added apache module
Diffstat (limited to 'common/sock_any.h')
-rw-r--r-- | common/sock_any.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/common/sock_any.h b/common/sock_any.h new file mode 100644 index 0000000..f281020 --- /dev/null +++ b/common/sock_any.h @@ -0,0 +1,32 @@ + +#ifndef __SOCK_ANY_H__ +#define __SOCK_ANY_H__ + +#include <sys/socket.h> +#include <sys/un.h> +#include <netinet/in.h> + +struct sockaddr_any +{ + size_t namelen; + union _sockaddr_any + { + /* The header */ + struct sockaddr a; + + /* The different types */ + struct sockaddr_un un; + struct sockaddr_in in; +#ifdef HAVE_INET6 + struct sockaddr_in6 in6; +#endif + } s; +}; + +#define SANY_ADDR(any) (&((any).s.a)) +#define SANY_LEN(any) ((any).namelen) +#define SANY_TYPE(any) ((any).s.a.sa_family) + +int sock_any_pton(const char* addr, struct sockaddr_any* any, int defport); + +#endif /* __SOCK_ANY_H__ */ |