예제 #1
0
/*  ADDITION
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function adds the values found at register
 *     B and C and places the resulting uint32_t into
 *     register A.
 *
 *  Output: N/A
 */
void addition(int A, int B, int C)
{
  	uint32_t b = register_at(B);
	uint32_t c = register_at(C);
	  
	uint32_t word = (b + c);
	assign_to_register(word, A);
}
예제 #2
0
/*  MULTIPLICATION
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function multiplies the values found at register
 *     B and C and places the resulting uint32_t into
 *     register A.
 *
 *  Output: N/A
 */
void multiplication(int A, int B, int C)
{
  	uint32_t b = register_at(B);
	uint32_t c = register_at(C);
	
	uint32_t word = (b * c);
	assign_to_register(word, A);
}
예제 #3
0
/*  BITWISE_NAND
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function bitwisenands the values found at register
 *     B and C and places the resulting uint32_t into
 *     register A.
 *
 *  Output: N/A
 */
void bitwise_nand(int A, int B, int C)
{
  	uint32_t b = register_at(B);
	uint32_t c = register_at(C);

	uint32_t word = ~(b & c);
	assign_to_register(word, A);
}
예제 #4
0
/*	SEGMENTED_LOAD
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function returns the segment found in the segment
 *     memory sequence at the id found in register B. The 
 *     uint32_t word found at offset found in register C is
 *     then placed in register A.
 *
 *  Output: N/A
 */
void segmented_load(int A, int B, int C)
{
// 	fprintf(stderr, "in seg load\n");
	uint32_t b = register_at(B);
	uint32_t c = register_at(C);

	Seg_array seg_array = SEG_MEMORY[b];
	assign_to_register(seg_array->segment[(int)c], A);
}
예제 #5
0
/*  CONDITIONAL_MOVE 
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function checks to see if the word at
 *     register C != 0. If it does the operation does
 *     does nothing, if it doesn't equal zero the value
 *     found at register B is placed in register A 
 *
 *  Output: N/A
 */
void conditional_move(int A, int B, int C)
{
	uint32_t b = register_at(B);
	uint32_t c = register_at(C);

	if (c != 0){
		assign_to_register(b, A);
	}
}
예제 #6
0
/*	SEGMENTED_STORE
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function returns the segment found in the segment
 *     memory sequence at the id found in register A. The 
 *     uint32_t word found at register C is then placed
 *     in the segment at the offset found in register B
 *
 *  Output: N/A
 */
void segmented_store(int A, int B, int C)
{
// 	fprintf(stderr, "in seg store\n");
	uint32_t a = register_at(A);
	uint32_t b = register_at(B);
	uint32_t c = register_at(C);
	Seg_array seg_array = SEG_MEMORY[a];
	if (seg_array->segment[b] == 0) {
		seg_array->num_elements++;
	}
	seg_array->segment[b] = c;	
}	
예제 #7
0
/*
 * call from within bdb_initialize()
 */
static int
bdb_monitor_initialize( void )
{
	int		i, code;
	ConfigArgs c;
	char	*argv[ 3 ];

	static int	bdb_monitor_initialized = 0;

	if ( backend_info( "monitor" ) == NULL ) {
		return -1;
	}

	if ( bdb_monitor_initialized++ ) {
		return 0;
	}

	/* register schema here */

	argv[ 0 ] = "back-bdb/back-hdb monitor";
	c.argv = argv;
	c.argc = 3;
	c.fname = argv[0];

	for ( i = 0; s_oid[ i ].name; i++ ) {
		c.lineno = i;
		argv[ 1 ] = s_oid[ i ].name;
		argv[ 2 ] = s_oid[ i ].oid;

		if ( parse_oidm( &c, 0, NULL ) != 0 ) {
			Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
				": unable to add "
				"objectIdentifier \"%s=%s\"\n",
				s_oid[ i ].name, s_oid[ i ].oid, 0 );
			return 1;
		}
	}

	for ( i = 0; s_at[ i ].desc != NULL; i++ ) {
		code = register_at( s_at[ i ].desc, s_at[ i ].ad, 1 );
		if ( code != LDAP_SUCCESS ) {
			Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
				": register_at failed\n",
				0, 0, 0 );
		}
		(*s_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
	}

	for ( i = 0; s_oc[ i ].desc != NULL; i++ ) {
		code = register_oc( s_oc[ i ].desc, s_oc[ i ].oc, 1 );
		if ( code != LDAP_SUCCESS ) {
			Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
				": register_oc failed\n",
				0, 0, 0 );
		}
		(*s_oc[ i ].oc)->soc_flags |= SLAP_OC_HIDE;
	}

	return 0;
}
예제 #8
0
int lastbind_initialize()
{
	int i, code;

	/* register operational schema for this overlay (authTimestamp attribute) */
	for (i=0; lastBind_OpSchema[i].def; i++) {
		code = register_at( lastBind_OpSchema[i].def, lastBind_OpSchema[i].ad, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"lastbind_initialize: register_at failed\n" );
			return code;
		}
	}

	ad_authTimestamp->ad_type->sat_flags |= SLAP_AT_MANAGEABLE;

	lastbind.on_bi.bi_type = "lastbind";
	lastbind.on_bi.bi_db_init = lastbind_db_init;
	lastbind.on_bi.bi_db_close = lastbind_db_close;
	lastbind.on_bi.bi_op_bind = lastbind_bind;

	/* register configuration directives */
	lastbind.on_bi.bi_cf_ocs = lastbindocs;
	code = config_register_schema( lastbindcfg, lastbindocs );
	if ( code ) return code;

	return overlay_register( &lastbind );
}
예제 #9
0
int
vernum_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,
				"vernum_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;
		}
	}

	vernum.on_bi.bi_type = "vernum";

	vernum.on_bi.bi_op_add = vernum_op_add;
	vernum.on_bi.bi_op_modify = vernum_op_modify;

	vernum.on_bi.bi_db_init = vernum_db_init;
	vernum.on_bi.bi_db_open = vernum_db_open;
	vernum.on_bi.bi_db_destroy = vernum_db_destroy;

	return overlay_register( &vernum );
}
예제 #10
0
void map_segment(int A, int B, int C)
{
// 	fprintf(stderr, "in map seg\n");
	(void) A;
	uint32_t c = register_at(C);
	Seg_array seg_array = initialize_seg_array((int)c);
	uint32_t id = 0;
     //   fprintf(stderr, "before resize\n");
	if (SEG_NUM + 1 >= SEG_LENGTH){
      //          fprintf(stderr, "in resize\n");
		resize_seg_mem(SEG_LENGTH * 2);
	}
       // fprintf(stderr, "after resize\n");
	if (Seq_length(UNMAP_SEG) == 0){
		id = SEG_NUM + 1;
		SEG_NUM++;
	}
 	else {
		id = (uint32_t)(uintptr_t)Seq_remlo(UNMAP_SEG); 
	}
	assign_to_register(id, B);
// 	fprintf(stderr, "id: %u, seg_num: %d, mem_length: %d\n", id, SEG_NUM, UArray_length(SEG_MEMORY));
	SEG_MEMORY[id] = seg_array;
	//fprintf(stderr, "after seg\n");
}
예제 #11
0
int
pguid_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,
				"pguid_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;
		}
	}

	pguid.on_bi.bi_type = "pguid";

	pguid.on_bi.bi_op_add = pguid_op_add;
	pguid.on_bi.bi_op_modrdn = pguid_op_rename;

	pguid.on_bi.bi_db_init = pguid_db_init;
	pguid.on_bi.bi_db_open = pguid_db_open;

	return overlay_register( &pguid );
}
예제 #12
0
파일: allowed.c 프로젝트: benegon/openldap
static
#endif /* SLAPD_OVER_ALLOWED == SLAPD_MOD_DYNAMIC */
int
aa_initialize( void )
{
	int i;

	aa.on_bi.bi_type = "allowed";

	aa.on_bi.bi_operational = aa_operational;

	/* aa schema integration */
	for ( i = 0; aa_attrs[i].at; i++ ) {
		int code;

		code = register_at( aa_attrs[i].at, aa_attrs[i].ad, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"aa_initialize: register_at failed\n", 0, 0, 0 );
			return -1;
		}
	}

	return overlay_register( &aa );
}
예제 #13
0
파일: usn.c 프로젝트: benegon/openldap
int
usn_init( void )
{
	int i, code;

	memset( &usn, 0, sizeof( slap_overinst ) );
	usn.on_bi.bi_type = "usn";
	usn.on_bi.bi_db_init = usn_db_init;
	usn.on_bi.bi_db_destroy = usn_db_destroy;
	usn.on_bi.bi_db_open = usn_db_open;
	usn.on_bi.bi_db_close = usn_db_close;

	usn.on_bi.bi_op_modify = usn_func;
	usn.on_bi.bi_op_modrdn = usn_func;
	usn.on_bi.bi_op_add = usn_func;
	usn.on_bi.bi_op_delete = usn_func;
	usn.on_bi.bi_operational = usn_operational;

	for ( i = 0; as[i].desc; i++ ) {
		code = register_at( as[i].desc, as[i].adp, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"usn_init: register_at #%d failed\n", i, 0, 0 );
			return code;
		}
	}
	return overlay_register( &usn );
}
예제 #14
0
/*
 * call from within ldap_back_initialize()
 */
static int
ldap_back_monitor_initialize( void )
{
	int		i, code;
	ConfigArgs c;
	char	*argv[ 3 ];

	static int	ldap_back_monitor_initialized = 0;

	/* register schema here; if compiled as dynamic object,
	 * must be loaded __after__ back_monitor.la */

	if ( ldap_back_monitor_initialized++ ) {
		return 0;
	}

	if ( backend_info( "monitor" ) == NULL ) {
		return -1;
	}

	argv[ 0 ] = "back-ldap monitor";
	c.argv = argv;
	c.argc = 3;
	c.fname = argv[0];
	for ( i = 0; s_oid[ i ].name; i++ ) {
	
		argv[ 1 ] = s_oid[ i ].name;
		argv[ 2 ] = s_oid[ i ].oid;

		if ( parse_oidm( &c, 0, NULL ) != 0 ) {
			Debug( LDAP_DEBUG_ANY,
				"ldap_back_monitor_initialize: unable to add "
				"objectIdentifier \"%s=%s\"\n",
				s_oid[ i ].name, s_oid[ i ].oid, 0 );
			return 1;
		}
	}

	for ( i = 0; s_at[ i ].desc != NULL; i++ ) {
		code = register_at( s_at[ i ].desc, s_at[ i ].ad, 1 );
		if ( code != LDAP_SUCCESS ) {
			Debug( LDAP_DEBUG_ANY,
				"ldap_back_monitor_initialize: register_at failed\n",
				0, 0, 0 );
		}
	}

	for ( i = 0; s_oc[ i ].desc != NULL; i++ ) {
		code = register_oc( s_oc[ i ].desc, s_oc[ i ].oc, 1 );
		if ( code != LDAP_SUCCESS ) {
			Debug( LDAP_DEBUG_ANY,
				"ldap_back_monitor_initialize: register_oc failed\n",
				0, 0, 0 );
		}
	}

	return 0;
}
예제 #15
0
/*	OUTPUT
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function returns the uint32_t found at from
 *     register C and pulls the char with lsb 0 out of the
 *     word and prints it to stdout.
 *
 *  Output: N/A
 */
void output(int A, int B, int C)
{
	(void) A;
	(void) B;

	uint32_t word = register_at(C);
	char s = 0;
	s = Bitpack_getu(word, 8, 0);
	putchar(s);
}
예제 #16
0
/*	UNMAP_SEGMENT
 *  Input: Three ints (A, B, C) representing registers
 *
 *     This function returns the segment found in the segment
 *     memory sequence at the id found in register C. A NULL
 *     character is placed at that space in the segment_memory
 *     and that id is placed in the unmapped id sequence.
 *
 *  Output: N/A
 */
void unmap_segment(int A, int B, int C)
{
//   fprintf(stderr, "in unmap seg\n");
	(void) A;
	(void) B;
	uint32_t c = register_at(C);
	Seg_array seg_array = SEG_MEMORY[c];
	SEG_MEMORY[c] = 0;
	FREE(seg_array->segment);
	FREE(seg_array);
	Seq_addhi(UNMAP_SEG, (void *)(uintptr_t)c);
}
예제 #17
0
/*	LOAD_PROGRAM
 *  Input: Three ints (A, B, C) representing registers
 *	Seq_T segment = (Seq_T)Seq_get(SEGMEMORY, 0);

 *     This function searches for the segment at the id
 *     found in register B. If the id is zero, the counter
 *     to the value found in register C. If the id is not
 *     the instruction code segment is freed and the
 *     segment at id is duplicated and placed in the 0th
 *     position in the segment_memory sequence.
 *
 *  Output: N/A
 */
void load_program(int A, int B, int C)
{
// 	fprintf(stderr, "in load prog\n");
	(void) A;
	uint32_t b = register_at(B); 
	uint32_t c = register_at(C);
	if (b == 0){
		uint32_t c = register_at(C);
		if (c == 0)
			assign_counter(-1);
		else
			assign_counter(c - 1);
		return;
	}
	Seg_array seg_array = SEG_MEMORY[b];
	Seg_array new_seg_array = array_copy(seg_array);
	Seg_array inst_seg_array = SEG_MEMORY[0];
	FREE(inst_seg_array);
	SEG_MEMORY[0] = new_seg_array;
	if (c == 0)
		assign_counter(-1);
	assign_counter(c - 1);
}
예제 #18
0
int autoca_initialize() {
	int i, code;

	autoca.on_bi.bi_type = "autoca";
	autoca.on_bi.bi_db_init = autoca_db_init;
	autoca.on_bi.bi_db_destroy = autoca_db_destroy;
	autoca.on_bi.bi_db_open = autoca_db_open;
	autoca.on_bi.bi_op_search = autoca_op_search;

	autoca.on_bi.bi_cf_ocs = autoca_ocs;
	code = config_register_schema( autoca_cfg, autoca_ocs );
	if ( code ) return code;

	for ( i=0; aca_attrs[i]; i++ ) {
		code = register_at( aca_attrs[i], NULL, 0 );
		if ( code ) return code;
	}

	return overlay_register( &autoca );
}
예제 #19
0
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 );
}
예제 #20
0
static
#endif /* SLAPD_OVER_RETCODE == SLAPD_MOD_DYNAMIC */
int
retcode_initialize( void )
{
	int		i, code;

	static struct {
		char			*desc;
		AttributeDescription	**ad;
	} retcode_at[] = {
	        { "( 1.3.6.1.4.1.4203.666.11.4.1.1 "
		        "NAME ( 'errCode' ) "
		        "DESC 'LDAP error code' "
		        "EQUALITY integerMatch "
		        "ORDERING integerOrderingMatch "
		        "SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 "
			"SINGLE-VALUE )",
			&ad_errCode },
		{ "( 1.3.6.1.4.1.4203.666.11.4.1.2 "
			"NAME ( 'errOp' ) "
			"DESC 'Operations the errObject applies to' "
			"EQUALITY caseIgnoreMatch "
			"SUBSTR caseIgnoreSubstringsMatch "
			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
			&ad_errOp},
		{ "( 1.3.6.1.4.1.4203.666.11.4.1.3 "
			"NAME ( 'errText' ) "
			"DESC 'LDAP error textual description' "
			"EQUALITY caseIgnoreMatch "
			"SUBSTR caseIgnoreSubstringsMatch "
			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 "
			"SINGLE-VALUE )",
			&ad_errText },
		{ "( 1.3.6.1.4.1.4203.666.11.4.1.4 "
			"NAME ( 'errSleepTime' ) "
			"DESC 'Time to wait before returning the error' "
			"EQUALITY integerMatch "
			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 "
			"SINGLE-VALUE )",
			&ad_errSleepTime },
		{ "( 1.3.6.1.4.1.4203.666.11.4.1.5 "
			"NAME ( 'errMatchedDN' ) "
			"DESC 'Value to be returned as matched DN' "
			"EQUALITY distinguishedNameMatch "
			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
			"SINGLE-VALUE )",
			&ad_errMatchedDN },
		{ "( 1.3.6.1.4.1.4203.666.11.4.1.6 "
			"NAME ( 'errUnsolicitedOID' ) "
			"DESC 'OID to be returned within unsolicited response' "
			"EQUALITY objectIdentifierMatch "
			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 "
			"SINGLE-VALUE )",
			&ad_errUnsolicitedOID },
		{ "( 1.3.6.1.4.1.4203.666.11.4.1.7 "
			"NAME ( 'errUnsolicitedData' ) "
			"DESC 'Data to be returned within unsolicited response' "
			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 "
			"SINGLE-VALUE )",
			&ad_errUnsolicitedData },
		{ "( 1.3.6.1.4.1.4203.666.11.4.1.8 "
			"NAME ( 'errDisconnect' ) "
			"DESC 'Disconnect without notice' "
			"SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 "
			"SINGLE-VALUE )",
			&ad_errDisconnect },
		{ NULL }
	};

	static struct {
		char		*desc;
		ObjectClass	**oc;
	} retcode_oc[] = {
		{ "( 1.3.6.1.4.1.4203.666.11.4.3.0 "
			"NAME ( 'errAbsObject' ) "
			"SUP top ABSTRACT "
			"MUST ( errCode ) "
			"MAY ( "
				"cn "
				"$ description "
				"$ errOp "
				"$ errText "
				"$ errSleepTime "
				"$ errMatchedDN "
				"$ errUnsolicitedOID "
				"$ errUnsolicitedData "
				"$ errDisconnect "
			") )",
			&oc_errAbsObject },
		{ "( 1.3.6.1.4.1.4203.666.11.4.3.1 "
			"NAME ( 'errObject' ) "
			"SUP errAbsObject STRUCTURAL "
			")",
			&oc_errObject },
		{ "( 1.3.6.1.4.1.4203.666.11.4.3.2 "
			"NAME ( 'errAuxObject' ) "
			"SUP errAbsObject AUXILIARY "
			")",
			&oc_errAuxObject },
		{ NULL }
	};


	for ( i = 0; retcode_at[ i ].desc != NULL; i++ ) {
		code = register_at( retcode_at[ i ].desc, retcode_at[ i ].ad, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"retcode: register_at failed\n" );
			return code;
		}

		(*retcode_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
	}

	for ( i = 0; retcode_oc[ i ].desc != NULL; i++ ) {
		code = register_oc( retcode_oc[ i ].desc, retcode_oc[ i ].oc, 0 );
		if ( code ) {
			Debug( LDAP_DEBUG_ANY,
				"retcode: register_oc failed\n" );
			return code;
		}

		(*retcode_oc[ i ].oc)->soc_flags |= SLAP_OC_HIDE;
	}

	retcode.on_bi.bi_type = "retcode";

	retcode.on_bi.bi_db_init = retcode_db_init;
	retcode.on_bi.bi_db_open = retcode_db_open;
	retcode.on_bi.bi_db_destroy = retcode_db_destroy;

	retcode.on_bi.bi_op_add = retcode_op_func;
	retcode.on_bi.bi_op_bind = retcode_op_func;
	retcode.on_bi.bi_op_compare = retcode_op_func;
	retcode.on_bi.bi_op_delete = retcode_op_func;
	retcode.on_bi.bi_op_modify = retcode_op_func;
	retcode.on_bi.bi_op_modrdn = retcode_op_func;
	retcode.on_bi.bi_op_search = retcode_op_func;

	retcode.on_bi.bi_extended = retcode_op_func;

	retcode.on_response = retcode_response;

	retcode.on_bi.bi_cf_ocs = rcocs;

	code = config_register_schema( rccfg, rcocs );
	if ( code ) {
		return code;
	}

	return overlay_register( &retcode );
}
예제 #21
0
 Assembler::Register top_of_stack_register() { return register_at(top_of_stack()); }
예제 #22
0
/*
 * call from within bdb_initialize()
 */
static int
bdb_monitor_initialize( void )
{
	int		i, code;
	ConfigArgs c;
	char	*argv[ 3 ];

	static int	bdb_monitor_initialized = 0;

	/* set to 0 when successfully initialized; otherwise, remember failure */
	static int	bdb_monitor_initialized_failure = 1;

	if ( bdb_monitor_initialized++ ) {
		return bdb_monitor_initialized_failure;
	}

	if ( backend_info( "monitor" ) == NULL ) {
		return -1;
	}

	/* register schema here */

	argv[ 0 ] = "back-bdb/back-hdb monitor";
	c.argv = argv;
	c.argc = 3;
	c.fname = argv[0];

	for ( i = 0; s_oid[ i ].name; i++ ) {
		c.lineno = i;
		argv[ 1 ] = s_oid[ i ].name;
		argv[ 2 ] = s_oid[ i ].oid;

		if ( parse_oidm( &c, 0, NULL ) != 0 ) {
			Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
				": unable to add "
				"objectIdentifier \"%s=%s\"\n",
				s_oid[ i ].name, s_oid[ i ].oid, 0 );
			return 2;
		}
	}

	for ( i = 0; s_at[ i ].desc != NULL; i++ ) {
		code = register_at( s_at[ i ].desc, s_at[ i ].ad, 1 );
		if ( code != LDAP_SUCCESS ) {
			Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
				": register_at failed for attributeType (%s)\n",
				s_at[ i ].desc, 0, 0 );
			return 3;

		} else {
			(*s_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
		}
	}

	for ( i = 0; s_oc[ i ].desc != NULL; i++ ) {
		code = register_oc( s_oc[ i ].desc, s_oc[ i ].oc, 1 );
		if ( code != LDAP_SUCCESS ) {
			Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
				": register_oc failed for objectClass (%s)\n",
				s_oc[ i ].desc, 0, 0 );
			return 4;

		} else {
			(*s_oc[ i ].oc)->soc_flags |= SLAP_OC_HIDE;
		}
	}

	return ( bdb_monitor_initialized_failure = LDAP_SUCCESS );
}
예제 #23
0
 void pop(Assembler::Register reg) {
   GUARANTEE(register_at(top_of_stack()) == reg, "Can only pop register at top of stack");
   pop();
 }
예제 #24
0
  Assembler::Register register_for(int index) {
    GUARANTEE(0 < index && index <= top_of_stack(), "Index out of bounds");

    return register_at(top_of_stack() - index);
  }
예제 #25
0
파일: aci.c 프로젝트: Smilefant/ReOpenLDAP
static int
aci_init( void )
{
	/* OpenLDAP eXperimental Syntax */
	static slap_syntax_defs_rec aci_syntax_def = {
		"( 1.3.6.1.4.1.4203.666.2.1 DESC 'OpenLDAP Experimental ACI' )",
			SLAP_SYNTAX_HIDE,
			NULL,
			OpenLDAPaciValidate,
			OpenLDAPaciPretty
	};
	static slap_mrule_defs_rec aci_mr_def = {
		"( 1.3.6.1.4.1.4203.666.4.2 NAME 'OpenLDAPaciMatch' "
			"SYNTAX 1.3.6.1.4.1.4203.666.2.1 )",
			SLAP_MR_HIDE | SLAP_MR_EQUALITY, NULL,
			NULL, OpenLDAPaciNormalize, OpenLDAPaciMatch,
			NULL, NULL,
			NULL
	};
	static struct {
		char			*name;
		char			*desc;
		slap_mask_t		flags;
		AttributeDescription	**ad;
	}		aci_at = {
		"OpenLDAPaci", "( 1.3.6.1.4.1.4203.666.1.5 "
			"NAME 'OpenLDAPaci' "
			"DESC 'OpenLDAP access control information (experimental)' "
			"EQUALITY OpenLDAPaciMatch "
			"SYNTAX 1.3.6.1.4.1.4203.666.2.1 "
			"USAGE directoryOperation )",
		SLAP_AT_HIDE,
		&slap_ad_aci
	};

	int			rc;

	/* ACI syntax */
	rc = register_syntax( &aci_syntax_def );
	if ( rc != 0 ) {
		return rc;
	}

	/* ACI equality rule */
	rc = register_matching_rule( &aci_mr_def );
	if ( rc != 0 ) {
		return rc;
	}

	/* ACI attribute */
	rc = register_at( aci_at.desc, aci_at.ad, 0 );
	if ( rc != LDAP_SUCCESS ) {
		Debug( LDAP_DEBUG_ANY,
			"aci_init: at_register failed\n" );
		return rc;
	}

	/* install flags */
	(*aci_at.ad)->ad_type->sat_flags |= aci_at.flags;

	return rc;
}
예제 #26
0
파일: dds.c 프로젝트: Smilefant/ReOpenLDAP
static
#endif /* SLAPD_OVER_DDS == SLAPD_MOD_DYNAMIC */
int
dds_initialize()
{
	int		rc = 0;
	int		i, code;

	/* Make sure we don't exceed the bits reserved for userland */
	config_check_userland( DDS_LAST );

	if ( !do_not_load_schema ) {
		static struct {
			char			*desc;
			slap_mask_t		flags;
			AttributeDescription	**ad;
		}		s_at[] = {
			{ "( 1.3.6.1.4.1.4203.666.1.57 "
				"NAME ( 'entryExpireTimestamp' ) "
				"DESC 'RFC2589 OpenLDAP extension: expire time of a dynamic object, "
					"computed as now + entryTtl' "
				"EQUALITY generalizedTimeMatch "
				"ORDERING generalizedTimeOrderingMatch "
				"SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 "
				"SINGLE-VALUE "
				"NO-USER-MODIFICATION "
				"USAGE dSAOperation )",
				SLAP_AT_HIDE,
				&ad_entryExpireTimestamp },
			{ NULL }
		};

		for ( i = 0; s_at[ i ].desc != NULL; i++ ) {
			code = register_at( s_at[ i ].desc, s_at[ i ].ad, 0 );
			if ( code ) {
				Debug( LDAP_DEBUG_ANY,
					"dds_initialize: register_at failed\n" );
				return code;
			}
			(*s_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
		}
	}

	if ( !do_not_load_exop ) {
		rc = load_extop2( (struct berval *)&slap_EXOP_REFRESH,
			SLAP_EXOP_WRITES|SLAP_EXOP_HIDE, slap_exop_refresh,
			!do_not_replace_exop );
		if ( rc != LDAP_SUCCESS ) {
			Log1( LDAP_DEBUG_ANY, LDAP_LEVEL_ERR,
				"DDS unable to register refresh exop: %d.\n",
				rc );
			return rc;
		}
	}

	dds.on_bi.bi_type = "dds";

	dds.on_bi.bi_db_init = dds_db_init;
	dds.on_bi.bi_db_open = dds_db_open;
	dds.on_bi.bi_db_close = dds_db_close;
	dds.on_bi.bi_db_destroy = dds_db_destroy;

	dds.on_bi.bi_op_add = dds_op_add;
	dds.on_bi.bi_op_delete = dds_op_delete;
	dds.on_bi.bi_op_modify = dds_op_modify;
	dds.on_bi.bi_op_modrdn = dds_op_rename;
	dds.on_bi.bi_extended = dds_op_extended;

	dds.on_bi.bi_cf_ocs = dds_ocs;

	rc = config_register_schema( dds_cfg, dds_ocs );
	if ( rc ) {
		return rc;
	}

	return overlay_register( &dds );
}