Problems using access entries

helge.fredriksen____4tel.no helge.fredriksen____4tel.no
Fri May 19 21:41:46 CEST 2000


Thanks, that seemed to do the trick!

Another small problem: Reporting error on get-operations.

Under Agent++3.3 I used the following standard code in my
source files:

void msgLogLocalDirectory::get_request(Request* req, int ind)
{
       if( ccRequest::getString(oid.get_printable(), this) == 0 )
  		 MibLeaf::get_request(req, ind);
       else
	 	Mib::instance->error(req->get_transaction_id(), ind,
SNMP_ERROR_RESOURCE_UNAVAIL);
}

The last statement do not work anymore. Any suggestions for a good
replacement?


Helge Fredriksen

-----Original Message-----
From: Frank.Fock____t-online.de [mailto:Frank.Fock____t-online.de]
Sent: 19. mai 2000 20:22
To: helge.fredriksen____4tel.no
Subject: Re: Problems using access entries




helge.fredriksen____4tel.no wrote:

>
> We have just been upgrading from AGENT++ 3.3 to AGENT++ 3.4 and
> encountered
> the following problem:
>
> We are working with a process-table, which we use to spawn new
> processes on
> a host.
> During this process, it is necessary for us to dynamically create new
> context views, so
> that the correct process can be accessed later on for managed
> information.
>
> In version 3.3 we successfully used the following code to create such
> views
> when a
> new row (new process) were created in our process-table:
>
OK, I changed the context support from 3.3 to 3.4. Now there is a
list of contexts in class Mib to which you can add MibObjects
individually.

When a requests comes in, the responsible object is searched only
in the corresponding MibContext instance. In 3.3 there was only
one such context (the Mib class).

I think you use (and would like still to) a single MibObject
(Leaf/Table)
for all contexts you support. In 3.4 you normally have a MibObject
instance
for each context. But you can also add a instance to more than one
context, although you then have to make sure, that this object is only
destroyed once when contextes are deleted.

What I would suppose is to override the Mib::get_context method by
subclassing Mib. You MyMib::get_context should then look like:

MyMib::get_context(const OctetStr& context)
{
return defaultContext;
}

By using this MyMib instead of Mib, you will get the same behaviour
as in 3.3.

Hopefully you could follow my explainations?

Best regards,
Frank



More information about the AGENTPP mailing list