diff options
Diffstat (limited to 'common/sock-any.h')
-rw-r--r-- | common/sock-any.h | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/common/sock-any.h b/common/sock-any.h index e9b57ef..7b5da34 100644 --- a/common/sock-any.h +++ b/common/sock-any.h @@ -45,24 +45,23 @@ struct sockaddr_any { - union _sockaddr_any - { - /* The header */ - struct sockaddr a; - - /* The different types */ - struct sockaddr_un un; - struct sockaddr_in in; + 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; + struct sockaddr_in6 in6; #endif - } s; - size_t namelen; + } s; + size_t namelen; }; -#define SANY_ADDR(any) ((any).s.a) -#define SANY_LEN(any) ((any).namelen) -#define SANY_TYPE(any) ((any).s.a.sa_family) +#define SANY_ADDR(any) ((any).s.a) +#define SANY_LEN(any) ((any).namelen) +#define SANY_TYPE(any) ((any).s.a.sa_family) /* -------------------------------------------------------------------------- */ @@ -70,22 +69,22 @@ struct sockaddr_any int sock_any_pton(const char* addr, struct sockaddr_any* any, int opts); /* The default port to fill in when no IP/IPv6 port specified */ -#define SANY_OPT_DEFPORT(p) (int)((p) & 0xFFFF) +#define SANY_OPT_DEFPORT(p) (int)((p) & 0xFFFF) /* When only port specified default to IPANY */ -#define SANY_OPT_DEFANY 0x00000000 +#define SANY_OPT_DEFANY 0x00000000 /* When only port specified default to LOCALHOST */ -#define SANY_OPT_DEFLOCAL 0x00100000 +#define SANY_OPT_DEFLOCAL 0x00100000 /* When only port specified default to IPv6 */ -#define SANY_OPT_DEFINET6 0x00200000 +#define SANY_OPT_DEFINET6 0x00200000 /* Don't resolve host name */ -#define SANY_OPT_NORESOLV 0x01000000 +#define SANY_OPT_NORESOLV 0x01000000 /* The family type returned when resolving is needed */ -#define SANY_AF_DNS 0x01000000 +#define SANY_AF_DNS 0x01000000 /* -------------------------------------------------------------------------- */ @@ -93,7 +92,7 @@ int sock_any_pton(const char* addr, struct sockaddr_any* any, int opts); int sock_any_ntop(const struct sockaddr_any* any, char* addr, size_t addrlen, int opts); /* Don't print or compare the port */ -#define SANY_OPT_NOPORT 0x01000000 +#define SANY_OPT_NOPORT 0x01000000 /* -------------------------------------------------------------------------- */ |