equilibrium2-mgmt.h

Go to the documentation of this file.
00001 /*
00002  * $Id: equilibrium2-mgmt.h 366303 2010-03-05 13:14:01Z taoliu $
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 __EQUILIBRIUM2_MGMT_H__
00022 #define __EQUILIBRIUM2_MGMT_H__
00023 
00024 #include <netinet/in.h>
00025 #include <jnx/ipc_types.h>
00026 #include <jnx/aux_types.h>
00027 #include <jnx/junos_kcom_pub_blob.h>
00028 #include <jnx/pconn.h>
00029 
00033 #define DNAME_EQUILIBRIUM2_MGMT    "equilibrium2-mgmt"
00034 
00036 #define PMON_HB_INTERVAL   30
00037 
00039 #define EQ2_TRACE(_msg_type, _fmt, ...) \
00040     junos_trace((_msg_type), _fmt, ##__VA_ARGS__)
00041 
00043 #define EQ2_LOG(_level, _fmt, ...)   \
00044         ERRMSG(EQ2_MGMT, (_level), _fmt, ##__VA_ARGS__)
00045 
00047 typedef enum config_ssrb_op_e {
00048     CONFIG_SSRB_ADD = 1,  
00049     CONFIG_SSRB_CHANGE,   
00050     CONFIG_SSRB_DEL       
00051 } config_ssrb_op_t;
00052 
00054 typedef enum ssrb_state_e {
00055     SSRB_IDLE = 0,
00056     SSRB_PENDING,
00057     SSRB_UPDATED
00058 } ssrb_state_t;
00059 
00061 typedef struct svc_gate_s {
00062     LIST_ENTRY(svc_gate_s) entry;                   
00063     char                   gate_name[MAX_NAME_LEN]; 
00064     in_addr_t              gate_addr;               
00065 } svc_gate_t;
00066 
00068 typedef LIST_HEAD(svc_gate_head_s, svc_gate_s) svc_gate_head_t;
00069 
00071 typedef struct svc_type_s {
00072     LIST_ENTRY(svc_type_s) entry;                   
00073     char                   type_name[MAX_NAME_LEN]; 
00074     in_port_t              type_port;               
00075 } svc_type_t;
00076 
00078 typedef LIST_HEAD(svc_type_head_s, svc_type_s) svc_type_head_t;
00079 
00081 typedef struct svc_term_s {
00082     LIST_ENTRY(svc_term_s)  entry;                        
00083     char                    term_name[MAX_NAME_LEN];      
00084     int                     term_match;                   
00085     char                    term_match_val[MAX_NAME_LEN]; 
00086     int                     term_act;                     
00087     char                    term_act_val[MAX_NAME_LEN];   
00088 } svc_term_t;
00089 
00091 typedef LIST_HEAD(svc_term_head_s, svc_term_s) svc_term_head_t;
00092 
00094 typedef struct svc_rule_s {
00095     LIST_ENTRY(svc_rule_s) entry;                   
00096     char                   rule_name[MAX_NAME_LEN]; 
00097     svc_term_head_t        rule_term_head;          
00098     int                    rule_term_count;         
00099 } svc_rule_t;
00100 
00102 typedef LIST_HEAD(svc_rule_head_s, svc_rule_s) svc_rule_head_t;
00103 
00105 typedef struct svc_set_rule_s {
00106     LIST_ENTRY(svc_set_rule_s) entry;                   
00107     char                       rule_name[MAX_NAME_LEN]; 
00108 } svc_set_rule_t;
00109 
00111 typedef LIST_HEAD(svc_set_rule_head_s, svc_set_rule_s) svc_set_rule_head_t;
00112 
00114 typedef struct svc_set_s {
00115     LIST_ENTRY(svc_set_s) entry;              
00116     char           ss_name[MAX_NAME_LEN];     
00117     char           ss_if_name[MAX_NAME_LEN];  
00118     uint16_t       ss_id;                     
00119     uint8_t        ss_eq2_svc_id;             
00120     svc_set_rule_head_t  ss_rule_head;        
00121     int            ss_rule_count;             
00122 } svc_set_t;
00123 
00125 typedef LIST_HEAD(svc_set_head_s, svc_set_s) svc_set_head_t;
00126 
00128 typedef struct svc_if_s {
00129     LIST_ENTRY(svc_if_s) entry;     
00130     char                 *if_name;  
00131 } svc_if_t;
00132 
00134 typedef LIST_HEAD(svc_if_head_s, svc_if_s) svc_if_head_t;
00135 
00137 typedef struct ssrb_node_s {
00138     LIST_ENTRY(ssrb_node_s) entry;       
00139     junos_kcom_pub_ssrb_t   ssrb;        
00140     ssrb_state_t            ssrb_state;  
00141 } ssrb_node_t;
00142 
00144 typedef LIST_HEAD(ssrb_head_s, ssrb_node_s) ssrb_head_t;
00145 
00147 typedef struct client_s {
00148     LIST_ENTRY(client_s) entry;     
00149     pconn_session_t      *session;  
00150     pconn_peer_info_t    info;      
00151     char                 *msg;      
00152 } client_t;
00153 
00155 typedef LIST_HEAD(client_head_s, client_s) client_head_t;
00156 
00157 
00158 provider_origin_id_t  eq2_origin_id;   
00159 provider_id_t         eq2_provider_id; 
00160 svc_if_head_t         svc_if_head;     
00161 int                   svc_if_count;    
00163 /*** GLOBAL/EXTERNAL Functions ***/
00164 
00175 int kcom_init(evContext ctx);
00176 
00181 void kcom_close(void);
00182 
00190 int kcom_get_config_blob(void);
00191 
00205 int kcom_add_config_blob(config_blob_key_t *key, void *blob);
00206 
00217 int kcom_del_config_blob(config_blob_key_t *key);
00218 
00229 int server_open(evContext ctx);
00230 
00235 void server_close(void);
00236 
00242 void config_init(void);
00243 
00248 void config_clear(void);
00249 
00254 void clear_ssrb_config(void);
00255 
00269 int config_ssrb_op(junos_kcom_pub_ssrb_t *ssrb, config_ssrb_op_t op);
00270 
00283 int eq2_config_read(int check);
00284 
00295 void config_svr_group_blob_proc(config_blob_key_t *key, void *blob);
00296 
00307 void config_svc_set_blob_proc(config_blob_key_t *key, void *blob);
00308 
00319 client_t *client_get_next(client_t *client);
00320 
00321 #endif
00322 

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:58 2010 for SDK Your Net Corporation Equilibrium II: equilibrium2-mgmt 1.0 by Doxygen 1.5.1