/*
 *  Copyright (c) 1996-2007 Digi International Inc., All Rights Reserved
 *
 *  This software contains proprietary and confidential information of Digi
 *  International Inc.  By accepting transfer of this copy, Recipient agrees
 *  to retain this software in confidence, to prevent disclosure to others,
 *  and to make no use of this software other than that for which it was
 *  delivered.  This is an unpublished copyrighted work of Digi International
 *  Inc.  Except as permitted by federal law, 17 USC 117, copying is strictly
 *  prohibited.
 *
 *  Restricted Rights Legend
 *
 *  Use, duplication, or disclosure by the Government is subject to
 *  restrictions set forth in sub-paragraph (c)(1)(ii) of The Rights in
 *  Technical Data and Computer Software clause at DFARS 252.227-7031 or
 *  subparagraphs (c)(1) and (2) of the Commercial Computer Software -
 *  Restricted Rights at 48 CFR 52.227-19, as applicable.
 *
 *  Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
 *
*************************************************************************
*  File Description:
*************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif
#include <snmpapi.h>

/************************************************************************/
/* MIB Group Magic Number Definitions                                   */
/************************************************************************/
#define SNMPTRAPOID             1
#define SNMPTRAPENTERPRISE      3

#define SNMP_COLD_START_TRAP                0
#define SNMP_WARM_START_TRAP                1
#define SNMP_LINK_DOWN_TRAP                 2
#define SNMP_LINK_UP_TRAP                   3
#define SNMP_AUTHENTICATION_FAILURE_TRAP    4
#define SNMP_EGP_NEIGHBOR_LOSS_TRAP         5

/* MIB Group data definitions                                           */
struct snmpTrap
{
    int snmpTrapOIDLen;
    unsigned long snmpTrapOID[128];
    int snmpTrapEnterpriseLen;
    unsigned long snmpTrapEnterprise[128];
};

/* To set the enterprise oid for V1 trap messages, use the              */
/* SNMP_TRAP_SET_ENTERPRISE macro                                       */
#define SNMP_ENTERPRISE_OID_INDEX       6
extern oid snmpEnterpriseOID[];
#define SNMP_TRAP_SET_ENTERPRISE(E)     snmpEnterpriseOID[SNMP_ENTERPRISE_OID_INDEX] = (E)

/* These values are returned from Set routines */
#define SNMP_SET_OK     0
#define SNMP_SET_FAIL   1

int trapMibRegister(void);

void * snmpTrapGet(struct variable *, oid *, int *, int, int *,
    setMethod * setVar);

unsigned long * snmpTrapOIDOidGet(int * length);
int snmpTrapOIDOidSet(unsigned long * pOid, int length);
unsigned long * snmpTrapEnterpriseOidGet(int * length);
int snmpTrapEnterpriseOidSet(unsigned long * pOid, int length);

int coldStartTrap(char * user, NaSnmpTrapAddrInfo_t *addrInfo);
int warmStartTrap(char * user, NaSnmpTrapAddrInfo_t *addrInfo);
/* You must implement the ifTable MIB to do link up and link down traps */
int linkdownTrap(char * user, NaSnmpTrapAddrInfo_t *addrInfo, unsigned long * ifIndex);
int linkupTrap(char * user, NaSnmpTrapAddrInfo_t *addrInfo, unsigned long * ifIndex);
int authenticationFailureTrap(char * user, NaSnmpTrapAddrInfo_t *addrInfo);
#ifdef __cplusplus
}
#endif
