/*
 * 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 "ieee8021BridgeTpPortTable.h"


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

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


/**
 * set mib index(es)
 *
 * @param tbl_idx mib index structure
 * @param ieee8021BridgeTpPortComponentId_val
 * @param ieee8021BridgeTpPort_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
ieee8021BridgeTpPortTable_indexes_set_tbl_idx(ieee8021BridgeTpPortTable_mib_index *tbl_idx, u_long ieee8021BridgeTpPortComponentId_val, u_long ieee8021BridgeTpPort_val)
{
    DEBUGMSGTL(("verbose:ieee8021BridgeTpPortTable:ieee8021BridgeTpPortTable_indexes_set_tbl_idx","called\n"));

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

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


    return MFD_SUCCESS;
} /* ieee8021BridgeTpPortTable_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
ieee8021BridgeTpPortTable_indexes_set(ieee8021BridgeTpPortTable_rowreq_ctx *rowreq_ctx, u_long ieee8021BridgeTpPortComponentId_val, u_long ieee8021BridgeTpPort_val)
{
    DEBUGMSGTL(("verbose:ieee8021BridgeTpPortTable:ieee8021BridgeTpPortTable_indexes_set","called\n"));

    if(MFD_SUCCESS != ieee8021BridgeTpPortTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
                                   , ieee8021BridgeTpPortComponentId_val
                                   , ieee8021BridgeTpPort_val
           ))
        return MFD_ERROR;

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

    return MFD_SUCCESS;
} /* ieee8021BridgeTpPortTable_indexes_set */


/*---------------------------------------------------------------------
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeTpPortEntry.ieee8021BridgeTpPortMaxInfo
 * ieee8021BridgeTpPortMaxInfo is subid 3 of ieee8021BridgeTpPortEntry.
 * Its status is Current, and its access level is ReadOnly.
 * OID: .1.3.111.2.802.1.1.2.1.2.1.1.3
 * Description:
The maximum size of the INFO (non-MAC) field that
        this port will receive or transmit.
 *
 * Attributes:
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 *   settable   0
 *
 *
 * 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 ieee8021BridgeTpPortMaxInfo data.
 *
 * Set a value using the data context for the row.
 *
 * @param rowreq_ctx
 *        Pointer to the row request context.
 * @param ieee8021BridgeTpPortMaxInfo_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
ieee8021BridgeTpPortMaxInfo_get( ieee8021BridgeTpPortTable_rowreq_ctx *rowreq_ctx, long * ieee8021BridgeTpPortMaxInfo_val_ptr )
{
   /** we should have a non-NULL pointer */
   netsnmp_assert( NULL != ieee8021BridgeTpPortMaxInfo_val_ptr );


    DEBUGMSGTL(("verbose:ieee8021BridgeTpPortTable:ieee8021BridgeTpPortMaxInfo_get","called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

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

    return MFD_SUCCESS;
} /* ieee8021BridgeTpPortMaxInfo_get */

/*---------------------------------------------------------------------
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeTpPortEntry.ieee8021BridgeTpPortInFrames
 * ieee8021BridgeTpPortInFrames is subid 4 of ieee8021BridgeTpPortEntry.
 * Its status is Current, and its access level is ReadOnly.
 * OID: .1.3.111.2.802.1.1.2.1.2.1.1.4
 * Description:
The number of frames that have been received by this
        port from its segment.  Note that a frame received on the
        interface corresponding to this port is only counted by
        this object if and only if it is for a protocol being
        processed by the local bridging function, including
        bridge management frames.

        Discontinuities in the value of the counter can occur
        at re-initialization of the management system, and at
        other times as indicated by the value of
        ifCounterDiscontinuityTime object of the associated
        interface (if any).
 *
 * Attributes:
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 *   settable   0
 *
 *
 * Its syntax is COUNTER64 (based on perltype COUNTER64)
 * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
 */
/**
 * Extract the current value of the ieee8021BridgeTpPortInFrames data.
 *
 * Set a value using the data context for the row.
 *
 * @param rowreq_ctx
 *        Pointer to the row request context.
 * @param ieee8021BridgeTpPortInFrames_val_ptr
 *        Pointer to storage for a U64 variable
 *
 * @retval MFD_SUCCESS         : success
 * @retval MFD_SKIP            : skip this node (no value for now)
 * @retval MFD_ERROR           : Any other error
 */
int
ieee8021BridgeTpPortInFrames_get( ieee8021BridgeTpPortTable_rowreq_ctx *rowreq_ctx, U64 * ieee8021BridgeTpPortInFrames_val_ptr )
{
   /** we should have a non-NULL pointer */
   netsnmp_assert( NULL != ieee8021BridgeTpPortInFrames_val_ptr );

/*
 * TODO:231:o: |-> copy ieee8021BridgeTpPortInFrames data.
 * get (* ieee8021BridgeTpPortInFrames_val_ptr ).low and (* ieee8021BridgeTpPortInFrames_val_ptr ).high from rowreq_ctx->data
 */
    (* ieee8021BridgeTpPortInFrames_val_ptr ).high = rowreq_ctx->data.ieee8021BridgeTpPortInFrames.high;
    (* ieee8021BridgeTpPortInFrames_val_ptr ).low = rowreq_ctx->data.ieee8021BridgeTpPortInFrames.low;


    return MFD_SUCCESS;
} /* ieee8021BridgeTpPortInFrames_get */

/*---------------------------------------------------------------------
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeTpPortEntry.ieee8021BridgeTpPortOutFrames
 * ieee8021BridgeTpPortOutFrames is subid 5 of ieee8021BridgeTpPortEntry.
 * Its status is Current, and its access level is ReadOnly.
 * OID: .1.3.111.2.802.1.1.2.1.2.1.1.5
 * Description:
The number of frames that have been transmitted by this
        port to its segment.  Note that a frame transmitted on
        the interface corresponding to this port is only counted
        by this object if and only if it is for a protocol being
        processed by the local bridging function, including
        bridge management frames.

        Discontinuities in the value of the counter can occur
        at re-initialization of the management system, and at
        other times as indicated by the value of
        ifCounterDiscontinuityTime object of the associated
        interface (if any).
 *
 * Attributes:
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 *   settable   0
 *
 *
 * Its syntax is COUNTER64 (based on perltype COUNTER64)
 * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
 */
/**
 * Extract the current value of the ieee8021BridgeTpPortOutFrames data.
 *
 * Set a value using the data context for the row.
 *
 * @param rowreq_ctx
 *        Pointer to the row request context.
 * @param ieee8021BridgeTpPortOutFrames_val_ptr
 *        Pointer to storage for a U64 variable
 *
 * @retval MFD_SUCCESS         : success
 * @retval MFD_SKIP            : skip this node (no value for now)
 * @retval MFD_ERROR           : Any other error
 */
int
ieee8021BridgeTpPortOutFrames_get( ieee8021BridgeTpPortTable_rowreq_ctx *rowreq_ctx, U64 * ieee8021BridgeTpPortOutFrames_val_ptr )
{
   /** we should have a non-NULL pointer */
   netsnmp_assert( NULL != ieee8021BridgeTpPortOutFrames_val_ptr );

/*
 * TODO:231:o: |-> copy ieee8021BridgeTpPortOutFrames data.
 * get (* ieee8021BridgeTpPortOutFrames_val_ptr ).low and (* ieee8021BridgeTpPortOutFrames_val_ptr ).high from rowreq_ctx->data
 */
    (* ieee8021BridgeTpPortOutFrames_val_ptr ).high = rowreq_ctx->data.ieee8021BridgeTpPortOutFrames.high;
    (* ieee8021BridgeTpPortOutFrames_val_ptr ).low = rowreq_ctx->data.ieee8021BridgeTpPortOutFrames.low;


    return MFD_SUCCESS;
} /* ieee8021BridgeTpPortOutFrames_get */

/*---------------------------------------------------------------------
 * IEEE8021-BRIDGE-MIB::ieee8021BridgeTpPortEntry.ieee8021BridgeTpPortInDiscards
 * ieee8021BridgeTpPortInDiscards is subid 6 of ieee8021BridgeTpPortEntry.
 * Its status is Current, and its access level is ReadOnly.
 * OID: .1.3.111.2.802.1.1.2.1.2.1.1.6
 * Description:
Count of received valid frames that were discarded
        (i.e., filtered) by the Forwarding Process.

        Discontinuities in the value of the counter can occur
        at re-initialization of the management system, and at
        other times as indicated by the value of
        ifCounterDiscontinuityTime object of the associated
        interface (if any).
 *
 * Attributes:
 *   accessible 1     isscalar 0     enums  0      hasdefval 0
 *   readable   1     iscolumn 1     ranges 0      hashint   0
 *   settable   0
 *
 *
 * Its syntax is COUNTER64 (based on perltype COUNTER64)
 * The net-snmp type is ASN_COUNTER64. The C type decl is U64 (U64)
 */
/**
 * Extract the current value of the ieee8021BridgeTpPortInDiscards data.
 *
 * Set a value using the data context for the row.
 *
 * @param rowreq_ctx
 *        Pointer to the row request context.
 * @param ieee8021BridgeTpPortInDiscards_val_ptr
 *        Pointer to storage for a U64 variable
 *
 * @retval MFD_SUCCESS         : success
 * @retval MFD_SKIP            : skip this node (no value for now)
 * @retval MFD_ERROR           : Any other error
 */
int
ieee8021BridgeTpPortInDiscards_get( ieee8021BridgeTpPortTable_rowreq_ctx *rowreq_ctx, U64 * ieee8021BridgeTpPortInDiscards_val_ptr )
{
   /** we should have a non-NULL pointer */
   netsnmp_assert( NULL != ieee8021BridgeTpPortInDiscards_val_ptr );

/*
 * TODO:231:o: |-> copy ieee8021BridgeTpPortInDiscards data.
 * get (* ieee8021BridgeTpPortInDiscards_val_ptr ).low and (* ieee8021BridgeTpPortInDiscards_val_ptr ).high from rowreq_ctx->data
 */
    (* ieee8021BridgeTpPortInDiscards_val_ptr ).high = rowreq_ctx->data.ieee8021BridgeTpPortInDiscards.high;
    (* ieee8021BridgeTpPortInDiscards_val_ptr ).low = rowreq_ctx->data.ieee8021BridgeTpPortInDiscards.low;


    return MFD_SUCCESS;
} /* ieee8021BridgeTpPortInDiscards_get */



/** @} */
