equilibrium2.h

Go to the documentation of this file.
00001 /*
00002  * $Id: equilibrium2.h 354699 2009-12-24 01:00:59Z deo $
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_H__
00022 #define __EQUILIBRIUM2_H__
00023 
00024 #include <stdbool.h>
00025 #include <sys/types.h>
00026 #include <sys/queue.h>
00027 
00028 /*** Constants ***/
00029 
00030 #define MAX_NAME_LEN 64        
00033 #define EQ2_BALANCE_SVC_NAME    "equilibrium2-balance"
00034 
00036 #define EQ2_CLASSIFY_SVC_NAME   "equilibrium2-classify"
00037 
00038 #define EQ2_BALANCE_SVC      1                
00039 #define EQ2_CLASSIFY_SVC     2                
00041 #define BALANCE_PLUGIN       EQ2_BALANCE_SVC  
00042 #define CLASSIFY_PLUGIN      EQ2_CLASSIFY_SVC 
00044 #define TERM_FROM_SVC_TYPE   1     
00045 #define TERM_FROM_SVC_GATE   2     
00046 #define TERM_FROM_EXCEPT     0x100 
00048 #define TERM_THEN_ACCEPT     1     
00049 #define TERM_THEN_DISCARD    2     
00050 #define TERM_THEN_SVC_GATE   3     
00051 #define TERM_THEN_SVR_GROUP  4     
00053 #define CONFIG_BLOB_SVR_GROUP       1  
00054 #define CONFIG_BLOB_SVC_SET         2  
00056 #define EQ2_MGMT_SERVER_PORT          8100     
00057 #define EQ2_CLIENT_RETRY              10       
00058 #define EQ2_BALANCE_MSG_SVR_GROUP     1        
00059 #define EQ2_SVC_INFO_MSG_LEN          256      
00064 typedef struct svr_addr_s {
00065     LIST_ENTRY(svr_addr_s)  entry;           
00066     in_addr_t               addr;            
00067     uint16_t                addr_ssn_count;  
00068     bool                    addr_new;        
00069 } svr_addr_t;
00070 
00072 typedef LIST_HEAD(svr_addr_head_s, svr_addr_s) svr_addr_head_t;
00073 
00075 typedef struct svr_group_s {
00076     LIST_ENTRY(svr_group_s) entry;              
00077     char                    group_name[MAX_NAME_LEN]; 
00078     svr_addr_head_t         group_addr_head;    
00079     int                     group_addr_count;   
00080 } svr_group_t;
00081 
00083 typedef LIST_HEAD(svr_group_head_s, svr_group_s) svr_group_head_t;
00084 
00086 typedef struct config_blob_key_s {
00087     char     key_name[MAX_NAME_LEN];  
00088     uint8_t  key_tag;                 
00089     uint8_t  key_plugin_id;           
00090 } config_blob_key_t;
00091 
00093 typedef struct blob_svr_group_s {
00094     char         group_name[MAX_NAME_LEN];  
00095     uint16_t     group_addr_count;     
00096     in_addr_t    group_addr[0];        
00097 } blob_svr_group_t;
00098 
00100 typedef struct blob_svr_group_set_s {
00101     uint16_t         gs_cksum;       
00102     uint16_t         gs_size;        
00103     uint16_t         gs_count;       
00104     blob_svr_group_t gs_group[0];    
00105 } blob_svr_group_set_t;
00106 
00108 typedef struct blob_term_s {
00109     char         term_name[MAX_NAME_LEN];  
00110     uint8_t      term_match_id;            
00111     uint16_t     term_match_port;          
00112     in_addr_t    term_match_addr;          
00113     uint8_t      term_act_id;              
00114     in_addr_t    term_act_addr;            
00115     char         term_act_group_name[MAX_NAME_LEN];
00117 } blob_term_t;
00118 
00120 typedef struct blob_rule_s {
00121     char         rule_name[MAX_NAME_LEN];  
00122     uint16_t     rule_term_count;          
00123     blob_term_t  rule_term[0];             
00124 } blob_rule_t;
00125 
00127 typedef struct blob_svc_set_s {
00128     uint16_t     ss_cksum;              
00129     uint16_t     ss_id;                 
00130     uint32_t     ss_svc_id;             
00131     uint32_t     ss_gen_num;            
00132     uint16_t     ss_size;                   
00133     char         ss_name[MAX_NAME_LEN];     
00134     char         ss_if_name[MAX_NAME_LEN];  
00135     uint8_t      ss_eq2_svc_id;             
00136     uint16_t     ss_rule_count;             
00137     blob_rule_t  ss_rule[0];                
00138 } blob_svc_set_t;
00139 
00141 typedef struct blob_svc_set_node_s {
00142     LIST_ENTRY(blob_svc_set_node_s) entry;         
00143     blob_svc_set_t                  *ss;           
00144 } blob_svc_set_node_t;
00145 
00147 typedef LIST_HEAD(blob_ss_head_s, blob_svc_set_node_s) blob_ss_head_t;
00148 
00150 typedef struct msg_svr_addr_s {
00151     in_addr_t    addr;            
00152     uint16_t     addr_ssn_count;  
00153 } msg_svr_addr_t;
00154 
00156 typedef struct msg_svr_group_s {
00157     char         group_name[MAX_NAME_LEN];  
00158     uint16_t     group_addr_count;          
00159     uint16_t     pad;                       
00162     char         group_addr[0];             
00163 } msg_svr_group_t;
00164 
00165 #endif /* __EQUILIBRIUM2_H__ */
00166 

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