zCm 0.1.0
Lightweight messaging toolkit
Loading...
Searching...
No Matches
zcm_domain.h File Reference

Shared zCm domain endpoint resolution helpers.

Go to the source code of this file.

Data Structures

struct  zcm_domain_info
 Resolved broker endpoints for the current environment. More...

Macros

#define ZCM_DOMAIN_NAME_MAX   256
 Maximum number of bytes reserved for domain and host name strings.
#define ZCM_DOMAIN_PATH_MAX   1024
 Maximum number of bytes reserved for the resolved ZCmDomains path.
#define ZCM_DOMAIN_ENDPOINT_MAX   512
 Maximum number of bytes reserved for one broker endpoint string.

Typedefs

typedef struct zcm_domain_info zcm_domain_info_t
 Resolved broker endpoints for the current environment.

Functions

int zcm_domain_info_load (zcm_domain_info_t *out_info)
 Resolve broker endpoints from environment and ZCmDomains.
int zcm_domain_info_update_published_host (const zcm_domain_info_t *info)
 Publish the active broker host back into ZCmDomains.

Macro Definition Documentation

◆ ZCM_DOMAIN_ENDPOINT_MAX

#define ZCM_DOMAIN_ENDPOINT_MAX   512

Definition at line 18 of file zcm_domain.h.

◆ ZCM_DOMAIN_NAME_MAX

#define ZCM_DOMAIN_NAME_MAX   256

Definition at line 14 of file zcm_domain.h.

◆ ZCM_DOMAIN_PATH_MAX

#define ZCM_DOMAIN_PATH_MAX   1024

Definition at line 16 of file zcm_domain.h.

Typedef Documentation

◆ zcm_domain_info_t

query_endpoint is the advertised/shared endpoint used by CLI tools to find the active broker. bind_endpoint is the local endpoint a broker instance on this host should bind to if it becomes the active broker.

Function Documentation

◆ zcm_domain_info_load()

int zcm_domain_info_load ( zcm_domain_info_t * out_info)

When ZCMBROKER/ZCMBROKER_ENDPOINT is set, both endpoints resolve to that explicit override and has_domain_mapping is 0.

Otherwise the current domain is read from ZCMDOMAIN and the advertised endpoint is loaded from ZCmDomains, while the bind endpoint is rewritten to use a local host identity for this machine.

Parameters
out_infoOutput structure to populate.
Returns
0 on success, -1 on failure.

◆ zcm_domain_info_update_published_host()

int zcm_domain_info_update_published_host ( const zcm_domain_info_t * info)

This only applies when has_domain_mapping is nonzero.

Parameters
infoResolved domain info.
Returns
0 on success, -1 on failure.