diff options
author | Stephen Morris <stephen@isc.org> | 2012-11-16 12:19:19 +0100 |
---|---|---|
committer | Stephen Morris <stephen@isc.org> | 2012-11-16 12:19:19 +0100 |
commit | d2551c3b2bddcc80c496a59e85e390687776c24d (patch) | |
tree | f49d49dd76bb89d2094912748275161b6f61968d /src/lib/dhcpsrv/database_backends.dox | |
parent | [master] add released date (for tomorrow) (diff) | |
download | kea-d2551c3b2bddcc80c496a59e85e390687776c24d.tar.xz kea-d2551c3b2bddcc80c496a59e85e390687776c24d.zip |
[2475] Split dhcp files into dhcp and dhcpsrv directories
Diffstat (limited to 'src/lib/dhcpsrv/database_backends.dox')
-rw-r--r-- | src/lib/dhcpsrv/database_backends.dox | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/lib/dhcpsrv/database_backends.dox b/src/lib/dhcpsrv/database_backends.dox new file mode 100644 index 0000000000..8eeb5c5684 --- /dev/null +++ b/src/lib/dhcpsrv/database_backends.dox @@ -0,0 +1,64 @@ +/** + @page dhcp-database-backends DHCP Database Back-Ends + + All DHCP lease data is stored in some form of database, the interface + to this being through the Lease Manager. + + All backend classes such as isc::dhcp::MySqlLeaseMgr are derived from + the abstract isc::dhcp::LeaseMgr class. This provides methods to + create, retrieve, modify and delete leases in the database. + + @section dhcpdb-instantiation Instantiation of Lease Managers + + A lease manager is instantiated through the LeaseMgrFactory class. This + has three methods: + + - isc::dhcp::LeaseMgrFactory::create - Creates a singleton Lease + Manager of the appropriate type. + - isc::dhcp::LeaseMgrFactory::instance - Returns a reference to the + the instance of the Lease Manager. + - isc::dhcp::LeaseMgrFactory::destroy - Destroys the singleton lease manager. + + The selection of the Lease Manager (and thus the backend database) is + controlled by the connection string passed to + isc::dhcp::LeaseMgrFactory::create. This is a set of "keyword=value" pairs + (no embedded spaces), each pair separated by a space from the others, e.g. + + \code + type=mysql user=keatest password=keatest name=keatest host=localhost + \endcode + + The following keywords are used for all backends: + + - <b>type</b> - specifies the type of database backend. The following values + for the type keyword are supported: + - <b>mysql</b> - Use MySQL as the database + + The following sections list the database-specific keywords: + + @subsection dhcpdb-keywords-mysql MySQL connection string keywords + + - <b>host</b> - host on which the selected database is running. If not + supplied, "localhost" is assumed. + - <b>name</b> - name of the MySQL database to access. There is no default - + this must always be supplied. + - <b>password</b> - password for the selected user ID (see below). If not + specified, no password is used. + - <b>user</b> - database user ID under which the database is accessed. If not + specified, no user ID is used - the database is assumed to be open. + + + @section dhcp-backend-unittest Running Unit Tests + + With the use of databases requiring separate authorisation, there are + certain database-specific pre-requisites for successfully running the unit + tests. These are listed in the following sections. + + @subsection dhcp-mysql-unittest MySQL + + A database called <i>keatest</i> needs to be set up using the MySQL + <b>CREATE DATABASE</b> command. A database user, also called <i>keatest</i> + (with a password <i>keatest</i>) must be given full privileges in that + database. The unit tests create the schema in the database before each test + and delete it afterwards. + */ |