1<!--$Id: repmgr_site_list.so,v 1.7 2006/09/11 16:57:54 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: DbEnv::repmgr_site_list</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>DbEnv::repmgr_site_list</b> 14</td> 15<td align=right> 16<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a> 17<a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a></td> 18</tr></table> 19<hr size=1 noshade> 20<tt> 21<b><pre> 22#include <db_cxx.h> 23<p> 24int 25DbEnv::repmgr_site_list(u_int *countp, DB_REPMGR_SITE **listp); 26</pre></b> 27<hr size=1 noshade> 28<b>Description: DbEnv::repmgr_site_list</b> 29<p>The DbEnv::repmgr_site_list method returns the status of the sites currently 30known by the replication manager.</p> 31<p>The DbEnv::repmgr_site_list method creates a statistical structure of type 32DB_REPMGR_SITE and copies a pointer to it into a user-specified memory 33location.</p> 34<p>Statistical structures are stored in allocated memory. If application-specific allocation 35routines have been declared (see <a href="/api_cxx/env_set_alloc.html">DbEnv::set_alloc</a> for more 36information), they are used to allocate the memory; otherwise, the 37standard C library <b>malloc</b>(3) is used. The caller is 38responsible for deallocating the memory. To deallocate the memory, free 39the memory reference; references inside the returned memory need not be 40individually freed.</p> 41<p>The following DB_REPMGR_SITE fields will be filled in:</p> 42<br> 43<b>int eid;</b><ul compact><li>Environment ID assigned by the replication manager. 44This is the same value that is passed to the application's 45event notification function for the <a href="/api_cxx/env_event_notify.html#DB_EVENT_REP_NEWMASTER">DB_EVENT_REP_NEWMASTER</a> event.</ul> 46<b>char host[];</b><ul compact><li>Nul-terminated host name.</ul> 47<b>u_int port;</b><ul compact><li>TCP/IP port number.</ul> 48<b>u_int32_t status;</b><ul compact><li>One of the following list of constants: <a name="DB_REPMGR_CONNECTED">DB_REPMGR_CONNECTED</a>, 49<a name="DB_REPMGR_DISCONNECTED">DB_REPMGR_DISCONNECTED</a>.</ul> 50<br> 51<p>The DbEnv::repmgr_site_list method may be called at any time during the life of the 52application.</p> 53<p>The DbEnv::repmgr_site_list method 54either returns a non-zero error value 55or throws an exception that encapsulates a non-zero error value on 56failure, and returns 0 on success. 57</p> 58<b>Parameters</b> <br> 59 <b>countp</b><ul compact><li>A count of the returned structures will be stored into the memory 60referenced by <b>countp</b>.</ul> 61 <b>listp</b><ul compact><li>A reference to an array of structures will be stored into the memory 62referenced by <b>listp</b>.</ul> 63<br> 64<hr size=1 noshade> 65<br><b>Class</b> 66<a href="/api_cxx/env_class.html">DbEnv</a> 67<br><b>See Also</b> 68<a href="/api_cxx/rep_list.html">Replication and Related Methods</a> 69</tt> 70<table width="100%"><tr><td><br></td><td align=right> 71<a href="/api_cxx/api_core.html"><img src="/images/api.gif" alt="API"></a><a href="/ref/toc.html"><img src="/images/ref.gif" alt="Ref"></a> 72</td></tr></table> 73<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 74</body> 75</html> 76