2000-09-01 14:46:32 -04:00
|
|
|
/*
|
|
|
|
|
* Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
|
|
|
|
|
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef LDAP_CONSTRAINTS_H
|
|
|
|
|
#define LDAP_CONSTRAINTS_H
|
|
|
|
|
#include <list>
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "ac/time.h"
|
|
|
|
|
|
|
|
|
|
#include "LDAPControl.h"
|
2000-10-03 14:25:34 -04:00
|
|
|
#include "LDAPControlSet.h"
|
|
|
|
|
#include "LDAPRebind.h"
|
2000-09-01 14:46:32 -04:00
|
|
|
|
|
|
|
|
//TODO!!
|
|
|
|
|
// * implement the Alias-Handling Option (OPT_DEREF)
|
|
|
|
|
// * the Restart-Option ???
|
|
|
|
|
// * default Server(s)
|
|
|
|
|
|
2000-10-03 14:25:34 -04:00
|
|
|
//* Class for representating the various protocol options
|
|
|
|
|
/** This class represents some options that can be set for a LDAPConnection
|
2000-09-01 14:46:32 -04:00
|
|
|
* operation. Namely these are time and size limits. Options for referral
|
|
|
|
|
* chasing and a default set of client of server controls to be used with
|
|
|
|
|
* every request
|
|
|
|
|
*/
|
|
|
|
|
class LDAPConstraints{
|
2000-10-03 14:25:34 -04:00
|
|
|
|
2000-09-01 14:46:32 -04:00
|
|
|
public :
|
2000-10-03 14:25:34 -04:00
|
|
|
const static int DEREF_NEVER = 0x00;
|
|
|
|
|
const static int DEREF_SEARCHING = 0x01;
|
|
|
|
|
const static int DEREF_FINDING = 0x02;
|
|
|
|
|
const static int DEREF_ALWAYS = 0x04;
|
|
|
|
|
|
|
|
|
|
//* Constructs a LDAPConstraints object with default values
|
2000-09-01 14:46:32 -04:00
|
|
|
LDAPConstraints();
|
|
|
|
|
|
2000-10-03 14:25:34 -04:00
|
|
|
//* Copy constructor
|
2000-09-01 14:46:32 -04:00
|
|
|
LDAPConstraints(const LDAPConstraints& c);
|
|
|
|
|
|
|
|
|
|
~LDAPConstraints();
|
|
|
|
|
|
2000-10-03 14:25:34 -04:00
|
|
|
void setAliasDeref(int deref);
|
|
|
|
|
void setMaxTime(int t);
|
2000-09-01 14:46:32 -04:00
|
|
|
void setSizeLimit(int s);
|
|
|
|
|
void setReferralChase(bool rc);
|
2000-10-03 14:25:34 -04:00
|
|
|
void setHopLimit(int hop);
|
|
|
|
|
void setReferralRebind(const LDAPRebind* rebind);
|
|
|
|
|
void setServerControls(const LDAPControlSet* ctrls);
|
|
|
|
|
void setClientControls(const LDAPControlSet* ctrls);
|
|
|
|
|
|
|
|
|
|
int getAliasDeref() const;
|
|
|
|
|
int getMaxTime() const ;
|
2000-09-01 14:46:32 -04:00
|
|
|
int getSizeLimit() const;
|
2000-10-03 14:25:34 -04:00
|
|
|
const LDAPRebind* getReferralRebind() const;
|
|
|
|
|
const LDAPControlSet* getServerControls() const;
|
|
|
|
|
const LDAPControlSet* getClientControls() const;
|
|
|
|
|
|
|
|
|
|
//*for internal use only
|
2000-09-01 14:46:32 -04:00
|
|
|
LDAPControl** getSrvCtrlsArray() const;
|
2000-10-03 14:25:34 -04:00
|
|
|
|
|
|
|
|
//*for internal use only
|
2000-09-01 14:46:32 -04:00
|
|
|
LDAPControl** getClCtrlsArray() const;
|
2000-10-03 14:25:34 -04:00
|
|
|
|
|
|
|
|
//*for internal use only
|
2000-09-01 14:46:32 -04:00
|
|
|
timeval* getTimeoutStruct() const;
|
|
|
|
|
bool getReferralChase() const ;
|
2000-10-03 14:25:34 -04:00
|
|
|
int getHopLimit() const;
|
|
|
|
|
|
|
|
|
|
private :
|
|
|
|
|
int m_aliasDeref;
|
|
|
|
|
|
|
|
|
|
//* max. time the server may spend for a search request
|
|
|
|
|
int m_maxTime;
|
|
|
|
|
|
|
|
|
|
//* max number of entries to return from a search request
|
|
|
|
|
int m_maxSize;
|
|
|
|
|
|
|
|
|
|
//* Flag for enabling automatic referral/reference chasing
|
|
|
|
|
bool m_referralChase;
|
|
|
|
|
|
|
|
|
|
//* HopLimit for referral chasing
|
|
|
|
|
int m_HopLimit;
|
|
|
|
|
|
|
|
|
|
//* Alias dereferencing option
|
|
|
|
|
int m_deref;
|
|
|
|
|
|
|
|
|
|
//* Object used to do bind for Referral chasing
|
|
|
|
|
const LDAPRebind* m_refRebind;
|
|
|
|
|
|
|
|
|
|
//* List of Client Controls that should be used for each request
|
|
|
|
|
LDAPControlSet* m_clientControls;
|
|
|
|
|
|
|
|
|
|
//* List of Server Controls that should be used for each request
|
|
|
|
|
LDAPControlSet* m_serverControls;
|
|
|
|
|
|
2000-09-01 14:46:32 -04:00
|
|
|
};
|
|
|
|
|
#endif //LDAP_CONSTRAINTS_H
|