/*
 * Note: this file originally auto-generated by mib2c using
 *       version $ of $ 
 *
 * $Id:$
 */
/* standard Net-SNMP includes */
#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-features.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>

/* include our parent header */
#include "dot1qFdbTable.h"


/** @defgroup data_get data_get: Routines to get data
 *
 * TODO:230:M: Implement dot1qFdbTable get routines.
 * TODO:240:M: Implement dot1qFdbTable mapping routines (if any).
 *
 * These routine are used to get the value for individual objects. The
 * row context is passed, along with a pointer to the memory where the
 * value should be copied.
 *
 * @{
 */
/**********************************************************************
 **********************************************************************
 ***
 *** Table dot1qFdbTable
 ***
 **********************************************************************
 **********************************************************************/
/*
 * Q-BRIDGE-MIB::dot1qFdbTable is subid 1 of dot1qTp.
 * Its status is Current.
 * OID: .1.3.6.1.2.1.17.7.1.2.1, length: 11
*/

/* ---------------------------------------------------------------------
 * TODO:200:r: Implement dot1qFdbTable data context functions.
 */


/**
 * set mib index(es)
 *
 * @param tbl_idx mib index structure
 * @param dot1qFdbId_val
 *
 * @retval MFD_SUCCESS     : success.
 * @retval MFD_ERROR       : other error.
 *
 * @remark
 *  This convenience function is useful for setting all the MIB index
 *  components with a single function call. It is assume that the C values
 *  have already been mapped from their native/rawformat to the MIB format.
 */
int
dot1qFdbTable_indexes_set_tbl_idx(dot1qFdbTable_mib_index *tbl_idx, u_long dot1qFdbId_val)
{
    DEBUGMSGTL(("verbose:dot1qFdbTable:dot1qFdbTable_indexes_set_tbl_idx","called\n"));

    /* dot1qFdbId(1)/UNSIGNED32/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/r/d/h */
    tbl_idx->dot1qFdbId = dot1qFdbId_val;
    

    return MFD_SUCCESS;
} /* dot1qFdbTable_indexes_set_tbl_idx */

/**
 * @internal
 * set row context indexes
 *
 * @param reqreq_ctx the row context that needs updated indexes
 *
 * @retval MFD_SUCCESS     : success.
 * @retval MFD_ERROR       : other error.
 *
 * @remark
 *  This function sets the mib indexs, then updates the oid indexs
 *  from the mib index.
 */
int
dot1qFdbTable_indexes_set(dot1qFdbTable_rowreq_ctx *rowreq_ctx, u_long dot1qFdbId_val)
{
    DEBUGMSGTL(("verbose:dot1qFdbTable:dot1qFdbTable_indexes_set","called\n"));

    if(MFD_SUCCESS != dot1qFdbTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
                                   , dot1qFdbId_val
           ))
        return MFD_ERROR;

    /*
     * convert mib index to oid index
     */
    rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
    if(0 != dot1qFdbTable_index_to_oid(&rowreq_ctx->oid_idx,
                                    &rowreq_ctx->tbl_idx)) {
        return MFD_ERROR;
    }

    return MFD_SUCCESS;
} /* dot1qFdbTable_indexes_set */


/*---------------------------------------------------------------------
 * Q-BRIDGE-MIB::dot1qFdbEntry.dot1qFdbDynamicCount
 * dot1qFdbDynamicCount is subid 2 of dot1qFdbEntry.
 * Its status is Current, and its access level is ReadOnly.
 * OID: .1.3.6.1.2.1.17.7.1.2.1.1.2
 * Description:
The current number of dynamic entries in this
        Filtering Database.
 *
 * Attributes:
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 *   settable   0
 *
 *
 * Its syntax is COUNTER (based on perltype COUNTER)
 * The net-snmp type is ASN_COUNTER. The C type decl is u_long (u_long)
 */
/**
 * Extract the current value of the dot1qFdbDynamicCount data.
 *
 * Set a value using the data context for the row.
 *
 * @param rowreq_ctx
 *        Pointer to the row request context.
 * @param dot1qFdbDynamicCount_val_ptr
 *        Pointer to storage for a u_long variable
 *
 * @retval MFD_SUCCESS         : success
 * @retval MFD_SKIP            : skip this node (no value for now)
 * @retval MFD_ERROR           : Any other error
 */
int
dot1qFdbDynamicCount_get( dot1qFdbTable_rowreq_ctx *rowreq_ctx, u_long * dot1qFdbDynamicCount_val_ptr )
{
   /** we should have a non-NULL pointer */
   netsnmp_assert( NULL != dot1qFdbDynamicCount_val_ptr );


    DEBUGMSGTL(("verbose:dot1qFdbTable:dot1qFdbDynamicCount_get","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

/*
 * TODO:231:o: |-> Extract the current value of the dot1qFdbDynamicCount data.
 * copy (* dot1qFdbDynamicCount_val_ptr ) from rowreq_ctx->data
 */
    (* dot1qFdbDynamicCount_val_ptr ) = rowreq_ctx->data.dot1qFdbDynamicCount;

    return MFD_SUCCESS;
} /* dot1qFdbDynamicCount_get */



/** @} */
