snmpstats_globals.h

Go to the documentation of this file.
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  *
00029  */
00030 
00039 #ifndef _SNMP_STATS_GLOBALS_
00040 #define _SNMP_STATS_GLOBALS_
00041 
00042 #include "../../sr_module.h"
00043 
00044 #define OPENSER_OID            1,3,6,1,4,1,34352
00045 
00046 /***************************************************************
00047  * Textual Conventions for BITS types - begins
00048  *
00049  * To set a bit  : |= with the define
00050  * To clear a bit: &= ~(the_define)
00051  *
00052  * Example:
00053  *
00054  * 1) Setting a minor alarm status:
00055  *
00056  *      currentAlarmStatus |=  TC_ALARM_STATUS_MINOR
00057  *
00058  * 2) Clearing a minor alarm status:
00059  *
00060  *      currentAlarmStatus &= ~TC_ALARM_STATUS_MINOR
00061  */
00062 #define TC_SIP_TRANSPORT_PROTOCOL_OTHER (128>>0)
00063 #define TC_SIP_TRANSPORT_PROTOCOL_UDP   (128>>1)
00064 #define TC_SIP_TRANSPORT_PROTOCOL_TCP   (128>>2)
00065 #define TC_SIP_TRANSPORT_PROTOCOL_SCTP  (128>>3)
00066 #define TC_SIP_TRANSPORT_PROTOCOL_TLS   (128>>4)
00067 
00068 #define TC_SIP_ENTITY_ROLE_OTHER            (128 >> 0)
00069 #define TC_SIP_ENTITY_ROLE_USER_AGENT       (128 >> 1)
00070 #define TC_SIP_ENTITY_ROLE_PROXY_SERVER     (128 >> 2)
00071 #define TC_SIP_ENTITY_ROLE_REDIRECT_SERVER  (128 >> 3)
00072 #define TC_SIP_ENTITY_ROLE_REGISTRAR_SERVER (128 >> 4)
00073 
00074 #define TC_SIP_OPTION_TAG_REQUIRE       (128 >> 0)
00075 #define TC_SIP_OPTION_TAG_PROXY_REQUIRE (128 >> 1)
00076 #define TC_SIP_OPTION_TAG_SUPPORTED     (128 >> 2)
00077 #define TC_SIP_OPTION_TAG_UNSUPPORTED   (128 >> 3)
00078 
00079 #define TC_ALARM_STATUS_UNDER_REPAIR      (128 >> 0)
00080 #define TC_ALARM_STATUS_CRITICAL          (128 >> 1)
00081 #define TC_ALARM_STATUS_MAJOR             (128 >> 2)
00082 #define TC_ALARM_STATUS_MINOR             (128 >> 3)
00083 #define TC_ALARM_STATUS_ALARM_OUTSTANDING (128 >> 4)
00084 #define TC_ALARM_STATUS_UNKNOWN           (128 >> 5)
00085 
00086 #define TC_TRANSPORT_PROTOCOL_OTHER (128 >> 0)
00087 #define TC_TRANSPORT_PROTOCOL_UDP   (128 >> 1)
00088 #define TC_TRANSPORT_PROTOCOL_TCP   (128 >> 2)
00089 #define TC_TRANSPORT_PROTOCOL_SCTP  (128 >> 3)
00090 #define TC_TRANSPORT_PROTOCOL_TLS   (128 >> 4)
00091 /*
00092  * Textual Conventions for BITS types - ends
00093  *************************************************************/
00094 
00095 
00096 
00097 /***************************************************************
00098  * Textual Conventions for INTEGER types - begins
00099  */
00100 #define TC_ALARM_STATE_CLEAR    0
00101 #define TC_ALARM_STATE_CRITICAL 1
00102 #define TC_ALARM_STATE_MAJOR    2
00103 #define TC_ALARM_STATE_MINOR    3
00104 #define TC_ALARM_STATE_UNKNOWN  4
00105 
00106 #define TC_USAGE_STATE_IDLE    0
00107 #define TC_USAGE_STATE_ACTIVE  1
00108 #define TC_USAGE_STATE_BUSY    2
00109 #define TC_USAGE_STATE_UNKNOWN 3
00110 
00111 #define TC_ROWSTATUS_ACTIVE        1
00112 #define TC_ROWSTATUS_NOTINSERVICE  2
00113 #define TC_ROWSTATUS_NOTREADY      3
00114 #define TC_ROWSTATUS_CREATEANDGO   4
00115 #define TC_ROWSTATUS_CREATEANDWAIT 5 
00116 #define TC_ROWSTATUS_DESTROY       6
00117 /*
00118  * Textual Conventions for INTEGER types - ends
00119  *************************************************************/
00120 
00121 
00122 #define TC_TRUE  1
00123 #define TC_FALSE 2
00124 
00125 #define SNMPGET_TEMP_FILE "/tmp/openSER_SNMPAgent.txt"
00126 #define SNMPGET_MAX_BUFFER 80
00127 #define MAX_PROC_BUFFER    256
00128 
00129 #define MAX_USER_LOOKUP_COUNTER 255
00130 
00131 #define HASH_SIZE 32
00132 
00133 extern unsigned int global_UserLookupCounter;
00134 
00135 /*******************************************************************************
00136  * Configuration File Handler Prototypes
00137  */
00138 
00140 int handleSipEntityType( modparam_t type, void* val);
00141 
00143 int set_queue_minor_threshold(modparam_t type, void *val);
00144 
00146 int set_queue_major_threshold(modparam_t type, void *val);
00147 
00149 int set_dlg_minor_threshold(modparam_t type, void *val);
00150 
00152 int set_dlg_major_threshold(modparam_t type, void *val);
00153 
00155 int set_snmpget_path( modparam_t type, void *val);
00156 
00158 int set_snmp_community( modparam_t type, void *val);
00159 
00160 
00161 #endif