Beispiel #1
0
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;
}
/**
 * @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 */
Beispiel #3
0
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;
}
/* 
 * 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);
	} 
}
Beispiel #5
0
/* 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);
	}

}
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;
}
/**
 * @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 */
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;
}
Beispiel #9
0
/*
 * 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);
}
/**
 *
 * @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;
}
Beispiel #11
0
/**
 * 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;
}
Beispiel #12
0
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);
}
Beispiel #13
0
/** 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 */
}
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;
}
/**
 * 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);
    }
}
Beispiel #16
0
/** remove a row from the table */
static int
unregister_cb(int major, int minor, void* serv, void* client)
{
    sysORTable_entry *value;
    netsnmp_iterator* it = CONTAINER_ITERATOR(table);

    DEBUGMSGTL(("mibII/sysORTable/unregister_cb",
                "unregister_cb(%d, %d, %p, %p)\n", major, minor, serv, client));
    sysORLastChange = ((struct sysORTable*)(serv))->OR_uptime;

    while ((value = (sysORTable_entry*)ITERATOR_NEXT(it)) && value->data != serv);
    ITERATOR_RELEASE(it);
    if(value) {
	CONTAINER_REMOVE(table, value);
	free(value);
    }
    return SNMP_ERR_NOERROR;
}
/**
 * 
 * @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;
}
/**
 * Remove a client
 */
void
del_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);
	}
}
/**
 * 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);
    }
}
/**
 * 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);
    }
}
Beispiel #21
0
void
delete_(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"));
	}
		
}
Beispiel #22
0
int
delete_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;
}
/**
 * 
 * @session_id
 * @resource_id
 * @saHpiEventLogRowPointer
 * @aHpiEventLogRowPointer_len
 * 
 * @return 
 */
SaErrorT domain_event_log_clear(SaHpiSessionIdT session_id, 
                                SaHpiResourceIdT resource_id,  
                                oid *saHpiEventLogRowPointer, 
                                size_t saHpiEventLogRowPointer_len,
				int modifyTotal)
{
     
	oid domain_evt_oid[DOMAIN_EVENT_LOG_INDEX_NR];
	netsnmp_index domain_evt_idx;
	netsnmp_index *domain_index;
	saHpiDomainEventLogTable_context *domain_evt_ctx;
	
	DR_XREF *dr_entry;
	SaHpiDomainIdResourceIdArrayT dr_pair;

	int column_len = 2;

        DEBUGMSGTL ((AGENT, "domain_event_log_clear, called\n"));
		
	DEBUGMSGTL ((AGENT, "Attempting to delete domain el row with the following indexes:\n"));
        DEBUGMSGTL ((AGENT,"     Domain   [%ld]\n", saHpiEventLogRowPointer[saHpiDomainEventLogTable_oid_len + column_len]));
        DEBUGMSGTL ((AGENT,"     Entry id [%ld]\n", saHpiEventLogRowPointer[saHpiDomainEventLogTable_oid_len + column_len + 1]));
	DEBUGMSGTL ((AGENT,"     Severity [%s]\n",  oh_lookup_severity(
						saHpiEventLogRowPointer[saHpiDomainEventLogTable_oid_len + column_len + 2]-1)));	
	/* BUILD oid for new row */
		/* assign the number of indices */
	domain_evt_idx.len = DOMAIN_EVENT_LOG_INDEX_NR;
		/** Index saHpiDomainId is external */
	domain_evt_oid[0] = saHpiEventLogRowPointer[saHpiDomainEventLogTable_oid_len + column_len];
                /** Index saHpiDomainEventEntryId is external */	
	domain_evt_oid[1] = saHpiEventLogRowPointer[saHpiDomainEventLogTable_oid_len + column_len + 1];
		/** Index saHpiEventSeverity is external */
	domain_evt_oid[2] = saHpiEventLogRowPointer[saHpiDomainEventLogTable_oid_len + column_len + 2];
		/* assign the indices to the index */
	domain_evt_idx.oids = (oid *) & domain_evt_oid;
			
	domain_index = CONTAINER_FIRST(cb.container);
	domain_evt_ctx = CONTAINER_FIND(cb.container, &domain_evt_idx);
	
	if (!domain_evt_ctx) {
		DEBUGMSGTL ((AGENT, "domain_event_log_clear did not find a row to delete\n"));
	}
	else {
		
		DEBUGMSGTL ((AGENT, "domain_event_log_clear found row to delete\n"));
		CONTAINER_REMOVE(cb.container, domain_evt_ctx);
		saHpiDomainEventLogTable_delete_row(domain_evt_ctx);
		
		/* Reset the entry id for this domain/resource pair */
		dr_pair.domainId_resourceId_arry[0] = saHpiEventLogRowPointer[saHpiDomainEventLogTable_oid_len + column_len];
		dr_pair.domainId_resourceId_arry[1] = resource_id;
		dr_entry = domain_resoruce_pair_lookup(&dr_pair, &dr_table); 
		
		if (dr_entry == NULL) {
			DEBUGMSGTL ((AGENT, 
			"ERROR: domain_event_log_clear() domain_resoruce_pair_lookup returned NULL\n"));
			return AGENT_ERR_INTERNAL_ERROR;
		}
	
		DEBUGMSGTL ((AGENT, 
			"domain_event_log_clear() resetting entry_id to 0\n"));
		dr_entry->entry_id = 0;	
		
		domain_event_log_entry_count = CONTAINER_SIZE (cb.container);
		
		if (modifyTotal == MIB_TRUE) {	
			domain_event_log_entry_count_total--;
		}	
		
	}	
	
        return SA_OK;
}
/**
 * check entry for update
 *
 */
static void
_check_interface_entry_for_updates(ifTable_rowreq_ctx * rowreq_ctx,
                                   netsnmp_container *ifcontainer)
{
    char            oper_changed = 0;

    /*
     * check for matching entry. We can do this directly, since
     * both containers use the same index.
     */
    netsnmp_interface_entry *ifentry =
        CONTAINER_FIND(ifcontainer, rowreq_ctx);

#ifdef USING_IP_MIB_IPV4INTERFACETABLE_IPV4INTERFACETABLE_MODULE
    /*
     * give ipv4If table a crack at the entry
     */
    ipv4InterfaceTable_check_entry_for_updates(rowreq_ctx, ifentry);
#endif

#ifdef USING_IP_MIB_IPV6INTERFACETABLE_IPV6INTERFACETABLE_MODULE
    /*
     * give ipv6If table a crack at the entry
     */
    ipv6InterfaceTable_check_entry_for_updates(rowreq_ctx, ifentry);
#endif

    if (NULL == ifentry) {
        /*
         * if this is the first time we detected that this interface is
         * missing, set admin/oper status down, and set last change.
         *
         * yyy-rks: when, if ever, would we consider an entry
         * deleted (and thus need to update ifTableLastChanged)?
         */
        if (!rowreq_ctx->known_missing) {
            DEBUGMSGTL(("ifTable:access", "updating missing entry\n"));
            rowreq_ctx->known_missing = 1;
            rowreq_ctx->data.ifAdminStatus = IFADMINSTATUS_DOWN;
            if ((!(rowreq_ctx->data.ifentry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE))
                && (rowreq_ctx->data.ifOperStatus != IFOPERSTATUS_DOWN))
                oper_changed = 1;
            rowreq_ctx->data.ifOperStatus = IFOPERSTATUS_DOWN;
        }
    } else {
        DEBUGMSGTL(("ifTable:access", "updating existing entry\n"));

#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
        {
            int rc = strcmp(rowreq_ctx->data.ifName,
                            ifentry->name);
            netsnmp_assert(rc == 0);
        }
#endif
        /*
         * if the interface was missing, but came back, clear the
         * missing flag and set the discontinuity time. (if an os keeps
         * persistent counters, tough cookies. We'll cross that 
         * bridge if we come to it).
         */
        if (rowreq_ctx->known_missing) {
            rowreq_ctx->known_missing = 0;
#ifdef USING_IF_MIB_IFXTABLE_IFXTABLE_MODULE
            rowreq_ctx->data.ifCounterDiscontinuityTime =
                netsnmp_get_agent_uptime();
#endif
        }

        /*
         * Check for changes, then update
         */
        if ((!(ifentry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_LASTCHANGE))
            && (rowreq_ctx->data.ifOperStatus != ifentry->oper_status))
            oper_changed = 1;
        netsnmp_access_interface_entry_copy(rowreq_ctx->data.ifentry,
                                            ifentry);

        /*
         * remove entry from temporary ifcontainer
         */
        CONTAINER_REMOVE(ifcontainer, ifentry);
        netsnmp_access_interface_entry_free(ifentry);
    }

    /*
     * if ifOperStatus changed, update ifLastChange
     */
    if (oper_changed)
        rowreq_ctx->data.ifLastChange = netsnmp_get_agent_uptime();

}
Beispiel #25
0
int
delete_sensor_row (SaHpiDomainIdT domain_id,
		   SaHpiResourceIdT resource_id, SaHpiSensorNumT sensor_num)
{

  saHpiSensorTable_context *ctx;
  oid index_oid[SENSOR_INDEX_NR];
  netsnmp_index sensor_index;
  int rc = AGENT_ERR_NOT_FOUND;

  DEBUGMSGTL ((AGENT, "delete_sensor_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_index.oids = (oid *) & index_oid;
  sensor_index.len = SENSOR_INDEX_NR;

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

  if (ctx)
    {
      rc = delete_ReadingCurrent_row (ctx->domain_id,
				      ctx->resource_id,
				      ctx->saHpiSensorIndex);


      if (rc != AGENT_ERR_NOERROR)
	DEBUGMSGTL ((AGENT,
		     "call to delete_ReadingCurrent failed with rc: %d\n",
		     rc));

      if (ctx->flags & SAHPI_SRF_MIN)
	{
	  rc = delete_ReadingMin_row (ctx->domain_id,
				      ctx->resource_id,
				      ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ReadingMin failed with rc: %d\n",
			 rc));
	}
      if (ctx->flags & SAHPI_SRF_MAX)
	{
	  rc = delete_ReadingMax_row (ctx->domain_id,
				      ctx->resource_id,
				      ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ReadingMaxfailed with rc: %d\n",
			 rc));
	}
      if (ctx->flags & SAHPI_SRF_NORMAL_MIN)
	{
	  rc = delete_ReadingNormalMin_row (ctx->domain_id,
					    ctx->resource_id,
					    ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ReadingNormalMin failed with rc: %d\n",
			 rc));
	}
      if (ctx->flags & SAHPI_SRF_NORMAL_MAX)
	{
	  rc = delete_ReadingNormalMax_row (ctx->domain_id,
					    ctx->resource_id,
					    ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ReadingNormalMax failed with rc: %d\n",
			 rc));
	}
      if (ctx->flags & SAHPI_SRF_NOMINAL)
	{
	  rc = delete_ReadingNominal_row (ctx->domain_id,
					  ctx->resource_id,
					  ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ReadingNominal failed with rc: %d\n",
			 rc));
	}


      /*
       * Threshold rows
       */
      if (ctx->saHpiSensorHasThresholds == MIB_TRUE)
	{
	  rc = delete_ThdLowCritical_row (ctx->domain_id,
					  ctx->resource_id,
					  ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdLowCritical failed with rc: %d\n",
			 rc));

	  rc = delete_ThdLowMajor_row (ctx->domain_id,
				       ctx->resource_id,
				       ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdLowMajor failed with rc: %d\n",
			 rc));
	  rc = delete_ThdLowMinor_row (ctx->domain_id,
				       ctx->resource_id,
				       ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdLowMinor failed with rc: %d\n",
			 rc));
	  rc = delete_ThdUpCritical_row (ctx->domain_id,
					 ctx->resource_id,
					 ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdUpCritical failed with rc: %d\n",
			 rc));
	  rc = delete_ThdUpMajor_row (ctx->domain_id,
				      ctx->resource_id,
				      ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdUpMajor failed with rc: %d\n",
			 rc));
	  rc = delete_ThdUpMinor_row (ctx->domain_id,
				      ctx->resource_id,
				      ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdUpMinor failed with rc: %d\n",
			 rc));
	  rc = delete_ThdPosHysteresis_row (ctx->domain_id,
					    ctx->resource_id,
					    ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdPosHysteresis failed with rc: %d\n",
			 rc));
	  rc = delete_ThdNegHysteresis_row (ctx->domain_id,
					    ctx->resource_id,
					    ctx->saHpiSensorIndex);

	  if (rc != AGENT_ERR_NOERROR)
	    DEBUGMSGTL ((AGENT,
			 "call to delete_ThdNegHysteresis failed with rc: %d\n",
			 rc));
	}
      CONTAINER_REMOVE (cb.container, ctx);
      saHpiSensorTable_delete_row (ctx);
      sensor_count = CONTAINER_SIZE (cb.container);
      rc = AGENT_ERR_NOERROR;
    }
  DEBUGMSGTL ((AGENT, "delete_sensor_row. Exit (rc: %d).\n", rc));
  return rc;
}
/**
 * @internal
 * determine if we want a ifTable row in our container
 */
void
ipv6InterfaceTable_check_entry_for_updates(const ifTable_rowreq_ctx *
                                           ift_rrc,
                                           netsnmp_interface_entry *entry)
{
    netsnmp_container *c = ipv6InterfaceTable_container_get();
    ifTable_rowreq_ctx *ip6if_rrc;
    int             changed = 0;

    DEBUGMSGTL(("verbose:ipv6InterfaceTable:check_entry_for_updates",
                "called\n"));

    /*
     * do we have a corresponding row?
     */
    ip6if_rrc = CONTAINER_FIND(c, ift_rrc);
    if (NULL == ip6if_rrc) {
        /*
         * no corresponding row. should we have one?
         */
        if ((NULL != entry) &&
            (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6)) {
            /*
             * yes.
             */
            DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
                        "inserted row for index %d\n", entry->index));
            CONTAINER_INSERT(c, ift_rrc);
            changed = 1;
        }
    } else {
        /*
         * found corresponding row. is it still applicable?
         */
        if ((NULL == entry) ||
            (0 == (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV6))) {
            /*
             * no
             */
            DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
                        "removed  row for index %d\n",
                        ift_rrc->data.ifentry->index));
            CONTAINER_REMOVE(c, ift_rrc);
            changed = 1;
        } else {
            /*
             * still applicable. anything changed?
             */
            if (/** retransmit */
                   ((entry->
                     ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT)
                    && (entry->retransmit_v6 !=
                        ift_rrc->data.ifentry->retransmit_v6)) ||
                /** reasm */
                   ((entry->
                     ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX)
                    && (entry->reasm_max_v6 !=
                        ift_rrc->data.ifentry->reasm_max_v6)) ||
                /** reachable time */
                   ((entry->
                     ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_REACHABLE)
                    && (entry->reachable_time !=
                        ift_rrc->data.ifentry->reachable_time)) ||
                /** if id */
                   ((entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_IFID)
                    &&
                    ((entry->v6_if_id_len !=
                      ift_rrc->data.ifentry->v6_if_id_len)
                     || (0 !=
                         memcmp(entry->v6_if_id,
                                ift_rrc->data.ifentry->v6_if_id,
                                entry->v6_if_id_len)))) ||
                /** forwarding */
                   ((entry->
                     ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_V6_FORWARDING)
                    && (entry->forwarding_v6 !=
                        ift_rrc->data.ifentry->forwarding_v6))) {
                DEBUGMSGTL(("ipv6InterfaceTable:check_entry_for_updates",
                            "row changed for index %d\n",
                            ift_rrc->data.ifentry->index));
                changed = 1;
            }
        }
    }

    /*
     * if something changed, update table last changed
     */
    if (changed)
        ipv6InterfaceTable_lastChange_set(netsnmp_get_agent_uptime());
}
Beispiel #27
0
static void process_set_group (netsnmp_index * o, void *c)
{
    /* xxx-rks: should we continue processing after an error?? */
    set_context *context = (set_context *) c;

    netsnmp_request_group *ag = (netsnmp_request_group *) o;

    int rc = SNMP_ERR_NOERROR;

    switch (context->agtreq_info->mode)
    {

    case MODE_SET_RESERVE1:
        /** -> SET_RESERVE2 || SET_FREE */

        /*
         * if not a new row, save undo info
         */
        if (ag->row_created == 0)
        {
            if (context->tad->cb->duplicate_row)
                ag->undo_info = context->tad->cb->duplicate_row (ag->existing_row);
            else
                ag->undo_info = NULL;
            if (NULL == ag->undo_info)
            {
                rc = SNMP_ERR_RESOURCEUNAVAILABLE;
                break;
            }
        }

        if (context->tad->cb->set_reserve1)
            context->tad->cb->set_reserve1 (ag);
        break;

    case MODE_SET_RESERVE2:
        /** -> SET_ACTION || SET_FREE */
        if (context->tad->cb->set_reserve2)
            context->tad->cb->set_reserve2 (ag);
        break;

    case MODE_SET_ACTION:
        /** -> SET_COMMIT || SET_UNDO */
        if (context->tad->cb->set_action)
            context->tad->cb->set_action (ag);
        break;

    case MODE_SET_COMMIT:
        /** FINAL CHANCE ON SUCCESS */
        if (ag->row_created == 0)
        {
            /*
             * this is an existing row, has it been deleted?
             */
            if (ag->row_deleted == 1)
            {
                DEBUGMSGT ((TABLE_ARRAY_NAME, "action: deleting row\n"));
                if (CONTAINER_REMOVE (ag->table, ag->existing_row) != 0)
                {
                    rc = SNMP_ERR_COMMITFAILED;
                    break;
                }
            }
        }
        else if (ag->row_deleted == 0)
        {
            /*
             * new row (that hasn't been deleted) should be inserted
             */
            DEBUGMSGT ((TABLE_ARRAY_NAME, "action: inserting row\n"));
            if (CONTAINER_INSERT (ag->table, ag->existing_row) != 0)
            {
                rc = SNMP_ERR_COMMITFAILED;
                break;
            }
        }

        if (context->tad->cb->set_commit)
            context->tad->cb->set_commit (ag);

        /** no more use for undo_info, so free it */
        if (ag->undo_info)
        {
            context->tad->cb->delete_row (ag->undo_info);
            ag->undo_info = NULL;
        }

#if 0
        /* XXX-rks: finish row cooperative notifications
         * if the table has requested it, send cooperative notifications
         * for row operations.
         */
        if (context->tad->notifications)
        {
            if (ag->undo_info)
            {
                if (!ag->existing_row)
                    netsnmp_monitor_notify (EVENT_ROW_DEL);
                else
                    netsnmp_monitor_notify (EVENT_ROW_MOD);
            }
            else
                netsnmp_monitor_notify (EVENT_ROW_ADD);
        }
#endif

        if ((ag->row_created == 0) && (ag->row_deleted == 1))
        {
            context->tad->cb->delete_row (ag->existing_row);
            ag->existing_row = NULL;
        }
        break;

    case MODE_SET_FREE:
        /** FINAL CHANCE ON FAILURE */
        if (context->tad->cb->set_free)
            context->tad->cb->set_free (ag);

        /** no more use for undo_info, so free it */
        if (ag->row_created == 1)
        {
            if (context->tad->cb->delete_row)
                context->tad->cb->delete_row (ag->existing_row);
            ag->existing_row = NULL;
        }
        else
        {
            if (context->tad->cb->delete_row)
                context->tad->cb->delete_row (ag->undo_info);
            ag->undo_info = NULL;
        }
        break;

    case MODE_SET_UNDO:
        /** FINAL CHANCE ON FAILURE */
        /*
         * status already set - don't change it now
         */
        if (context->tad->cb->set_undo)
            context->tad->cb->set_undo (ag);

        /*
         * no more use for undo_info, so free it
         */
        if (ag->row_created == 0)
        {
            /*
             * restore old values
             */
            context->tad->cb->row_copy (ag->existing_row, ag->undo_info);
            context->tad->cb->delete_row (ag->undo_info);
            ag->undo_info = NULL;
        }
        else
        {
            context->tad->cb->delete_row (ag->existing_row);
            ag->existing_row = NULL;
        }
        break;

    default:
        snmp_log (LOG_ERR, "unknown mode processing SET for " "netsnmp_table_array_helper_handler\n");
        rc = SNMP_ERR_GENERR;
        break;
    }

    if (rc)
        netsnmp_set_request_error (context->agtreq_info, ag->list->ri, rc);

}
/**
 * load initial data
 *
 * TODO:350:M: Implement ipAddressTable data load
 * This function will also be called by the cache helper to load
 * the container again (after the container free function has been
 * called to free the previous contents).
 *
 * @param container container to which items should be inserted
 *
 * @retval MFD_SUCCESS              : success.
 * @retval MFD_RESOURCE_UNAVAILABLE : Can't access data source
 * @retval MFD_ERROR                : other error.
 *
 *  This function is called to load the index(es) (and data, optionally)
 *  for the every row in the data set.
 *
 * @remark
 *  While loading the data, the only important thing is the indexes.
 *  If access to your data is cheap/fast (e.g. you have a pointer to a
 *  structure in memory), it would make sense to update the data here.
 *  If, however, the accessing the data invovles more work (e.g. parsing
 *  some other existing data, or peforming calculations to derive the data),
 *  then you can limit yourself to setting the indexes and saving any
 *  information you will need later. Then use the saved information in
 *  ipAddressTable_row_prep() for populating data.
 *
 * @note
 *  If you need consistency between rows (like you want statistics
 *  for each row to be from the same time frame), you should set all
 *  data here.
 *
 */
int
ipAddressTable_container_load(netsnmp_container *container)
{
    netsnmp_container *ipaddress_container;
    void           *tmp_ptr[2];

    DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_cache_load",
                "called\n"));

    /*
     * TODO:351:M: |-> Load/update data in the ipAddressTable container.
     * loop over your ipAddressTable data, allocate a rowreq context,
     * set the index(es) [and data, optionally] and insert into
     * the container.
     */
    ipaddress_container =
        netsnmp_access_ipaddress_container_load(NULL,
                                                NETSNMP_ACCESS_IPADDRESS_LOAD_ADDL_IDX_BY_ADDR);
    /*
     * we just got a fresh copy of interface data. compare it to
     * what we've already got, and make any adjustments, saving
     * missing addresses to be deleted.
     */
    tmp_ptr[0] = ipaddress_container->next;
    tmp_ptr[1] = NULL;
    CONTAINER_FOR_EACH(container, (netsnmp_container_obj_func *)
                       _check_entry_for_updates, tmp_ptr);

    /*
     * now add any new interfaces
     */
    CONTAINER_FOR_EACH(ipaddress_container,
                       (netsnmp_container_obj_func *) _add_new_entry,
                       container);

    /*
     * free the container. we've either claimed each entry, or released it,
     * so the access function doesn't need to clear the container.
     */
    netsnmp_access_ipaddress_container_free(ipaddress_container,
                                            NETSNMP_ACCESS_IPADDRESS_FREE_DONT_CLEAR);

    /*
     * remove deleted addresses from table container
     */
    if (NULL != tmp_ptr[1]) {
        netsnmp_container *tmp_container =
            (netsnmp_container *) tmp_ptr[1];
        ipAddressTable_rowreq_ctx *tmp_ctx;

        /*
         * this works because the tmp_container is a linked list,
         * which can be used like a stack...
         */
        while (CONTAINER_SIZE(tmp_container)) {
            /*
             * get from delete list
             */
            tmp_ctx = (ipAddressTable_rowreq_ctx*)CONTAINER_FIRST(tmp_container);

            /*
             * release context, delete from table container
             */
            CONTAINER_REMOVE(container, tmp_ctx);
            ipAddressTable_release_rowreq_ctx(tmp_ctx);

            /*
             * pop off delete list
             */
            CONTAINER_REMOVE(tmp_container, NULL);
        }
    }

    DEBUGMSGT(("verbose:ipAddressTable:ipAddressTable_cache_load",
               "%lu records\n", (unsigned long)CONTAINER_SIZE(container)));

    return MFD_SUCCESS;
}
/**
 * 
 * @domainId
 * @resourceId
 * 
 * @return 
 */
SaErrorT clear_ctrl_digital(SaHpiDomainIdT domainId, 
                             SaHpiResourceIdT resourceId)

{
        SaErrorT rv = SA_OK;
        netsnmp_index *row_idx;
        saHpiCtrlDigitalTable_context *ctrl_ctx;

	DEBUGMSGTL ((AGENT, "clear_ctrl_digital, called\n"));	
	DEBUGMSGTL ((AGENT, "           domainId   [%d]\n", domainId));	
	DEBUGMSGTL ((AGENT, "           resourceId [%d]\n", resourceId));

        DR_XREF *dr_entry;
        SaHpiDomainIdResourceIdArrayT dr_pair;

        /* reset any existing indexEntry value */
        dr_pair.domainId_resourceId_arry[0] = domainId;
        dr_pair.domainId_resourceId_arry[1] = resourceId;
        dr_entry = domain_resoruce_pair_lookup(&dr_pair, &dr_table); 
        if (dr_entry == NULL) {
                DEBUGMSGTL ((AGENT, 
                "INFO: clear_ctrl_digital() domain_resource_pair_get returned NULL\n"));
                return SA_ERR_HPI_NOT_PRESENT;
        } else {
                dr_entry->entry_id = 0;
        }

        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)                    */
                        ctrl_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 ((ctrl_ctx->index.oids[saHpiCtrlDigitalDomainId_INDEX] ==
                             domainId) &&

                            (ctrl_ctx->index.oids[saHpiCtrlDigitalResourceEntryId_INDEX] ==
                             resourceId)) {

                                /* all conditions met remove row */
                                CONTAINER_REMOVE (cb.container, ctrl_ctx);
                                saHpiCtrlDigitalTable_delete_row (ctrl_ctx);
                                ctrl_digital_entry_count = 
                                        CONTAINER_SIZE (cb.container);
                                DEBUGMSGTL ((AGENT, "clear_ctrl_digital: "
                                                    "found row: removing\n"));

                        }

                } while (row_idx);
        } 

        return rv;
}
/**
 * @internal
 * determine if we want a ifTable row in our container
 */
void
ipv4InterfaceTable_check_entry_for_updates(const ifTable_rowreq_ctx *
                                           ift_rrc,
                                           netsnmp_interface_entry *entry)
{
    netsnmp_container *c = ipv4InterfaceTable_container_get();
    ifTable_rowreq_ctx *ip4if_rrc;
    int             changed = 0;

    DEBUGMSGTL(("verbose:ipv4InterfaceTable:check_entry_for_updates",
                "called\n"));

    /*
     * do we have a corresponding row?
     */
    ip4if_rrc = CONTAINER_FIND(c, ift_rrc);
    if (NULL == ip4if_rrc) {
        /*
         * no corresponding row. should we have one?
         */
        if ((NULL != entry) &&
            (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4)) {
            /*
             * yes.
             */
            DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
                        "inserted row for %d\n", entry->index));
            CONTAINER_INSERT(c, ift_rrc);
            changed = 1;
        }
    } else {
        /*
         * found corresponding row. is it still applicable?
         */
        if ((NULL == entry) ||
            (0 == (entry->ns_flags & NETSNMP_INTERFACE_FLAGS_HAS_IPV4))) {
            /*
             * no
             */
            DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
                        "removed  row for %d\n",
                        ift_rrc->data.ifentry->index));
            CONTAINER_REMOVE(c, ift_rrc);
            changed = 1;
        } else {
            /*
             * still applicable. anything changed?
             */
            if ((entry->retransmit_v4 !=
                 ift_rrc->data.ifentry->retransmit_v4) ||
                (entry->reasm_max_v4 != ift_rrc->data.ifentry->reasm_max_v4)) {
                DEBUGMSGTL(("ipv4InterfaceTable:check_entry_for_updates",
                            "row changed for %d\n",
                            ift_rrc->data.ifentry->index));
                changed = 1;
            }
        }
    }

    /*
     * if something changed, update table last changed
     */
    if (changed)
        ipv4InterfaceTable_lastChange_set(netsnmp_get_agent_uptime());
}