snmpSIPRegUserLookupTable.h

00001 /*
00002  * $Id$
00003  *
00004  * SNMPStats Module 
00005  * Copyright (C) 2006 SOMA Networks, INC.
00006  * Written by: Jeffrey Magder (jmagder@somanetworks.com)
00007  *
00008  * This file is part of Kamailio, a free SIP server.
00009  *
00010  * Kamailio is free software; you can redistribute it and/or modify it
00011  * under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version
00014  *
00015  * Kamailio is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023  * USA
00024  *
00025  * History:
00026  * --------
00027  * 2006-11-23 initial version (jmagder)
00028  * 2007-02-16 Moved all OID registrations from the experimental branch to 
00029  *            OpenSER's IANA assigned enterprise branch. (jmagder)
00030  * 
00031  * Note: this file originally auto-generated by mib2c using 
00032  * mib2c.array-user.conf,
00033  *
00034  * This file implements the openserSIPRegUserLookupTable.  For a full
00035  * description of the table, please see the OPENSER-SIP-SERVER-MIB.
00036  *
00037  * This file consists of many more functions than the other header files.  
00038  * This is because this table is writable, bringing a lot of SNMP overhead.
00039  *
00040  * Most of the contents are auto-generated (aside from white space and comment
00041  * changes), and can be ignored.  The functions that have been modified are:
00042  *
00043  * 1) openserSIPRegUserLookupTable_extract_index() 
00044  *
00045  * 2) openserSIPRegUserLookupTable_can_[activate|deactivate|delete]()
00046  *
00047  * 3) openserSIPRegUserLookupTable_set_reserve1()
00048  *
00049  * 4) openserSIPRegUserLookupTable_set_action()
00050  *
00051  * Full details can be found in openserSIPRegUserLookupTable.c.  You can safely
00052  * ignore the other functions.  
00053  */
00054 
00055 #ifndef OPENSERSIPREGUSERLOOKUPTABLE_H
00056 #define OPENSERSIPREGUSERLOOKUPTABLE_H
00057 
00058 #ifdef __cplusplus
00059 extern "C" {
00060 #endif
00061 
00062     
00063 #include <net-snmp/net-snmp-config.h>
00064 #include <net-snmp/library/container.h>
00065 #include <net-snmp/agent/table_array.h>
00066 
00067 #include "../../config.h"
00068 
00069 
00070 /* This structure represnts a row in the table */
00071 typedef struct openserSIPRegUserLookupTable_context_s 
00072 {
00073         netsnmp_index index; 
00074 
00076         unsigned long  openserSIPRegUserLookupIndex;
00077 
00079         unsigned char *openserSIPRegUserLookupURI;
00080         long           openserSIPRegUserLookupURI_len;
00081 
00083         unsigned long  openserSIPRegUserIndex;
00084 
00086         long openserSIPRegUserLookupRowStatus;
00087 
00088         void * data;
00089 
00090 } openserSIPRegUserLookupTable_context;
00091 
00092 /*
00093  * Initializes the openserSIPRegUserLookupTable table.  This step is easier
00094  * than in the other tables because there is no table population.  All table
00095  * population takes place during run time. 
00096  */
00097 void init_openserSIPRegUserLookupTable(void);
00098 
00099 
00100 /*
00101  * Initialize the openserSIPRegUserLookupTable table by defining how it is
00102  * structured. 
00103  *
00104  * This function is mostly auto-generated.
00105  */
00106 void initialize_table_openserSIPRegUserLookupTable(void);
00107 
00108 /* 
00109  * This function was auto-generated and didn't need modifications from its
00110  * auto-generation.  It is called to handle an SNMP GET request. 
00111  */
00112 int openserSIPRegUserLookupTable_get_value(netsnmp_request_info *, 
00113                 netsnmp_index *, netsnmp_table_request_info *);
00114 
00115 const openserSIPRegUserLookupTable_context * 
00116         openserSIPRegUserLookupTable_get_by_idx(netsnmp_index *);
00117 
00118 const openserSIPRegUserLookupTable_context * 
00119         openserSIPRegUserLookupTable_get_by_idx_rs(
00120                         netsnmp_index *, 
00121                         int row_status);
00122 
00123 /* oid declarations */
00124 extern oid    openserSIPRegUserLookupTable_oid[];
00125 extern size_t openserSIPRegUserLookupTable_oid_len;
00126 
00127 
00128 #define openserSIPRegUserLookupTable_TABLE_OID OPENSER_OID,3,1,2,1,5,9
00129 
00130 
00131 /* column number definitions for table openserSIPRegUserLookupTable */
00132 #define COLUMN_OPENSERSIPREGUSERLOOKUPINDEX     1
00133 #define COLUMN_OPENSERSIPREGUSERLOOKUPURI       2
00134 #define COLUMN_OPENSERSIPREGUSERINDEX           3
00135 #define COLUMN_OPENSERSIPREGUSERLOOKUPROWSTATUS 4
00136 
00137 #define openserSIPRegUserLookupTable_COL_MIN 2
00138 #define openserSIPRegUserLookupTable_COL_MAX 4
00139 
00140 
00141 /* Handles index extraction for row creation */
00142 int openserSIPRegUserLookupTable_extract_index( 
00143                 openserSIPRegUserLookupTable_context *ctx, netsnmp_index *hdr);
00144 
00145 /* Handle RESERVE1 and RESERVE2 phases of an SNMP SET */
00146 void openserSIPRegUserLookupTable_set_reserve1(netsnmp_request_group *);
00147 void openserSIPRegUserLookupTable_set_reserve2(netsnmp_request_group *);
00148 
00149 /* Handle the SET and ACTION phases of an SNMP SET */
00150 void openserSIPRegUserLookupTable_set_action(netsnmp_request_group *);
00151 void openserSIPRegUserLookupTable_set_commit(netsnmp_request_group *);
00152 
00153 /* Handle Resource cleanup if the ACTION or RESERVE1/RESERVE2 phases of an
00154  * SNMPSET fail */
00155 void openserSIPRegUserLookupTable_set_free(netsnmp_request_group *);
00156 void openserSIPRegUserLookupTable_set_undo(netsnmp_request_group *);
00157 
00158 openserSIPRegUserLookupTable_context * 
00159         openserSIPRegUserLookupTable_duplicate_row(
00160                         openserSIPRegUserLookupTable_context*);
00161 
00162 netsnmp_index * openserSIPRegUserLookupTable_delete_row(
00163                 openserSIPRegUserLookupTable_context*);
00164 
00165 /* Used to check if there is a reason why a row can't be activated 
00166  * (There is no reason in our implementation)
00167  */
00168 int openserSIPRegUserLookupTable_can_activate(
00169                 openserSIPRegUserLookupTable_context *undo_ctx,
00170                 openserSIPRegUserLookupTable_context *row_ctx,
00171                 netsnmp_request_group * rg);
00172 
00173 /* Used to check if there is a reason why a row can't be deactivated 
00174  * (There is no reason in our implementation)
00175  */
00176 int openserSIPRegUserLookupTable_can_deactivate(
00177                 openserSIPRegUserLookupTable_context *undo_ctx,
00178                 openserSIPRegUserLookupTable_context *row_ctx,
00179                 netsnmp_request_group * rg);
00180 
00181 /* Used to check if there is a reason why a row can't be deleted
00182  * (There is no reason in our implementation)
00183  */
00184 int openserSIPRegUserLookupTable_can_delete(
00185                 openserSIPRegUserLookupTable_context *undo_ctx,
00186                 openserSIPRegUserLookupTable_context *row_ctx,
00187                 netsnmp_request_group * rg);
00188         
00189 /* Basic structural setups of the new row */
00190 openserSIPRegUserLookupTable_context * openserSIPRegUserLookupTable_create_row(
00191                 netsnmp_index*);
00192 
00193 
00194 #ifdef __cplusplus
00195 }
00196 #endif
00197 
00198 #endif