00001
00002
00003
00004
00005 #ifndef _TABLE_ARRAY_HANDLER_H_
00006 #define _TABLE_ARRAY_HANDLER_H_
00007
00008 #ifdef __cplusplus
00009 extern "C" {
00010 #endif
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <net-snmp/library/container.h>
00027 #include <net-snmp/agent/table.h>
00028
00029 #define TABLE_ARRAY_NAME "table_array"
00030
00031
00032
00033
00034
00035 typedef struct netsnmp_request_group_item_s {
00036 netsnmp_request_info *ri;
00037 netsnmp_table_request_info *tri;
00038 struct netsnmp_request_group_item_s *next;
00039 } netsnmp_request_group_item;
00040
00041
00042
00043
00044 typedef struct netsnmp_request_group_s {
00045
00046
00047
00048
00049 netsnmp_index index;
00050
00051
00052
00053
00054 netsnmp_container *table;
00055
00056
00057
00058
00059 netsnmp_index *existing_row;
00060 netsnmp_index *undo_info;
00061
00062
00063
00064
00065 char row_created;
00066 char row_deleted;
00067 char fill1;
00068 char fill2;
00069
00070
00071
00072
00073 netsnmp_request_group_item *list;
00074
00075 int status;
00076
00077 void *rg_void;
00078
00079 } netsnmp_request_group;
00080
00081 typedef int (Netsnmp_User_Row_Operation_c) (const void *lhs,
00082 const void *rhs);
00083 typedef int (Netsnmp_User_Row_Operation) (void *lhs, void *rhs);
00084 typedef int (Netsnmp_User_Get_Processor) (netsnmp_request_info *,
00085 netsnmp_index
00086 *,
00087 netsnmp_table_request_info
00088 *);
00089 typedef netsnmp_index
00090 *(UserRowMethod) (netsnmp_index *);
00091 typedef int (Netsnmp_User_Row_Action) (netsnmp_index *,
00092 netsnmp_index *,
00093 netsnmp_request_group *);
00094 typedef void (Netsnmp_User_Group_Method) (netsnmp_request_group *);
00095
00096
00097
00098
00099 typedef struct netsnmp_table_array_callbacks_s {
00100
00101 Netsnmp_User_Row_Operation *row_copy;
00102 Netsnmp_User_Row_Operation_c *row_compare;
00103
00104 Netsnmp_User_Get_Processor *get_value;
00105
00106
00107 Netsnmp_User_Row_Action *can_activate;
00108 Netsnmp_User_Row_Action *activated;
00109 Netsnmp_User_Row_Action *can_deactivate;
00110 Netsnmp_User_Row_Action *deactivated;
00111 Netsnmp_User_Row_Action *can_delete;
00112
00113 UserRowMethod *create_row;
00114 UserRowMethod *duplicate_row;
00115 UserRowMethod *delete_row;
00116
00117 Netsnmp_User_Group_Method *set_reserve1;
00118 Netsnmp_User_Group_Method *set_reserve2;
00119 Netsnmp_User_Group_Method *set_action;
00120 Netsnmp_User_Group_Method *set_commit;
00121 Netsnmp_User_Group_Method *set_free;
00122 Netsnmp_User_Group_Method *set_undo;
00123
00125 netsnmp_container* container;
00126 char can_set;
00127
00128 } netsnmp_table_array_callbacks;
00129
00130
00131 int
00132 netsnmp_table_container_register(netsnmp_handler_registration *reginfo,
00133 netsnmp_table_registration_info
00134 *tabreq,
00135 netsnmp_table_array_callbacks *cb,
00136 netsnmp_container *container,
00137 int group_rows);
00138
00139 int netsnmp_table_array_register(netsnmp_handler_registration *reginfo,
00140 netsnmp_table_registration_info *tabreq,
00141 netsnmp_table_array_callbacks *cb,
00142 netsnmp_container *container,
00143 int group_rows);
00144
00145 netsnmp_container * netsnmp_extract_array_context(netsnmp_request_info *);
00146
00147 Netsnmp_Node_Handler netsnmp_table_array_helper_handler;
00148
00149 int
00150 netsnmp_table_array_check_row_status(netsnmp_table_array_callbacks *cb,
00151 netsnmp_request_group *ag,
00152 long *rs_new, long *rs_old);
00153
00154 #ifdef __cplusplus
00155 }
00156 #endif
00157
00158 #endif