monitube2-mgmt_config.h

Go to the documentation of this file.
00001 /*
00002  * $Id: monitube2-mgmt_config.h 347265 2009-11-19 13:55:39Z kdickman $
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) 2009, Juniper Networks, Inc.
00011  * All rights reserved.
00012  */
00013 
00021 #ifndef __MONITUBE2_MGMT_CONFIG_H__
00022 #define __MONITUBE2_MGMT_CONFIG_H__
00023 
00024 #include <jnx/patricia.h>
00025 
00026 /*** Constants ***/
00027 
00028 #define STATS_BASE_WINDOW  60  
00029 
00030 #define MONITUBE2_MGMT_STRLEN 256  
00031 
00032 /*** Data structures ***/
00033 
00037 typedef struct list_item_s {
00038     void * item; 
00039     TAILQ_ENTRY(list_item_s) entries; 
00040 } list_item_t;
00041 
00042 
00043 typedef TAILQ_HEAD(list_s, list_item_s) list_t; 
00044 
00045 
00050 typedef struct ss_info_s {
00051     patnode    node;       
00052     char       name[MONITUBE2_MGMT_STRLEN];  
00053     char       es[MONITUBE2_MGMT_STRLEN];    
00054     uint16_t   id;                           
00055     uint16_t   fpc_slot;                     
00056     uint16_t   pic_slot;                     
00057     evTimerID  timer;                        
00058     u_int32_t  gen_num;                      
00059     u_int32_t  svc_id;                       
00060     list_t     rules;                        
00061 } ss_info_t;
00062 
00063 
00068 typedef struct address_s {
00069     patnode    node;       
00070     in_addr_t  address;    
00071     in_addr_t  mask;       
00072 } address_t;
00073 
00074 
00079 typedef struct rule_s {
00080     patnode    node;                
00081     char       name[MONITUBE2_MGMT_STRLEN];  
00082     uint32_t   rate;                
00083     in_addr_t  redirect;            
00084     patroot *  addresses;           
00085     list_t     ssets;               
00086 } rule_t;
00087 
00088 
00093 typedef struct flowstat_ss_s {
00094     patnode     node;       
00095     uint16_t    ssid;       
00096     patroot *   stats;      
00097 } flowstat_ss_t;
00098 
00099 
00104 typedef struct flowstat_s {
00105     patnode     node;       
00106     
00107     uint16_t    fpc_slot;   
00108     uint16_t    pic_slot;   
00109     in_addr_t   flow_addr;  
00110     uint16_t    flow_port;  
00111 
00112     evTimerID   timer_id;   
00113     uint32_t    reports;    
00114     uint16_t    window_position;                
00115     double      last_mdi_df[STATS_BASE_WINDOW]; 
00116     uint32_t    last_mdi_mlr[STATS_BASE_WINDOW];
00117     
00118     flowstat_ss_t * ssi; // service set info about which tree it is in
00119 } flowstat_t;
00120 
00121 
00122 /*** GLOBAL/EXTERNAL Functions ***/
00123 
00124 
00128 void
00129 init_config(evContext ctx);
00130 
00131 
00135 void
00136 clear_config(void);
00137 
00141 void
00142 clear_stats(void);
00143 
00144 
00155 int
00156 monitube_config_read(int check);
00157 
00158 
00167 rule_t *
00168 next_rule(rule_t * data);
00169 
00170 
00183 address_t *
00184 next_address(rule_t * rule, address_t * data);
00185 
00186 
00195 ss_info_t *
00196 next_serviceset(ss_info_t * data);
00197 
00198 
00208 flowstat_ss_t *
00209 next_flowstat_ss(flowstat_ss_t * data);
00210 
00223 flowstat_t *
00224 next_flowstat(flowstat_ss_t * fss, flowstat_t * data);
00225 
00226 
00251 void
00252 set_flow_stat(uint16_t fpc_slot,
00253               uint16_t pic_slot,
00254               uint16_t ssid,
00255               in_addr_t flow_addr,
00256               uint16_t flow_port,
00257               double mdi_df,
00258               uint32_t mdi_mlr);
00259 
00260 
00264 void
00265 clear_all_flowstats(void);
00266 
00267 
00268 #endif
00269 

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:27:04 2010 for SDK Your Net Corporation Monitube2 IPTV Monitoring Example: monitube2-mgmt 1.0 by Doxygen 1.5.1