X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Flibnfs-private.h;h=b1fe13480dac57570d5c39c17f62706a0926cf45;hb=5670ec6e746ac6d1f110e160806c8d846b98b660;hp=3131a201cdec1a1d398c5fcc2636103d21bfe88d;hpb=3be2733596b0cc976136361c5b20576ffca5bef5;p=deb_libnfs.git diff --git a/include/libnfs-private.h b/include/libnfs-private.h index 3131a20..b1fe134 100644 --- a/include/libnfs-private.h +++ b/include/libnfs-private.h @@ -14,8 +14,15 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ +#include #include +struct rpc_fragment { + struct rpc_fragment *next; + uint64_t size; + char *data; +}; + struct rpc_context { int fd; int is_connected; @@ -44,6 +51,13 @@ struct rpc_context { int is_udp; struct sockaddr *udp_dest; int is_broadcast; + + /* track the address we connect to so we can auto-reconnect on session failure */ + struct sockaddr_storage s; + int auto_reconnect; + + /* fragment reassembly */ + struct rpc_fragment *fragments; }; struct rpc_pdu { @@ -75,6 +89,8 @@ void rpc_set_error(struct rpc_context *rpc, char *error_string, ...); void nfs_set_error(struct nfs_context *nfs, char *error_string, ...); struct rpc_context *nfs_get_rpc_context(struct nfs_context *nfs); +const char *nfs_get_server(struct nfs_context *nfs); +const char *nfs_get_export(struct nfs_context *nfs); /* we dont want to expose UDP to normal applications/users this is private to libnfs to use exclusively for broadcast RPC */ int rpc_bind_udp(struct rpc_context *rpc, char *addr, int port); @@ -82,3 +98,9 @@ int rpc_set_udp_destination(struct rpc_context *rpc, char *addr, int port, int i struct rpc_context *rpc_init_udp_context(void); struct sockaddr *rpc_get_recv_sockaddr(struct rpc_context *rpc); +void rpc_set_autoreconnect(struct rpc_context *rpc); +void rpc_unset_autoreconnect(struct rpc_context *rpc); + +int rpc_add_fragment(struct rpc_context *rpc, char *data, uint64_t size); +void rpc_free_all_fragments(struct rpc_context *rpc); +