ped_policy_table.h

Go to the documentation of this file.
00001 /*
00002  * $Id: ped_policy_table.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) 2007-2008, Juniper Networks, Inc.
00011  * All rights reserved.
00012  */
00013 
00023 #ifndef __PED_POLICY_TABLE_H_
00024 #define __PED_POLICY_TABLE_H_
00025 
00026 #include <sync/psd_ipc.h>
00027 
00028 /*** Constants ***/
00029 
00030 
00031 /*** Data structures ***/
00032 
00033 
00037 typedef enum {
00038     FILTER_UNVERIFIED,    
00039     FILTER_ADDED,         
00040     FILTER_FAILED,        
00041     FILTER_PENDING        
00042 } policy_filter_status_e;
00043 
00044 
00048 typedef enum {
00049     ROUTE_UNVERIFIED,   
00050     ROUTE_ADDED,        
00051     ROUTE_FAILED,       
00052     ROUTE_PENDING       
00053 } policy_route_status_e;
00054 
00055 
00059 typedef struct ped_policy_filter_s {
00060     policy_filter_msg_t     filter_data; 
00061     policy_filter_status_e  status;      
00062 } ped_policy_filter_t;
00063 
00064 
00068 typedef struct ped_policy_route_s {
00069     policy_route_msg_t         route_data; 
00070     policy_route_status_e      status;     
00071     struct ped_policy_route_s  * next;     
00072 } ped_policy_route_t;
00073 
00074 
00078 typedef struct policy_table_entry_s {
00079     char                 ifname[MAX_IF_NAME_LEN + 1]; 
00080     uint8_t              af;                          
00081     ped_policy_filter_t *filter;     
00082     ped_policy_route_t  *route;      
00083     boolean              broken;     
00084     boolean              pfd_filter; 
00085 } policy_table_entry_t;
00086 
00087 
00088 /*** GLOBAL/EXTERNAL Functions ***/
00089 
00090 
00094 void init_table(void);
00095 
00096 
00100 void destroy_table(void);
00101 
00102 
00107 void policy_table_iterator_reset(void);
00108 
00109 
00120 policy_table_entry_t *policy_table_next(void);
00121 
00122 
00128 int policy_table_entry_count(void);
00129 
00130 
00138 void policy_table_add_filter(policy_filter_msg_t * filter_data);
00139 
00140 
00148 void policy_table_add_route(policy_route_msg_t * route_data);
00149 
00150 
00162 void policy_table_clear_policy(char *ifname, uint8_t af);
00163 
00164 
00178 void
00179 policy_table_delete_policy(char *ifname, uint8_t af, boolean interface_exists);
00180 
00181 
00186 void policy_table_clean(void);
00187 
00188 
00197 boolean policy_table_unverify_all(void);
00198 
00199 
00200 #endif

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:06 2010 for SDK Your Net Corporation Policy Manager Example: Policy Enforcement Daemon 1.0 by Doxygen 1.5.1