UserAuthenticationDatabase Class Reference

#include <RTSPServer.hh>

Collaboration diagram for UserAuthenticationDatabase:

Collaboration graph
[legend]

Public Member Functions

 UserAuthenticationDatabase (char const *realm=NULL, Boolean passwordsAreMD5=False)
virtual ~UserAuthenticationDatabase ()
virtual void addUserRecord (char const *username, char const *password)
virtual void removeUserRecord (char const *username)
virtual char const * lookupPassword (char const *username)
char const * realm ()
Boolean passwordsAreMD5 ()

Protected Attributes

HashTablefTable
char * fRealm
Boolean fPasswordsAreMD5

Detailed Description

Definition at line 36 of file RTSPServer.hh.


Constructor & Destructor Documentation

UserAuthenticationDatabase::UserAuthenticationDatabase ( char const *  realm = NULL,
Boolean  passwordsAreMD5 = False 
)

Definition at line 1226 of file RTSPServer.cpp.

01228   : fTable(HashTable::create(STRING_HASH_KEYS)),
01229     fRealm(strDup(realm == NULL ? "LIVE555 Streaming Media" : realm)),
01230     fPasswordsAreMD5(passwordsAreMD5) {
01231 }

UserAuthenticationDatabase::~UserAuthenticationDatabase (  )  [virtual]

Definition at line 1233 of file RTSPServer.cpp.

References fRealm, and fTable.

01233                                                         {
01234   delete[] fRealm;
01235   delete fTable;
01236 }


Member Function Documentation

void UserAuthenticationDatabase::addUserRecord ( char const *  username,
char const *  password 
) [virtual]

Definition at line 1238 of file RTSPServer.cpp.

References HashTable::Add(), fTable, and strDup().

Referenced by main().

01239                                                                      {
01240   fTable->Add(username, (void*)(strDup(password)));
01241 }

void UserAuthenticationDatabase::removeUserRecord ( char const *  username  )  [virtual]

Definition at line 1243 of file RTSPServer.cpp.

References fTable, HashTable::Lookup(), password, and HashTable::Remove().

01243                                                                       {
01244   char* password = (char*)(fTable->Lookup(username));
01245   fTable->Remove(username);
01246   delete[] password;
01247 }

char const * UserAuthenticationDatabase::lookupPassword ( char const *  username  )  [virtual]

Definition at line 1249 of file RTSPServer.cpp.

References fTable, and HashTable::Lookup().

01249                                                                            {
01250   return (char const*)(fTable->Lookup(username));
01251 }

char const* UserAuthenticationDatabase::realm (  )  [inline]

Definition at line 51 of file RTSPServer.hh.

References fRealm.

00051 { return fRealm; }

Boolean UserAuthenticationDatabase::passwordsAreMD5 (  )  [inline]

Definition at line 52 of file RTSPServer.hh.

References fPasswordsAreMD5.

00052 { return fPasswordsAreMD5; }


Field Documentation

HashTable* UserAuthenticationDatabase::fTable [protected]

Definition at line 55 of file RTSPServer.hh.

Referenced by addUserRecord(), lookupPassword(), removeUserRecord(), and ~UserAuthenticationDatabase().

char* UserAuthenticationDatabase::fRealm [protected]

Definition at line 56 of file RTSPServer.hh.

Referenced by realm(), and ~UserAuthenticationDatabase().

Boolean UserAuthenticationDatabase::fPasswordsAreMD5 [protected]

Definition at line 57 of file RTSPServer.hh.

Referenced by passwordsAreMD5().


The documentation for this class was generated from the following files:
Generated on Tue Oct 7 15:40:13 2008 for live by  doxygen 1.5.2