Library Version 18.1.40

DB_ENV->repmgr_site_list()
Prev | Chapter 10. Replication Methods | Next

## DB_ENV->repmgr_site_list()

    #include <db.h>

    int
    DB_ENV->repmgr_site_list(DB_ENV *env,
        u_int *countp, DB_REPMGR_SITE **listp);

The `DB_ENV->repmgr_site_list()` method returns the status of the sites currently known by the Replication Manager.

The `DB_ENV->repmgr_site_list()` method creates an array of statistical structures of type `DB_REPMGR_SITE` and copies a pointer to it into a user-specified memory location.

Statistical structures are stored in allocated memory. If application-specific allocation routines have been declared (see DB_ENV->set_alloc() for more information), they are used to allocate the memory; otherwise, the standard C library malloc(3) is used. The caller is responsible for deallocating the memory. To deallocate the memory, free the memory reference; references inside the returned memory need not be individually freed.

The following `DB_REPMGR_SITE` fields will be filled in:

- int eid;

  Environment ID assigned by the Replication Manager. This is the same value that is passed to the application's event notification function for the DB_EVENT_REP_NEWMASTER event.

- char host[];

  Null-terminated host name.

- u_int port;

  TCP/IP port number.

- DB_LSN max_ack_lsn;

  The LSN of the most recent transaction acknowledged as durable by this remote client site. This information is maintained only in the site list on the master site.

- u_int32_t status;

  Zero (if unknown), or one of the following constants: `DB_REPMGR_CONNECTED`, `DB_REPMGR_DISCONNECTED`.

- u_int32_t flags;

  Zero or a bitwise inclusive OR of the following constants:

  - `DB_REPMGR_ISPEER`: The site is a possible client-to-client peer.
  - `DB_REPMGR_ISVIEW`: The site is a view.
  - `DB_REPMGR_ISELECTABLE`: The site can potentially be elected master.

The `DB_ENV->repmgr_site_list()` method may be called only after the DB_ENV->repmgr_start() method has been called with a `0` return code.

The `DB_ENV->repmgr_site_list()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### countp

A count of the returned structures will be stored into the memory referenced by countp.

#### listp

A reference to an array of structures will be stored into the memory referenced by listp.

### Class

DB_ENV

### See Also

Replication and Related Methods

Prev | Up | Next
DB_ENV->repmgr_site_by_eid() | Home | DB_ENV->repmgr_set_ssl_config()