1 /* frontend.c - routines for dealing with frontend */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2005 The OpenLDAP Foundation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
11 * A copy of this license is available in the file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
15 /* Portions Copyright (c) 1995 Regents of the University of Michigan.
16 * All rights reserved.
18 * Redistribution and use in source and binary forms are permitted
19 * provided that this notice is preserved and that due credit is given
20 * to the University of Michigan at Ann Arbor. The name of the University
21 * may not be used to endorse or promote products derived from this
22 * software without specific prior written permission. This software
23 * is provided ``as is'' without express or implied warranty.
31 #include <ac/string.h>
32 #include <ac/socket.h>
42 #include "slapi/slapi.h"
45 BackendInfo slap_frontendInfo;
46 BackendDB slap_frontendDB;
47 BackendDB *frontendDB;
53 frontendDB = &slap_frontendDB;
56 frontendDB->be_dfltaccess = ACL_READ;
59 frontendDB->be_def_limit.lms_t_soft = SLAPD_DEFAULT_TIMELIMIT; /* backward compatible limits */
60 frontendDB->be_def_limit.lms_t_hard = 0;
61 frontendDB->be_def_limit.lms_s_soft = SLAPD_DEFAULT_SIZELIMIT; /* backward compatible limits */
62 frontendDB->be_def_limit.lms_s_hard = 0;
63 frontendDB->be_def_limit.lms_s_unchecked = -1; /* no limit on unchecked size */
64 frontendDB->be_def_limit.lms_s_pr = 0; /* page limit */
65 frontendDB->be_def_limit.lms_s_pr_hide = 0; /* don't hide number of entries left */
66 frontendDB->be_def_limit.lms_s_pr_total = 0; /* number of total entries returned by pagedResults equal to hard limit */
69 /* FIXME: do we need this? */
70 frontendDB->be_pcl_mutexp = &frontendDB->be_pcl_mutex;
71 ldap_pvt_thread_mutex_init( frontendDB->be_pcl_mutexp );
73 LDAP_STAILQ_INIT( &frontendDB->be_syncinfo );
77 frontendDB->be_suffix = ch_calloc( 2, sizeof( struct berval ) );
78 ber_str2bv( "", 0, 1, &frontendDB->be_suffix[0] );
79 BER_BVZERO( &frontendDB->be_suffix[1] );
80 frontendDB->be_nsuffix = ch_calloc( 2, sizeof( struct berval ) );
81 ber_str2bv( "", 0, 1, &frontendDB->be_nsuffix[0] );
82 BER_BVZERO( &frontendDB->be_nsuffix[1] );
85 frontendDB->bd_info = &slap_frontendInfo;
88 frontendDB->bd_info->bi_type = "frontend";
91 frontendDB->bd_info->bi_controls = slap_known_controls;
94 frontendDB->bd_info->bi_op_abandon = fe_op_abandon;
95 frontendDB->bd_info->bi_op_add = fe_op_add;
96 frontendDB->bd_info->bi_op_bind = fe_op_bind;
97 frontendDB->bd_info->bi_op_compare = fe_op_compare;
98 frontendDB->bd_info->bi_op_delete = fe_op_delete;
99 frontendDB->bd_info->bi_op_modify = fe_op_modify;
100 frontendDB->bd_info->bi_op_modrdn = fe_op_modrdn;
101 frontendDB->bd_info->bi_op_search = fe_op_search;
102 frontendDB->bd_info->bi_extended = fe_extended;
105 /* FIXME: is this too early? */
106 return backend_startup_one( frontendDB );