Commit b25a2dfd authored by Pekka Pessi's avatar Pekka Pessi

Declaring sockaddr_storage in su.h if it is not provided in environment.

darcs-hash:20051130222405-65a35-4fe81116d78ab931703bc99c152a9f612a477506.gz
parent fcb99696
......@@ -146,6 +146,29 @@ typedef int su_socket_t;
typedef SOCKET su_socket_t;
#endif
#if !SU_HAVE_SOCKADDR_STORAGE
/*
* RFC 2553: protocol-independent placeholder for socket addresses
*/
#define _SS_MAXSIZE 128
#define _SS_ALIGNSIZE (sizeof(int64_t))
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(u_char) * 2)
#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(u_char) * 2 - \
_SS_PAD1SIZE - _SS_ALIGNSIZE)
struct sockaddr_storage {
#if SU_HAVE_SOCKADDR_SA_LEN
unsigned char ss_len; /* address length */
unsigned char ss_family; /* address family */
#else
unsigned short ss_family; /* address family */
#endif
char __ss_pad1[_SS_PAD1SIZE];
int64_t __ss_align; /* force desired structure storage alignment */
char __ss_pad2[_SS_PAD2SIZE];
};
#endif
/** Common socket address structure. */
union su_sockaddr_u {
#ifdef DOCUMENTATION_ONLY
......
......@@ -61,6 +61,9 @@
/** Define as 1 if you have sa_len field in struct sockaddr */
#undef SU_HAVE_SOCKADDR_SA_LEN
/** Define as 1 if you have struct sockaddr_storage */
#undef SU_HAVE_SOCKADDR_STORAGE
/** Define as 1 if you have getaddrinfo() function. */
#undef SU_HAVE_GETADDRINFO
......
......@@ -50,6 +50,12 @@
#define SU_HAVE_NT 0
#define SU_HAVE_IN6 (0)
/** Define as 1 if you have struct sockaddr_storage */
#define SU_HAVE_SOCKADDR_STORAGE 1
/** Define as 1 if you have getaddrinfo() function. */
#define SU_HAVE_GETADDRINFO 1
/* Define this as 1 if you have if_nameindex() */
#define SU_HAVE_IF_NAMEINDEX (0)
......
......@@ -139,6 +139,13 @@ yes) SAC_SU_DEFINE(SU_HAVE_IN6, 1, [
*) AC_MSG_ERROR([Inconsistent struct sockaddr_sin6 test]) ;;
esac
AC_MSG_CHECKING([for struct sockaddr_storage])
AC_EGREP_HEADER([struct.+sockaddr_storage], [sys/socket.h], [dnl
AC_MSG_RESULT(yes)
SAC_SU_DEFINE(SU_HAVE_SOCKADDR_STORAGE)],[dnl
AC_MSG_RESULT(no)
])
dnl SIOGCIFCONF & struct ifconf
AC_MSG_CHECKING(for struct ifconf)
AC_EGREP_HEADER(struct.+ifconf, net/if.h,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment