sub_agent.c File Reference

SNMP statistic module, master agent connection. More...

#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <signal.h>
#include "sub_agent.h"
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>
#include "openserSIPCommonObjects.h"
#include "openserSIPServerObjects.h"
#include "openserObjects.h"
#include "openserSIPPortTable.h"
#include "openserSIPMethodSupportedTable.h"
#include "openserSIPStatusCodesTable.h"
#include "openserSIPRegUserTable.h"
#include "openserSIPContactTable.h"
#include "openserSIPRegUserLookupTable.h"
#include "openserMIBNotifications.h"
#include "../../dprint.h"

Include dependency graph for sub_agent.c:

Go to the source code of this file.

Functions

void agentx_child (int rank)
static int initialize_agentx (void)
void register_with_master_agent (char *name_to_register_under)
static void sigterm_handler (int signal)

Variables

static int keep_running


Detailed Description

SNMP statistic module, master agent connection.

This file defines all functions required to establish a relationship with a master agent.

Definition in file sub_agent.c.


Function Documentation

void agentx_child ( int  rank  ) 

Creates a child that will become the AgentX sub-agent. The child will insulate itself from the rest of OpenSER by overriding most of signal handlers.

Definition at line 126 of file sub_agent.c.

References initialize_agentx(), NULL, and sigterm_handler().

static int initialize_agentx ( void   )  [static]

This function:

1) Registers itself with the Master Agent 2) Initializes all of the SNMPStats modules scalars and tables, while simultaneously registering their respective SNMP OID's and handlers with the master agent. 3) Repeatedly checks for new SNMP messages to process

Note:
This function never returns, so it should always be called from a sub-process.

Definition at line 89 of file sub_agent.c.

References AGENT_PROCESS_NAME, init_openserObjects(), init_openserSIPCommonObjects(), init_openserSIPContactTable(), init_openserSIPMethodSupportedTable(), init_openserSIPPortTable(), init_openserSIPRegUserLookupTable(), init_openserSIPRegUserTable(), init_openserSIPServerObjects(), init_openserSIPStatusCodesTable(), keep_running, and register_with_master_agent().

Referenced by agentx_child().

void register_with_master_agent ( char *  name_to_register_under  ) 

This function opens up a connection with the master agent specified in the snmpstats modules configuration file

Definition at line 172 of file sub_agent.c.

Referenced by initialize_agentx(), and run_alarm_check().

static void sigterm_handler ( int  signal  )  [static]

The function handles Handles shutting down of the sub_agent process.

Definition at line 72 of file sub_agent.c.

Referenced by agentx_child().


Variable Documentation

int keep_running [static]

Definition at line 69 of file sub_agent.c.

Referenced by initialize_agentx().


Generated on Thu May 24 20:00:44 2012 for Kamailio - The Open Source SIP Server by  doxygen 1.5.6