/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _NIS_PARSE_LDAP_CONF_H
#define _NIS_PARSE_LDAP_CONF_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#include <lber.h>
#include <ldap.h>
#include <iso/limits_iso.h>
#include "ldap_parse.h"
#include "nisdb_ldap.h"
#ifndef UINT32_MAX
#endif
#define IS_TERMINAL_CHAR(c) \
((c) == QUESTION_MARK || \
(c) == EQUAL_CHAR || \
(c) == COMMA_CHAR || \
(c) == CLOSE_PAREN_CHAR || \
(c) == COLON_CHAR || \
(c) == SEMI_COLON_CHAR)
/* initial configuration keywords */
/* for NIS+ */
#define IS_CONFIG_KEYWORD(x) \
((x) >= key_config_dn && (x) <= key_config_proxy_passwd)
/* LDAP server keywords */
/* for NIS+ */
#define IS_BIND_INFO(x) \
((x) >= key_preferred_servers && (x) <= key_follow_referral)
/* This information will be need to determine the server behavior */
/* for NIS+ */
#define THREAD_CREATE_ERROR_ACTION \
"nisplusThreadCreationErrorAction"
#define THREAD_CREATE_ERROR_ATTEMPTS \
"nisplusThreadCreationErrorAttempts"
#define THREAD_CREATE_ERROR_TIMEOUT \
"nisplusThreadCreationErrorTimeout"
#define IS_OPER_INFO(x) \
((x) >= key_initial_update_action && (x) <= key_max_rpc_recsize)
/* The following definitions are for NIS */
#define IS_YP_CONFIG_KEYWORD(x) \
((x) >= key_yp_config_dn && (x) <= key_yp_config_proxy_passwd)
#define IS_YP_BIND_INFO(x) \
((x) == key_preferred_servers || \
(x) == key_auth_method || \
(x) == key_search_base || \
((x) >= key_yp_tls_option && (x) <= key_yp_follow_referral))
#define IS_YP_OPER_INFO(x) \
((x) >= key_yp_retrieve_error_action && (x) <= key_yp_match_fetch)
#define IS_YP_DOMAIN_INFO(x) \
((x) >= key_yp_domain_context && (x) <= key_yppasswdd_domains)
#define IS_YP_MAP_ATTR(x) \
((x) == key_yp_domain_context || \
(x) == key_yppasswdd_domains || \
((x) >= key_yp_db_id_map && (x) <= key_nis_to_ldap_map))
#define DEFAULT_NUMBER_OF_THREADS 0
#define DEFAULT_YP_EMULATION 0
typedef enum {
} parse_error;
typedef enum {
} conn_error;
typedef enum {
no_more_keys = 0,
} config_key;
typedef enum {
} token_type;
typedef enum {
typedef enum {
typedef enum {
typedef enum {
} tls_method_t;
typedef struct {
char *config_dn;
char *default_servers;
char *proxy_dn;
char *proxy_passwd;
char *tls_cert_db;
typedef enum {
typedef struct {
char *default_servers;
char *default_search_base;
char *proxy_dn;
char *proxy_passwd;
char *tls_cert_db;
char *default_nis_domain;
int search_time_limit;
int search_size_limit;
extern __nis_ldap_proxy_info proxyInfo;
extern __nis_table_mapping_t *ldapTableMapping;
extern int parse_ldap_migration(const char *const *cmdline_options,
const char *config_file);
extern void free_ldap_connections();
/* Deallocation functions */
extern void free_parse_structs(void);
extern void free_mapping_element(__nis_mapping_element_t *e);
/* Parser functions */
const char *attrib_val, int attrib_len,
extern config_key get_attrib_num(const char *s, int n);
extern const char *
extern const char *get_search_triple(const char *s, const char *end_s,
__nis_mapping_rlhs_t *m);
extern const char *skip_token(const char *s, const char *end_s,
token_type t);
extern const char *get_next_extract_format_item(const char *begin_fmt,
extern const char *get_next_print_format_item(const char *begin_fmt,
extern const char *get_next_token(const char **begin_token,
const char **end_token, token_type *t);
extern const char *get_next_object_dn_token(const char **begin_ret,
extern void init_yptol_flag();
/* Utility functions */
extern char *s_strndup_esc(const char *s, int n);
extern char *s_strndup(const char *s, int n);
extern char *s_strdup(const char *s);
extern bool_t is_whitespace(int c);
/* Error and information reporting functions */
/* Validation functions */
extern int start_line_num;
extern int cur_line_num;
extern int seq_num;
extern parse_error p_error;
extern char _key_val[38];
extern const char *command_line_source;
extern const char *file_source;
extern const char *ldap_source;
extern const char *warn_file;
/* SSL and sasl-digest md5 functions */
const char *ldapssl_err2string(const int prerrno);
#ifdef __cplusplus
}
#endif
#endif /* _NIS_PARSE_LDAP_CONF_H */