/*
** CBLM v3
** $Id: trap.h,v 1.2 2008/07/14 00:25:08 sella Exp $
** Copyright (c) 2005,2006 James M. Sella. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/

#ifndef __DGS_TRAP_H
#define __DGS_TRAP_H

#include "config.h"

#include <snmptrap.h>

#include "common.h"

/* .dgt.dgtProduct.cblmMIB.cblmTrap. */
#define TRAP_PROCESS_STARTUP ".1.3.6.1.4.1.25439.1.4.3.1"			/* .processStartup */
#define TRAP_PROCESS_SHUTDOWN ".1.3.6.1.4.1.25439.1.4.3.2"			/* .processShutdown */
#define TRAP_PROCESS_RESTART ".1.3.6.1.4.1.25439.1.4.3.3"			/* .processRestart */
#define TRAP_DATABASE_DOWN ".1.3.6.1.4.1.25439.1.4.3.4"				/* .databaseDown */
#define TRAP_DATABASE_UP ".1.3.6.1.4.1.25439.1.4.3.5"					/* .databaseUp */
#define TRAP_DATABASE_RECONFIG ".1.3.6.1.4.1.25439.1.4.3.6"			/* .databaseReconfiguration */
#define TRAP_PROBE_THRESHOLD_ALARM ".1.3.6.1.4.1.25439.1.4.3.7"	/* .probeThresholdAlarm */
#define TRAP_PROBE_THRESHOLD_CLEAR ".1.3.6.1.4.1.25439.1.4.3.8"	/* .probeThresholdClear */

/* .dgt.dgtProduct.cblmMIB.cblmCMI. */
#define OID_ID ".1.3.6.1.4.1.25439.1.4.1.1"								/* .cblmID */
#define OID_DATABASE_HOST ".1.3.6.1.4.1.25439.1.4.1.2"				/* .databaseHost */
#define OID_DATABASE_PORT ".1.3.6.1.4.1.25439.1.4.1.3"				/* .databasePort */
#define OID_DATABASE_SOCKET ".1.3.6.1.4.1.25439.1.4.1.4"				/* .databaseSocket */
#define OID_DATABASE_NAME ".1.3.6.1.4.1.25439.1.4.1.5"				/* .databaseName */
#define OID_DATABASE_USER ".1.3.6.1.4.1.25439.1.4.1.6"				/* .databaseUser */
#define OID_PROBE_ADDRESS ".1.3.6.1.4.1.25439.1.4.1.7"				/* .probeAddress */
#define OID_PROBE_NAME ".1.3.6.1.4.1.25439.1.4.1.8"					/* .probeName */
#define OID_PROBE_REMOTE_ADDRESS ".1.3.6.1.4.1.25439.1.4.1.9"		/* .probeRemoteAddress */
#define OID_PROBE_REMOTE_NAME ".1.3.6.1.4.1.25439.1.4.1.10"			/* .probeRemoteName */
#define OID_PROBE_THRESHOLD_TYPE ".1.3.6.1.4.1.25439.1.4.1.11"		/* .probeThresholdType */
#define OID_PROBE_THRESHOLD_TRIGGER ".1.3.6.1.4.1.25439.1.4.1.11"	/* .probeThresholdTrigger */
#define OID_PROBE_THRESHOLD_CURRENT ".1.3.6.1.4.1.25439.1.4.1.12"	/* .probeThresholdCurrent */

#define THRESHOLD_TYPE_UNKNOWN 0												/* unknown(0) */
#define THRESHOLD_TYPE_PACKET_LOSS 1										/* packetLoss(1) */
#define THRESHOLD_TYPE_ROUNDTRIPTIME 2										/* roundTripTime(2) */
#define THRESHOLD_TYPE_ONEWAYTRIPTIME 3									/* oneWayTripTime(3) */
#define THRESHOLD_TYPE_JITTER 4												/* jitter(4) */
#define THRESHOLD_TYPE_OUTOFORDER 5											/* outOfOrder(5) */
#define THRESHOLD_TYPE_DUPLICATE 6											/* duplicate(6) */
#define THRESHOLD_TYPE_TYPEOFSERVICE 7										/* typeOfService(7) */
#define THRESHOLD_TYPE_PRIORITY 8											/* priority(8) */
#define THRESHOLD_TYPE_MAX 8

/* Function definitions. */
int snmptrap_process_startup();
int snmptrap_process_shutdown();
int snmptrap_process_restart();
int snmptrap_database_down();
int snmptrap_database_up();
int snmptrap_database_reconfig();
int snmptrap_probe_threshold_alarm(int threshold_type, struct probe_t *probe, unsigned int current, unsigned int threshold);
int snmptrap_probe_threshold_clear(int threshold_type, struct probe_t *probe, unsigned int current, unsigned int threshold);

int init_snmptrap_t(const char *trap_oid, snmptrap_t *trap);
int snmptrap_pid(const char *trap_oid);
int snmptrap_database(const char *trap_oid);
int snmptrap_probe_threshold(const char* trap_oid, int threshold_type, struct probe_t *probe, unsigned int current, unsigned int threshold);

#endif

/*
** Local Variables:
** c-basic-offset: 3
** tab-width: 3
** End:
** vim: noet ts=3 sw=3
*/
