3 * Copyright 2000-2011 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
8 #include "LDAPMessage.h"
10 #include "LDAPResult.h"
11 #include "LDAPExtResult.h"
12 #include "LDAPSaslBindResult.h"
13 #include "LDAPRequest.h"
14 #include "LDAPSearchResult.h"
15 #include "LDAPSearchReference.h"
21 LDAPMsg::LDAPMsg(LDAPMessage *msg){
22 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPMsg::LDAPMsg()" << endl);
23 msgType=ldap_msgtype(msg);
27 LDAPMsg::LDAPMsg(int type, int id=0){
28 DEBUG(LDAP_DEBUG_CONSTRUCT,"LDAPMsg::LDAPMsg()" << endl);
34 LDAPMsg* LDAPMsg::create(const LDAPRequest *req, LDAPMessage *msg){
35 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::create()" << endl);
36 switch(ldap_msgtype(msg)){
38 return new LDAPSearchResult(req,msg);
40 case SEARCH_REFERENCE :
41 return new LDAPSearchReference(req, msg);
43 case EXTENDED_RESPONSE :
44 return new LDAPExtResult(req,msg);
47 return new LDAPSaslBindResult(req,msg);
49 return new LDAPResult(req, msg);
55 int LDAPMsg::getMessageType(){
56 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMessageType()" << endl);
60 int LDAPMsg::getMsgID(){
61 DEBUG(LDAP_DEBUG_TRACE,"LDAPMsg::getMsgID()" << endl);
65 bool LDAPMsg::hasControls() const{
69 const LDAPControlSet& LDAPMsg::getSrvControls() const {