PTLib  Version 2.18.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pils.h
Go to the documentation of this file.
1 /*
2  * pils.h
3  *
4  * Microsoft Internet Location Server Protocol interface class.
5  *
6  * Portable Windows Library
7  *
8  * Copyright (c) 1993-2003 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Portable Windows Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  *
24  * Contributor(s): ______________________________________.
25  */
26 
27 #ifndef PTLIB_PILS_H
28 #define PTLIB_PILS_H
29 
30 #ifdef P_USE_PRAGMA
31 #pragma interface
32 #endif
33 
34 #if P_LDAP
35 
36 #include <ptlib/sockets.h>
37 #include <ptclib/pldap.h>
38 
39 
42 class PILSSession : public PLDAPSession
43 {
45  public:
48  PILSSession();
49 
60  {
61  public:
62  MSIPAddress(DWORD a = 0) : Address(a) { }
64  MSIPAddress(const PString & dotNotation) : Address(dotNotation) { }
65  MSIPAddress(PINDEX len, const BYTE * bytes) : Address(len, bytes) { }
66 
67  MSIPAddress & operator=(DWORD a) { Address::operator=(a); return *this; }
68  MSIPAddress & operator=(const PIPSocket::Address & a) { Address::operator=(a); return *this; }
69  MSIPAddress & operator=(const PString & dotNotation) { Address::operator=(dotNotation); return *this; }
70 
71  friend istream & operator>>(istream & s, MSIPAddress & a);
72  friend ostream & operator<<(ostream & s, MSIPAddress & a);
73  };
74 
75  PLDAP_STRUCT_BEGIN(RTPerson)
76  PLDAP_ATTR_SIMP(RTPerson, PString, cn); // Must be non-empty
77  PLDAP_ATTR_SIMP(RTPerson, PString, c);
78  PLDAP_ATTR_SIMP(RTPerson, PString, o);
79  PLDAP_ATTR_SIMP(RTPerson, PString, surname);
80  PLDAP_ATTR_SIMP(RTPerson, PString, givenName);
81  PLDAP_ATTR_SIMP(RTPerson, PString, rfc822Mailbox); // Must be non-empty
82  PLDAP_ATTR_SIMP(RTPerson, PString, location);
83  PLDAP_ATTR_SIMP(RTPerson, PString, comment);
84  PLDAP_ATTR_SIMP(RTPerson, MSIPAddress, sipAddress);
85  PLDAP_ATTR_SIMP(RTPerson, PWORDArray, sport);
86  PLDAP_ATTR_INIT(RTPerson, unsigned, sflags, 0);
87  PLDAP_ATTR_INIT(RTPerson, unsigned, ssecurity, 0);
88  PLDAP_ATTR_INIT(RTPerson, unsigned, smodop, 0);
89  PLDAP_ATTR_INIT(RTPerson, unsigned, sttl, 3600);
90  PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotid);
91  PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotmimetype);
92  PLDAP_ATTR_INIT(RTPerson, PString, sappid, PProcess::Current().GetName()); // Must be non-empty
93  PLDAP_ATTR_INIT(RTPerson, PString, sappguid, "none"); // Must be non-empty
94  PLDAP_ATTR_SIMP(RTPerson, PStringList, smimetype);
95  PLDAP_ATTR_INIT(RTPerson, PBoolean, ilsa32833566, 0); // 1=audio capable
96  PLDAP_ATTR_INIT(RTPerson, PBoolean, ilsa32964638, 0); // 1=video capable
97  PLDAP_ATTR_INIT(RTPerson, PBoolean, ilsa26214430, 0); // 1=in a call
98  PLDAP_ATTR_INIT(RTPerson, unsigned, ilsa26279966, 0); // unknown
99  PLDAP_ATTR_INIT(RTPerson, unsigned, ilsa39321630, 0); // 1 personal; 2 business user; 4 adults-only
100  PLDAP_ATTR_INIT(RTPerson, time_t, timestamp, PTime().GetTimeInSeconds());
101 
102  public:
103  PString GetDN() const;
104 
106 
107  PBoolean AddPerson(
108  const RTPerson & person
109  );
110 
111  PBoolean ModifyPerson(
112  const RTPerson & person
113  );
114 
115  PBoolean DeletePerson(
116  const RTPerson & person
117  );
118 
119  PBoolean SearchPerson(
120  const PString & canonicalName,
121  RTPerson & person
122  );
123 
124  PList<RTPerson> SearchPeople(
125  const PString & filter
126  );
127 };
128 
129 #endif // P_LDAP
130 
131 #endif // PTLIB_PILS_H
132 
133 
134 // End of file ////////////////////////////////////////////////////////////////
PBoolean DeletePerson(const RTPerson &person)
MSIPAddress & operator=(DWORD a)
Definition: pils.h:67
friend ostream & operator<<(ostream &s, MSIPAddress &a)
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:2164
This class defines an absolute time and date.
Definition: ptime.h:49
Special IP address class.
Definition: pils.h:59
This class will create an LDAP client to access a remote LDAP server.
Definition: pldap.h:51
PBoolean ModifyPerson(const RTPerson &person)
PLDAP_ATTR_SIMP(RTPerson, PString, cn)
PString GetDN() const
PILSSession()
Create an ILS client.
This template class maps the PAbstractList to a specific object type.
Definition: lists.h:322
This class represents an operating system process.
Definition: pprocess.h:106
MSIPAddress & operator=(const PIPSocket::Address &a)
Definition: pils.h:68
MSIPAddress(const PString &dotNotation)
Definition: pils.h:64
friend istream & operator>>(istream &s, MSIPAddress &a)
MSIPAddress(PINDEX len, const BYTE *bytes)
Definition: pils.h:65
PBoolean AddPerson(const RTPerson &person)
MSIPAddress(DWORD a=0)
Definition: pils.h:62
bool PBoolean
Definition: object.h:174
#define PLDAP_STRUCT_BEGIN(name)
Definition: pldap.h:558
The character string class.
Definition: pstring.h:108
PBoolean SearchPerson(const PString &canonicalName, RTPerson &person)
This is a list collection class of PString objects.
Definition: pstring.h:2562
A class describing an IP address.
Definition: ipsock.h:59
PList< RTPerson > SearchPeople(const PString &filter)
This class will create an LDAP client to access a remote ILS server.
Definition: pils.h:42
This template class maps the PAbstractArray to a specific element type.
Definition: array.h:504
PLDAP_ATTR_INIT(RTPerson, unsigned, sflags, 0)
MSIPAddress & operator=(const PString &dotNotation)
Definition: pils.h:69
MSIPAddress(const PIPSocket::Address &a)
Definition: pils.h:63
Address()
Create an IPv4 address with the default address: 127.0.0.1 (loopback).