equilibrium-mgmt_config.h

Go to the documentation of this file.
00001 /*
00002  * $Id: equilibrium-mgmt_config.h 346460 2009-11-14 05:06:47Z ssiano $
00003  *
00004  * This code is provided as is by Juniper Networks SDK Developer Support.
00005  * It is provided with no warranties or guarantees, and Juniper Networks
00006  * will not provide support or maintenance of this code in any fashion.
00007  * The code is provided only to help a developer better understand how
00008  * the SDK can be used.
00009  * 
00010  * Copyright (c) 2008, Juniper Networks, Inc.
00011  * All rights reserved.
00012  */
00013 
00021 #ifndef __EQUILIBRIUM_MGMT_CONFIG_H__
00022 #define __EQUILIBRIUM_MGMT_CONFIG_H__
00023 
00024 #include <sys/queue.h>
00025 #include <jnx/patricia.h>
00026 #include <jnx/junos_kcom_pub_blob.h>
00027 
00028 /*** Constants ***/
00029 
00030 #define SERVER_DOWN 0 
00031 #define SERVER_UP   1 
00032 
00033 #define MAX_SVC_SET_NAME  JNX_EXT_SVC_SET_NAME_LEN  
00034 #define MAX_SVC_NAME                           256  
00035 #define MAX_SVC_INT_NAME                        64  
00036 #define MAX_APP_NAME                           256  
00037 
00038 /*** Data structures ***/
00039 
00040 
00044 typedef struct eq_smon_s {
00045     uint16_t    connection_interval;  
00046     uint16_t    connection_timeout;   
00047     uint8_t     timeouts_allowed;     
00048     uint16_t    down_retry_interval;  
00049 } eq_smon_t;
00050 
00051 
00055 typedef struct eq_server_s {
00056     in_addr_t                  server_addr; 
00057     uint8_t                    status;      
00058     TAILQ_ENTRY(eq_server_s)   entries;     
00059 } eq_server_t;
00060 
00061 
00065 typedef TAILQ_HEAD(server_list_s, eq_server_s) server_list_t;
00066 
00067 
00072 typedef struct eq_app_s {
00073     patnode     node;              
00074     char        application_name[MAX_APP_NAME]; 
00075     in_addr_t   application_addr;  
00076     uint16_t    application_port;  
00077     uint16_t    session_timeout;   
00078     eq_smon_t * server_mon_params; 
00079     server_list_t * servers;       
00080     uint32_t    session_count;     
00081 } eq_app_t;
00082 
00083 
00088 typedef struct eq_serviceset_s {
00089     patnode    node;              
00090     char       svc_set_name[MAX_SVC_SET_NAME];  
00091     int        svc_set_id;                      
00092     char       svc_int_name[MAX_SVC_INT_NAME];  
00093     char       ext_svc_name[MAX_SVC_NAME];      
00094     patroot *  applications;                    
00095 } eq_serviceset_t;
00096 
00097 
00098 /*** GLOBAL/EXTERNAL Functions ***/
00099 
00100 
00105 void
00106 init_config(void);
00107 
00108 
00112 void
00113 clear_config(void);
00114 
00115 
00119 void
00120 clear_ssrb_config(void);
00121 
00122 
00132 int
00133 add_ssrb(junos_kcom_pub_ssrb_t * ssrb);
00134 
00135 
00145 junos_kcom_pub_ssrb_t *
00146 get_ssrb_by_name(char * name);
00147 
00148 
00158 junos_kcom_pub_ssrb_t *
00159 get_ssrb_by_id(uint16_t svc_set_id);
00160 
00161 
00168 void
00169 delete_ssrb_by_name(char * name);
00170 
00171 
00178 void
00179 delete_ssrb_by_id(uint16_t svc_set_id);
00180 
00181 
00197 void
00198 set_server_status(uint16_t svc_set_id,
00199                   char * app_name,
00200                   in_addr_t server,
00201                   uint8_t status);
00202 
00203 
00216 void
00217 set_app_sessions(uint16_t svc_set_id,
00218                  char * app_name,
00219                  uint32_t session_count);
00220 
00221 
00231 eq_serviceset_t *
00232 next_service_set(eq_serviceset_t * data);
00233 
00234 
00247 eq_app_t *
00248 next_application(eq_serviceset_t * ss, eq_app_t * data);
00249 
00250 
00259 eq_serviceset_t *
00260 find_service_set(const char * name);
00261 
00262 
00274 eq_app_t *
00275 find_application(const eq_serviceset_t * ss, const char * name);
00276 
00277 
00289 int
00290 equilibrium_config_read(int check);
00291 
00292 #endif
00293 

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:57 2010 for SDK Your Net Corporation Equilibrium Load Balancer Example: equilibrium-mgmt 1.0 by Doxygen 1.5.1