lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] SNMPv3 TRAPS


From: Luca Ussoli
Subject: Re: [lwip-users] SNMPv3 TRAPS
Date: Fri, 16 Dec 2022 10:39:11 +0100

Hello Indan,

I've tried to call snmp_mngr_send() with set = 2 importing manager code, but without success.
Since I only need agent functionality, I've worked only on snmp_traps.c file duplicating the functions used to build the TRAP message, on the basis that SNMPv3 TRAPS are similar to management messages, and filling struct snmp_msg_trap with the needed fields.
I'm attaching my snmp_traps.c file. The differences from snmp_traps.c file of the last master commit of lwIP are clear if you compare them.
Currently my code contains the limitation that the user ID is fixed with SNMP_V3_USER_ID  (#define SNMP_V3_USER_ID   0). So the user with ID 0 from the table is fixed.
TRAPS v3 are working. If I've missed anything in their implementation, I'm available to discuss it.

Greetings,
Luca


Il giorno lun 5 dic 2022 alle ore 08:10 Luca Ussoli <lucaussoli3@gmail.com> ha scritto:
Hello Indan,

Thanks for your reply!
I'll work on that as soon as I can.

Greetings,

Luca

Il giorno dom 4 dic 2022 alle ore 13:20 Indan Zupancic <indan.zupancic@mep-info.com> ha scritto:
Hello Luca,

On 2022-12-02 18:38, Luca Ussoli wrote:
> Using the master branch I managed to get the SNMPv3 agent running.
> However,
> TRAPS are managed up to the v2c version. I'm currently trying to
> implement
> the v3 version as well, but without success so far.
>
> Has anyone successfully implemented them? Or is trying so we could
> share our ideas?

Sending traps is very similar to sending SNMP management messages. Some
years ago
I had a quick stab at implementing v3 traps on top of Harrold's SNMP
manager code,
but due to lack of time and customer need I never finished it.

The attached patch comes on top of
https://savannah.nongnu.org/patch/?9927 and
Harrold's other SNMP patches, see
https://savannah.nongnu.org/users/harrold68,
and perhaps some other changes we did since then internally. All this is
based on
an internal lwip fork off commit 0192fe77, but updating it to master
should be easy.

To send a v3 trap call snmp_mngr_send() with set = 2, and you need to
implement
snmpv3_get_trap_auth(). The traps v3 patch is fully untested, but should
be
almost there. The manager code we have running in production for a
couple of
years now, though I'm not sure if all bugfixes have been sent as patches
yet.

If you do get v3 traps working, please post a patch and share it with
this
mailinglist. Perhaps then there is a chance that the SNMP manager patch
will
be finally upstreamed as well.

Greetings,

Indan

Attachment: snmp_traps.c
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]