00001 /* 00002 * Copyright 2000, OpenLDAP Foundation, All Rights Reserved. 00003 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file 00004 */ 00005 00006 00007 #ifndef LDAP_MSG_H 00008 #define LDAP_MSG_H 00009 #include <ldap.h> 00010 00011 #include <LDAPControlSet.h> 00012 00013 class LDAPRequest; 00022 class LDAPMsg{ 00023 public: 00024 //public Constants defining the Message types 00025 static const int BIND_RESPONSE=LDAP_RES_BIND; 00026 static const int SEARCH_ENTRY=LDAP_RES_SEARCH_ENTRY; 00027 static const int SEARCH_DONE=LDAP_RES_SEARCH_RESULT; 00028 static const int SEARCH_REFERENCE=LDAP_RES_SEARCH_REFERENCE; 00029 static const int MODIFY_RESPONSE=LDAP_RES_MODIFY; 00030 static const int ADD_RESPONSE=LDAP_RES_ADD; 00031 static const int DEL_RESPONSE=LDAP_RES_DELETE; 00032 static const int MODDN_RESPONSE=LDAP_RES_MODDN; 00033 static const int COMPARE_RESPONSE=LDAP_RES_COMPARE; 00034 static const int EXTENDED_RESPONSE=LDAP_RES_EXTENDED; 00035 00040 virtual ~LDAPMsg() {} 00041 00058 static LDAPMsg* create(const LDAPRequest *req, LDAPMessage *msg); 00059 00074 int getMessageType(); 00075 00080 int getMsgID(); 00081 00086 bool hasControls() const; 00087 00092 const LDAPControlSet& getSrvControls() const; 00093 00094 protected: 00100 LDAPMsg(LDAPMessage *msg); 00101 00106 LDAPControlSet m_srvControls; 00107 00108 bool m_hasControls; 00109 00110 private: 00111 int msgType; 00112 int msgID; 00113 }; 00114 #endif //ifndef LDAP_MSG_H