Harlequin RIP SDK

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_CTXTrf_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...
 

Detailed Description

Interface for starting and stopping the DFE Interface reactor.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Return values for rf_parse_address_and_port().

Enumerator
RF_PARSE_ERROR_MEMORY 

Failure to allocate memory.

RF_PARSE_ERROR_PORT 

Invalid port number.

RF_PARSE_ERROR 

Failure to parse address.

RF_PARSE_SET_DEFAULTS 

Default values for address and port.

RF_PARSE_SET_ADDR 

Set address, default port.

RF_PARSE_SET_PORT 

Default address, set port.

RF_PARSE_SET_BOTH 

Set address and set port.

◆ RF_GLOBAL_CFG_FROM_values

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.

Function Documentation

◆ rf_iface_start()

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.

Parameters
[in]paramsA non-NULL parameters structure.
Returns
A non-NULL context pointer if the DFE Interface was successfully started. Otherwise NULL.

◆ rf_iface_stop()

void rf_iface_stop ( RF_IFACE_CTXT **  p_iface_ctxt)

Stop the DFE Interface reactor.

Parameters
[in,out]p_iface_ctxtA pointer to the context returned by rf_iface_start(). Safe against NULL *p_iface_ctxt, which is always set to NULL on exit.

◆ rf_parse_address_and_port()

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.

Parameters
[in]addrandportThe combined IP address or host name and port.
[out]phostA 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]pportA 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.
Returns
A negative value indicates an error parsing the address specification, or a failure to allocate storage for the returned address. A non-negative value indicates success. The caller must free the address string using rf_mem_free(). A non-negative value indicates which of the address and port components were set explicitly, and which were given default values.
Note
Successful parsing of the host and port does not mean that the host name can be successfully resolved, or that the port can be opened. This function may be more relaxed about validating exact hostname or IP address syntax than internet standards.