Interface for starting and stopping the DFE Interface reactor. More...
Data Structures | |
struct | RF_DFE_PORTS |
A structure for the valid ports that may be used whilst running the application. More... | |
union | RF_GLOBAL_CFG_FROM |
Method and parameters to initialize the global configuration. More... | |
struct | RF_IFACE_PARAMS |
The parameters for rf_iface_start(). More... | |
Macros | |
#define | RF_DFE_PORTS_INIT_TF(tf_) { sizeof(RF_DFE_PORTS), (tf_), (tf_), (tf_), (tf_), (tf_), } |
Static/auto initializer for RF_DFE_PORTS, to set the default for all ports to TRUE or FALSE . | |
#define | RF_DFE_PORTS_INIT RF_DFE_PORTS_INIT_TF(TRUE) |
Static/auto initializer for RF_DFE_PORTS, to set the default for all ports to TRUE . | |
#define | RF_GLOBAL_CFG_DEFAULT_FILE "ripfarm_global.json" |
Default name for global configuration file, if used. | |
#define | RF_GLOBAL_CFG_FROM_INIT { NULL } |
Static/auto initializer for the RF_GLOBAL_CFG_FROM union. | |
#define | RF_IFACE_PARAMS_INIT |
Static/auto initializer for RF_IFACE_PARAMS. Interface parameters should be initialized using this value, and then individual fields modified as desired. | |
Typedefs | |
typedef struct RF_DFE_PORTS | RF_DFE_PORTS |
A structure for the valid ports that may be used whilst running the application. | |
typedef union RF_GLOBAL_CFG_FROM | RF_GLOBAL_CFG_FROM |
Method and parameters to initialize the global configuration. | |
typedef struct RF_IFACE_PARAMS | RF_IFACE_PARAMS |
The parameters for rf_iface_start(). | |
Enumerations | |
enum | { RF_PARSE_ERROR_MEMORY = -3 , RF_PARSE_ERROR_PORT = -2 , RF_PARSE_ERROR = -1 , RF_PARSE_SET_DEFAULTS = 0 , RF_PARSE_SET_ADDR = 1 , RF_PARSE_SET_PORT = 2 , RF_PARSE_SET_BOTH = 3 } |
Return values for rf_parse_address_and_port(). More... | |
enum | RF_GLOBAL_CFG_FROM_values { RF_GLOBAL_CFG_FROM_DEFAULTS = 0 , RF_GLOBAL_CFG_FROM_CBFC = 1 , RF_GLOBAL_CFG_FROM_CBFC_ABORT_ON_ERROR = 2 , RF_GLOBAL_CFG_FROM_DIRECTORY = 3 , RF_GLOBAL_CFG_FROM_JSON_STRING = 4 , RF_GLOBAL_CFG_FROM_JSON_OBJECT = 5 } |
Methods to initialize the global configuration. More... | |
Functions | |
int | rf_parse_address_and_port (const char *addrandport, char **phost, int *pport) |
Parse incoming IP address/hostname and port combination into separate string for IP address/hostname and port. This accepts the traditional hostname:port syntax for host names, ipaddr:port for IPv4 address, and [ipaddr]:port syntax for IPv6 addresses. More... | |
RF_IFACE_CTXT * | rf_iface_start (RF_IFACE_PARAMS *params) |
Start the DFE Interface reactor. More... | |
void | rf_iface_stop (RF_IFACE_CTXT **p_iface_ctxt) |
Stop the DFE Interface reactor. More... | |
Interface for starting and stopping the DFE Interface reactor.
anonymous enum |
Return values for rf_parse_address_and_port().
Methods to initialize the global configuration.
Enumerator | |
---|---|
RF_GLOBAL_CFG_FROM_DEFAULTS | Use default values for global config. |
RF_GLOBAL_CFG_FROM_CBFC | Request global config from central blade's Farm Controller. |
RF_GLOBAL_CFG_FROM_CBFC_ABORT_ON_ERROR | Request global config from central blade's Farm Controller but do not retry on an error such as the farm being shutdown. |
RF_GLOBAL_CFG_FROM_DIRECTORY | Load global config from a file with leafname RF_GLOBAL_CFG_DEFAULT_FILE, located in the directory specified. |
RF_GLOBAL_CFG_FROM_JSON_STRING | Load global config from a stringified JSON object. |
RF_GLOBAL_CFG_FROM_JSON_OBJECT | Load global config from a libjansson JSON object reference. |
RF_IFACE_CTXT* rf_iface_start | ( | RF_IFACE_PARAMS * | params | ) |
Start the DFE Interface reactor.
The reactor runs in a dedicated thread created for the purpose by this function.
[in] | params | A non-NULL parameters structure. |
NULL
context pointer if the DFE Interface was successfully started. Otherwise NULL
. void rf_iface_stop | ( | RF_IFACE_CTXT ** | p_iface_ctxt | ) |
Stop the DFE Interface reactor.
[in,out] | p_iface_ctxt | A pointer to the context returned by rf_iface_start(). Safe against NULL *p_iface_ctxt, which is always set to NULL on exit. |
int rf_parse_address_and_port | ( | const char * | addrandport, |
char ** | phost, | ||
int * | pport | ||
) |
Parse incoming IP address/hostname and port combination into separate string for IP address/hostname and port. This accepts the traditional hostname:port syntax for host names, ipaddr:port for IPv4 address, and [ipaddr]:port syntax for IPv6 addresses.
[in] | addrandport | The combined IP address or host name and port. |
[out] | phost | A location where the hostname will be stored. If the return value is non-negative, this string must be freed by the caller using rf_mem_free(). |
[out] | pport | A location where the base port will be stored. If there is no base port in the addrandport specification, the default base port will be stored. |