X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Flibnfs-private.h;h=a8f5d26247ea7e3d494e59a0283b4733de4e7efa;hb=86ef4910045771a1da4023a1880ba1c9e265eb6d;hp=c6a8820f6bcae2b5e10e00f4c56fc7bf3e1194e0;hpb=b077fdeb65aca9d9bc15fcd311372816d87dc213;p=deb_libnfs.git diff --git a/include/libnfs-private.h b/include/libnfs-private.h index c6a8820..a8f5d26 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; + size_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 { @@ -84,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, size_t size); +void rpc_free_all_fragments(struct rpc_context *rpc); +