text: /*
   * 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 "ethtoolStatTable.h"
  
  
  /** @defgroup data_get data_get: Routines to get data
   *
   * TODO:230:M: Implement ethtoolStatTable get routines.
   * TODO:240:M: Implement ethtoolStatTable 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 ethtoolStatTable
   ***
   **********************************************************************
   **********************************************************************/
  /*
   * ETHTOOL-MIB::ethtoolStatTable is subid 1 of ethtool.
   * Its status is Current.
   * OID: .1.3.6.1.4.1.39178.100.1.1, length: 10
  */
  
  /* ---------------------------------------------------------------------
   * TODO:200:r: Implement ethtoolStatTable data context functions.
   */
  
  
  /**
   * set mib index(es)
   *
   * @param tbl_idx mib index structure
   * @param ifIndex_val
   * @param ethtoolStatName_ptr
   * @param ethtoolStatName_ptr_len
   *
   * @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
  ethtoolStatTable_indexes_set_tbl_idx(ethtoolStatTable_mib_index *tbl_idx, long ifIndex_val, char *ethtoolStatName_val_ptr,  size_t ethtoolStatName_val_ptr_len)
  {
      DEBUGMSGTL(("verbose:ethtoolStatTable:ethtoolStatTable_indexes_set_tbl_idx","called\n"));
  
      /* ifIndex(1)/InterfaceIndex/ASN_INTEGER/long(long)//l/A/w/e/R/d/H */
      tbl_idx->ifIndex = ifIndex_val;
      
      /* ethtoolStatName(1)/ShortDisplayString/ASN_OCTET_STR/char(char)//L/a/w/e/R/d/H */
      tbl_idx->ethtoolStatName_len = sizeof(tbl_idx->ethtoolStatName)/sizeof(tbl_idx->ethtoolStatName[0]); /* max length */
      /*
       * make sure there is enough space for ethtoolStatName data
       */
      if ((NULL == tbl_idx->ethtoolStatName) ||
          (tbl_idx->ethtoolStatName_len <
           (ethtoolStatName_val_ptr_len))) {
          snmp_log(LOG_ERR,"not enough space for value\n");
          return MFD_ERROR;
      }
      tbl_idx->ethtoolStatName_len = ethtoolStatName_val_ptr_len;
      memcpy( tbl_idx->ethtoolStatName, ethtoolStatName_val_ptr, ethtoolStatName_val_ptr_len* sizeof(ethtoolStatName_val_ptr[0]) );
      
  
      return MFD_SUCCESS;
  } /* ethtoolStatTable_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
  ethtoolStatTable_indexes_set(ethtoolStatTable_rowreq_ctx *rowreq_ctx, long ifIndex_val, char *ethtoolStatName_val_ptr,  size_t ethtoolStatName_val_ptr_len)
  {
      DEBUGMSGTL(("verbose:ethtoolStatTable:ethtoolStatTable_indexes_set","called\n"));
  
      if(MFD_SUCCESS != ethtoolStatTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx
                                     , ifIndex_val
                                     , ethtoolStatName_val_ptr, ethtoolStatName_val_ptr_len
             ))
          return MFD_ERROR;
  
      /*
       * convert mib index to oid index
       */
      rowreq_ctx->oid_idx.len = sizeof(rowreq_ctx->oid_tmp) / sizeof(oid);
      if(0 != ethtoolStatTable_index_to_oid(&rowreq_ctx->oid_idx,
                                      &rowreq_ctx->tbl_idx)) {
          return MFD_ERROR;
      }
  
      return MFD_SUCCESS;
  } /* ethtoolStatTable_indexes_set */
  
  
  /*---------------------------------------------------------------------
   * ETHTOOL-MIB::ethtoolStatEntry.ethtoolStat
   * ethtoolStat is subid 2 of ethtoolStatEntry.
   * Its status is Current, and its access level is ReadOnly.
   * OID: .1.3.6.1.4.1.39178.100.1.1.1.2
   * Description:
  Value of the statistic as returned by ETHTOOL ioctl.
   *
   * 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 ethtoolStat data.
   *
   * Set a value using the data context for the row.
   *
   * @param rowreq_ctx
   *        Pointer to the row request context.
   * @param ethtoolStat_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
  ethtoolStat_get( ethtoolStatTable_rowreq_ctx *rowreq_ctx, U64 * ethtoolStat_val_ptr )
  {
     /** we should have a non-NULL pointer */
     netsnmp_assert( NULL != ethtoolStat_val_ptr );
  
  /*
   * TODO:231:o: |-> copy ethtoolStat data.
   * get (* ethtoolStat_val_ptr ).low and (* ethtoolStat_val_ptr ).high from rowreq_ctx->data
   */
      (* ethtoolStat_val_ptr ).high = rowreq_ctx->data.ethtoolStat.high;
      (* ethtoolStat_val_ptr ).low = rowreq_ctx->data.ethtoolStat.low;
  
  
      return MFD_SUCCESS;
  } /* ethtoolStat_get */
  
  
  
  /** @} */
  