From: unknown Date: Mon, 12 Sep 2011 17:58:23 +0000 (+0200) Subject: [add] - list nfs servers nfsclient-sync X-Git-Tag: upstream/1.9.6^2~302^2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=e078d276f732eb85615faf9cb1b1c16060b6134d;p=deb_libnfs.git [add] - list nfs servers nfsclient-sync --- diff --git a/examples/nfsclient-sync.c b/examples/nfsclient-sync.c index 449d8e3..bc19f48 100644 --- a/examples/nfsclient-sync.c +++ b/examples/nfsclient-sync.c @@ -61,6 +61,21 @@ struct client { }; +void PrintServerList() +{ + struct nfs_server_list *srvrs; + struct nfs_server_list *srv; + + srvrs = nfs_find_local_servers(); + + for (srv=srvrs; srv; srv = srv->next) + { + printf("Found nfs server: %s\n", srv->addr); + + } + free_nfs_srvr_list(srvrs); +} + char buf[3*1024*1024+337]; int main(int argc _U_, char *argv[] _U_) @@ -86,6 +101,9 @@ int main(int argc _U_, char *argv[] _U_) client.server = SERVER; client.export = EXPORT; client.is_finished = 0; + + PrintServerList(); + export = mount_getexports(SERVER); if (export != NULL) { printf("exports on server %s\n", SERVER);