/*
 * Copyright Notice:
 * Copyright Treck Incorporated  1997 - 2004.
 * Copyright Elmic Incorporated  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 Inc OR Elmic Systems.
 * Copyright laws and International Treaties protect the contents of this
 * file. Unauthorized use is prohibited. All rights reserved.
 *
 * Description:
 *
 * Filename: example_local.c
 * Generated by The Treck MIB compiler - version 1.23.
 * Date Created: Tue Dec 05 14:32:22 2006
 */


#include "trdefs.h"
#include "trasn1.h"
#include "trsnmp.h"
#include "trimpl.h"
#include "trmib.h"
#include "trconsts.h"
#ifdef TM_SNMP_AGENT_V3
#include "trsnmpv3.h"
#include "trdeskey.h"
#endif /* TM_SNMP_AGENT_V3 */
#include "trregstr.h"
#include "example_local.h"
#include "example_var.h"

/* Include you local .h files here */

/********************************************************************
* tfgroup_get
*
* PARAMETERS:
*   what    - one of the #define's in the xxx_var.h file
*   length  - pointer to the value length
*
* RETURNS:
*   Pointer to the variable's value on success, NULL on failure
*
* NOTES:
*
*********************************************************************/
long *tfgroup_get(u_char what, int *length)
{
#ifdef NET_OS_SPECIFIC
    /* NAMIB specific code added */
    extern long * app_group_get(u_char what, int *length);

    return app_group_get(what, length);
#endif
}

/********************************************************************
* tfwrite_group
*
* PARAMETERS:
*   what          - one of the #define's in the xxx_var.h file.
*   buffer        - pointer to the value to write
*   buffer_length - length of the value
*
* RETURNS:
*   OK on success, FAIL on failure
*
* NOTES:
*
*********************************************************************/
int tfwrite_group(
    int what, u_char *buffer, int buffer_length)
{
#ifdef NET_OS_SPECIFIC
    /* NAMIB specific code added */
    extern int app_write_group(int what, u_char *buffer, int buffer_length);

    return app_write_group(what, buffer, buffer_length);
#endif
}

/********************************************************************
* tfsimpletable_entry_get
*
* PARAMETERS:
*   exact   - 1 if the exact value is retrieved; 0 otherwise
*   entry0  - pointer to a struct simpletable_entry
*
* RETURNS:
*   1 on success, 0 on failure
*
* NOTES:
*   This function is called with the pointer to 
*   struct simpletable_entry
*   On entry the indices are set, to allow to identify the row,
*   and all other fields are bzero'd. An entry may only be used
*   to identify the row (in case of a row with multiple index or in case
*   the table has an external object index.) The indexes (indices) may or
*   may not be valid row index (indices).
*   If exact == 1 and the row is found, fill in ALL fields in the row
*   entry and return 1.
*   If exact == 1 and the row is not found, return 0.
*   If exact == 0 and there is a row lexicographically following
*   the given one, fill in ALL fields from that row, including
*   index (indices) and return 1.
*   If exact == 0 and there are no rows lexicographically following
*   the given one, return 0
*
*********************************************************************/
int tfsimpletable_entry_get(int exact,
     struct simpletable_entry *entry0)
{
#ifdef NET_OS_SPECIFIC
    /* NAMIB specific code added */
    extern int app_simpletable_entry_get(int exact, struct simpletable_entry *entry0);

    return app_simpletable_entry_get(exact, entry0);
#endif
}

/********************************************************************
* tfwrite_simpletable_entry
*
* PARAMETERS:
*   index0        - table of index (per RFC)
*   what          - one of the #define's in the xxx_var.h file.
*                   (table's column)
*   value         - pointer to the value to write
*   value_length  - length of the value
*
* RETURNS:
*   OK on success, FAIL on failure
*
* NOTES:
*
*********************************************************************/
int tfwrite_simpletable_entry(
    int index0, 
    int what, u_char *value, int value_length)
{
#ifdef NET_OS_SPECIFIC
    /* NAMIB specific code added */
    extern int app_write_simpletable_entry(int index0, int what, u_char *value, int value_length);

    return app_write_simpletable_entry(index0, what, value, value_length);
#endif
}

