Merge remote branch 't-nelson/automake'
[deb_libnfs.git] / examples / nfsclient-listservers.c
CommitLineData
552c7665
RS
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 */
20
21#include <stdio.h>
22#include <unistd.h>
23#include <stdlib.h>
24#include <string.h>
25#include <poll.h>
26#include <errno.h>
27#include <sys/socket.h>
28#include <sys/ioctl.h>
29#include <sys/time.h>
30#include <net/if.h>
31#include <netdb.h>
32#include "libnfs.h"
33#include "libnfs-raw.h"
34#include "libnfs-raw-mount.h"
35#include "libnfs-raw-portmap.h"
36#include "libnfs-private.h"
37
38
39int main(int argc _U_, char *argv[] _U_)
40{
41 struct nfs_server_list *srvrs;
42 struct nfs_server_list *srv;
43
44 srvrs = nfs_find_local_servers();
45 for (srv=srvrs; srv; srv = srv->next) {
46 printf("NFS SERVER @ %s\n", srv->addr);
47 }
48 free_nfs_srvr_list(srvrs);
49 return 0;
50}