/*
 *  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
/************************************************************************/
/* Variable Limit Definitions                                           */
/************************************************************************/
#define SYSDESCR_UPPER_LIMIT           255
#define SYSDESCR_LOWER_LIMIT           0

#define SYSCONTACT_UPPER_LIMIT         255
#define SYSCONTACT_LOWER_LIMIT         0

#define SYSNAME_UPPER_LIMIT            255
#define SYSNAME_LOWER_LIMIT            0

#define SYSLOCATION_UPPER_LIMIT        255
#define SYSLOCATION_LOWER_LIMIT        0

#define SYSSERVICES_UPPER_LIMIT        127
#define SYSSERVICES_LOWER_LIMIT        0

#define SNMPSETSERIALNO_UPPER_LIMIT    2147483647
#define SNMPSETSERIALNO_LOWER_LIMIT    0

#define SYSORINDEX_UPPER_LIMIT     2147483647
#define SYSORINDEX_LOWER_LIMIT     1

#define SYSORDESCR_UPPER_LIMIT     255
#define SYSORDESCR_LOWER_LIMIT     0

/************************************************************************/
/* MIB Group Data Structures                                            */
/************************************************************************/
struct sys
{
    int sysDescrLen;
    unsigned char sysDescr[SYSDESCR_UPPER_LIMIT];
    int sysObjectIDLen;
    unsigned long sysObjectID[128];
    unsigned long sysUpTime;
    int sysContactLen;
    unsigned char sysContact[SYSCONTACT_UPPER_LIMIT];
    int sysNameLen;
    unsigned char sysName[SYSNAME_UPPER_LIMIT];
    int sysLocationLen;
    unsigned char sysLocation[SYSLOCATION_UPPER_LIMIT];
    int sysServices;
    unsigned long sysORLastChange;
};

struct sysORTable
{
    struct sysORTable * next;
    int sysORIndex;
    int sysORIDLen;
    unsigned long sysORID[128];
    int sysORDescrLen;
    unsigned char sysORDescr[SYSORDESCR_UPPER_LIMIT];
    unsigned long sysORUpTime;
};

/* These values are used for the 'get' parameter in <table>EntryGet and */
/* <table>LocalGet routines                                             */
#define SNMP_GET_THIS   0
#define SNMP_GET_NEXT   1
#define SNMP_GET_PRIOR  -1

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

int sysLocalInitialize();

unsigned char * sysDescrStrGet(int * length);
unsigned long * sysObjectIDOidGet(int * length);
unsigned long sysUpTimeValGet();
extern u_long time_mib;             /* Added - TBD Change to API */

unsigned char * sysContactStrGet(int * length);
int sysContactStrSet(unsigned char * string, int length);
unsigned char * sysNameStrGet(int * length);
int sysNameStrSet(unsigned char * string, int length);
unsigned char * sysLocationStrGet(int * length);
int sysLocationStrSet(unsigned char * string, int length);
unsigned long sysServicesValGet();
unsigned long sysORLastChangeValGet();

int sysORTableLocalGet(int,
    struct sysORTable *);

int sysORTableSerialAdd(
    unsigned long * orid,
    int oridLen,
    unsigned char * ord);

int sysORTableLocalInsert(struct sysORTable * ort);

struct sysORTable * sysORTableEntryGet(int get,
    struct sysORTable * ortSearch);

#ifdef __cplusplus
}
#endif
