/*
 * Copyright Notice:
 * Copyright Treck Incorporated  1997 - 2004
 * Copyright Elmic Systems Japan 1997 - 2004
 * No portions or the complete contents of this file may be copied or
 * distributed in any form (including but not limited to printed or electronic
 * forms) without the expressed written consent of Treck Incorporated OR
 * Elmic Systems.  Copyright laws and International Treaties protect the
 * contents of this file.  Unauthorized use is prohibited.
 * All rights reserved.
 *
 * Description:
 *  The primary header file that the user needs to include in their
 *  application to be able to use the SNMP Agent.
 *
 * Filename: trapi.h
 * Author: Ed Remmell
 * Date Created: 12/28/01
 * $Source: /cvs_tick/treck_stack/snmpd/trapi.h,v $
 *
 * Modification History
 * $Revision: 1.11.10.1 $
 * $Date: 2006/06/05 18:55:31 $
 * $Author: mwasiel $
 * $ProjectName: /home/mks/proj/snmpdprj $
 * $ProjectRevision: 4.0.2.53 $
 */
/***********************************************************
        Copyright 1988 by Carnegie Mellon University
 
                      All Rights Reserved
 
Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of CMU not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  
 
CMU DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
CMU BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/

#ifndef _TRAPI_H_
#define _TRAPI_H_

#ifndef _TRDEFS_H_
#include "trdefs.h"
#endif /* _TRDEFS_H_ */

#ifndef _TRASN1_H_
#include "trasn1.h"
#endif /* _TRASN1_H_ */
#ifndef _TRIMPL_H_
#include "trimpl.h"
#endif /* _TRIMPL_H_ */
#ifndef _TRMIB_H_
#include "trmib.h"
#endif /* _TRMIB_H_ */
#ifndef _TRCONSTS_H_
#include "trconsts.h"
#endif /* _TRCONSTS_H_ */
#ifndef _TRSNMPV3_H_
#include "trsnmpv3.h"
#endif /* _TRSNMPV3_H_ */
#ifndef _TRREGSTR_H_
#include "trregstr.h"
#endif /* _TRREGSTR_H_ */
#ifndef _TRCONCPT_H_
#include "trconcpt.h"
#endif /* _TRCONCPT_H_ */

#ifdef __cplusplus
extern "C" {
#endif

/* constant declarations and enumerations */
#define TM_SNMPAPI_NOERROR              0
#define TM_COMMUNITY_NOT_PRINTABLE      -1
#define TM_NOMORE_COMMUNITIES           -2
#define TM_UNKNOWN_COMMUNITY_FLAG       -3
#define TM_COMMUNITY_TOOLONG            -4
#define TM_RECORD_NOTFOUND              -5
#define TM_DEFAULT_NOTDELETED           -6
#define TM_RECORD_LOCKED                -7
#define TM_NOMORE_TRAPENTRIES           -8
#define TM_PORT_TOOLARGE                -9
#define TM_SYSSERVICES_TOOLARGE         -10
#define TM_AGENT_RUNNING                -11
#define TM_BAD_ADDRESS_FAMILY           -12
#define TM_DUPLICATE_COMMUNITY          -13
#define TM_NULL_COMMUNITY               -14
#define TM_NULL_ENTRY                   -15
#define TM_DUPLICATE_ENTRY               -16

/**#define SYS_ERR_OFFSET                  1000**/

#define TM_SYSDESCR_NOT_PRINTABLE       -1
#define TM_SYSNAME_NOT_PRINTABLE        -1
#define TM_SYSCONTACT_NOT_PRINTABLE     -1
#define TM_SYSLOCATION_NOT_PRINTABLE    -1
#define TM_SYSNAME_TOOLONG              -4
#define TM_SYSDESCR_TOOLONG             -4
#define TM_SYSCONTACT_TOOLONG           -4
#define TM_SYSLOCATION_TOOLONG          -4
#define TM_SYSOID_TOOLONG               -4
/* NETOS added. */
#define TM_ENGINEID_TOOLONG             -5
/* End NETOS added. */

#define TM_ZERO_ENGINEID_LENGTH         -1
#define TM_WRONG_USERNAME_LENGTH        -2
#define TM_USERNAME_NOT_PRINTABLE       -3
#define TM_ZERO_SECURITYNAME_LENGTH     -4
#define TM_SECURITYNAME_NOT_PRINTABLE   -5
#define TM_ZERO_CLONEFROM_LENGTH        -6
#define TM_PUBLIC_NOT_PRINTABLE         -7
#define TM_UNKNOWN_STORAGETYPE          -8
#define TM_WRONG_STATUS                 -9
#define TM_WRONG_PUBLIC_LENGTH          -10

#define TM_WRONG_CONTEXTNAME_LENGTH     -1
#define TM_CONTEXTNAME_NOT_PRINTABLE    -2

#define TM_WRONG_SECURITYMODEL          -1
#define TM_WRONG_SECURITYNAME_LENGTH    -2
#define TM_WRONG_GROUPNAME_LENGTH       -3
#define TM_GROUPNAME_NOT_PRINTABLE      -4

#define TM_WRONG_PREFIX_LENGTH          -1
#define TM_PREFIX_NOT_PRINTABLE         -2
#define TM_WRONG_SECURITYLEVEL          -3
#define TM_WRONG_MATCH                  -4

#define TM_WRONG_VTFNAME_LENGTH         -1
#define TM_VTFNAME_NOT_PRINTABLE        -2
#define TM_WRONG_TYPE                   -3

#define TM_ALLOCATION_ERROR             -1

#define TM_PASSWORD_NOT_PRINTABLE       -1
#define TM_PASSWORD_TOOLONG             -2

#define TM_READ_COMMUNITY_FLAG          1
#define TM_WRITE_COMMUNITY_FLAG         2

/* type definitions */

/* global function prototypes */

#ifdef TM_TRECK_OS
TM_PROTO_EXTERN int tfSnmpdMain (
    int blockingState, ttUser32Bit timerInterval);
#else /* !TM_TRECK_OS */
TM_PROTO_EXTERN int tfSnmpdMain ();
#endif /* TM_TRECK_OS */

TM_PROTO_EXTERN int tfSnmpdStop (void);

TM_PROTO_EXTERN int tfAddCommunity (int, ttCharPtr );
TM_PROTO_EXTERN int tfModifyCommunity (int, ttCharPtr , ttCharPtr );
TM_PROTO_EXTERN int tfDeleteCommunity (int, ttCharPtr );
#ifdef NET_OS_SPECIFIC
TM_PROTO_EXTERN tt32Bit tfGetEnterpriseNumber(oid * enterpriseNumberPtr);
TM_PROTO_EXTERN void tfSetEnterpriseNumber(oid enterpriseNumber, tt32Bit enterpriseLength);
#endif
#ifdef TM_SNMP_AGENT_V3
TM_PROTO_EXTERN int tfAddCommunityTableEntry(tt32Bit, ttSnmpCommunityTablePtr);
TM_PROTO_EXTERN int tfModifyCommunityTableEntry(
    tt32Bit flags, ttCharPtr comIndex, ttSnmpCommunityTablePtr comEntryPtr);
TM_PROTO_EXTERN int tfDeleteCommunityTableEntry(tt32Bit, ttCharPtr );
TM_PROTO_EXTERN int tfDisplayCommunityTableEntry(
    ttSnmpCommunityTablePtr, unsigned int);
TM_PROTO_EXTERN int tfAddNotifyTableEntry(
    tt32Bit, ttSnmpNotifyTableEntryPtr);
TM_PROTO_EXTERN int tfDeleteNotifyTableEntry(tt32Bit flags, ttCharPtr );
TM_PROTO_EXTERN int tfDisplayNotifyTableEntry(
    ttSnmpNotifyTableEntryPtr, unsigned int);
TM_PROTO_EXTERN int tfAddNotifyFilterProfileTableEntry(
    tt32Bit, ttSnmpNotifyFilterProfileTableEntryPtr);
TM_PROTO_EXTERN int tfDeleteNotifyFilterTableEntry(
    tt32Bit, ttCharPtr , int, ttOidPtr);
TM_PROTO_EXTERN int tfDisplayNotifyFilterProfileTableEntry(
    ttSnmpNotifyFilterProfileTableEntryPtr, unsigned int);
TM_PROTO_EXTERN int tfAddNotifyFilterTableEntry(
    tt32Bit, ttSnmpNotifyFilterTableEntryPtr);
TM_PROTO_EXTERN int tfDeleteNotifyFilterProfileTableEntry(tt32Bit, ttCharPtr );
TM_PROTO_EXTERN int tfDisplayNotifyFilterTableEntry(
    ttSnmpNotifyFilterTableEntryPtr, unsigned int);
TM_PROTO_EXTERN int tfAddTargetParamsTableEntry(
    tt32Bit, ttSnmpTargetParamsTableEntryPtr);
TM_PROTO_EXTERN int tfDeleteTargetParamsTableEntry(tt32Bit, ttCharPtr );
TM_PROTO_EXTERN int tfDisplayTargetParamsTableEntry(
    ttSnmpTargetParamsTableEntryPtr, unsigned int);
TM_PROTO_EXTERN int tfAddTargetAddrTableEntry(
    tt32Bit, ttSnmpTargetAddrTableEntryPtr);
TM_PROTO_EXTERN int tfDeleteTargetAddrTableEntry(tt32Bit, ttCharPtr );
TM_PROTO_EXTERN int tfDisplayTargetAddrTableEntry(
    ttSnmpTargetAddrTableEntryPtr, unsigned int);
    
TM_PROTO_EXTERN int tfSetSnmpEngineBoots (ttUser32Bit);

#ifdef NET_OS_SPECIFIC
TM_PROTO_EXTERN int tfSetSnmpEngineId (ttConstCharPtr engineId, tt32Bit len);
TM_PROTO_EXTERN int tfGetSnmpEngineInfo(ttSnmpEngineInfoPtr engineInfo);
#endif
#endif /* !TM_SNMP_AGENT_V3 */

#ifdef TM_USE_IPV4
TM_PROTO_EXTERN int tfAddTrapEntry (ttSnmpTrapParmsPtr);
TM_PROTO_EXTERN int tfModifyTrapEntry (
    ttSnmpTrapParmsPtr, ttSnmpTrapParmsPtr);
TM_PROTO_EXTERN int tfDeleteTrapEntry (ttSnmpTrapParmsPtr);
TM_PROTO_EXTERN int tfDisplayTrapEntry (ttSnmpTrapParmsPtr, unsigned int);
#endif /* TM_USE_IPV4 */
TM_PROTO_EXTERN int tfNgAddTrapEntry (ttNgSnmpTrapParmsPtr);
TM_PROTO_EXTERN int tfNgModifyTrapEntry (
    ttNgSnmpTrapParmsPtr, ttNgSnmpTrapParmsPtr);
TM_PROTO_EXTERN int tfNgDeleteTrapEntry (ttNgSnmpTrapParmsPtr);
TM_PROTO_EXTERN int tfNgDisplayTrapEntry (ttNgSnmpTrapParmsPtr, unsigned int);
TM_PROTO_EXTERN int tfSetSnmpPort (ttUser16Bit);
TM_PROTO_EXTERN int tfModifySysDescr (ttCharPtr );
TM_PROTO_EXTERN int tfModifySysName (ttCharPtr );
TM_PROTO_EXTERN int tfModifySysContact (ttCharPtr );
TM_PROTO_EXTERN int tfModifySysLocation (ttCharPtr );
TM_PROTO_EXTERN int tfModifySysObjId (ttOidPtr, int);
TM_PROTO_EXTERN int tfModifySysServices (tt16Bit );
TM_PROTO_EXTERN int tfSetColdStartTrap(
    ttConstCharPtr , const struct ttSockaddrStorage TM_FAR *, int);
TM_PROTO_EXTERN int tfDisplaySysName (ttCharPtr );
TM_PROTO_EXTERN int tfDisplaySysDescr (ttCharPtr );
TM_PROTO_EXTERN int tfDisplaySysContact (ttCharPtr );
TM_PROTO_EXTERN int tfDisplaySysLocation (ttCharPtr );
TM_PROTO_EXTERN int tfDisplaySysObjectId (ttOidPtr, ttIntPtr);


#ifdef TM_SNMP_AGENT_V3
TM_PROTO_EXTERN int tfDeleteAccessEntry(ttSnmpVacmAccessTablePtr );
TM_PROTO_EXTERN int tfDisplayAccessEntry(
    ttSnmpVacmAccessTablePtr , unsigned int );
TM_PROTO_EXTERN int tfInsertAccessEntry(ttSnmpVacmAccessTablePtr );
TM_PROTO_EXTERN int tfDeleteContextEntry(ttSnmpVacmContextTablePtr );
TM_PROTO_EXTERN int tfDisplayContextEntry(
    ttSnmpVacmContextTablePtr , unsigned int );
TM_PROTO_EXTERN int tfInsertContextEntry(ttSnmpVacmContextTablePtr );
TM_PROTO_EXTERN int tfDeleteSec2GroupEntry(ttSnmpVacmSec2GroupTablePtr );
TM_PROTO_EXTERN int tfDisplaySec2GroupEntry(
    ttSnmpVacmSec2GroupTablePtr , unsigned int );
TM_PROTO_EXTERN int tfInsertSec2GroupEntry(ttSnmpVacmSec2GroupTablePtr );
TM_PROTO_EXTERN int tfDeleteUsmEntry(ttSnmpUsmUserTablePtr );
TM_PROTO_EXTERN int tfDisplayUsmEntry(ttSnmpUsmUserTablePtr , unsigned int );
TM_PROTO_EXTERN int tfInsertUsmEntry(ttSnmpUsmUserTablePtr );
TM_PROTO_EXTERN int tfDeleteVtfEntry(ttSnmpVacmViewTreeFamilyTablePtr );
TM_PROTO_EXTERN int tfDisplayVtfEntry(
    ttSnmpVacmViewTreeFamilyTablePtr , unsigned int );
TM_PROTO_EXTERN int tfInsertVtfEntry(ttSnmpVacmViewTreeFamilyTablePtr );
TM_PROTO_EXTERN int tfModifyAuthPassword(int, ttCharPtr , ttCharPtr );
TM_PROTO_EXTERN int tfModifyPrivacyPassword(int, ttCharPtr , ttCharPtr );
#endif /* TM_SNMP_AGENT_V3 */

/* global variable extern's */

/* macro definitions */

#ifdef __cplusplus
}
#endif

#endif /* #ifndef _TRAPI_H_ */

/* Processed by Treck Shipping Tool v2.48 
 * 2005/11/16 15:13:14      For: Digi
 * File Name: trapi.h       File Revision: 4.0.2.8 
 * Project Name: snmpdprj   Project Release: 4.0.2.53
 * Input checksum: 17475    Output checksum: 59239
 */
