1/* $NetBSD$ */ 2 3/* component.h */ 4/* OpenLDAP: pkg/ldap/servers/slapd/component.h,v 1.4.2.5 2010/04/13 20:23:13 kurt Exp */ 5/* This work is part of OpenLDAP Software <http://www.openldap.org/>. 6 * 7 * Copyright 2004-2010 The OpenLDAP Foundation. 8 * Portions Copyright 2004 by IBM Corporation. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted only as authorized by the OpenLDAP 13 * Public License. 14 * 15 * A copy of this license is available in the file LICENSE in the 16 * top-level directory of the distribution or, alternatively, at 17 * <http://www.OpenLDAP.org/license.html>. 18 */ 19 20#ifndef _H_SLAPD_COMPONENT 21#define _H_SLAPD_COMPONENT 22 23#include "portable.h" 24 25#include <ac/string.h> 26#include <ac/socket.h> 27#include <ldap_pvt.h> 28#include "lutil.h" 29#include <ldap.h> 30#include "slap.h" 31 32typedef enum { ASN_BASIC, ASN_COMPOSITE } AsnType; 33/* 34 * Decoder Modes 35 * Different operation is required to handle Decoding(2), Extracted Component 36 * decoding(0), ANY DEFINED TYPe(2) 37 * b0 : Component Alloc(yes) 38 * Constructed type : Component Alloc (Yes) 39 * Primitive type : Component Alloc (Yes) 40 * set to mode 2 in inner decoders 41 * b1 : Component Alloc (No) 42 * Constructed type : Component Alloc (No) 43 * Primitive type : Component Alloc (No) 44 * set to mode 2 in inner decoders 45 * b2 : Default Mode 46 * Constructed type : Component Alloc (Yes) 47 * Primitive type : Component Alloc (No) 48 * in addition to above modes, the 4th bit has special meaning, 49 * b4 : if the 4th bit is clear, DecxxxContent is called 50 * b4 : if the 4th bit is set, Decxxx is called, then it is cleared. 51 */ 52#define DEC_ALLOC_MODE_0 0x01 53#define DEC_ALLOC_MODE_1 0x02 54#define DEC_ALLOC_MODE_2 0x04 55#define CALL_TAG_DECODER 0x08 56#define CALL_CONTENT_DECODER ~0x08 57/* 58 * For Attribute Aliasing 59 */ 60#define MAX_ALIASING_ENTRY 128 61typedef struct comp_attribute_aliasing { 62 AttributeDescription* aa_aliasing_ad; 63 AttributeDescription* aa_aliased_ad; 64 ComponentFilter* aa_cf; 65 MatchingRule* aa_mr; 66 char* aa_cf_str; 67} AttributeAliasing; 68 69typedef struct comp_matchingrule_aliasing { 70 MatchingRule* mra_aliasing_attr; 71 MatchingRule* mra_aliased_attr; 72 AttributeDescription* mra_attr; 73 ComponentFilter* mra_cf; 74 MatchingRule* mra_mr; 75 char* mra_cf_str; 76} MatchingRuleAliasing; 77 78#endif 79