X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=utils%2Fmount%2Fnetwork.h;h=2a3a1105498df483adbd5722ae226e32763fb1dd;hp=83375f052a4be117db0d5dee05560b9e57a16318;hb=e9ab22a79e385babb16623a9260bda358291c80d;hpb=a4b10d48a730fbc6ff62197facddccdf7e204610 diff --git a/utils/mount/network.h b/utils/mount/network.h index 83375f0..2a3a110 100644 --- a/utils/mount/network.h +++ b/utils/mount/network.h @@ -21,11 +21,58 @@ * */ -#include "conn.h" -#include "mount.h" +#ifndef _NFS_UTILS_MOUNT_NETWORK_H +#define _NFS_UTILS_MOUNT_NETWORK_H + +#include + +#define MNT_SENDBUFSIZE (2048U) +#define MNT_RECVBUFSIZE (1024U) + +typedef struct { + char **hostname; + struct sockaddr_in saddr; + struct pmap pmap; +} clnt_addr_t; + +/* RPC call timeout values */ +static const struct timeval TIMEOUT = { 20, 0 }; +static const struct timeval RETRY_TIMEOUT = { 3, 0 }; int probe_bothports(clnt_addr_t *, clnt_addr_t *); +int nfs_probe_bothports(const struct sockaddr *, const socklen_t, + struct pmap *, const struct sockaddr *, + const socklen_t, struct pmap *); int nfs_gethostbyname(const char *, struct sockaddr_in *); -int nfs_call_umount(clnt_addr_t *, dirpath *); +int nfs_lookup(const char *hostname, const sa_family_t family, + struct sockaddr *sap, socklen_t *salen); +int nfs_string_to_sockaddr(const char *, struct sockaddr *, socklen_t *); +int nfs_present_sockaddr(const struct sockaddr *, + const socklen_t, char *, const size_t); +int nfs_callback_address(const struct sockaddr *, const socklen_t, + struct sockaddr *, socklen_t *); +int clnt_ping(struct sockaddr_in *, const unsigned long, + const unsigned long, const unsigned int, + struct sockaddr_in *); + +struct mount_options; + +int nfs_nfs_proto_family(struct mount_options *options, sa_family_t *family); +int nfs_mount_proto_family(struct mount_options *options, sa_family_t *family); +int nfs_nfs_version(struct mount_options *options, unsigned long *version); +int nfs_nfs_protocol(struct mount_options *options, unsigned long *protocol); + +int nfs_options2pmap(struct mount_options *, + struct pmap *, struct pmap *); int start_statd(void); + +unsigned long nfsvers_to_mnt(const unsigned long); + +int nfs_call_umount(clnt_addr_t *, dirpath *); +int nfs_advise_umount(const struct sockaddr *, const socklen_t, + const struct pmap *, const dirpath *); +CLIENT *mnt_openclnt(clnt_addr_t *, int *); +void mnt_closeclnt(CLIENT *, int); + +#endif /* _NFS_UTILS_MOUNT_NETWORK_H */