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

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


/** @defgroup data_get data_get: Routines to get data
 *
 * TODO:230:M: Implement ieee8021BridgeTrafficClassTable get routines.
 * TODO:240:M: Implement ieee8021BridgeTrafficClassTable 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 ieee8021BridgeTrafficClassTable
 ***
 **********************************************************************
 **********************************************************************/
/*
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeTrafficClassTable is subid 3 of ieee8021BridgePriority.
 * Its status is Current.
 * OID: .1.3.111.2.802.1.1.2.1.3.3, length: 11
*/

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


/**
 * set mib index(es)
 *
 * @param tbl_idx mib index structure
 * @param ieee8021BridgeBasePortComponentId_val
 * @param ieee8021BridgeBasePort_val
 * @param ieee8021BridgeTrafficClassPriority_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
ieee8021BridgeTrafficClassTable_indexes_set_tbl_idx(ieee8021BridgeTrafficClassTable_mib_index *tbl_idx, u_long ieee8021BridgeBasePortComponentId_val, u_long ieee8021BridgeBasePort_val, u_long ieee8021BridgeTrafficClassPriority_val)
{
    DEBUGMSGTL(("verbose:ieee8021BridgeTrafficClassTable:ieee8021BridgeTrafficClassTable_indexes_set_tbl_idx","called\n"));

    /* ieee8021BridgeBasePortComponentId(1)/IEEE8021PbbComponentIdentifier/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H */
    tbl_idx->ieee8021BridgeBasePortComponentId = ieee8021BridgeBasePortComponentId_val;

    /* ieee8021BridgeBasePort(2)/IEEE8021BridgePortNumber/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H */
    tbl_idx->ieee8021BridgeBasePort = ieee8021BridgeBasePort_val;

    /* ieee8021BridgeTrafficClassPriority(1)/IEEE8021PriorityValue/ASN_UNSIGNED/u_long(u_long)//l/a/w/e/R/d/H */
    tbl_idx->ieee8021BridgeTrafficClassPriority = ieee8021BridgeTrafficClassPriority_val;


    return MFD_SUCCESS;
} /* ieee8021BridgeTrafficClassTable_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
ieee8021BridgeTrafficClassTable_indexes_set(ieee8021BridgeTrafficClassTable_rowreq_ctx *rowreq_ctx, u_long ieee8021BridgeBasePortComponentId_val, u_long ieee8021BridgeBasePort_val, u_long ieee8021BridgeTrafficClassPriority_val)
{
    DEBUGMSGTL(("verbose:ieee8021BridgeTrafficClassTable:ieee8021BridgeTrafficClassTable_indexes_set","called\n"));

    if(MFD_SUCCESS != ieee8021BridgeTrafficClassTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
                                   , ieee8021BridgeBasePortComponentId_val
                                   , ieee8021BridgeBasePort_val
                                   , ieee8021BridgeTrafficClassPriority_val
           ))
        return MFD_ERROR;

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

    return MFD_SUCCESS;
} /* ieee8021BridgeTrafficClassTable_indexes_set */


/*---------------------------------------------------------------------
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeTrafficClassEntry.ieee8021BridgeTrafficClass
 * ieee8021BridgeTrafficClass is subid 2 of ieee8021BridgeTrafficClassEntry.
 * Its status is Current, and its access level is ReadWrite.
 * OID: .1.3.111.2.802.1.1.2.1.3.3.1.2
 * Description:
The Traffic Class the received frame is mapped to.

        The value of this object MUST be retained across
        reinitializations of the management system.
 *
 * Attributes:
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 *   readable   1     iscolumn 1     ranges 1      hashint   0
 *   settable   1
 *
 * Ranges:  0 - 7;
 *
 * Its syntax is INTEGER32 (based on perltype INTEGER32)
 * The net-snmp type is ASN_INTEGER. The C type decl is long (long)
 */
/**
 * Extract the current value of the ieee8021BridgeTrafficClass data.
 *
 * Set a value using the data context for the row.
 *
 * @param rowreq_ctx
 *        Pointer to the row request context.
 * @param ieee8021BridgeTrafficClass_val_ptr
 *        Pointer to storage for a long variable
 *
 * @retval MFD_SUCCESS         : success
 * @retval MFD_SKIP            : skip this node (no value for now)
 * @retval MFD_ERROR           : Any other error
 */
int
ieee8021BridgeTrafficClass_get( ieee8021BridgeTrafficClassTable_rowreq_ctx *rowreq_ctx, long * ieee8021BridgeTrafficClass_val_ptr )
{
   /** we should have a non-NULL pointer */
   netsnmp_assert( NULL != ieee8021BridgeTrafficClass_val_ptr );


    DEBUGMSGTL(("verbose:ieee8021BridgeTrafficClassTable:ieee8021BridgeTrafficClass_get","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

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

    return MFD_SUCCESS;
} /* ieee8021BridgeTrafficClass_get */



/** @} */
