X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=include%2Flibnfs-private.h;h=4c8594c72452a2c7903cd4070b7863af12801dc7;hb=4ed97718b3699a76047741b9c21df7357d8fe513;hp=8fb305f0ee8860c9ee2bfae6ad015d31588e6cdd;hpb=cdb19ec1642636497881215a69166fd5f1d0cda2;p=deb_libnfs.git diff --git a/include/libnfs-private.h b/include/libnfs-private.h index 8fb305f..4c8594c 100644 --- a/include/libnfs-private.h +++ b/include/libnfs-private.h @@ -14,6 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ +#include #include struct rpc_context { @@ -33,11 +34,17 @@ struct rpc_context { int encodebuflen; struct rpc_pdu *outqueue; + struct sockaddr_storage udp_src; struct rpc_pdu *waitpdu; int inpos; int insize; char *inbuf; + + /* special fields for UDP, which can sometimes be BROADCASTed */ + int is_udp; + struct sockaddr *udp_dest; + int is_broadcast; }; struct rpc_pdu { @@ -69,4 +76,12 @@ 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); +int rpc_set_udp_destination(struct rpc_context *rpc, char *addr, int port, int is_broadcast); +struct rpc_context *rpc_init_udp_context(void); +struct sockaddr *rpc_get_recv_sockaddr(struct rpc_context *rpc);