Blame include/nsswitch.h

Packit 8480eb
/* ----------------------------------------------------------------------- *
Packit 8480eb
 *
Packit 8480eb
 *  nsswitch.h - header file for module to call parser for nsswitch
Packit 8480eb
 *		 config and store result into a struct.
Packit 8480eb
 *
Packit 8480eb
 *   Copyright 2006 Ian Kent <raven@themaw.net>
Packit 8480eb
 *
Packit 8480eb
 *   This program is free software; you can redistribute it and/or modify
Packit 8480eb
 *   it under the terms of the GNU General Public License as published by
Packit 8480eb
 *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
Packit 8480eb
 *   USA; either version 2 of the License, or (at your option) any later
Packit 8480eb
 *   version.
Packit 8480eb
 *
Packit 8480eb
 *   This program is distributed in the hope that it will be useful,
Packit 8480eb
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 8480eb
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 8480eb
 *   GNU General Public License for more details.
Packit 8480eb
 *
Packit 8480eb
 * ----------------------------------------------------------------------- */
Packit 8480eb
Packit 8480eb
#ifndef __NSSWITCH_H
Packit 8480eb
#define __NSSWITCH_H
Packit 8480eb
Packit 8480eb
#include <netdb.h>
Packit 8480eb
#include "list.h"
Packit 8480eb
Packit 8480eb
#define NSSWITCH_FILE _PATH_NSSWITCH_CONF
Packit 8480eb
Packit 8480eb
enum nsswitch_status {
Packit 8480eb
	NSS_STATUS_UNKNOWN = -1,
Packit 8480eb
	NSS_STATUS_SUCCESS,
Packit 8480eb
	NSS_STATUS_NOTFOUND,
Packit 8480eb
	NSS_STATUS_UNAVAIL,
Packit 8480eb
	NSS_STATUS_TRYAGAIN,
Packit 8480eb
	NSS_STATUS_MAX
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
/* Internal NSS STATUS for map inclusion lookups */
Packit 8480eb
#define NSS_STATUS_COMPLETED    NSS_STATUS_MAX
Packit 8480eb
Packit 8480eb
enum nsswitch_action {
Packit 8480eb
	NSS_ACTION_UNKNOWN = 0,
Packit 8480eb
	NSS_ACTION_CONTINUE,
Packit 8480eb
	NSS_ACTION_RETURN
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
struct nss_action {
Packit 8480eb
	enum nsswitch_action action;
Packit 8480eb
	int negated;
Packit 8480eb
};
Packit 8480eb
Packit 8480eb
struct nss_source {
Packit 8480eb
	char *source;
Packit 8480eb
	struct nss_action action[NSS_STATUS_MAX];
Packit 8480eb
	struct list_head list;
Packit 8480eb
}; 
Packit 8480eb
Packit 8480eb
int set_action(struct nss_action *a, char *status, char *action, int negated);
Packit 8480eb
int check_nss_result(struct nss_source *this, enum nsswitch_status result);
Packit 8480eb
struct nss_source *add_source(struct list_head *head, char *source);
Packit 8480eb
int free_sources(struct list_head *list);
Packit 8480eb
Packit 8480eb
int nsswitch_parse(struct list_head *list);
Packit 8480eb
Packit 8480eb
#endif