snmpstats.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  * Structure and prototype definitions for the SNMPStats module.
00030  *
00031  * There are some important points to understanding the SNMPStat modules
00032  * architecture.
00033  *
00034  * 1) The SNMPStats module will fork off a new process in mod_child_init when
00035  *    the rank is equal to PROC_MAIN_PROCESS.  The sub-process will be
00036  *    responsible for registering with a master agent (the source of snmp
00037  *    requests), and handling all received requests. 
00038  *
00039  * 2) The Module will register a periodic alarm checking function with a sip
00040  *    timer using register_timer().  This function checks for alarm conditions,
00041  *    and will send out traps to the master agent when it detects their
00042  *    presence.
00043  *
00044  * 3) The SNMPStats module is required to run an external application upon
00045  *    startup, to collect sysUpTime data from the master agent.  This involves
00046  *    spawning a short-lived process.  For this reason, the module temporarily
00047  *    installs a new SIGCHLD handler to deal specifically with this process.  It
00048  *    does not change the normal SIGCHLD behaviour for any process except for
00049  *    this short lived sysUpTime process. 
00050  *
00051  * 4) mod_init() will initialize some interprocess communication buffers, as
00052  *    well as callback mechanisms for the usrloc module.  To understand what the
00053  *    interprocess buffer and callbacks are and are for, please see the
00054  *    respective comments in interprocess_buffer.h, openserSIPRegUserTable.h,
00055  *    and openserSIPContactTable.h.
00056  */
00057 
00065 #ifndef _SNMP_STATS_
00066 #define _SNMP_STATS_
00067 
00068 #define SNMPSTATS_MODULE_NAME "snmpstats"
00069 #define SYSUPTIME_OID         ".1.3.6.1.2.1.1.3.0"
00070 
00071 
00072 #endif