pils.h

Go to the documentation of this file.
00001 /*
00002  * pils.h
00003  *
00004  * Microsoft Internet Location Server Protocol interface class.
00005  *
00006  * Portable Windows Library
00007  *
00008  * Copyright (c) 1993-2003 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Portable Windows Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Contributor(s): ______________________________________.
00025  *
00026  * $Log: pils.h,v $
00027  * Revision 1.4  2004/02/20 16:27:52  ykiryanov
00028  * if'd LDAP code to enable non-LDAP builds
00029  *
00030  * Revision 1.3  2003/04/11 00:07:46  robertj
00031  * More for Microsoft IP address specification wierdness (registration side).
00032  *
00033  * Revision 1.2  2003/04/07 13:05:09  robertj
00034  * Workaround for Microsoft IP address specification wierdness.
00035  *
00036  * Revision 1.1  2003/03/31 03:35:20  robertj
00037  * Major addition of LDAP functionality.
00038  * Added ILS specialisation of LDAP.
00039  *
00040  */
00041 
00042 #ifndef _PILS_H
00043 #define _PILS_H
00044 
00045 #ifdef P_USE_PRAGMA
00046 #pragma interface
00047 #endif
00048 
00049 #if P_LDAP
00050 
00051 #include <ptlib/sockets.h>
00052 #include <ptclib/pldap.h>
00053 
00054 
00057 class PILSSession : public PLDAPSession
00058 {
00059   PCLASSINFO(PILSSession, PLDAPSession)
00060   public:
00063     PILSSession();
00064 
00074     class MSIPAddress : public PIPSocket::Address
00075     {
00076       public:
00077         MSIPAddress(DWORD a = 0)                    : Address(a) { }
00078         MSIPAddress(const PIPSocket::Address & a)   : Address(a) { }
00079         MSIPAddress(const PString & dotNotation)    : Address(dotNotation) { }
00080         MSIPAddress(PINDEX len, const BYTE * bytes) : Address(len, bytes) { }
00081 
00082         MSIPAddress & operator=(DWORD a)                      { Address::operator=(a); return *this; }
00083         MSIPAddress & operator=(const PIPSocket::Address & a) { Address::operator=(a); return *this; }
00084         MSIPAddress & operator=(const PString & dotNotation)  { Address::operator=(dotNotation); return *this; }
00085 
00086       friend istream & operator>>(istream & s, MSIPAddress & a);
00087       friend ostream & operator<<(ostream & s, MSIPAddress & a);
00088     };
00089 
00090     PLDAP_STRUCT_BEGIN(RTPerson)
00091        PLDAP_ATTR_SIMP(RTPerson, PString,     cn); // Must be non-empty
00092        PLDAP_ATTR_SIMP(RTPerson, PString,     c);
00093        PLDAP_ATTR_SIMP(RTPerson, PString,     o);
00094        PLDAP_ATTR_SIMP(RTPerson, PString,     surname);
00095        PLDAP_ATTR_SIMP(RTPerson, PString,     givenName);
00096        PLDAP_ATTR_SIMP(RTPerson, PString,     rfc822Mailbox); // Must be non-empty
00097        PLDAP_ATTR_SIMP(RTPerson, PString,     location);
00098        PLDAP_ATTR_SIMP(RTPerson, PString,     comment);
00099        PLDAP_ATTR_SIMP(RTPerson, MSIPAddress, sipAddress);
00100        PLDAP_ATTR_SIMP(RTPerson, PWORDArray,  sport);
00101        PLDAP_ATTR_INIT(RTPerson, unsigned,    sflags,       0);
00102        PLDAP_ATTR_INIT(RTPerson, unsigned,    ssecurity,    0);
00103        PLDAP_ATTR_INIT(RTPerson, unsigned,    smodop,       0);
00104        PLDAP_ATTR_INIT(RTPerson, unsigned,    sttl,         3600);
00105        PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotid);
00106        PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotmimetype);
00107        PLDAP_ATTR_INIT(RTPerson, PString,     sappid,       PProcess::Current().GetName()); // Must be non-empty
00108        PLDAP_ATTR_INIT(RTPerson, PString,     sappguid,     "none"); // Must be non-empty
00109        PLDAP_ATTR_SIMP(RTPerson, PStringList, smimetype);
00110        PLDAP_ATTR_INIT(RTPerson, BOOL,        ilsa32833566, 0); // 1=audio capable
00111        PLDAP_ATTR_INIT(RTPerson, BOOL,        ilsa32964638, 0); // 1=video capable
00112        PLDAP_ATTR_INIT(RTPerson, BOOL,        ilsa26214430, 0); // 1=in a call
00113        PLDAP_ATTR_INIT(RTPerson, unsigned,    ilsa26279966, 0); // unknown
00114        PLDAP_ATTR_INIT(RTPerson, unsigned,    ilsa39321630, 0); // 1 personal; 2 business user; 4 adults-only
00115        PLDAP_ATTR_INIT(RTPerson, time_t,      timestamp,    PTime().GetTimeInSeconds());
00116 
00117       public:
00118        PString GetDN() const;
00119 
00120     PLDAP_STRUCT_END();
00121 
00122     BOOL AddPerson(
00123       const RTPerson & person
00124     );
00125 
00126     BOOL ModifyPerson(
00127       const RTPerson & person
00128     );
00129 
00130     BOOL DeletePerson(
00131       const RTPerson & person
00132     );
00133 
00134     BOOL SearchPerson(
00135       const PString & canonicalName,
00136       RTPerson & person
00137     );
00138 
00139     PList<RTPerson> SearchPeople(
00140       const PString & filter
00141     );
00142 };
00143 
00144 #endif // P_LDAP
00145 
00146 #endif // _PILS_H
00147 
00148 
00149 // End of file ////////////////////////////////////////////////////////////////

Generated on Fri Mar 7 06:25:02 2008 for PTLib by  doxygen 1.5.1