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 "LDAPRequest.h"
12 #include "LDAPSearchResult.h"
13 #include "LDAPSearchReference.h"
19 LDAPMsg::LDAPMsg(LDAPMessage *msg){
20 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPMsg::LDAPMsg()" << endl);
21 msgType=ldap_msgtype(msg);
25 LDAPMsg* LDAPMsg::create(const LDAPRequest *req, LDAPMessage *msg){
26 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::create()" << endl);
27 switch(ldap_msgtype(msg)){
29 return new LDAPSearchResult(req,msg);
31 case SEARCH_REFERENCE :
32 return new LDAPSearchReference(req, msg);
34 case EXTENDED_RESPONSE :
35 return new LDAPExtResult(req,msg);
38 return new LDAPResult(req, msg);
44 int LDAPMsg::getMessageType(){
45 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMessageType()" << endl);
49 int LDAPMsg::getMsgID(){
50 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMsgID()" << endl);
54 bool LDAPMsg::hasControls() const{
58 const LDAPControlSet& LDAPMsg::getSrvControls() const {