2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A/*
2N/A * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _NIS_PARSE_LDAP_CONF_H
2N/A#define _NIS_PARSE_LDAP_CONF_H
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A#include <lber.h>
2N/A#include <ldap.h>
2N/A#include <iso/limits_iso.h>
2N/A#include "ldap_parse.h"
2N/A#include "nisdb_ldap.h"
2N/A
2N/A#define YP_DEFAULT_MAPPING_FILE "/var/yp/NISLDAPmapping"
2N/A#define mmt_berstring_null ((__nis_mapping_match_type_t)-1)
2N/A#define ESCAPE_CHAR '\\'
2N/A#define EQUAL_CHAR '='
2N/A#define COMMA_CHAR ','
2N/A#define COMMA_STRING ","
2N/A#define OPEN_PAREN_CHAR '('
2N/A#define CLOSE_PAREN_CHAR ')'
2N/A#define DOUBLE_QUOTE_CHAR '"'
2N/A#define PERIOD_CHAR '.'
2N/A#define COLON_CHAR ':'
2N/A#define POUND_SIGN '#'
2N/A#define SEMI_COLON_CHAR ';'
2N/A#define QUESTION_MARK '?'
2N/A#define PLUS_SIGN '+'
2N/A#define PERCENT_SIGN '%'
2N/A#define OPEN_BRACKET '['
2N/A#define CLOSE_BRACKET ']'
2N/A#define ASTERIX_CHAR '*'
2N/A#define DASH_CHAR '-'
2N/A#define SINGLE_QUOTE_CHAR '\''
2N/A#define DEFAULT_COMMENT_CHAR '#'
2N/A#define DEFAULT_SEP_STRING " "
2N/A#define SPACE_CHAR ' '
2N/A
2N/A#define FOREVER -1
2N/A#define FIFTEEN_SECONDS 15
2N/A#define TWO_MINUTES 120
2N/A#define THIRTY_MINUTES 1800
2N/A#define THREE_MINUTES 180
2N/A#define ONE_HOUR 3600
2N/A#define MAX_LDAP_CONFIG_RETRY_TIME 60
2N/A
2N/A#define NO_VALUE_SET -2
2N/A
2N/A#define INITIAL_UPDATE_NO_ACTION -3
2N/A#define NO_INITIAL_UPDATE_NO_ACTION -4
2N/A#define FROM_NO_INITIAL_UPDATE -5
2N/A#define TO_NO_INITIAL_UPDATE -6
2N/A
2N/A#define BUFSIZE 8192
2N/A
2N/A#ifndef UINT32_MAX
2N/A#define UINT32_MAX (4294967295U)
2N/A#endif
2N/A
2N/A#define IS_TERMINAL_CHAR(c) \
2N/A ((c) == QUESTION_MARK || \
2N/A (c) == EQUAL_CHAR || \
2N/A (c) == COMMA_CHAR || \
2N/A (c) == CLOSE_PAREN_CHAR || \
2N/A (c) == COLON_CHAR || \
2N/A (c) == SEMI_COLON_CHAR)
2N/A
2N/A#define TIME_MAX LONG_MAX
2N/A#define WILL_OVERFLOW_TIME(t, d) ((t) > TIME_MAX/10 || \
2N/A ((t) == TIME_MAX/10 && d > TIME_MAX % 10))
2N/A
2N/A#define LIMIT_MAX (65535)
2N/A#define WILL_OVERFLOW_LIMIT(t, d) ((t) > LIMIT_MAX/10 || \
2N/A ((t) == LIMIT_MAX/10 && d > LIMIT_MAX % 10))
2N/A
2N/A#define WILL_OVERFLOW_INT(t, d) ((t) > INT_MAX/10 || \
2N/A ((t) == INT_MAX/10 && d > INT_MAX % 10))
2N/A
2N/A/* LDAP server keywords */
2N/A/* for NIS+ */
2N/A#define PREFERRED_SERVERS "preferredServerList"
2N/A#define AUTH_METHOD "authenticationMethod"
2N/A#define SEARCH_BASE "defaultSearchBase"
2N/A
2N/A#define IS_BIND_INFO(x) \
2N/A ((x) >= key_preferred_servers && (x) <= key_search_base)
2N/A
2N/A/* This information will be need to determine the server behavior */
2N/A
2N/A#define INITIAL_UPDATE_ACTION "nisLDAPinitialUpdateAction"
2N/A#define INITIAL_UPDATE_ONLY "nisLDAPinitialUpdateOnly"
2N/A#define REFRESH_ERROR_ACTION "nisLDAPrefreshErrorAction"
2N/A#define REFRESH_ERROR_ATTEMPTS "nisLDAPrefreshErrorAttempts"
2N/A#define REFRESH_ERROR_TIMEOUT "nisLDAPrefreshErrorTimeout"
2N/A#define THREAD_CREATE_ERROR_ACTION \
2N/A "nisThreadCreationErrorAction"
2N/A#define THREAD_CREATE_ERROR_ATTEMPTS \
2N/A "nisThreadCreationErrorAttempts"
2N/A#define THREAD_CREATE_ERROR_TIMEOUT \
2N/A "nisThreadCreationErrorTimeout"
2N/A#define DUMP_ERROR_ACTION "nisDumpErrorAction"
2N/A#define DUMP_ERROR_ATTEMPTS "nisDumpErrorAttempts"
2N/A#define DUMP_ERROR_TIMEOUT "nisDumpErrorTimeout"
2N/A#define RESYNC "nisResyncService"
2N/A#define UPDATE_BATCHING "nisUpdateBatching"
2N/A#define UPDATE_BATCHING_TIMEOUT "nisUpdateBatchingTimeout"
2N/A#define NUMBER_THREADS "nisNumberOfServiceThreads"
2N/A#define YP_EMULATION "ENABLE_NIS_YP_EMULATION"
2N/A#define MAX_RPC_RECSIZE "nisMaxRPCRecordSize"
2N/A
2N/A#define IS_OPER_INFO(x) \
2N/A ((x) >= key_initial_update_action && (x) <= key_max_rpc_recsize)
2N/A
2N/A/* The following definitions are for NIS */
2N/A
2N/A#define YP_CONFIG_DN "nisLDAPconfigDN"
2N/A#define YP_CONFIG_SERVER_LIST "nisLDAPconfigPreferredServerList"
2N/A#define YP_CONFIG_AUTH_METHOD "nisLDAPconfigAuthenticationMethod"
2N/A#define YP_CONFIG_TLS_OPTION "nisLDAPconfigTLS"
2N/A#define YP_CONFIG_TLS_CERT_DB "nisLDAPconfigTLSCertificateDBPath"
2N/A#define YP_CONFIG_PROXY_USER "nisLDAPconfigProxyUser"
2N/A#define YP_CONFIG_PROXY_PASSWD "nisLDAPconfigProxyPassword"
2N/A
2N/A#define IS_YP_CONFIG_KEYWORD(x) \
2N/A ((x) >= key_yp_config_dn && (x) <= key_yp_config_proxy_passwd)
2N/A
2N/A#define YP_TLS_OPTION "nisLDAPTLS"
2N/A#define YP_TLS_CERT_DB "nisLDAPTLSCertificateDBPath"
2N/A#define YP_PROXY_USER "nisLDAPproxyUser"
2N/A#define YP_PROXY_PASSWD "nisLDAPproxyPassword"
2N/A#define YP_LDAP_BASE_DOMAIN "nisLDAPbaseDomain"
2N/A#define YP_BIND_TIMEOUT "nisLDAPbindTimeout"
2N/A#define YP_SEARCH_TIMEOUT "nisLDAPsearchTimeout"
2N/A#define YP_MODIFY_TIMEOUT "nisLDAPmodifyTimeout"
2N/A#define YP_ADD_TIMEOUT "nisLDAPaddTimeout"
2N/A#define YP_DELETE_TIMEOUT "nisLDAPdeleteTimeout"
2N/A#define YP_SEARCH_TIME_LIMIT "nisLDAPsearchTimeLimit"
2N/A#define YP_SEARCH_SIZE_LIMIT "nisLDAPsearchSizeLimit"
2N/A#define YP_FOLLOW_REFERRAL "nisLDAPfollowReferral"
2N/A
2N/A#define IS_YP_BIND_INFO(x) \
2N/A ((x) == key_preferred_servers || \
2N/A (x) == key_auth_method || \
2N/A (x) == key_search_base || \
2N/A ((x) >= key_yp_tls_option && (x) <= key_yp_follow_referral))
2N/A
2N/A#define YP_RETRIEVE_ERROR_ACTION "nisLDAPretrieveErrorAction"
2N/A#define YP_RETREIVE_ERROR_ATTEMPTS "nisLDAPretrieveErrorAttempts"
2N/A#define YP_RETREIVE_ERROR_TIMEOUT "nisLDAPretrieveErrorTimeout"
2N/A#define YP_STORE_ERROR_ACTION "nisLDAPstoreErrorAction"
2N/A#define YP_STORE_ERROR_ATTEMPTS "nisLDAPstoreErrorAttempts"
2N/A#define YP_STORE_ERROR_TIMEOUT "nisLDAPstoreErrorTimeout"
2N/A#define YP_MATCH_FETCH "nisLDAPmatchFetchAction"
2N/A
2N/A#define IS_YP_OPER_INFO(x) \
2N/A ((x) >= key_yp_retrieve_error_action && (x) <= key_yp_match_fetch)
2N/A
2N/A#define YP_DOMAIN_CONTEXT "nisLDAPdomainContext"
2N/A#define YPPASSWDD_DOMAINS "nisLDAPyppasswddDomains"
2N/A
2N/A#define IS_YP_DOMAIN_INFO(x) \
2N/A ((x) >= key_yp_domain_context && (x) <= key_yppasswdd_domains)
2N/A
2N/A#define YP_DB_ID_MAP "nisLDAPdatabaseIdMapping"
2N/A#define YP_COMMENT_CHAR "nisLDAPcommentChar"
2N/A#define YP_MAP_FLAGS "nisLDAPmapFlags"
2N/A#define YP_ENTRY_TTL "nisLDAPentryTtl"
2N/A#define YP_NAME_FIELDS "nisLDAPnameFields"
2N/A#define YP_SPLIT_FIELD "nisLDAPsplitField"
2N/A#define YP_REPEATED_FIELD_SEPARATORS "nisLDAPrepeatedFieldSeparators"
2N/A#define YP_LDAP_OBJECT_DN "nisLDAPobjectDN"
2N/A#define LDAP_TO_NIS_MAP "nisLDAPfieldFromAttribute"
2N/A#define NIS_TO_LDAP_MAP "nisLDAPattributeFromField"
2N/A
2N/A#define IS_YP_MAP_ATTR(x) \
2N/A ((x) == key_yp_domain_context || \
2N/A (x) == key_yppasswdd_domains || \
2N/A ((x) >= key_yp_db_id_map && (x) <= key_nis_to_ldap_map))
2N/A
2N/A#define DEFAULT_YP_SEARCH_TIMEOUT THREE_MINUTES
2N/A#define DEFAULT_BIND_TIMEOUT FIFTEEN_SECONDS
2N/A#define DEFAULT_SEARCH_TIMEOUT FIFTEEN_SECONDS
2N/A#define DEFAULT_MODIFY_TIMEOUT FIFTEEN_SECONDS
2N/A#define DEFAULT_ADD_TIMEOUT FIFTEEN_SECONDS
2N/A#define DEFAULT_DELETE_TIMEOUT FIFTEEN_SECONDS
2N/A
2N/A#define DEFAULT_SEARCH_TIME_LIMIT LDAP_NO_LIMIT
2N/A#define DEFAULT_SEARCH_SIZE_LIMIT LDAP_NO_LIMIT
2N/A
2N/A#define DEFAULT_THREAD_ERROR_ATTEMPTS FOREVER
2N/A#define DEFAULT_THREAD_ERROR_TIME_OUT FIFTEEN_SECONDS
2N/A#define DEFAULT_DUMP_ERROR_ATTEMPTS FOREVER
2N/A#define DEFAULT_DUMP_ERROR_TIME_OUT FIFTEEN_SECONDS
2N/A#define DEFAULT_RETRIEVE_ERROR_ATTEMPTS FOREVER
2N/A#define DEFAULT_RETRIEVE_ERROR_TIME_OUT FIFTEEN_SECONDS
2N/A#define DEFAULT_STORE_ERROR_ATTEMPTS FOREVER
2N/A#define DEFAULT_STORE_ERROR_TIME_OUT FIFTEEN_SECONDS
2N/A#define DEFAULT_REFRESH_ERROR_ATTEMPTS FOREVER
2N/A#define DEFAULT_REFRESH_ERROR_TIME_OUT FIFTEEN_SECONDS
2N/A
2N/A#define DEFAULT_BATCHING_TIME_OUT TWO_MINUTES
2N/A#define DEFAULT_NUMBER_OF_THREADS 0
2N/A#define DEFAULT_YP_EMULATION 0
2N/A
2N/A#define DEFAULT_TTL_HIGH (ONE_HOUR + THIRTY_MINUTES)
2N/A#define DEFAULT_TTL_LOW (ONE_HOUR - THIRTY_MINUTES)
2N/A#define DEFAULT_TTL ONE_HOUR
2N/A
2N/Atypedef enum {
2N/A no_parse_error,
2N/A parse_no_mem_error,
2N/A parse_bad_key,
2N/A parse_bad_continuation_error,
2N/A parse_line_too_long,
2N/A parse_internal_err,
2N/A parse_initial_update_action_error,
2N/A parse_initial_update_only_error,
2N/A parse_retrieve_error_action_error,
2N/A parse_store_error_action_error,
2N/A parse_refresh_error_action_error,
2N/A parse_thr_create_err_action_err,
2N/A parse_dump_error_action_error,
2N/A parse_resync_error,
2N/A parse_update_batching_error,
2N/A parse_match_fetch_error,
2N/A parse_no_object_dn,
2N/A parse_invalid_scope,
2N/A parse_invalid_ldap_search_filter,
2N/A parse_semi_expected_error,
2N/A parse_mismatched_brackets,
2N/A parse_unsupported_format,
2N/A parse_unexpected_dash,
2N/A parse_unmatched_escape,
2N/A parse_bad_lhs_format_error,
2N/A parse_comma_expected_error,
2N/A parse_equal_expected_error,
2N/A parse_close_paren_expected_error,
2N/A parse_too_many_extract_items,
2N/A parse_not_enough_extract_items,
2N/A parse_bad_print_format,
2N/A parse_bad_elide_char,
2N/A parse_start_rhs_unrecognized,
2N/A parse_item_expected_error,
2N/A parse_format_string_expected_error,
2N/A parse_unexp_data_end_rule,
2N/A parse_bad_ttl_format_error,
2N/A parse_bad_auth_method_error,
2N/A parse_open_file_error,
2N/A parse_no_proxy_dn_error,
2N/A parse_no_config_auth_error,
2N/A parse_no_proxy_auth_error,
2N/A parse_ldap_init_error,
2N/A parse_ldap_bind_error,
2N/A parse_ldap_search_error,
2N/A parse_ldap_get_values_error,
2N/A parse_object_dn_syntax_error,
2N/A parse_invalid_dn,
2N/A parse_bad_index_format,
2N/A parse_bad_item_format,
2N/A parse_bad_ldap_item_format,
2N/A parse_invalid_print_arg,
2N/A parse_bad_extract_fmt_spec,
2N/A parse_no_db_del_mapping_rule,
2N/A parse_invalid_db_del_mapping_rule,
2N/A parse_bad_domain_name,
2N/A parse_bad_dn,
2N/A parse_yes_or_no_expected_error,
2N/A parse_bad_uint_error,
2N/A parse_bad_int_error,
2N/A parse_bad_command_line_attribute_format,
2N/A parse_no_ldap_server_error,
2N/A parse_bad_ber_format,
2N/A parse_no_config_server_addr,
2N/A parse_bad_time_error,
2N/A parse_lhs_rhs_type_mismatch,
2N/A parse_no_match_item,
2N/A parse_cannot_elide,
2N/A parse_bad_tls_option_error,
2N/A parse_ldapssl_client_init_error,
2N/A parse_ldapssl_init_error,
2N/A parse_no_available_referrals_error,
2N/A parse_no_config_cert_db,
2N/A parse_no_cert_db,
2N/A parse_unknown_yp_domain_error,
2N/A parse_unexpected_yp_domain_end_error,
2N/A parse_bad_map_error,
2N/A parse_bad_yp_comment_error,
2N/A parse_bad_field_separator_error,
2N/A parse_bad_name_field,
2N/A parse_yp_retrieve_err_action_err,
2N/A parse_yp_store_error_action_error
2N/A} parse_error;
2N/A
2N/Atypedef enum {
2N/A no_conn_error,
2N/A conn_no_mem_error,
2N/A conn_ldap_init_error,
2N/A conn_unsupported_ldap_bind_method,
2N/A conn_ldap_bind_error
2N/A} conn_error;
2N/A
2N/Atypedef enum {
2N/A key_bad = -1,
2N/A no_more_keys = 0,
2N/A key_preferred_servers = 1,
2N/A key_auth_method,
2N/A key_search_base,
2N/A key_initial_update_action,
2N/A key_initial_update_only,
2N/A key_refresh_error_action,
2N/A key_refresh_error_attempts,
2N/A key_refresh_error_timeout,
2N/A key_thread_create_error_action,
2N/A key_thread_create_error_attempts,
2N/A key_thread_create_error_timeout,
2N/A key_dump_error_action,
2N/A key_dump_error_attempts,
2N/A key_dump_error_timeout,
2N/A key_resync,
2N/A key_update_batching,
2N/A key_update_batching_timeout,
2N/A key_number_threads,
2N/A key_yp_emulation,
2N/A key_max_rpc_recsize,
2N/A key_yp_config_dn,
2N/A key_yp_config_server_list,
2N/A key_yp_config_auth_method,
2N/A key_yp_config_tls_option,
2N/A key_yp_config_tls_certificate_db,
2N/A key_yp_config_proxy_user,
2N/A key_yp_config_proxy_passwd,
2N/A key_yp_preferred_servers,
2N/A key_yp_auth_method,
2N/A key_yp_tls_option,
2N/A key_yp_tls_certificate_db,
2N/A key_yp_search_base,
2N/A key_yp_proxy_user,
2N/A key_yp_proxy_passwd,
2N/A key_yp_ldap_base_domain,
2N/A key_yp_bind_timeout,
2N/A key_yp_search_timeout,
2N/A key_yp_modify_timeout,
2N/A key_yp_add_timeout,
2N/A key_yp_delete_timeout,
2N/A key_yp_search_time_limit,
2N/A key_yp_search_size_limit,
2N/A key_yp_follow_referral,
2N/A key_yp_retrieve_error_action,
2N/A key_yp_retrieve_error_attempts,
2N/A key_yp_retreive_error_timeout,
2N/A key_yp_store_error_action,
2N/A key_yp_store_error_attempts,
2N/A key_yp_store_error_timeout,
2N/A key_yp_match_fetch,
2N/A key_yp_domain_context,
2N/A key_yppasswdd_domains,
2N/A key_yp_db_id_map,
2N/A key_yp_comment_char,
2N/A key_yp_map_flags,
2N/A key_yp_entry_ttl,
2N/A key_yp_name_fields,
2N/A key_yp_split_field,
2N/A key_yp_repeated_field_separators,
2N/A key_yp_ldap_object_dn,
2N/A key_ldap_to_nis_map,
2N/A key_nis_to_ldap_map,
2N/A n_config_keys
2N/A} config_key;
2N/A
2N/Atypedef enum {
2N/A string_token,
2N/A quoted_string_token,
2N/A equal_token,
2N/A comma_token,
2N/A open_paren_token,
2N/A close_paren_token,
2N/A colon_token,
2N/A no_token
2N/A} token_type;
2N/A
2N/Atypedef enum {
2N/A dn_no_token,
2N/A dn_semi_token,
2N/A dn_ques_token,
2N/A dn_colon_token,
2N/A dn_base_token,
2N/A dn_one_token,
2N/A dn_sub_token,
2N/A dn_text_token
2N/A} object_dn_token;
2N/A
2N/Atypedef enum {
2N/A dn_begin_parse,
2N/A dn_got_read_dn,
2N/A dn_got_read_q_scope,
2N/A dn_got_read_scope,
2N/A dn_got_read_q_filter,
2N/A dn_got_read_filter,
2N/A dn_got_write_colon,
2N/A dn_got_write_dn,
2N/A dn_got_write_q_scope,
2N/A dn_got_write_scope,
2N/A dn_got_write_q_filter,
2N/A dn_got_write_filter,
2N/A dn_got_delete_colon,
2N/A dn_got_delete_dsp
2N/A} parse_object_dn_state;
2N/A
2N/Atypedef enum {
2N/A none = 1,
2N/A simple,
2N/A cram_md5,
2N/A digest_md5
2N/A} auth_method_t;
2N/A
2N/Atypedef enum {
2N/A no_tls = 1,
2N/A ssl_tls
2N/A} tls_method_t;
2N/A
2N/Atypedef struct {
2N/A char *config_dn;
2N/A char *default_servers;
2N/A auth_method_t auth_method;
2N/A tls_method_t tls_method;
2N/A char *proxy_dn;
2N/A char *proxy_passwd;
2N/A char *tls_cert_db;
2N/A} __nis_config_info_t;
2N/A
2N/Atypedef enum {
2N/A follow = 1,
2N/A no_follow
2N/A} follow_referral_t;
2N/A
2N/Atypedef struct {
2N/A char *default_servers;
2N/A auth_method_t auth_method;
2N/A tls_method_t tls_method;
2N/A char *default_search_base;
2N/A char *proxy_dn;
2N/A char *proxy_passwd;
2N/A char *tls_cert_db;
2N/A char *default_nis_domain;
2N/A struct timeval bind_timeout;
2N/A struct timeval search_timeout;
2N/A struct timeval modify_timeout;
2N/A struct timeval add_timeout;
2N/A struct timeval delete_timeout;
2N/A int search_time_limit;
2N/A int search_size_limit;
2N/A follow_referral_t follow_referral;
2N/A} __nis_ldap_proxy_info;
2N/A
2N/Aextern __nisdb_table_mapping_t ldapDBTableMapping;
2N/Aextern __nis_ldap_proxy_info proxyInfo;
2N/Aextern __nis_table_mapping_t *ldapTableMapping;
2N/A
2N/Aextern int parse_ldap_migration(const char *const *cmdline_options,
2N/A const char *config_file);
2N/A
2N/Aextern void get_ldap_connection(LDAP **ld, time_t retry_time);
2N/Aextern void free_ldap_connection(LDAP *ld);
2N/Aextern void return_ldap_connection(LDAP *ld);
2N/Aextern void free_ldap_connections();
2N/A
2N/A
2N/Aextern void initialize_parse_structs(__nis_ldap_proxy_info *proxy_info,
2N/A __nis_config_t *config_info, __nisdb_table_mapping_t *table_info);
2N/Aextern void initialize_yp_parse_structs(__yp_domain_context_t *ypDomains);
2N/A
2N/A/* Deallocation functions */
2N/Aextern void free_parse_structs(void);
2N/Aextern void free_yp_domain_context(__yp_domain_context_t *domains);
2N/Aextern void free_config_info(__nis_config_info_t *config_info);
2N/Aextern void free_mapping_rule(__nis_mapping_rule_t *rule);
2N/Aextern void free_object_dn(__nis_object_dn_t *obj_dn);
2N/Aextern void free_mapping_format(__nis_mapping_format_t *fmt);
2N/Aextern void free_index(__nis_index_t *index);
2N/Aextern void free_mapping_item(__nis_mapping_item_t *item);
2N/Aextern void free_mapping_element(__nis_mapping_element_t *e);
2N/Aextern void free_mapping_sub_element(__nis_mapping_sub_element_t *sub);
2N/Aextern void free_proxy_info(__nis_ldap_proxy_info *proxy_info);
2N/Aextern void free_table_mapping(__nis_table_mapping_t *mapping);
2N/A
2N/A/* Parser functions */
2N/Aextern int read_line(int fd, char *buffer, int buflen);
2N/Aextern __nis_table_mapping_t *find_table_mapping(const char *s, int len,
2N/A __nis_table_mapping_t *table_mapping);
2N/Aextern int second_parser_pass(__nis_table_mapping_t **table_mapping);
2N/Aextern int final_parser_pass(__nis_table_mapping_t **table_mapping,
2N/A __yp_domain_context_t *ypDomains);
2N/Aextern int finish_parse(__nis_ldap_proxy_info *proxy_info,
2N/A __nis_table_mapping_t **table_mapping);
2N/Aextern void set_default_values(__nis_ldap_proxy_info *proxy_info,
2N/A __nis_config_t *config_info, __nisdb_table_mapping_t *table_info);
2N/A
2N/Aextern int add_config_attribute(config_key attrib_num, const char *attrib_val,
2N/A int attrib_len, __nis_config_info_t *config_info);
2N/Aextern int add_bind_attribute(config_key attrib_num, const char *attrib_val,
2N/A int attrib_len, __nis_ldap_proxy_info *proxy_info);
2N/Aextern int add_operation_attribute(config_key attrib_num,
2N/A const char *attrib_val, int attrib_len, __nis_config_t *config_info,
2N/A __nisdb_table_mapping_t *table_info);
2N/Aextern int add_mapping_attribute(config_key attrib_num, const char *attrib_val,
2N/A int attrib_len, __nis_table_mapping_t **table_mapping);
2N/Aextern int add_ypdomains_attribute(config_key attrib_num,
2N/A const char *attrib_val, int attrib_len,
2N/A __yp_domain_context_t *ypDomains);
2N/Aextern config_key get_attrib_num(const char *s, int n);
2N/Abool_t is_cmd_line_option(config_key a_num);
2N/A
2N/Aextern const char *
2N/Askip_get_dn(const char *dn, const char *end);
2N/Aextern const char *get_search_triple(const char *s, const char *end_s,
2N/A __nis_search_triple_t *triple);
2N/Aextern bool_t parse_index(const char *s, const char *end_s,
2N/A __nis_index_t *index);
2N/Aextern bool_t add_element(__nis_mapping_element_t *e,
2N/A __nis_mapping_rlhs_t *m);
2N/Aextern const char *skip_token(const char *s, const char *end_s,
2N/A token_type t);
2N/Aextern const char *get_next_extract_format_item(const char *begin_fmt,
2N/A const char *end_fmt, __nis_mapping_format_t *fmt);
2N/Aextern const char *get_next_print_format_item(const char *begin_fmt,
2N/A const char *end_fmt, __nis_mapping_format_t *fmt);
2N/Aextern const char *get_next_token(const char **begin_token,
2N/A const char **end_token, token_type *t);
2N/Aextern const char *get_next_object_dn_token(const char **begin_ret,
2N/A const char **end_ret, object_dn_token *token);
2N/Aextern const char *get_ldap_filter(const char **begin, const char **end);
2N/Aconst char *get_ava_list(const char **begin, const char **end,
2N/A bool_t end_nis);
2N/A
2N/Aextern void init_yptol_flag();
2N/A/* Utility functions */
2N/Aextern char *s_strndup_esc(const char *s, int n);
2N/Aextern char *s_strndup(const char *s, int n);
2N/Aextern char *s_strdup(const char *s);
2N/Aextern void *s_calloc(size_t n, size_t size);
2N/Aextern void *s_realloc(void *s, size_t size);
2N/Aextern bool_t is_whitespace(int c);
2N/Aextern bool_t contains_string(const char *s1, const char *s2);
2N/Aextern const char *skip_string(const char *s1, const char *s2, int len);
2N/Aextern bool_t same_string(const char *s1, const char *s2, int len);
2N/A
2N/A/* Error and information reporting functions */
2N/Aextern void report_error(const char *str, const char *attr);
2N/Aextern void report_error2(const char *str1, const char *str2);
2N/Aextern void report_info(const char *str, const char *arg);
2N/Aextern void report_conn_error(conn_error e, const char *str1, const char *str2);
2N/Aextern void warn_duplicate_map(const char *db_id, config_key attrib_num);
2N/A
2N/A/* Validation functions */
2N/Aextern bool_t validate_dn(const char *s, int len);
2N/Aextern bool_t validate_ldap_filter(const char *s, const char *end);
2N/A
2N/Aextern int start_line_num;
2N/Aextern int cur_line_num;
2N/Aextern int seq_num;
2N/Aextern parse_error p_error;
2N/Aextern char _key_val[38];
2N/Aextern const char *command_line_source;
2N/Aextern const char *file_source;
2N/Aextern const char *ldap_source;
2N/Aextern const char *warn_file;
2N/A
2N/A/* SSL and sasl-digest md5 functions */
2N/Aint ldapssl_client_init(const char *certdbpath, void *certdbhandle);
2N/Aconst char *ldapssl_err2string(const int prerrno);
2N/ALDAP *ldapssl_init(const char *defhost, int defport, int defsecure);
2N/Aint ldap_x_sasl_digest_md5_bind_s(LDAP *ld, char *user_name,
2N/A struct berval *cred,
2N/A LDAPControl **serverctrls, LDAPControl **clientctrls);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _NIS_PARSE_LDAP_CONF_H */