コード例 #1
0
ファイル: valsort.c プロジェクト: ystk/debian-openldap
int valsort_initialize( void )
{
	int rc;

	valsort.on_bi.bi_type = "valsort";
	valsort.on_bi.bi_db_destroy = valsort_destroy;
	valsort.on_bi.bi_db_open = valsort_db_open;

	valsort.on_bi.bi_op_add = valsort_add;
	valsort.on_bi.bi_op_modify = valsort_modify;

	valsort.on_response = valsort_response;

	valsort.on_bi.bi_cf_ocs = valsort_cfocs;

	rc = register_supported_control( LDAP_CONTROL_VALSORT,
		SLAP_CTRL_SEARCH | SLAP_CTRL_HIDE, NULL, valsort_parseCtrl,
		&valsort_cid );
	if ( rc != LDAP_SUCCESS ) {
		Debug( LDAP_DEBUG_ANY, "Failed to register control %d\n", rc, 0, 0 );
		return rc;
	}

	syn_numericString = syn_find( "1.3.6.1.4.1.1466.115.121.1.36" );

	rc = config_register_schema( valsort_cfats, valsort_cfocs );
	if ( rc ) return rc;

	return overlay_register(&valsort);
}
コード例 #2
0
ファイル: init.c プロジェクト: tiniesst/ReOpenLDAP
void
init_component_description_table () {
	AsnTypeId id;
	struct berval mr;
	AsnTypetoSyntax* asn_to_syn;
	Syntax* syn;

	for ( id = BASICTYPE_BOOLEAN; id != ASNTYPE_END ; id++ ) {
		asntype_to_compType_mapping_tbl[id].ac_comp_type.ct_subtypes = NULL;
		asntype_to_compType_mapping_tbl[id].ac_comp_type.ct_syntax =  NULL;

		/* Equality Matching Rule */
		if ( asntype_to_compMR_mapping_tbl[id].atc_equality ) {
			mr.bv_val = asntype_to_compMR_mapping_tbl[id].atc_equality;
			mr.bv_len = strlen(asntype_to_compMR_mapping_tbl[id].atc_equality);
			asntype_to_compType_mapping_tbl[id].ac_comp_type.ct_equality = mr_bvfind( &mr );
		}
		/* Approx Matching Rule */
		if ( asntype_to_compMR_mapping_tbl[id].atc_approx ) {
			mr.bv_val = asntype_to_compMR_mapping_tbl[id].atc_approx;
			mr.bv_len = strlen(asntype_to_compMR_mapping_tbl[id].atc_approx);
			asntype_to_compType_mapping_tbl[id].ac_comp_type.ct_approx = mr_bvfind( &mr );
		}

		/* Ordering Matching Rule */
		if ( asntype_to_compMR_mapping_tbl[id].atc_ordering ) {
			mr.bv_val = asntype_to_compMR_mapping_tbl[id].atc_ordering;
			mr.bv_len = strlen(asntype_to_compMR_mapping_tbl[id].atc_ordering);
			asntype_to_compType_mapping_tbl[id].ac_comp_type.ct_ordering= mr_bvfind( &mr );
		}

		/* Substr Matching Rule */
		if ( asntype_to_compMR_mapping_tbl[id].atc_substr ) {
			mr.bv_val = asntype_to_compMR_mapping_tbl[id].atc_substr;
			mr.bv_len = strlen(asntype_to_compMR_mapping_tbl[id].atc_substr);
			asntype_to_compType_mapping_tbl[id].ac_comp_type.ct_substr = mr_bvfind( &mr );
		}
		/* Syntax */

		asn_to_syn = &asn_to_syntax_mapping_tbl[ id ];
		if ( asn_to_syn->ats_syn_oid )
			syn = syn_find ( asn_to_syn->ats_syn_oid );
		else
			syn = NULL;
		asntype_to_compType_mapping_tbl[id].ac_comp_type.ct_syntax = syn;

		/* Initialize Component Descriptions of primitive ASN.1 types */
		asntype_to_compdesc_mapping_tbl[id].atcd_cd.cd_comp_type = (AttributeType*)&asntype_to_compType_mapping_tbl[id].ac_comp_type;
	}
}
コード例 #3
0
ファイル: rdnval.c プロジェクト: RevanthPar/openldap
int
rdnval_initialize(void)
{
	int code, i;

	for ( i = 0; as[ i ].desc != NULL; i++ ) {
		code = register_at( as[ i ].desc, as[ i ].adp, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"rdnval_initialize: register_at #%d failed\n",
				i, 0, 0 );
			return code;
		}

		/* Allow Manager to set these as needed */
		if ( is_at_no_user_mod( (*as[ i ].adp)->ad_type ) ) {
			(*as[ i ].adp)->ad_type->sat_flags |=
				SLAP_AT_MANAGEABLE;
		}
	}

	syn_IA5String = syn_find( "1.3.6.1.4.1.1466.115.121.1.26" );
	if ( syn_IA5String == NULL ) {
		Debug( LDAP_DEBUG_ANY,
			"rdnval_initialize: unable to find syntax '1.3.6.1.4.1.1466.115.121.1.26' (IA5String)\n",
			0, 0, 0 );
		return LDAP_OTHER;
	}

	rdnval.on_bi.bi_type = "rdnval";

	rdnval.on_bi.bi_op_add = rdnval_op_add;
	rdnval.on_bi.bi_op_modrdn = rdnval_op_rename;

	rdnval.on_bi.bi_db_init = rdnval_db_init;
	rdnval.on_bi.bi_db_open = rdnval_db_open;

	return overlay_register( &rdnval );
}