这篇教程C++ CONTAINER_FIND函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CONTAINER_FIND函数的典型用法代码示例。如果您正苦于以下问题:C++ CONTAINER_FIND函数的具体用法?C++ CONTAINER_FIND怎么用?C++ CONTAINER_FIND使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CONTAINER_FIND函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: update_watchdog_rowintupdate_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,
示例2: ipv4InterfaceTable_row_find_by_mib_indexipv4InterfaceTable_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,
示例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,
示例4: delete_hotswap_rowintdelete_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,
示例5: delete_watchdog_rowintdelete_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,
示例6: delete_ThdPosHysteresis_rowintdelete_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,
示例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,
示例8: update_hotswap_eventintupdate_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,
示例9: put_memTablevoidput_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,
示例10: _cert_map_tweak_storagestatic 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,
示例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,
示例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,
示例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,
示例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,
示例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. */intdebug_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,
示例16: return/** finds a row in the 'tdata' table given the index OID */netsnmp_tdata_row *netsnmp_tdata_row_get_byoid (netsnmp_tdata * table, oid * searchfor, size_t searchfor_len){ netsnmp_index index; if (!table) return NULL; index.oids = searchfor; index.len = searchfor_len; return (netsnmp_tdata_row *) CONTAINER_FIND (table->container, &index);}
开发者ID:274914765,项目名称:C,代码行数:12,
示例17: populate_hotswapintpopulate_hotswap (SaHpiRptEntryT * rpt_entry, oid * rpt_oid, size_t rpt_oid_len){ SaHpiSessionIdT session_id; int rc = AGENT_ERR_NOERROR; oid index_oid[HOTSWAP_INDEX_NR]; netsnmp_index hotswap_index; saHpiHotSwapTable_context *hotswap_context; DEBUGMSGTL ((AGENT, "/n/t--- populate_hotswap. Entry/n")); if ((rc = getSaHpiSession (&session_id)) == AGENT_ERR_NOERROR) { index_oid[0] = rpt_entry->DomainId; index_oid[1] = rpt_entry->ResourceId; hotswap_index.oids = (oid *) & index_oid; hotswap_index.len = HOTSWAP_INDEX_NR; hotswap_context = CONTAINER_FIND (cb.container, &hotswap_index); if (!hotswap_context) { // Couldn't find it. Add new entry. hotswap_context = saHpiHotSwapTable_create_row (&hotswap_index); } if (!hotswap_context) { snmp_log (LOG_ERR, "Not enough memory for a HotSwap row!/n"); return AGENT_ERR_MEMORY_FAULT; } if (saHpiHotSwapTable_modify_context (rpt_entry, rpt_oid, rpt_oid_len, hotswap_context) == AGENT_NEW_ENTRY) { CONTAINER_INSERT (cb.container, hotswap_context); } } DEBUGMSGTL ((AGENT, "/n/t--- populate_hotswap: Exit (rc: %d)./n", rc)); return rc;}
开发者ID:openhpi1,项目名称:testrepo,代码行数:53,
示例18: createIndex/* Will return an existing row indexed by the parameter list if one exists, and * return a new one otherwise. If the row is new, then the provided index will be * assigned to the new row. * * Note: NULL will be returned on an error */openserSIPPortTable_context *getRow(int ipType, int *ipAddress) { int lengthOfOID; oid *currentOIDIndex = createIndex(ipType, ipAddress, &lengthOfOID); if (currentOIDIndex == NULL) { return NULL; } netsnmp_index theIndex; theIndex.oids = currentOIDIndex; theIndex.len = lengthOfOID; openserSIPPortTable_context *rowToReturn; /* Lets check to see if there is an existing row. */ rowToReturn = CONTAINER_FIND(cb.container, &theIndex); /* We found an existing row, so there is no need to create a new one. * Let's return it to the caller. */ if (rowToReturn != NULL) { /* We don't need the index we allocated anymore, because the * existing row already has its own copy, so free the memory */ pkg_free(currentOIDIndex); return rowToReturn; } /* If we are here then the row doesn't exist yet. So lets create it. */ rowToReturn = SNMP_MALLOC_TYPEDEF(openserSIPPortTable_context); /* Not enough memory to create the new row. */ if (rowToReturn == NULL) { pkg_free(currentOIDIndex); return NULL; } /* Assign the Container Index. */ rowToReturn->index.len = lengthOfOID; rowToReturn->index.oids = currentOIDIndex; memcpy(rowToReturn->openserSIPStringIndex, currentOIDIndex, NUM_IP_OCTETS + 3); rowToReturn->openserSIPStringIndex_len = NUM_IP_OCTETS + 3; /* Insert the new row into the table */ CONTAINER_INSERT(cb.container, rowToReturn); return rowToReturn;}
开发者ID:KISSMonX,项目名称:opensips,代码行数:58,
示例19: _check_for_updates/** * check entry for update */static void_check_for_updates(ipIfStatsTable_rowreq_ctx * rowreq_ctx, netsnmp_container *stats){ netsnmp_systemstats_entry *ifstats_entry; /* * check for matching entry. works because indexes are the same. */ ifstats_entry = (netsnmp_systemstats_entry*)CONTAINER_FIND(stats, rowreq_ctx->data); if (NULL == ifstats_entry) { DEBUGMSGTL(("ipIfStatsTable:access", "updating missing entry/n")); /* * mark row as missing, so we can set discontinuity * when it comes back. * * what else should we do? set refresh to 0? that's not quite right... */ rowreq_ctx->known_missing = 1; } else { DEBUGMSGTL(("ipIfStatsTable:access", "updating existing entry/n")); /* * Check for changes & update */ netsnmp_access_systemstats_entry_update(rowreq_ctx->data, ifstats_entry); /* * set discontinuity if previously missing. */ if (1 == rowreq_ctx->known_missing) { rowreq_ctx->known_missing = 0; rowreq_ctx->ipIfStatsDiscontinuityTime = netsnmp_get_agent_uptime(); ipIfStatsTable_lastChange_set(netsnmp_get_agent_uptime()); } /* * remove entry from container */ CONTAINER_REMOVE(stats, ifstats_entry); netsnmp_access_systemstats_entry_free(ifstats_entry); }}
开发者ID:liquidradio,项目名称:net-snmp,代码行数:51,
示例20: netsnmp_access_systemstats_entry_get_by_indexnetsnmp_systemstats_entry *netsnmp_access_systemstats_entry_get_by_index(netsnmp_container *container, oid index){ netsnmp_index tmp; DEBUGMSGTL(("access:systemstats:entry", "by_index/n")); if (NULL == container) { snmp_log(LOG_ERR, "invalid container for netsnmp_access_systemstats_entry_get_by_index/n"); return NULL; } tmp.len = 1; tmp.oids = &index; return (netsnmp_systemstats_entry *) CONTAINER_FIND(container, &tmp);}
开发者ID:schestowitz,项目名称:Cyrus,代码行数:18,
示例21: clear_sensor_normal_max/** * * @domainId * @resourceId * * @return */SaErrorT clear_sensor_normal_max(SaHpiDomainIdT domainId, SaHpiResourceIdT resourceId){ SaErrorT rv = SA_OK; netsnmp_index *row_idx; saHpiSensorReadingNormalMaxTable_context *sen_norm_max_ctx; DEBUGMSGTL ((AGENT, "clear_sensor_normal_max, called/n")); DEBUGMSGTL ((AGENT, " domainId [%d]/n", domainId)); DEBUGMSGTL ((AGENT, " resourceId [%d]/n", resourceId)); row_idx = CONTAINER_FIRST(cb.container); if (row_idx) //At least one entry was found. { do { /* based on the found row_idx get the pointer */ /* to its context (row data) */ sen_norm_max_ctx = CONTAINER_FIND(cb.container, row_idx); /* before we delete the context we should get the */ /* next row (context) if any before we delete this */ /* one. */ row_idx = CONTAINER_NEXT(cb.container, row_idx); if ((sen_norm_max_ctx->index.oids[saHpiSenNormMaxDomainId_INDEX] == domainId) && (sen_norm_max_ctx->index.oids[saHpiSenNormMaxResourceId_INDEX] == resourceId)) { /* all conditions met remove row */ CONTAINER_REMOVE (cb.container, sen_norm_max_ctx); saHpiSensorReadingNormalMaxTable_delete_row (sen_norm_max_ctx); DEBUGMSGTL ((AGENT, "clear_sensor_normal_max: " "found row: removing/n")); } } while (row_idx); } return rv;}
开发者ID:openhpi1,项目名称:testrepo,代码行数:51,
示例22: netsnmp_swrun_entry_get_by_indexnetsnmp_swrun_entry *netsnmp_swrun_entry_get_by_index(netsnmp_container *container, oid index){ netsnmp_index tmp; DEBUGMSGTL(("swrun:entry", "by_index/n")); netsnmp_assert(1 == _swrun_init); if (NULL == container) { snmp_log(LOG_ERR, "invalid container for netsnmp_swrun_entry_get_by_index/n"); return NULL; } tmp.len = 1; tmp.oids = &index; return (netsnmp_swrun_entry *) CONTAINER_FIND(container, &tmp);}
开发者ID:duniansampa,项目名称:SigLog,代码行数:19,
示例23: sctpAssocTable_add_or_updateintsctpAssocTable_add_or_update(netsnmp_container *assocTable, sctpAssocTable_entry * entry){ /* * we have full sctpAssocTable entry, update or add it in the container */ sctpAssocTable_entry *old; entry->valid = 1; /* * try to find it in the container */ sctpAssocTable_entry_update_index(entry); old = CONTAINER_FIND(assocTable, entry); if (old != NULL) { /* * update existing entry, don't overwrite the timestamp */ time_t timestamp = old->sctpAssocStartTime; if (timestamp == 0 && entry->sctpAssocStartTime == 0 && entry->sctpAssocState >= SCTPASSOCSTATE_ESTABLISHED) timestamp = netsnmp_get_agent_uptime(); /* set the timestamp if it was not set before and entry reaches the right state */ sctpAssocTable_entry_copy(entry, old); old->sctpAssocStartTime = timestamp; sctpAssocTable_entry_free(entry); } else { /* * the entry is new, add it there */ if (entry->sctpAssocStartTime == 0 && entry->sctpAssocState >= SCTPASSOCSTATE_ESTABLISHED) { entry->sctpAssocStartTime = netsnmp_get_agent_uptime(); } CONTAINER_INSERT(assocTable, entry); } return SNMP_ERR_NOERROR;}
开发者ID:a5216652166,项目名称:rcp100,代码行数:42,
示例24: del_radiusAccClientExtTable/** * Remove a client */voiddel_radiusAccClientExtTable(dm_id id){ netsnmp_index idx; oid soid[1]; radiusAccClientExtTable_context *row; if (!my_handler) return; idx.len = 1; idx.oids = &soid[0]; soid[0] = id; row = CONTAINER_FIND(cb.container, &idx); if (row) { CONTAINER_REMOVE(cb.container, row); free(row); }}
开发者ID:KanjiMonster,项目名称:mand,代码行数:23,
示例25: _check_entry_for_updates/** * check entry for update */static void _check_entry_for_updates (ipDefaultRouterTable_rowreq_ctx * rowreq_ctx, void **magic){ netsnmp_container *defaultrouter_container = magic[0]; netsnmp_container *to_delete = (netsnmp_container *) magic[1]; /* * check for matching entry using secondary index. */ netsnmp_defaultrouter_entry *defaultrouter_entry = CONTAINER_FIND (defaultrouter_container, rowreq_ctx->data); if (NULL == defaultrouter_entry) { DEBUGMSGTL (("ipDefaultRouterTable:access", "removing missing entry/n")); if (NULL == to_delete) { magic[1] = to_delete = netsnmp_container_find ("lifo"); if (NULL == to_delete) snmp_log (LOG_ERR, "couldn't create delete container/n"); } if (NULL != to_delete) CONTAINER_INSERT (to_delete, rowreq_ctx); } else { DEBUGMSGTL (("ipDefaultRouterTable:access", "updating existing entry/n")); /* * Check for changes & update */ netsnmp_access_defaultrouter_entry_update (rowreq_ctx->data, defaultrouter_entry); /* * remove entry from ifcontainer */ CONTAINER_REMOVE (defaultrouter_container, defaultrouter_entry); netsnmp_access_defaultrouter_entry_free (defaultrouter_entry); }}
开发者ID:274914765,项目名称:C,代码行数:43,
示例26: _check_entry_for_updates/** * check entry for update */static void_check_entry_for_updates(ipAddressTable_rowreq_ctx * rowreq_ctx, void **magic){ netsnmp_container *ipaddress_container = (netsnmp_container*)magic[0]; netsnmp_container *to_delete = (netsnmp_container*)magic[1]; /* * check for matching entry using secondary index. */ netsnmp_ipaddress_entry *ipaddress_entry = (netsnmp_ipaddress_entry*) CONTAINER_FIND(ipaddress_container, rowreq_ctx->data); if (NULL == ipaddress_entry) { DEBUGMSGTL(("ipAddressTable:access", "removing missing entry/n")); if (NULL == to_delete) { magic[1] = to_delete = netsnmp_container_find("lifo"); if (NULL == to_delete) snmp_log(LOG_ERR, "couldn't create delete container/n"); } if (NULL != to_delete) CONTAINER_INSERT(to_delete, rowreq_ctx); } else { DEBUGMSGTL(("ipAddressTable:access", "updating existing entry/n")); /* * Check for changes & update */ if (netsnmp_access_ipaddress_entry_update(rowreq_ctx->data, ipaddress_entry) > 0) rowreq_ctx->ipAddressLastChanged = netsnmp_get_agent_uptime(); /* * remove entry from ifcontainer */ CONTAINER_REMOVE(ipaddress_container, ipaddress_entry); netsnmp_access_ipaddress_entry_free(ipaddress_entry); }}
开发者ID:prak5192,项目名称:C_Project,代码行数:42,
示例27: delete_voiddelete_(unsigned int clientreg, void *clientarg) { netsnmp_index index; netSnmpIETFWGTable_context *x; netSnmpIETFWGTable_context blah; oid tmp[4]; tmp[0]=3; tmp[1]='A'; tmp[2] ='B'; tmp[3] ='C'; index.oids = tmp; index.len = 4; blah.index = index; DEBUGMSGTL((AGENT,"Delete first some table.")); x = CONTAINER_FIND(cb.container, &blah); DEBUGMSGTL((AGENT,"Found object [%X]/n",x)); if (x) { DEBUGMSGTL((AGENT,"Deleteing object/n")); CONTAINER_REMOVE(cb.container,x); DEBUGMSGTL((AGENT,"Object deleted/n")); } }
开发者ID:openhpi1,项目名称:testrepo,代码行数:24,
示例28: delete_rdr_rowintdelete_rdr_row (SaHpiDomainIdT domain_id, SaHpiResourceIdT resource_id, SaHpiEntryIdT num, SaHpiRdrTypeT type){ saHpiRdrTable_context *ctx; oid rdr_oid[RDR_INDEX_NR]; netsnmp_index rdr_index; int rc = AGENT_ERR_NOT_FOUND; DEBUGMSGTL ((AGENT, "delete_rdr_row (%d, %d, %d, %d). Entry./n", domain_id, resource_id, num, type));// Look at the MIB to find out what the indexs are rdr_oid[0] = domain_id; rdr_oid[1] = resource_id; rdr_oid[2] = num; rdr_oid[3] = type; // Possible more indexs? rdr_index.oids = (oid *) & rdr_oid; rdr_index.len = RDR_INDEX_NR; ctx = CONTAINER_FIND (cb.container, &rdr_index); if (ctx) { CONTAINER_REMOVE (cb.container, ctx); saHpiRdrTable_delete_row (ctx); rdr_count = CONTAINER_SIZE (cb.container); rc = AGENT_ERR_NOERROR; } DEBUGMSGTL ((AGENT, "delete_rdr_row. Exit (rc: %d)/n", rc)); return rc;}
开发者ID:openhpi1,项目名称:testrepo,代码行数:36,
示例29: put_pwrTablevoidput_pwrTable(int idx, char* name, int id, int status){ netsnmp_index index; oid myoid; pwrTable_context* myrow; int makeit=0; myoid = idx; index.oids = &myoid; index.len = 1; if(!(myrow = (pwrTable_context*)CONTAINER_FIND(cb.container, &index))) { myrow = pwrTable_create_row(&index); makeit=1; } myrow->pwrIndex = idx; strcpy(myrow->pwrSystem, name); myrow->pwrSystem_len = strlen(name); myrow->pwrId = id; myrow->pwrStatus = status; if(makeit) CONTAINER_INSERT(cb.container,myrow);}
开发者ID:lanian09,项目名称:mysource,代码行数:24,
示例30: netsnmp_access_interface_entry_get_by_namenetsnmp_interface_entry *netsnmp_access_interface_entry_get_by_name(netsnmp_container *container, const char *name){ netsnmp_interface_entry tmp; DEBUGMSGTL(("access:interface:entry", "by_name/n")); netsnmp_assert(1 == _access_interface_init); if (NULL == container) { snmp_log(LOG_ERR, "invalid container for netsnmp_access_interface_entry_get_by_name/n"); return NULL; } if (NULL == container->next) { snmp_log(LOG_ERR, "secondary index missing for netsnmp_access_interface_entry_get_by_name/n"); return NULL; } tmp.name = NETSNMP_REMOVE_CONST(char *, name); return (netsnmp_interface_entry*)CONTAINER_FIND(container->next, &tmp);}
开发者ID:duniansampa,项目名称:SigLog,代码行数:24,
注:本文中的CONTAINER_FIND函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CONTAINER_INSERT函数代码示例 C++ CONS_Printf函数代码示例 |