Back to index

glibc  2.9
nis_util.c
Go to the documentation of this file.
00001 /* Copyright (c) 1997, 1998, 1999, 2004 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #include <string.h>
00021 #include <rpcsvc/nis.h>
00022 
00023 #include "nis_xdr.h"
00024 #include "nis_intern.h"
00025 
00026 fd_result *
00027 __nis_finddirectory (directory_obj *dir, const_nis_name name)
00028 {
00029   nis_error status;
00030   fd_args fd_args;
00031   fd_result *fd_res;
00032 
00033   fd_args.dir_name = (char *)name;
00034   fd_args.requester = nis_local_host();
00035   fd_res = calloc (1, sizeof (fd_result));
00036   if (fd_res == NULL)
00037     return NULL;
00038 
00039   status = __do_niscall2 (dir->do_servers.do_servers_val,
00040                        dir->do_servers.do_servers_len,
00041                        NIS_FINDDIRECTORY, (xdrproc_t) _xdr_fd_args,
00042                        (caddr_t) &fd_args, (xdrproc_t) _xdr_fd_result,
00043                        (caddr_t) fd_res, NO_AUTHINFO|USE_DGRAM, NULL);
00044   if (status != NIS_SUCCESS)
00045     fd_res->status = status;
00046 
00047   return fd_res;
00048 }
00049 libnsl_hidden_def (__nis_finddirectory)
00050 
00051 /* The hash implementation is in a separate file.  */
00052 #include "nis_hash.c"