X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Flibnfs-private.h;h=79ac411339668ffcb4e79d3edd00c95ed2b4f54c;hb=c022471e52d3ea679139cdf026dcde179c8de23c;hp=d3cd3ec0b647c862460848c38fa57d4f56494e11;hpb=f816bf4c7641071d83ed2c796c93ce0ddba9b3b4;p=deb_libnfs.git diff --git a/include/libnfs-private.h b/include/libnfs-private.h index d3cd3ec..79ac411 100644 --- a/include/libnfs-private.h +++ b/include/libnfs-private.h @@ -14,10 +14,41 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ +#ifdef HAVE_CONFIG_H +#include "config.h" /* HAVE_SOCKADDR_STORAGE ? */ +#endif + +#ifndef WIN32 #include /* struct sockaddr_storage */ +#endif #include "libnfs-zdr.h" + +#if !defined(HAVE_SOCKADDR_STORAGE) && !defined(WIN32) +/* + * RFC 2553: protocol-independent placeholder for socket addresses + */ +#define _SS_MAXSIZE 128 +#define _SS_ALIGNSIZE (sizeof(double)) +#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof(unsigned char) * 2) +#define _SS_PAD2SIZE (_SS_MAXSIZE - sizeof(unsigned char) * 2 - \ + _SS_PAD1SIZE - _SS_ALIGNSIZE) + +struct sockaddr_storage { +#ifdef HAVE_SOCKADDR_LEN + unsigned char ss_len; /* address length */ + unsigned char ss_family; /* address family */ +#else + unsigned short ss_family; +#endif + char __ss_pad1[_SS_PAD1SIZE]; + double __ss_align; /* force desired structure storage alignment */ + char __ss_pad2[_SS_PAD2SIZE]; +}; +#endif + + struct rpc_fragment { struct rpc_fragment *next; uint64_t size;