*/
enum {
- PC_CHAINING = 1,
- PC_CACHE_URI = 2,
+ CH_CHAINING = 1,
+ CH_CACHE_URI = 2,
- PC_LAST
+ CH_LAST
};
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
static ConfigTable chaincfg[] = {
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
{ "chain-chaining", "args",
- 2, 4, 0, ARG_MAGIC|ARG_BERVAL|PC_CHAINING, chain_cf_gen,
+ 2, 4, 0, ARG_MAGIC|ARG_BERVAL|CH_CHAINING, chain_cf_gen,
"( OLcfgOvAt:3.1 NAME 'olcChainingBehavior' "
"DESC 'Chaining behavior control parameters (draft-sermersheim-ldap-chaining)' "
"SYNTAX OMsDirectoryString SINGLE-VALUE )", NULL, NULL },
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
{ "chain-cache-uris", "TRUE/FALSE",
- 2, 2, 0, ARG_MAGIC|ARG_ON_OFF|PC_CACHE_URI, chain_cf_gen,
+ 2, 2, 0, ARG_MAGIC|ARG_ON_OFF|CH_CACHE_URI, chain_cf_gen,
"( OLcfgOvAt:3.2 NAME 'olcCacheURIs' "
"DESC 'Enables caching of URIs not present in configuration' "
"SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
if ( c->op == SLAP_CONFIG_EMIT ) {
switch( c->type ) {
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
- case PC_CHAINING: {
+ case CH_CHAINING: {
struct berval resolve = BER_BVNULL,
continuation = BER_BVNULL;
}
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
- case PC_CACHE_URI:
+ case CH_CACHE_URI:
c->value_int = LDAP_CHAIN_CACHE_URI( lc );
break;
} else if ( c->op == LDAP_MOD_DELETE ) {
switch( c->type ) {
- case PC_CHAINING:
+ case CH_CHAINING:
return 1;
- case PC_CACHE_URI:
+ case CH_CACHE_URI:
lc->lc_flags &= ~LDAP_CHAIN_F_CACHE_URI;
break;
switch( c->type ) {
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
- case PC_CHAINING: {
+ case CH_CHAINING: {
char **argv = c->argv;
int argc = c->argc;
BerElementBuffer berbuf;
}
#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
- case PC_CACHE_URI:
+ case CH_CACHE_URI:
if ( c->value_int ) {
lc->lc_flags |= LDAP_CHAIN_F_CACHE_URI;
} else {
{
int rc;
- assert( PC_LAST <= ARGS_USERLAND );
+ /* Make sure we don't exceed the bits reserved for userland */
+ config_check_userland( CH_LAST );
#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
rc = register_supported_control( LDAP_CONTROL_X_CHAINING_BEHAVIOR,
* <http://www.OpenLDAP.org/license.html>.
*/
+#ifndef CONFIG_H
+#define CONFIG_H
+
typedef struct ConfigTable {
char *name;
char *what;
ConfigTable * config_find_keyword(ConfigTable *ct, ConfigArgs *c);
Entry * config_build_entry( Operation *op, SlapReply *rs, CfEntryInfo *parent,
ConfigArgs *c, struct berval *rdn, ConfigOCs *main, ConfigOCs *extra );
+
+ /* Make sure we don't exceed the bits reserved for userland */
+#define config_check_userland(last) \
+ assert( ( ( (last) - 1 ) & ARGS_USERLAND ) == ( (last) - 1 ) );
+
+#endif /* CONFIG_H */