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 1884 of file RTSPServer.cpp.

01886   : fTable(HashTable::create(STRING_HASH_KEYS)),
01887     fRealm(strDup(realm == NULL ? "LIVE555 Streaming Media" : realm)),
01888     fPasswordsAreMD5(passwordsAreMD5) {
01889 }

UserAuthenticationDatabase::~UserAuthenticationDatabase (  )  [virtual]

Definition at line 1891 of file RTSPServer.cpp.

References fRealm, fTable, NULL, password, and HashTable::RemoveNext().

01891                                                         {
01892   delete[] fRealm;
01893 
01894   // Delete the allocated 'password' strings that we stored in the table, and then the table itself:
01895   char* password;
01896   while ((password = (char*)fTable->RemoveNext()) != NULL) {
01897     delete[] password;
01898   }
01899   delete fTable;
01900 }


Member Function Documentation

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

Definition at line 1902 of file RTSPServer.cpp.

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

Referenced by main().

01903                                                                      {
01904   fTable->Add(username, (void*)(strDup(password)));
01905 }

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

Definition at line 1907 of file RTSPServer.cpp.

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

01907                                                                       {
01908   char* password = (char*)(fTable->Lookup(username));
01909   fTable->Remove(username);
01910   delete[] password;
01911 }

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

Definition at line 1913 of file RTSPServer.cpp.

References fTable, and HashTable::Lookup().

01913                                                                            {
01914   return (char const*)(fTable->Lookup(username));
01915 }

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 Mon Apr 29 13:32:45 2013 for live by  doxygen 1.5.2