equilibrium-data_config.h File Reference

Relating to getting and setting the configuration data. More...

Go to the source code of this file.

Data Structures

struct  eq_smon_s

Defines

#define MAX_APP_NAME   256
 Application name length.

Typedefs

typedef eq_smon_s eq_smon_t

Functions

status_t init_config (evContext ctx)
void clear_config (void)
time_t get_current_time (void)
void reset_configuration (void)
void delete_service_set (uint16_t svc_set_id)
void delete_application (uint16_t svc_set_id, char *app_name)
void delete_all_servers (uint16_t svc_set_id, char *app_name)
void delete_server (uint16_t svc_set_id, char *app_name, in_addr_t server_addr)
void update_application (uint16_t svc_set_id, char *app_name, in_addr_t app_addr, uint16_t app_port, uint16_t session_timeout, uint16_t connection_interval, uint16_t connection_timeout, uint8_t timeouts_allowed, uint16_t down_retry_interval)
void add_server (uint16_t svc_set_id, char *app_name, in_addr_t server_addr)
char * get_app_name (uint16_t svc_set_id, in_addr_t addr, uint16_t port)
uint16_t get_app_session_timeout (uint16_t svc_set_id, in_addr_t addr, uint16_t port)


Detailed Description

Relating to getting and setting the configuration data.

These functions will store and provide access to the configuration data which is essentailly coming from the mgmt component.

Definition in file equilibrium-data_config.h.


Typedef Documentation

typedef struct eq_smon_s eq_smon_t

The structure we use to store our server monitor info


Function Documentation

void add_server ( uint16_t  svc_set_id,
char *  app_name,
in_addr_t  server_addr 
)

Add a server to an application in the configuration

Parameters:
[in] svc_set_id The service-set id of the service set associated with the application
[in] app_name The application name of the application associated with the server
[in] server_addr The server's address

Definition at line 602 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, eq_app_t, INSIST_ERR, LOG, monitor_add_server(), eq_server_s::server_addr, and services_conf.

Referenced by mgmt_client_message().

void clear_config ( void   ) 

Clear the configuration data

Definition at line 161 of file equilibrium-data_config.c.

References reset_configuration().

Referenced by equilibrium_quit(), and mgmt_client_connection().

void delete_all_servers ( uint16_t  svc_set_id,
char *  app_name 
)

Delete all server associated with an application from the configuration

Parameters:
[in] svc_set_id The service-set id of the service set associated with the application
[in] app_name The application name

Definition at line 325 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, eq_app_t, LOG, monitor_remove_all_servers_in_app(), and services_conf.

Referenced by mgmt_client_message().

void delete_application ( uint16_t  svc_set_id,
char *  app_name 
)

Delete an application from the configuration

Parameters:
[in] svc_set_id The service-set id of the service set associated with the application
[in] app_name The application name

Definition at line 266 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, eq_app_t, LOG, monitor_remove_all_servers_in_app(), and services_conf.

Referenced by mgmt_client_message().

void delete_server ( uint16_t  svc_set_id,
char *  app_name,
in_addr_t  server_addr 
)

Delete a server associated with an application from the configuration

Parameters:
[in] svc_set_id The service-set id of the service set associated with the application
[in] app_name The application name of the application associated with the server
[in] server_addr The server address of the server to delete

Definition at line 378 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, eq_app_t, LOG, monitor_remove_server(), eq_server_s::server_addr, and services_conf.

Referenced by mgmt_client_message().

void delete_service_set ( uint16_t  svc_set_id  ) 

Delete the configuration for a service set

Parameters:
[in] svc_set_id The service-set id of the service set to delete

Definition at line 201 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, eq_app_t, LOG, monitor_remove_all_servers_in_service_set(), eq_serviceset_s::node, and services_conf.

Referenced by mgmt_client_message(), and reset_configuration().

char* get_app_name ( uint16_t  svc_set_id,
in_addr_t  addr,
uint16_t  port 
)

Search for the application with the given parameters, and if it exists return its name

Parameters:
[in] svc_set_id The service-set id of the service set associated with the application
[in] addr The application facade address
[in] port The application port
Returns:
the session timeout or 0 if no application meeting the parameters is found

Definition at line 670 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, eq_app_t, and services_conf.

Referenced by TAILQ_HEAD().

uint16_t get_app_session_timeout ( uint16_t  svc_set_id,
in_addr_t  addr,
uint16_t  port 
)

Search for the application with the given parameters, and if it exists return its session timeout. Always only called by main thread.

Parameters:
[in] svc_set_id The service-set id of the service set associated with the application
[in] addr The application facade address
[in] port The application port
Returns:
the session timeout or 0 if no application meeting the parameters is found

Definition at line 717 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, eq_app_t, and services_conf.

Referenced by aging_cleanup().

time_t get_current_time ( void   ) 

Get the currently cached time

Returns:
Current time

Definition at line 174 of file equilibrium-data_config.c.

References current_time.

Referenced by aging_cleanup(), process_fragment(), and process_packet().

status_t init_config ( evContext  ctx  ) 

Init the data structures that will store configuration info

Parameters:
[in] ctx event context
Returns:
SUCCESS if successful; otherwise EFAIL with an error message.

Definition at line 138 of file equilibrium-data_config.c.

References current_time, LOG, services_conf, and update_time().

Referenced by equilibrium_init().

void reset_configuration ( void   ) 

Reset all of the configuration

Definition at line 184 of file equilibrium-data_config.c.

References delete_service_set(), services_conf, and eq_serviceset_s::svc_set_id.

Referenced by clear_config(), and mgmt_client_message().

void update_application ( uint16_t  svc_set_id,
char *  app_name,
in_addr_t  app_addr,
uint16_t  app_port,
uint16_t  session_timeout,
uint16_t  connection_interval,
uint16_t  connection_timeout,
uint8_t  timeouts_allowed,
uint16_t  down_retry_interval 
)

Update or add an application to the configuration

Parameters:
[in] svc_set_id The service-set id of the service set associated with the application
[in] app_name The application name
[in] app_addr The application facade's address (unique to the application)
[in] app_port The application port
[in] session_timeout The session timeout of sessions falling into this application
[in] connection_interval The connection interval of the server monitoring parameters, or zero for no monitoring
[in] connection_timeout The connection timeout afterwhich the connection attempt is counted as failed if not already complete
[in] timeouts_allowed The number of connection timeouts that we can observe before we mark a server belonging to this application as down. (The number of retries)
[in] down_retry_interval The time to wait before retrying a probe (connection attempt) once a server is marked down.

Definition at line 462 of file equilibrium-data_config.c.

References eq_serviceset_s::applications, change_monitoring_config(), eq_smon_s::connection_interval, eq_smon_s::connection_timeout, eq_smon_s::down_retry_interval, eq_app_t, INSIST_ERR, LOG, MAX_APP_NAME, monitor_add_server(), monitor_remove_all_servers_in_app(), eq_serviceset_s::node, eq_server_s::server_addr, services_conf, eq_serviceset_s::svc_set_id, and eq_smon_s::timeouts_allowed.

Referenced by mgmt_client_message().


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:56 2010 for SDK Your Net Corporation Equilibrium Load Balancer Example: equilibrium-data 1.0 by Doxygen 1.5.1