On 22/11/2007, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I can see two functions that I think might be of use:
>
> netsnmp_transport_open_server and snmptrapd_add_session
>
> Are these the ones I need to be looking at?

netsnmp_transport_open_server  and snmp_add (or snmp_open) yes.
Those are the basic calls for setting up the listening ports.
(snmptrapd_add_session is just a wrapper round snmp_add)

>                     If so how do I just add a
> session to just monitor traps on port 162 of my IP address?

    transport = netsnmp_transport_open_server("snmptrap", "udp:162");
    ss = snmptrapd_add_session(transport);


This will then call the routine "snmp_input" whenever a request is received.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
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

Reply via email to