Take maintenance for libnfs
[deb_libnfs.git] / examples / nfsclient-listservers.c
CommitLineData
dabf4152
AM
1/*
2 Copyright (C) by Ronnie Sahlberg <ronniesahlberg@gmail.com> 2011
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <http://www.gnu.org/licenses/>.
16*/
17
18/* Example program showing sync interface to probe for all local servers
19 */
ee872606
RRS
20#ifdef AROS
21#include "aros_compat.h"
22#endif
23
24#ifdef WIN32
25#include "win32_compat.h"
26#endif
dabf4152
AM
27
28#include <stdio.h>
29#include <stdlib.h>
ee872606 30#include "libnfs-zdr.h"
dabf4152
AM
31#include "libnfs.h"
32
dabf4152
AM
33int main(int argc _U_, char *argv[] _U_)
34{
35 struct nfs_server_list *srvrs;
36 struct nfs_server_list *srv;
37
ee872606
RRS
38#ifdef AROS
39 aros_init_socket();
40#endif
41
dabf4152
AM
42 srvrs = nfs_find_local_servers();
43 for (srv=srvrs; srv; srv = srv->next) {
44 printf("NFS SERVER @ %s\n", srv->addr);
45 }
46 free_nfs_srvr_list(srvrs);
47 return 0;
48}