idmapd.h revision d3a612ca42c17c3baa6c96ded00f98db349cc881
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _IDMAPD_H
#define _IDMAPD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <syslog.h>
#include <stdarg.h>
#include <synch.h>
#include <thread.h>
#include <libintl.h>
#include <strings.h>
#include <inttypes.h>
#include "idmap_prot.h"
#include "adutils.h"
#include "idmap_config.h"
#ifdef __cplusplus
extern "C" {
#endif
/* States a server can be in wrt request */
#define _IDLE 0
#define _SERVED 1
#define CHECK_NULL(s) s?s:"null"
#define SENTINEL_PID UINT32_MAX
extern int _rpcsvcstate; /* set when a request is serviced */
extern int _rpcsvccount; /* number of requests being serviced */
/*
* Global state of idmapd daemon.
*/
#define IDMAP_MAX_NAME_LEN 512
typedef struct idmapd_state {
int new_eph_db; /* was the ephem ID db [re-]created? */
extern idmapd_state_t _idmapdstate;
#define RDLOCK_CONFIG() \
#define WRLOCK_CONFIG() \
#define UNLOCK_CONFIG() \
typedef struct hashentry {
} hashentry_t;
typedef struct lookup_state {
int ad_nqueries;
typedef struct list_cb_data {
void *result;
typedef struct msg_table {
const char *msg;
} msg_table_t;
/*
* Data structure to store well-known SIDs and
* associated mappings (if any)
*/
typedef struct wksids_table {
const char *sidprefix;
const char *winname;
int is_user;
int direction;
#define _IDMAP_F_DONE 0x00000000
#define _IDMAP_F_S2N_CACHE 0x00000001
#define _IDMAP_F_S2N_AD 0x00000002
#define _IDMAP_F_EXP_EPH_UID 0x00000004
#define _IDMAP_F_EXP_EPH_GID 0x00000010
#define SIZE_INCR 5
#define MAX_TRIES 5
#define IDMAP_DBDIR "/var/idmap"
#define IDMAP_CACHEDIR "/var/run/idmap"
typedef int (*list_svc_cb)(void *, int, char **, char **);
extern void idmapdlog(int, const char *, ...);
extern int init_mapping_system();
extern void fini_mapping_system();
extern void print_idmapdstate();
extern int load_config();
extern int idmap_init_tsd_key(void);
extern int init_dbs();
extern void fini_dbs();
extern idmap_retcode gen_sql_expr_from_utf8str(const char *,
const char *, const char *,
char *, const char *,
char **);
list_svc_cb, void *);
idmap_mapping *, idmap_id_res *);
int, int);
idmap_mapping *, idmap_id_res *);
idmap_mapping *, idmap_id_res *);
idmap_mapping *, int);
idmap_mapping *);
idmap_mapping_batch *, idmap_ids_res *);
#ifdef __cplusplus
}
#endif
#endif /* _IDMAPD_H */