1 /* frontend.c - routines for dealing with frontend */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2004 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 frontendDB->be_suffix = ch_calloc( 2, sizeof( struct berval ) );
70 ber_str2bv( "", 0, 1, &frontendDB->be_suffix[0] );
71 BER_BVZERO( &frontendDB->be_suffix[1] );
72 frontendDB->be_nsuffix = ch_calloc( 2, sizeof( struct berval ) );
73 ber_str2bv( "", 0, 1, &frontendDB->be_nsuffix[0] );
74 BER_BVZERO( &frontendDB->be_nsuffix[1] );
77 frontendDB->bd_info = &slap_frontendInfo;
80 frontendDB->bd_info->bi_type = "frontend";
83 frontendDB->bd_info->bi_controls = slap_known_controls;
86 frontendDB->bd_info->bi_op_add = fe_op_add;
87 frontendDB->bd_info->bi_op_bind = fe_op_bind;
88 frontendDB->bd_info->bi_op_compare = fe_op_compare;
89 frontendDB->bd_info->bi_op_delete = fe_op_delete;
90 frontendDB->bd_info->bi_op_modify = fe_op_modify;
91 frontendDB->bd_info->bi_op_modrdn = fe_op_modrdn;
92 frontendDB->bd_info->bi_op_search = fe_op_search;
93 frontendDB->bd_info->bi_extended = fe_extended;