"Fossies" - the Fresh Open Source Software Archive

Member "nss_ldap-265/nss_dbdefs.h" (6 Nov 2009, 3160 Bytes) of package /linux/privat/old/nss_ldap-265.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 /*
    2    Donated by HP to enable Winbindd to build on HPUX 11.x.
    3    Copyright (C) Jeremy Allison 2002.
    4  
    5    This library is free software; you can redistribute it and/or
    6    modify it under the terms of the GNU Library General Public
    7    License as published by the Free Software Foundation; either
    8    version 2 of the License, or (at your option) any later version.
    9  
   10    This library is distributed in the hope that it will be useful,
   11    but WITHOUT ANY WARRANTY; without even the implied warranty of
   12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   13    Library General Public License for more details.
   14  
   15    You should have received a copy of the GNU Library General Public
   16    License along with this library; if not, write to the
   17    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   18    Boston, MA  02111-1307, USA.
   19 */
   20 
   21 #ifndef _NSS_DBDEFS_H
   22 #define _NSS_DBDEFS_H
   23 
   24 #include <errno.h>
   25 #include <netdb.h>
   26 #include <limits.h>
   27  
   28 #ifndef NSS_INCLUDE_UNSAFE
   29 #define NSS_INCLUDE_UNSAFE      1       /* Build old, MT-unsafe interfaces, */
   30 #endif  /* NSS_INCLUDE_UNSAFE */
   31  
   32 enum nss_netgr_argn {
   33     NSS_NETGR_MACHINE,
   34     NSS_NETGR_USER,
   35     NSS_NETGR_DOMAIN,
   36     NSS_NETGR_N
   37 };
   38  
   39 enum nss_netgr_status {
   40     NSS_NETGR_FOUND,
   41     NSS_NETGR_NO,
   42     NSS_NETGR_NOMEM
   43 };
   44 
   45 struct nss_setnetgrent_args {
   46     const char *netgroup;
   47     nss_backend_t *iterator;
   48 };
   49 
   50 struct nss_getnetgrent_args {
   51     char *buffer;
   52     int buflen;
   53     enum nss_netgr_status status;
   54     char *retp[NSS_NETGR_N];
   55 };
   56  
   57 typedef unsigned nss_innetgr_argc;
   58 typedef char **nss_innetgr_argv;
   59  
   60 struct nss_innetgr_1arg {
   61     nss_innetgr_argc argc;
   62     nss_innetgr_argv argv;
   63 };
   64 
   65 struct nss_innetgr_args {
   66     struct nss_innetgr_1arg arg[NSS_NETGR_N];
   67     struct nss_innetgr_1arg groups;
   68     enum nss_netgr_status status;
   69 };
   70  
   71 typedef struct {
   72     void *result;   /* "result" parameter to getXbyY_r() */
   73     char *buffer;   /* "buffer"     "        "      */
   74     int buflen; /* "buflen"     "        "      */
   75 } nss_XbyY_buf_t;
   76  
   77 extern nss_XbyY_buf_t *_nss_XbyY_buf_alloc(int struct_size, int buffer_size);
   78 extern void _nss_XbyY_buf_free(nss_XbyY_buf_t *);
   79  
   80 union nss_XbyY_key {
   81     uid_t uid;
   82     gid_t gid;
   83     const char *name;
   84     int number;
   85     struct {
   86         long net; /* int on Solaris */
   87         int type;
   88     } netaddr;
   89     struct {
   90         const char *addr;
   91         int len;
   92         int type;
   93     } hostaddr;
   94     struct {
   95         union {
   96             const char *name;
   97             int port;
   98         } serv;
   99         const char *proto;
  100     } serv;
  101     void *ether;
  102     /* Solaris has private key args here */
  103 };
  104  
  105 typedef struct nss_XbyY_args {
  106     nss_XbyY_buf_t buf;
  107     int stayopen;
  108     /*
  109      * Support for setXXXent(stayopen)
  110      * Used only in hosts, protocols,
  111      * networks, rpc, and services.
  112      */
  113     int (*str2ent)(const char *instr, int instr_len, void *ent, char *buffer, int buflen);
  114     union nss_XbyY_key key;
  115  
  116     void *returnval;
  117     int erange;
  118 #undef h_errno
  119     int h_errno;
  120     nss_status_t status;
  121 } nss_XbyY_args_t;
  122 
  123 struct nss_groupsbymem {
  124     const char *username;
  125     gid_t *gid_array;
  126     int maxgids;
  127     int force_slow_way;
  128     int (*str2ent)(const char *instr, int instr_len, void *ent, char *buffer, int buflen);
  129     nss_status_t (*process_cstr)(const char *instr, int instr_len, struct nss_groupsbymem *);
  130     int numgids;
  131 };
  132  
  133 #endif /* _NSS_DBDEFS_H */
  134