Blame inet/netgroup.h

Packit 6c4009
/* Internal header for netgroup related functions.
Packit 6c4009
   Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
#ifndef _NETGROUP_H
Packit 6c4009
#define _NETGROUP_H	1
Packit 6c4009
Packit 6c4009
#include <nsswitch.h>
Packit 6c4009
Packit 6c4009
/* A netgroup can consist of names of other netgroups.  We have to
Packit 6c4009
   track which netgroups were read and which still have to be read.  */
Packit 6c4009
struct name_list
Packit 6c4009
{
Packit 6c4009
  struct name_list *next;
Packit 6c4009
  char name[];
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Dataset for iterating netgroups.  */
Packit 6c4009
struct __netgrent
Packit 6c4009
{
Packit 6c4009
  enum { triple_val, group_val } type;
Packit 6c4009
Packit 6c4009
  union
Packit 6c4009
  {
Packit 6c4009
    struct
Packit 6c4009
    {
Packit 6c4009
      const char *host;
Packit 6c4009
      const char *user;
Packit 6c4009
      const char *domain;
Packit 6c4009
    }
Packit 6c4009
    triple;
Packit 6c4009
Packit 6c4009
    const char *group;
Packit 6c4009
  } val;
Packit 6c4009
Packit 6c4009
  /* Room for the data kept between the calls to the netgroup
Packit 6c4009
     functions.  We must avoid global variables.  */
Packit 6c4009
  char *data;
Packit 6c4009
  size_t data_size;
Packit 6c4009
  union
Packit 6c4009
  {
Packit 6c4009
    char *cursor;
Packit 6c4009
    unsigned long int position;
Packit 6c4009
  };
Packit 6c4009
  int first;
Packit 6c4009
Packit 6c4009
  struct name_list *known_groups;
Packit 6c4009
  struct name_list *needed_groups;
Packit 6c4009
Packit 6c4009
  /* This handle for the NSS data base is shared between all
Packit 6c4009
     set/get/endXXXent functions.  */
Packit 6c4009
  service_user *nip;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* The internal netgroup handling functions might be called from outside.  */
Packit 6c4009
extern int __internal_setnetgrent (const char *group,
Packit 6c4009
				   struct __netgrent *datap);
Packit 6c4009
libc_hidden_proto (__internal_setnetgrent)
Packit 6c4009
extern void __internal_endnetgrent (struct __netgrent *datap);
Packit 6c4009
libc_hidden_proto (__internal_endnetgrent)
Packit 6c4009
extern int __internal_getnetgrent_r (char **hostp, char **userp,
Packit 6c4009
				     char **domainp, struct __netgrent *datap,
Packit 6c4009
				     char *buffer, size_t buflen, int *errnop);
Packit 6c4009
libc_hidden_proto (__internal_getnetgrent_r)
Packit 6c4009
Packit 6c4009
#endif /* netgroup.h */