X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Flibnfs-private.h;h=f995a7ef94a5466e1024b157563763fcc1f6e4ca;hb=00748f36c57324ccc2cb21ac9af45d15821cf675;hp=c12d95909ab39a53dbaf293082f7e44fc48a61ba;hpb=d14e28387f825d7acc33d655db7a22506b064d83;p=deb_libnfs.git diff --git a/include/libnfs-private.h b/include/libnfs-private.h index c12d959..f995a7e 100644 --- a/include/libnfs-private.h +++ b/include/libnfs-private.h @@ -14,17 +14,48 @@ 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 + #include /* struct sockaddr_storage */ #include "libnfs-zdr.h" +#ifndef HAVE_SOCKADDR_STORAGE +/* + * 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; char *data; }; +#define RPC_CONTEXT_MAGIC 0xc6e46435 + struct rpc_context { + uint32_t magic; int fd; int is_connected; @@ -33,7 +64,7 @@ struct rpc_context { rpc_cb connect_cb; void *connect_data; - AUTH *auth; + struct AUTH *auth; unsigned long xid; /* buffer used for encoding RPC PDU */