RE: help - SNMP Trap manager registration and deregistrationdynamically...

"Borra, Kishore Babu" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Thanks dave for the info. I will definitely try below defined method and will post the result.

But I had a basic question in the below context, which is regarding the usage of callback function and linked list.

i.e, when will be the linked list be used and when will be the callback function be used. ?, 
Is it any conf file changes to drive the trap destinations addtition and freeing using callback methodology?
Is there any other way to add/delete the trap managers using the linked list ?

However I will also try to refer the code and find out the info, if required.

Regards,
Kishore


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Dave Shield
Sent: Tuesday, January 19, 2010 8:22 PM
To: Borra, Kishore Babu
Cc: [email protected]; Mike Ayers
Subject: Re: help - SNMP Trap manager registration and deregistrationdynamically...

2010/1/19 Borra, Kishore Babu <[email protected]>:
> 1. For adding/creating a new trap session, used api - create_trap_session(..),
>     instead of netsnmp_config(  "trapsink  localhost"  );.
>  2.And Removing the Notification receivers using snmpd_free_trapsinks(), as replied in the below mail.
>
> But the problem here is snmpd_free_trapsinks(), is not removing the Recievers,
> but create_trap_session(..),  works properly.
>
> Could you pls me know, if  these two api - netsnmp_config(), create_trap_session(..),
> behaviours are different, which makes snmpd_free_trapsinks(), works or not.

You've got the code, and are geared up for testing this - why not try
for yourself?

But checking the code more closely, I suspect that you'll find that
snmpd_free_trapsinks()
won't actually work in either case.
   Both "create_trap_session" and the config processing each end up calling an
internal "create_trap_session2()" routine, which has two alternative mechanisms
for setting up trap recipients.  One uses an internal linked list, which is what
"snmpd_free_trapsinks()" subsequently removes.   But the other uses the callback
mechanism to populate the snmpNotifyTable, via the routine
notifyTable_register_notifications()

And the inverse to this (notifyTable_unregister_notifications()) is
invoked as part of
updating the config files.   (See init_snmpNotifyTable())

So you might have better luck if you call "update_config()" instead of
"snmpd_free_trapsinks()".

Try it, and see how you get on.

Dave

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.