Thank you for your response.
I would like to clarify the goal and purpose of my thoughts. I will be
happy to to make the code change in lwip if I can get a cvs permission
or if I can work with someone who can commit changes.
My suggestion is to separate between a specific SNMP-Agent and the
access to Ipstack MIB2 information maintained by the lwip Ipstack.
This is kind to separation and functional breakdown already exists
very nicely in the lwip implementation.
The suggestion:
Adding Compile-Time configuration for the support Ipstack MIB2 access
functions and structures.
(1) In op.h
Add Compile-Time configuration for Ipstack MIB2 access functions
Something like this:
example:
/**
* LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP
* transport.
*/
#ifndef LWIP_SNMP
#define LWIP_SNMP 0
#endif
/**
* \def LWIP_IPSTACK_MIB2==1: Compile-Time configuration to turn on
* SNMP Ipstack MIB-2 Access functions (counters and internal tables)
*
* This Compile-Time configuration maybe independent of LWIP_SNMP
* above.
*/
#ifndef LWIP_IPSTACK_MIB2
#define LWIP_IPSTACK_MIB2 0
#endif
(2) In all relevant Ipstack mib-2 were LWIP_SNMP is used
add
#if defined(LWIP_SNMP) || defined(LWIP_IPSTACK_MIB2)
... some code..
#endif
example:
/**
* Bring an interface up, available for processing
* traffic.
*
* @note: Enabling DHCP on a down interface will make it come
* up once configured.
*
* @see dhcp_start()
*/
void netif_set_up(struct netif *netif)
{
if ( !(netif->flags & NETIF_FLAG_UP )) {
netif->flags |= NETIF_FLAG_UP;
#if defined(LWIP_SNMP) || defined(LWIP_IPSTACK_MIB2)
snmp_get_sysuptime(&netif->ts);
#endif /* LWIP_SNMP || LWIP_IPSTACK_MIB2 */
--
- Yigal
Yigal Hochberg wrote:
> > Unfortunately no response from from Christiaan Simons
>
> I didn't hear (or see an email) from Christiaan for nearly 3 years
> now, he might well not be working at axon any more by now...
>
> > I would appreciate if anyone can "connect" me to the SNMP of Lwip.
>
> I'm not sure I understand you here...
>
> I guess that your agent is not open source or for free. Personally,
> I'm against changing the lwIP code to adapt to 3rd party closed source
> software - if I understood you correctly, this is what you want. lwIP
> already has an snmp agent and if you'd like to improve it to support
> snmp v2(c) or v3, that's of course welcome!
>
> Simon
>
_______________________________________________
lwip-users mailing list
lwip-...@nongnu.org
http://lists.nongnu.org/mailman/listinfo/lwip-users
I'm no expert on SNMP, but I don't quite follow what this change is for.
Can you give some justification for it? A more comprehensive patch
would help to illustrate what the LWIP_IPSTACK_MIB2 option would do. In
the patch fragment you included it's just used in the same way and at
the same time as LWIP_SNMP, so seems to add nothing.
Simon is right that the best way to contribute to lwIP is to improve the
open source distribution of it and help everyone benefit. However I
understand that this isn't always possible, and lwIP is deliberately
licensed using a BSD license to allow use in commercial and closed
source products. With that in mind I've got no objection in principal
to a change that makes such integration better and so improves the ways
in which lwIP can be used, but I'd want to understand what was being
proposed before making any such change.
Thanks
Kieran
Check out current CVS head, make your changes, prepare a diff that
contains your changes (ideally a unified diff so easier to read) and add
this as a patch to the lwIP's patch tracker. This should then get
reviewed and applied if appropriate.
http://lwip.wikia.com/wiki/Contributing_to_lwIP
I'm still not quite sure why you would ever need
#if defined(LWIP_SNMP) || defined(LWIP_SNMP_MIB2)
as in your previous example. Surely code in lwIP will either be part of
the SNMP agent protocol (and so controlled by LWIP_SNMP) or be the MIB-2
interface (and so controlled by LWIP_SNMP_MIB2) but not both (which
would require LWIP_SNMP || LWIP_SNMP_MIB2).
I assume it's the case that it doesn't make much sense to have LWIP_SNMP
defined without LWIP_SNMP_MIB2. If that's right, we should have a
compile time check that this dependency is met as with some of the other
options in src/core/init.c
Simon
OK, so it sounds like this idea of replacing lwIP's SNMP with a
roll-your-own version is something that we should do our best to
support.
> I didn't need any of the MIB-2 data either. So I guess it is possible
> to have an SNMP agent and not have MIB-2 info collection.
I meant "is MIB-2 required for the agent currently in lwIP", not "is
MIB-2 required for all any SNMP agent".
In general, if the SNMP agent already in lwIP is considered too
heavyweight, is there any interest in cutting it down, either by adding
a complete replacement along the lines of your version, or by making
more of the features in the lwIP agent compile-time configurable? I've
no idea how feasible either of those are, but wondered if it warrants a
task opening in savannah.
Simon
If not, the contents was this:
> Thinking about it, the change is rather trivial: the guards in snmp.h
> and netif.h would have to be changed from LWIP_SNMP to LWIP_MIB2 and the
> usages of LWIP_SNMP/snmp_get_sysuptime() in netif.c would have to be
> fixed and that should be it.
I don't think we need to add a new flag anywhere but in snmp.h. And I would suggest a name not including "IPSTACK". LWIP_MIB2 should be enough.