当前位置: 首页>>代码示例>>C++>>正文


C++ CONTAINER_FIND函数代码示例

本文整理汇总了C++中CONTAINER_FIND函数的典型用法代码示例。如果您正苦于以下问题:C++ CONTAINER_FIND函数的具体用法?C++ CONTAINER_FIND怎么用?C++ CONTAINER_FIND使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CONTAINER_FIND函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: update_watchdog_row

int
update_watchdog_row (SaHpiDomainIdT domain_id,
		     SaHpiResourceIdT resource_id,
		     SaHpiWatchdogNumT num, SaHpiWatchdogEventT * wdog)
{
  saHpiWatchdogTable_context *ctx;
  oid index_oid[WATCHDOG_INDEX_NR];
  netsnmp_index index;

  // Look at the MIB to find out what the indexs are
  index_oid[0] = domain_id;
  index_oid[1] = resource_id;
  index_oid[2] = num;
  // Possible more indexes?
  index.oids = (oid *) & index_oid;
  index.len = WATCHDOG_INDEX_NR;
  ctx = CONTAINER_FIND (cb.container, &index);

  if (ctx)
    {
      ctx->saHpiWatchdogTimerUse = wdog->WatchdogUse + 1;
      ctx->saHpiWatchdogTimerAction = wdog->WatchdogAction + 1;
      ctx->saHpiWatchdogPretimerInterrupt = wdog->WatchdogPreTimerAction + 1;
      return AGENT_ERR_NOERROR;
    }

  return AGENT_ERR_NOT_FOUND;

}
开发者ID:openhpi1,项目名称:testrepo,代码行数:29,代码来源:saHpiWatchdogTable.c

示例2: ipv4InterfaceTable_row_find_by_mib_index

ipv4InterfaceTable_rowreq_ctx *
ipv4InterfaceTable_row_find_by_mib_index(ipv4InterfaceTable_mib_index *
                                         mib_idx)
{
    ipv4InterfaceTable_rowreq_ctx *rowreq_ctx;
    oid             oid_tmp[MAX_OID_LEN];
    netsnmp_index   oid_idx;
    int             rc;

    /*
     * set up storage for OID
     */
    oid_idx.oids = oid_tmp;
    oid_idx.len = sizeof(oid_tmp) / sizeof(oid);

    /*
     * convert
     */
    rc = ifTable_index_to_oid(&oid_idx, mib_idx);
    if (MFD_SUCCESS != rc)
        return NULL;

    rowreq_ctx =
        CONTAINER_FIND(ipv4InterfaceTable_if_ctx.container, &oid_idx);

    return rowreq_ctx;
}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:27,代码来源:ipv4InterfaceTable_interface.c

示例3: clear_domain_info_entry

/**
 *
 * @sessionid
 *
 * @return
 */
SaErrorT clear_domain_info_entry(SaHpiDomainIdT domain_id)
{
    SaErrorT rv = SA_OK;
    netsnmp_index *row_idx;
    saHpiDomainInfoTable_context *ctx;

    DEBUGMSGTL ((AGENT, "clear_domain_info_entry, called\n"));
    DEBUGMSGTL ((AGENT, "           domainId   [%d]\n", domain_id));

    row_idx = CONTAINER_FIRST(cb.container);
    if (row_idx) //At least one entry was found.
    {
        do {
            ctx = CONTAINER_FIND(cb.container, row_idx);

            row_idx = CONTAINER_NEXT(cb.container, row_idx);

            if (ctx->index.oids[saHpiDomainId_INDEX] == domain_id) {

                /* all conditions met remove row */
                CONTAINER_REMOVE (cb.container, ctx);
                saHpiDomainInfoTable_delete_row (ctx);
                domain_info_entry_count =
                    CONTAINER_SIZE (cb.container);
                DEBUGMSGTL ((AGENT, "clear_domain_info_entry:"
                             " found row: removing\n"));
            }

        } while (row_idx);
    }

    return rv;
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:39,代码来源:saHpiDomainInfoTable.c

示例4: delete_hotswap_row

int
delete_hotswap_row (SaHpiDomainIdT domain_id, SaHpiResourceIdT resource_id)
{

  saHpiHotSwapTable_context *ctx;
  oid hotswap_oid[HOTSWAP_INDEX_NR];
  netsnmp_index hotswap_index;
  int rc = AGENT_ERR_NOT_FOUND;

  DEBUGMSGTL ((AGENT, "delete_hotswap_row (%d, %d). Entry\n",
	       domain_id, resource_id));

  hotswap_oid[0] = domain_id;
  hotswap_oid[1] = resource_id;


  // Possible more indexs?
  hotswap_index.oids = (oid *) & hotswap_oid;
  hotswap_index.len = HOTSWAP_INDEX_NR;

  ctx = CONTAINER_FIND (cb.container, &hotswap_index);

  if (ctx)
    {
      CONTAINER_REMOVE (cb.container, ctx);
      saHpiHotSwapTable_delete_row (ctx);
      rc = AGENT_ERR_NOERROR;
    }
  DEBUGMSGTL ((AGENT, "delete_hotswap_row. Exit (rc: %d).\n", rc));
  return rc;
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:31,代码来源:saHpiHotSwapTable.c

示例5: delete_watchdog_row

int
delete_watchdog_row (SaHpiDomainIdT domain_id,
		     SaHpiResourceIdT resource_id, SaHpiWatchdogNumT num)
{

  saHpiWatchdogTable_context *ctx;
  oid index_oid[WATCHDOG_INDEX_NR];
  netsnmp_index index;
  int rc = AGENT_ERR_NOT_FOUND;

  DEBUGMSGTL ((AGENT, "delete_watchdog_row (%d, %d, %d). Entry.\n",
	       domain_id, resource_id, num));

  // Look at the MIB to find out what the indexs are
  index_oid[0] = domain_id;
  index_oid[1] = resource_id;
  index_oid[2] = num;
  // Possible more indexes?
  index.oids = (oid *) & index_oid;
  index.len = WATCHDOG_INDEX_NR;
  ctx = CONTAINER_FIND (cb.container, &index);

  if (ctx)
    {
      CONTAINER_REMOVE (cb.container, ctx);
      saHpiWatchdogTable_delete_row (ctx);
      watchdog_count = CONTAINER_SIZE (cb.container);
      rc = AGENT_ERR_NOERROR;
    }
  DEBUGMSGTL ((AGENT, "delete_watchdog_row. Exit (rc: %d).\n", rc));
  return rc;
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:32,代码来源:saHpiWatchdogTable.c

示例6: delete_ThdPosHysteresis_row

int
delete_ThdPosHysteresis_row (SaHpiDomainIdT domain_id,
			   SaHpiResourceIdT resource_id,
			   SaHpiSensorNumT sensor_num)
{

  saHpiSensorThdPosHysteresisTable_context *ctx;
  oid index_oid[SENSOR_THD_INDEX_NR];
  netsnmp_index sensor_reading_index;
  int rc = AGENT_ERR_NOT_FOUND;

  DEBUGMSGTL ((AGENT, "delete_ThdPosHysteresis_row (%d, %d, %d). Entry.\n",
	       domain_id, resource_id, sensor_num));

  // Look at the MIB to find out what the indexs are
  index_oid[0] = domain_id;
  index_oid[1] = resource_id;
  index_oid[2] = sensor_num;
  // Possible more indexs?
  sensor_reading_index.oids = (oid *) & index_oid;
  sensor_reading_index.len = SENSOR_THD_INDEX_NR;

  ctx = CONTAINER_FIND (cb.container, &sensor_reading_index);

  if (ctx)
    {
      CONTAINER_REMOVE (cb.container, ctx);
      saHpiSensorThdPosHysteresisTable_delete_row (ctx);
      rc = AGENT_ERR_NOERROR;
    }
  DEBUGMSGTL ((AGENT, "delete_ThdPosHysteresis_row. Exit (rc: %d).\n", rc));
  return rc;
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:33,代码来源:saHpiSensorThdPosHysteresisTable.c

示例7: deleteContactRow

/* 
 * Removes the row indexed by userIndex and contactIndex, and free's up the
 * memory allocated to it.  If the row could not be found, then nothing is done.
 */
void deleteContactRow(int userIndex, int contactIndex) 
{
	openserSIPContactTable_context *theRow;

	netsnmp_index indexToRemove;
	oid indexToRemoveOID[2];

	/* Form the OID Index of the row so we can search for it */
	indexToRemoveOID[0] = userIndex;
	indexToRemoveOID[1] = contactIndex;
	indexToRemove.oids  = indexToRemoveOID;
	indexToRemove.len   = 2;

	theRow = CONTAINER_FIND(cb.container, &indexToRemove);

	/* The ContactURI is shared memory, the index.oids was allocated from
	 * pkg_malloc(), and theRow was made with the NetSNMP API which uses
	 * malloc() */
	if (theRow != NULL) {
		CONTAINER_REMOVE(cb.container, &indexToRemove);
		pkg_free(theRow->openserSIPContactURI);
		pkg_free(theRow->index.oids);
		free(theRow);
	} 
}
开发者ID:UIKit0,项目名称:OpenSIPS,代码行数:29,代码来源:openserSIPContactTable.c

示例8: update_hotswap_event

int
update_hotswap_event (SaHpiDomainIdT domain_id,
		      SaHpiResourceIdT resource_id,
		      SaHpiHotSwapEventT * event)
{

  saHpiHotSwapTable_context *ctx;
  oid hotswap_oid[HOTSWAP_INDEX_NR];
  netsnmp_index hotswap_index;
  int rc = AGENT_ERR_NOT_FOUND;

  hotswap_oid[0] = domain_id;
  hotswap_oid[1] = resource_id;

  // Possible more indexs?
  hotswap_index.oids = (oid *) & hotswap_oid;
  hotswap_index.len = HOTSWAP_INDEX_NR;

  ctx = CONTAINER_FIND (cb.container, &hotswap_index);

  if (ctx)
    {
      ctx->saHpiHotSwapState = event->HotSwapState + 1;
      ctx->saHpiHotSwapPreviousState = event->PreviousHotSwapState + 1;
      rc = AGENT_ERR_NOERROR;
    }

  return rc;
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:29,代码来源:saHpiHotSwapTable.c

示例9: put_memTable

void
put_memTable(int idx, char* name, int total, int avail, int used, int usage)
{
    netsnmp_index   index;
    oid             myoid;
    memTable_context* myrow;
	int 			makeit=0;

   	myoid      = idx;
    index.oids = &myoid;
    index.len  = 1;

    if(!(myrow = (memTable_context*)CONTAINER_FIND(cb.container, &index))) {
    	myrow = memTable_create_row(&index); makeit=1;
	}

   	myrow->memIndex = idx;
   	strcpy(myrow->memSystem, name);
   	myrow->memSystem_len = strlen(name);
   	myrow->memTotal = total;
   	myrow->memAvail = avail;
   	myrow->memUsed  = used;
   	myrow->memUsage = usage;

    if(makeit) CONTAINER_INSERT(cb.container,myrow);
}
开发者ID:lanian09,项目名称:mysource,代码行数:26,代码来源:memTable.c

示例10: _cert_map_tweak_storage

static void
_cert_map_tweak_storage(certToTSN_entry *entry)
{
    netsnmp_container *maps;
    netsnmp_cert_map *map, index;

    if (NULL == entry)
        return;

    DEBUGMSGTL(("tlstmCertToTSNTable:map:tweak", "pri %ld, st %d\n",
                entry->tlstmCertToTSNID, entry->storageType));

    /** get current active maps */
    maps = netsnmp_cert_map_container();
    if (NULL == maps)
        return;

    index.priority = entry->tlstmCertToTSNID;
    map = CONTAINER_FIND(maps, &index);
    if (NULL == map) {
        DEBUGMSGTL(("tlstmCertToTSNTable:map:tweak", "couldn't find map!\n"));
        return;
    }

    if (entry->storageType == ST_NONVOLATILE)
        map->flags |= NSCM_NONVOLATILE;
    else
        map->flags &= ~NSCM_NONVOLATILE;
}
开发者ID:RasmusKoldsoe,项目名称:performand.k70.2,代码行数:29,代码来源:snmpTlstmCertToTSNTable.c

示例11: deleteRegUserRow

/* Removes an SNMP row indexed by userIndex, and frees the string and index it
 * pointed to. */
void deleteRegUserRow(int userIndex) 
{
	
	openserSIPRegUserTable_context *theRow;

	netsnmp_index indexToRemove;
	oid indexToRemoveOID;
		
	indexToRemoveOID   = userIndex;
	indexToRemove.oids = &indexToRemoveOID;
	indexToRemove.len  = 1;

	theRow = CONTAINER_FIND(cb.container, &indexToRemove);

	/* The userURI is shared memory, the index.oids was allocated from
	 * pkg_malloc(), and theRow was made with the NetSNMP API which uses
	 * malloc() */
	if (theRow != NULL) {
		CONTAINER_REMOVE(cb.container, &indexToRemove);
		pkg_free(theRow->openserSIPUserUri);
		pkg_free(theRow->index.oids);
		free(theRow);
	}

}
开发者ID:iamroger,项目名称:voip,代码行数:27,代码来源:openserSIPRegUserTable.c

示例12: netSnmpIETFWGTable_get_by_idx

/************************************************************
 * netSnmpIETFWGTable_get_by_idx
 */
const netSnmpIETFWGTable_context *
netSnmpIETFWGTable_get_by_idx(netsnmp_index * hdr)
{
	DEBUGMSGTL((AGENT,"netSnmpIETFWGTable_get_by_idx"));
    return (const netSnmpIETFWGTable_context *)
        CONTAINER_FIND(cb.container, hdr);
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:10,代码来源:netSnmpIETFWGTable.c

示例13: saHpiRdrTable_get_by_idx

/************************************************************
 * saHpiRdrTable_get_by_idx
 */
const saHpiRdrTable_context *
saHpiRdrTable_get_by_idx(netsnmp_index * hdr)
{
	DEBUGMSGTL ((AGENT, "saHpiRdrTable_get_by_idx, called\n"));

    return (const saHpiRdrTable_context *)
        CONTAINER_FIND(cb.container, hdr );
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:11,代码来源:saHpiRdrTable.c

示例14: saHpiSensorThdNegHysteresisTable_get_by_idx

/************************************************************
 * saHpiSensorThdNegHysteresisTable_get_by_idx
 */
const saHpiSensorThdNegHysteresisTable_context *
saHpiSensorThdNegHysteresisTable_get_by_idx(netsnmp_index * hdr)
{
        DEBUGMSGTL ((AGENT, "saHpiSensorThdNegHysteresisTable_get_by_idx called\n"));

        return(const saHpiSensorThdNegHysteresisTable_context *)
        CONTAINER_FIND(cb.container, hdr );
}
开发者ID:openhpi1,项目名称:testrepo,代码行数:11,代码来源:saHpiSensorThdNegHysteresisTable.c

示例15: debug_is_token_registered

/*
 * debug_is_token_registered(char *TOKEN):
 * 
 * returns SNMPERR_SUCCESS
 * or SNMPERR_GENERR
 * 
 * if TOKEN has been registered and debugging support is turned on.
 */
int
debug_is_token_registered(const char *token)
{
    int             i, rc;

    /*
     * debugging flag is on or off 
     */
    if (!dodebug)
        return SNMPERR_GENERR;

    if (debug_num_tokens == 0 || debug_print_everything) {
        /*
         * no tokens specified, print everything 
         * (unless something might be excluded)
         */
        if (debug_num_excluded) {
            rc = SNMPERR_SUCCESS; /* ! found = success */
        } else {
            return SNMPERR_SUCCESS;
        }
    }
    else
        rc = SNMPERR_GENERR; /* ! found = err */

    for (i = 0; i < debug_num_tokens; i++) {
        if (SNMP_DEBUG_DISABLED == dbg_tokens[i].enabled)
            continue;
        if (dbg_tokens[i].token_name &&
            strncmp(dbg_tokens[i].token_name, token,
                    strlen(dbg_tokens[i].token_name)) == 0) {
            if (SNMP_DEBUG_ACTIVE == dbg_tokens[i].enabled)
                return SNMPERR_SUCCESS; /* active */
            else
                return SNMPERR_GENERR; /* excluded */
        }
    }

#ifdef NETSNMP_DEBUG_STATS
    if ((SNMPERR_SUCCESS == rc) && (NULL != dbg_stats)) {
        netsnmp_token_descr td, *found;

        td.token_name = token;
        found = CONTAINER_FIND(dbg_stats, &td);
        if (NULL == found) {
            found = SNMP_MALLOC_TYPEDEF(netsnmp_token_descr);
            netsnmp_assert(NULL != found);
            found->token_name = strdup(token);
            netsnmp_assert(0 == found->enabled);
            CONTAINER_INSERT(dbg_stats, found);
        }
        ++found->enabled;
    /*  snmp_log(LOG_ERR,"tok %s, %d hits\n", token, found->enabled);  */
    }
#endif

    return rc;
}
开发者ID:Undrizzle,项目名称:apps,代码行数:66,代码来源:snmp_debug.c


注:本文中的CONTAINER_FIND函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。