ldapsdk 0.0.1
|
00001 // $OpenLDAP$ 00002 /* 00003 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. 00004 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file 00005 */ 00006 00007 00008 #ifndef LDAP_MSG_H 00009 #define LDAP_MSG_H 00010 #include <ldap.h> 00011 00012 #include <LDAPControlSet.h> 00013 00014 class LDAPRequest; 00023 class LDAPMsg{ 00024 public: 00025 //public Constants defining the response message types 00026 static const int BIND_RESPONSE=LDAP_RES_BIND; 00027 static const int SEARCH_ENTRY=LDAP_RES_SEARCH_ENTRY; 00028 static const int SEARCH_DONE=LDAP_RES_SEARCH_RESULT; 00029 static const int SEARCH_REFERENCE=LDAP_RES_SEARCH_REFERENCE; 00030 static const int MODIFY_RESPONSE=LDAP_RES_MODIFY; 00031 static const int ADD_RESPONSE=LDAP_RES_ADD; 00032 static const int DEL_RESPONSE=LDAP_RES_DELETE; 00033 static const int MODDN_RESPONSE=LDAP_RES_MODDN; 00034 static const int COMPARE_RESPONSE=LDAP_RES_COMPARE; 00035 static const int EXTENDED_RESPONSE=LDAP_RES_EXTENDED; 00036 //public Constants defining the request message types 00037 static const int BIND_REQUEST=LDAP_REQ_BIND; 00038 static const int UNBIND_REQUEST=LDAP_REQ_UNBIND; 00039 static const int SEARCH_REQUEST=LDAP_REQ_SEARCH; 00040 static const int MODIFY_REQUEST=LDAP_REQ_MODIFY; 00041 static const int ADD_REQUEST=LDAP_REQ_ADD; 00042 static const int DELETE_REQUEST=LDAP_REQ_DELETE; 00043 static const int MODRDN_REQUEST=LDAP_REQ_MODRDN; 00044 static const int COMPARE_REQUEST=LDAP_REQ_COMPARE; 00045 static const int ABANDON_REQUEST=LDAP_REQ_ABANDON; 00046 static const int EXTENDED_REQUEST=LDAP_REQ_EXTENDED; 00047 00052 virtual ~LDAPMsg() {} 00053 00070 static LDAPMsg* create(const LDAPRequest *req, LDAPMessage *msg); 00071 00086 int getMessageType(); 00087 00092 int getMsgID(); 00093 00098 bool hasControls() const; 00099 00104 const LDAPControlSet& getSrvControls() const; 00105 00106 protected: 00112 LDAPMsg(LDAPMessage *msg); 00113 LDAPMsg(int msgType, int msgID); 00114 00119 LDAPControlSet m_srvControls; 00120 00121 bool m_hasControls; 00122 00123 private: 00124 int msgType; 00125 int msgID; 00126 }; 00127 #endif //ifndef LDAP_MSG_H