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


C++ CONTAINER_REMOVE函数代码示例

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


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

示例1: 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

示例2: _mfd_ipv4InterfaceTable_irreversible_commit

/**
 * @internal
 * commit irreversible actions
 */
int
_mfd_ipv4InterfaceTable_irreversible_commit(netsnmp_mib_handler *handler, netsnmp_handler_registration
                                            *reginfo, netsnmp_agent_request_info
                                            *agtreq_info,
                                            netsnmp_request_info *requests)
{
    ipv4InterfaceTable_rowreq_ctx *rowreq_ctx =
        netsnmp_container_table_row_extract(requests);

    DEBUGMSGTL(("internal:ipv4InterfaceTable:_mfd_ipv4InterfaceTable_irreversible:commit", "called\n"));

    netsnmp_assert(NULL != rowreq_ctx);

    /*
     * check for and handle row creation/deletion
     * and update column exist flags...
     */
    if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
        CONTAINER_REMOVE(ipv4InterfaceTable_if_ctx.container, rowreq_ctx);
    } else {
        if (rowreq_ctx->column_set_flags) {
            rowreq_ctx->column_set_flags = 0;
        }
    }

    return SNMP_ERR_NOERROR;
}                               /* _mfd_ipv4InterfaceTable_irreversible_commit */
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:31,代码来源:ipv4InterfaceTable_interface.c

示例3: 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

示例4: 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

示例5: 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

示例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: _mfd_dot11ConfTotalTrapGroupTable_post_request

/**
 * @internal
 * wrapper
 */
static int
_mfd_dot11ConfTotalTrapGroupTable_post_request(netsnmp_mib_handler *handler,
                             netsnmp_handler_registration *reginfo,
                             netsnmp_agent_request_info *agtreq_info,
                             netsnmp_request_info *requests)
{
    dot11ConfTotalTrapGroupTable_rowreq_ctx *rowreq_ctx;
    int rc = dot11ConfTotalTrapGroupTable_post_request(dot11ConfTotalTrapGroupTable_if_ctx.user_ctx);
    if (MFD_SUCCESS != rc) {
        /*
         * nothing we can do about it but log it
         */
        DEBUGMSGTL(("internal:dot11ConfTotalTrapGroupTable","error %d from "
                    "dot11ConfTotalTrapGroupTable_post_request\n", rc));
    }
    
    /*
     * if there are no errors, check for and handle row creation/deletion
     */
    rc = netsnmp_check_requests_error(requests);
    if ((SNMP_ERR_NOERROR == rc) &&
        (NULL !=
         (rowreq_ctx = netsnmp_container_table_row_extract(requests)))) {
        if (rowreq_ctx->rowreq_flags & MFD_ROW_CREATED) {
            rowreq_ctx->rowreq_flags &= ~MFD_ROW_CREATED;
            CONTAINER_INSERT(dot11ConfTotalTrapGroupTable_if_ctx.container, rowreq_ctx);
        }
        else if (rowreq_ctx->rowreq_flags & MFD_ROW_DELETED) {
            CONTAINER_REMOVE(dot11ConfTotalTrapGroupTable_if_ctx.container, rowreq_ctx);
            dot11ConfTotalTrapGroupTable_release_rowreq_ctx(rowreq_ctx);
        }
    }

    return SNMP_ERR_NOERROR;
} /* _mfd_dot11ConfTotalTrapGroupTable_post_request */
开发者ID:inibir,项目名称:daemongroup,代码行数:39,代码来源:dot11ConfTotalTrapGroupTable_interface.c

示例8: _cert_map_remove

static void
_cert_map_remove(certToTSN_entry *entry)
{
    netsnmp_container *maps;
    netsnmp_cert_map map;

    if (NULL == entry)
        return;

    DEBUGMSGTL(("tlstmCertToTSNTable:map:remove", "pri %ld, fp %s\n",
                entry->tlstmCertToTSNID, entry->fingerprint));

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

    map.priority = entry->tlstmCertToTSNID;
    map.fingerprint = entry->fingerprint;

    if (CONTAINER_REMOVE(maps, &map) != 0) {
        snmp_log(LOG_ERR, "could not remove certificate map");
    }
    entry->map_flags = 0;
}
开发者ID:RasmusKoldsoe,项目名称:performand.k70.2,代码行数:25,代码来源:snmpTlstmCertToTSNTable.c

示例9: sctpAssocRemAddrTable_delete_invalid

/*
 * Remove all entries from sctpAssocRemAddrTable, which are not marked as valid.
 * All valid entries are then marked as invalid (to delete them in next cache
 * load, if the entry is not updated). 
 */
void
sctpAssocRemAddrTable_delete_invalid(netsnmp_container *remAddrTable)
{
    netsnmp_container *to_delete = netsnmp_container_find("lifo");

    CONTAINER_FOR_EACH(remAddrTable, sctpAssocRemAddrTable_collect_invalid,
                       to_delete);

    while (CONTAINER_SIZE(to_delete)) {
        sctpAssocRemAddrTable_entry *entry = CONTAINER_FIRST(to_delete);
        CONTAINER_REMOVE(remAddrTable, entry);
        sctpAssocRemAddrTable_entry_free(entry);
        CONTAINER_REMOVE(to_delete, NULL);
    }
    CONTAINER_FREE(to_delete);
}
开发者ID:a5216652166,项目名称:rcp100,代码行数:21,代码来源:sctpTables_common.c

示例10: 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

示例11: CONTAINER_REMOVE

/**
 * removes a row from the given table and returns it (no free's called)
 *
 * returns the row pointer itself on successful removing.
 *      or NULL on failure (bad arguments)
 */
netsnmp_tdata_row *netsnmp_tdata_remove_row (netsnmp_tdata * table, netsnmp_tdata_row * row)
{
    if (!row || !table)
        return NULL;

    CONTAINER_REMOVE (table->container, row);
    return row;
}
开发者ID:274914765,项目名称:C,代码行数:14,代码来源:table_tdata.c

示例12: netsnmp_swinst_entry_remove

void
netsnmp_swinst_entry_remove(netsnmp_container * container,
                            netsnmp_swinst_entry *entry)
{
    DEBUGMSGTL(("swinst:container", "remove\n"));
    if (!entry)
        return;                 /* Nothing to remove */
    CONTAINER_REMOVE(container, entry);
}
开发者ID:duniansampa,项目名称:SigLog,代码行数:9,代码来源:swinst.cpp

示例13: cpqSasPhyDrvTable_removeEntry

/** remove a row from the table */
void
cpqSasPhyDrvTable_removeEntry(netsnmp_container * container,
                              cpqSasPhyDrvTable_entry * entry)
{

    if (!entry)
        return;                 /* Nothing to remove */
    CONTAINER_REMOVE(container, entry);
    if (entry)
        SNMP_FREE(entry);       /* XXX - release any other internal resources */
}
开发者ID:marker55,项目名称:hp-ams,代码行数:12,代码来源:cpqSasPhyDrvTable.c

示例14: snmpNotifyFilter_storage_remove

int
snmpNotifyFilter_storage_remove(snmpNotifyFilter_data_storage *data)
{
    int     rc;

    if (NULL == data)
        return SNMPERR_GENERR;

    DEBUGMSGTL(("internal:snmpNotifyFilter", "removing row\n"));
    rc = CONTAINER_REMOVE(_container, data);
    if (0 != rc)
        return SNMPERR_GENERR;

    return SNMPERR_SUCCESS;
}
开发者ID:fenner,项目名称:net-snmp,代码行数:15,代码来源:snmpNotifyFilterTable_data_storage.c

示例15: _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,代码来源:ipIfStatsTable_data_access.c


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