On Fri, 15 Apr 2005 10:41:18 +0200 Christian wrote: CJ> >Trying to figure out where a packet came from is strongly discouraged. CJ> >Once a PDU has been authenticated and accepted, it shouldn't matter where CJ> >it came from. If you need different data from different hosts, SNMP CJ> >contexts is the right way to do it. CJ> > CJ> >That said, if you really really want to do it, you could probably poke CJ> >about in the structures passed to the cache_load wrapper in *_interface.c, CJ> >and pass the info to the cache_load routine. CJ> > CJ> I've been looking around in *_interface.c and especially in the CJ> _cache_load(netsnmp_cache * cache, void *vmagic) procedure.
I should have looked at the code first... CJ> But from what I can understand, no such information is available in the CJ> netsmp_cache struct. Btw, what is the netsnmp_cache.hint used for? That's exactly what you need.. Set NETSNMP_CACHE_HINT_HANDLER_ARGS in your cache flags, and the hint will contain the full set of arguments that handlers normally get. Those are the structures you need to poke around in. I'm pretty sure you can find the peer address in there somewhere, but I'm not sure about the local address. The easiest way to do that would be to have a different community string for each address. Otherwise you are probably going to have to modify the libraries. -- NOTE: messages sent directly to me, instead of the lists, will be deleted unless they are requests for paid consulting services. Robert Story; NET-SNMP Junkie Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp> Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users> You are lost in a twisty maze of little standards, all different. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Net-snmp-users mailing list Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/listinfo/net-snmp-users