2 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved.
3 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 #include "LDAPMessage.h"
9 #include "LDAPResult.h"
10 #include "LDAPExtResult.h"
11 #include "LDAPSaslBindResult.h"
12 #include "LDAPRequest.h"
13 #include "LDAPSearchResult.h"
14 #include "LDAPSearchReference.h"
20 LDAPMsg::LDAPMsg(LDAPMessage *msg){
21 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPMsg::LDAPMsg()" << endl);
22 msgType=ldap_msgtype(msg);
26 LDAPMsg::LDAPMsg(int type, int id=0){
27 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPMsg::LDAPMsg()" << endl);
33 LDAPMsg* LDAPMsg::create(const LDAPRequest *req, LDAPMessage *msg){
34 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::create()" << endl);
35 switch(ldap_msgtype(msg)){
37 return new LDAPSearchResult(req,msg);
39 case SEARCH_REFERENCE :
40 return new LDAPSearchReference(req, msg);
42 case EXTENDED_RESPONSE :
43 return new LDAPExtResult(req,msg);
46 return new LDAPSaslBindResult(req,msg);
48 return new LDAPResult(req, msg);
54 int LDAPMsg::getMessageType(){
55 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMessageType()" << endl);
59 int LDAPMsg::getMsgID(){
60 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMsgID()" << endl);
64 bool LDAPMsg::hasControls() const{
68 const LDAPControlSet& LDAPMsg::getSrvControls() const {