pils.h
Go to the documentation of this file.
/*
* pils.h
*
* Microsoft Internet Location Server Protocol interface class.
*
* Portable Windows Library
*
* Copyright (c) 1993-2003 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Portable Windows Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
*
* Contributor(s): ______________________________________.
*
* $Revision: 21788 $
* $Author: rjongbloed $
* $Date: 2008-12-11 23:42:13 -0600 (Thu, 11 Dec 2008) $
*/
#ifndef PTLIB_PILS_H
#define PTLIB_PILS_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#if P_LDAP
#include <ptlib/sockets.h>
#include <ptclib/pldap.h>
class PILSSession : public PLDAPSession
{
PCLASSINFO(PILSSession, PLDAPSession)
public:
PILSSession();
class MSIPAddress : public PIPSocket::Address
{
public:
MSIPAddress(DWORD a = 0) : Address(a) { }
MSIPAddress(const PIPSocket::Address & a) : Address(a) { }
MSIPAddress(const PString & dotNotation) : Address(dotNotation) { }
MSIPAddress(PINDEX len, const BYTE * bytes) : Address(len, bytes) { }
MSIPAddress & operator=(DWORD a) { Address::operator=(a); return *this; }
MSIPAddress & operator=(const PIPSocket::Address & a) { Address::operator=(a); return *this; }
MSIPAddress & operator=(const PString & dotNotation) { Address::operator=(dotNotation); return *this; }
friend istream & operator>>(istream & s, MSIPAddress & a);
friend ostream & operator<<(ostream & s, MSIPAddress & a);
};
PLDAP_STRUCT_BEGIN(RTPerson)
PLDAP_ATTR_SIMP(RTPerson, PString, cn); // Must be non-empty
PLDAP_ATTR_SIMP(RTPerson, PString, c);
PLDAP_ATTR_SIMP(RTPerson, PString, o);
PLDAP_ATTR_SIMP(RTPerson, PString, surname);
PLDAP_ATTR_SIMP(RTPerson, PString, givenName);
PLDAP_ATTR_SIMP(RTPerson, PString, rfc822Mailbox); // Must be non-empty
PLDAP_ATTR_SIMP(RTPerson, PString, location);
PLDAP_ATTR_SIMP(RTPerson, PString, comment);
PLDAP_ATTR_SIMP(RTPerson, MSIPAddress, sipAddress);
PLDAP_ATTR_SIMP(RTPerson, PWORDArray, sport);
PLDAP_ATTR_INIT(RTPerson, unsigned, sflags, 0);
PLDAP_ATTR_INIT(RTPerson, unsigned, ssecurity, 0);
PLDAP_ATTR_INIT(RTPerson, unsigned, smodop, 0);
PLDAP_ATTR_INIT(RTPerson, unsigned, sttl, 3600);
PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotid);
PLDAP_ATTR_SIMP(RTPerson, PStringList, sprotmimetype);
PLDAP_ATTR_INIT(RTPerson, PString, sappid, PProcess::Current().GetName()); // Must be non-empty
PLDAP_ATTR_INIT(RTPerson, PString, sappguid, "none"); // Must be non-empty
PLDAP_ATTR_SIMP(RTPerson, PStringList, smimetype);
PLDAP_ATTR_INIT(RTPerson, PBoolean, ilsa32833566, 0); // 1=audio capable
PLDAP_ATTR_INIT(RTPerson, PBoolean, ilsa32964638, 0); // 1=video capable
PLDAP_ATTR_INIT(RTPerson, PBoolean, ilsa26214430, 0); // 1=in a call
PLDAP_ATTR_INIT(RTPerson, unsigned, ilsa26279966, 0); // unknown
PLDAP_ATTR_INIT(RTPerson, unsigned, ilsa39321630, 0); // 1 personal; 2 business user; 4 adults-only
PLDAP_ATTR_INIT(RTPerson, time_t, timestamp, PTime().GetTimeInSeconds());
public:
PString GetDN() const;
PLDAP_STRUCT_END();
PBoolean AddPerson(
const RTPerson & person
);
PBoolean ModifyPerson(
const RTPerson & person
);
PBoolean DeletePerson(
const RTPerson & person
);
PBoolean SearchPerson(
const PString & canonicalName,
RTPerson & person
);
PList<RTPerson> SearchPeople(
const PString & filter
);
};
#endif // P_LDAP
#endif // PTLIB_PILS_H
// End of file ////////////////////////////////////////////////////////////////
PILSSession::PLDAP_STRUCT_END
PLDAP_STRUCT_END()
PILSSession::DeletePerson
PBoolean DeletePerson(const RTPerson &person)
PILSSession::MSIPAddress::operator=
MSIPAddress & operator=(DWORD a)
Definition: pils.h:71
PILSSession::MSIPAddress::operator<<
friend ostream & operator<<(ostream &s, MSIPAddress &a)
PCLASSINFO
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
PTime
This class defines an absolute time and date.
Definition: ptime.h:53
PILSSession::MSIPAddress
Special IP address class.
Definition: pils.h:63
PLDAPSession
This class will create an LDAP client to access a remote LDAP server.
Definition: pldap.h:55
PILSSession::ModifyPerson
PBoolean ModifyPerson(const RTPerson &person)
PILSSession::PLDAP_ATTR_SIMP
PLDAP_ATTR_SIMP(RTPerson, PString, cn)
PILSSession::GetDN
PString GetDN() const
PILSSession::PILSSession
PILSSession()
Create an ILS client.
PList
This template class maps the PAbstractList to a specific object type.
Definition: lists.h:321
PProcess
This class represents an operating system process.
Definition: pprocess.h:227
PBoolean
BOOL PBoolean
Definition: object.h:102
PILSSession::MSIPAddress::operator=
MSIPAddress & operator=(const PIPSocket::Address &a)
Definition: pils.h:72
PILSSession::MSIPAddress::MSIPAddress
MSIPAddress(const PString &dotNotation)
Definition: pils.h:68
PWORDArray
Array of unsigned short integers.
Definition: array.h:710
PILSSession::MSIPAddress::operator>>
friend istream & operator>>(istream &s, MSIPAddress &a)
PILSSession::MSIPAddress::MSIPAddress
MSIPAddress(PINDEX len, const BYTE *bytes)
Definition: pils.h:69
PILSSession::AddPerson
PBoolean AddPerson(const RTPerson &person)
PILSSession::MSIPAddress::MSIPAddress
MSIPAddress(DWORD a=0)
Definition: pils.h:66
PLDAP_STRUCT_BEGIN
#define PLDAP_STRUCT_BEGIN(name)
Definition: pldap.h:567
PString
The character string class.
Definition: pstring.h:108
PILSSession::SearchPerson
PBoolean SearchPerson(const PString &canonicalName, RTPerson &person)
PStringList
This is a list collection class of PString objects.
Definition: pstring.h:2184
PIPSocket::Address
A class describing an IP address.
Definition: ipsock.h:75
PILSSession::SearchPeople
PList< RTPerson > SearchPeople(const PString &filter)
PILSSession
This class will create an LDAP client to access a remote ILS server.
Definition: pils.h:46
sockets.h
pldap.h
PILSSession::PLDAP_ATTR_INIT
PLDAP_ATTR_INIT(RTPerson, unsigned, sflags, 0)
PILSSession::MSIPAddress::operator=
MSIPAddress & operator=(const PString &dotNotation)
Definition: pils.h:73
PILSSession::MSIPAddress::MSIPAddress
MSIPAddress(const PIPSocket::Address &a)
Definition: pils.h:67
PIPSocket::Address::Address
Address()
Create an IPv4 address with the default address: 127.0.0.1 (loopback).