tasklwIP - A Lightweight TCP/IP stack - Tasks: task #13732, Correctly split SNMP agent, MIB2...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #13732: Correctly split SNMP agent, MIB2 change triggers and MIB2 implementation

Submitter:  Simon Goldschmidt <goldsimon>
Submitted:  Thu 03 Sep 2015 06:38:24 PM UTC
   
 
Category:  None Should Start On:  Thu 03 Sep 2015 12:00:00 AM UTC
Should be Finished on:  Thu 03 Sep 2015 12:00:00 AM UTC Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Percent Complete:  100%
Open/Closed:  Closed Planned Release:  1.5.0
Effort:  0.00

Jump to the original submission

Mon 05 Oct 2015 08:00:52 AM UTC, comment #8: 

Haha, it compiled only for me because I failed to commit it :-) Sorry for that...

Simon Goldschmidt <goldsimon>
Group administrator
Mon 05 Oct 2015 07:50:12 AM UTC, comment #7: 

By checking the headerfile and just changing the code until it compiles I got this diff.

(file #35070)

Erik Ekman <yarrick>
Group Member
Mon 05 Oct 2015 06:37:54 AM UTC, comment #6: 

When compiling the win32 port with mingw-64 with the same compiler flags, I don't get any errors. Can you tell us how to fix them?

Simon Goldschmidt <goldsimon>
Group administrator
Sun 04 Oct 2015 05:34:28 PM UTC, comment #5: 

The 'minimal' unix app does not build:

gcc -g -Wall -DLWIP_UNIX_LINUX -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wno-address -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../../../apps/httpserver_raw -I../../../../apps/shell -I../../../../apps/tcpecho -I../../../../apps/udpecho -I../../../../apps/snmp_private_mib -I../../../../apps/tcpecho_raw -I../../../../../lwip/src/include -I../../../../ports/unix/include -I../../../../../lwip/src -c ../../../../apps/snmp_private_mib/lwip_prvmib.c
../../../../apps/snmp_private_mib/lwip_prvmib.c:115:7: error: missing braces around initializer [-Werror=missing-braces]
../../../../apps/snmp_private_mib/lwip_prvmib.c:115:7: error: (near initialization for ‘sensor_addr_inf.sensor_list_rn.scalar.node’) [-Werror=missing-braces]
../../../../apps/snmp_private_mib/lwip_prvmib.c:115:7: error: initialization makes integer from pointer without a cast [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:115:7: error: (near initialization for ‘sensor_addr_inf.sensor_list_rn.scalar.node.node_type’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:119:7: error: initialization makes pointer from integer without a cast [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:119:7: error: (near initialization for ‘sensor_addr_inf.sensor_list_rn.scalar.set_value’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:121:5: error: excess elements in struct initializer [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:121:5: error: (near initialization for ‘sensor_addr_inf.sensor_list_rn.scalar’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:150:5: error: initialization makes integer from pointer without a cast [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:150:5: error: (near initialization for ‘sensorentry.node.node_type’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:150:5: error: initializer element is not computable at load time
../../../../apps/snmp_private_mib/lwip_prvmib.c:150:5: error: (near initialization for ‘sensorentry.node.node_type’)
../../../../apps/snmp_private_mib/lwip_prvmib.c:151:5: error: excess elements in struct initializer [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:151:5: error: (near initialization for ‘sensorentry.node’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:152:5: error: excess elements in struct initializer [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:152:5: error: (near initialization for ‘sensorentry.node’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:153:5: error: excess elements in struct initializer [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:153:5: error: (near initialization for ‘sensorentry.node’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:154:5: error: excess elements in struct initializer [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:154:5: error: (near initialization for ‘sensorentry.node’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:156:3: error: excess elements in struct initializer [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:156:3: error: (near initialization for ‘sensorentry.node’) [-Werror]
../../../../apps/snmp_private_mib/lwip_prvmib.c:156:3: error: missing initializer [-Werror=missing-field-initializers]

and lots more errors

Erik Ekman <yarrick>
Group Member
Sat 03 Oct 2015 07:34:11 PM UTC, comment #4: 

Looks good for now. The snmp agent will probably be changed soon to allow integration of other (non-private) mibs including a mib-to-C compiler, but that might take a while...

Simon Goldschmidt <goldsimon>
Group administrator
Thu 01 Oct 2015 08:26:02 AM UTC, comment #3: 

OK, so this is nearly done, but the mib structure still might need cleanup. This could both simplify the agent (non-mib) code and as well as fix some bugs (e.g. bug #37150)...

Simon Goldschmidt <goldsimon>
Group administrator
Tue 08 Sep 2015 07:48:13 AM UTC, comment #2: 

Partly done (patch by Dirk Ziegelmeier)

Simon Goldschmidt <goldsimon>
Group administrator
Thu 03 Sep 2015 06:39:03 PM UTC, comment #1: 

Targeting this to 1.5.0 as it would be a breaking change.

Simon Goldschmidt <goldsimon>
Group administrator
Thu 03 Sep 2015 06:38:24 PM UTC, original submission:  

The SNMP code is hard to read since it is not cleanly separated (and/or named).

It consists of the SNMP agent (plus protocol parsing functions), mib2 structure and the integration of the snmp change triggers/callback functions into the rest of the stack (and the netif drivers).

To clean this up, I'd change the MIB2 triggers to be more portable (i.e. to integrate a different SNMP agent plus MIB2 into lwIP) and move the rest of SNMP to a location outside of the core code (it's an application protocol, after all, not a core component of an IP stack).

That new location would be a new directory next to 'core', 'api' and 'netif'.

Also, mib2 could share some of the counters with LWIP_STATS to prevent the two drifting apart (and to reduce the code impact of calling multiple incrementing functions throughout the stack).

Simon Goldschmidt <goldsimon>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by yarrick (Posted a comment)
  • -email is unavailable- added by goldsimon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-10-05 yarrick Attached File- Added 0001-Fix-compile-of-lwip_prvmib.patch, #35070
    2015-10-03 goldsimon StatusIn Progress Done
        Percent Complete80% 100%
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2015-10-01 goldsimon Percent Complete50% 80%
    2015-09-08 goldsimon StatusNone In Progress
        Percent Complete0% 50%
    2015-09-03 goldsimon Planned ReleaseNone 1.5.0

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code