How to implement lwIP+SNMP in lpcxpresso?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to implement lwIP+SNMP in lpcxpresso?

1,260 Views
vishakhadakhane
Contributor III

Hello there,

I am already done with lpcopen's webserver example . Now I would like to implement SNMP with the existing lwip present in webserver. I have seen the steps to build SNMP agent on some websites and even tried to implement them but i am getting the errors. Please help me out.

I am following this website for building SNMP agent

https://www.nongnu.org/lwip/2_0_x/group__snmp.html

Errors :

1) In function 'main':
../example/src/webserver.c:173:34: error: 'snmp_ifType_ethernet_csmacd' undeclared (first use in this function) 

2) make: *** [example/src/webserver.o] Error 1

Tags (1)
6 Replies

1,032 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Dear Vishakha,

The erros mention that the snmp_ifType_ethernet_csmacd is missing, I've tried to find this in the lwip stack and in the link you send me but couldn't find it. Could you let me know where did you find this issue?

Best Regards,

Alexis Andalon

1,032 Views
vishakhadakhane
Contributor III

Hello Sir,

           Thanks for your reply.I am getting this error in webserver.c file which present in webserver folder which is the the example of LPCOPEN. I get this error while following the steps to build the SNMP Agent. The 1st step in building the agent is we need to add the following define to our lwipopts.h file: #define LWIP_SNMP   1. I did this step and when I build the project ,I get the error which is mentioned above. I am getting error at  NETIF_INIT_SNMP(&lpc_netif, snmp_ifType_ethernet_csmacd, 100000000); and when I do Right click---->open declaration on NETIF_INIT_SNMP , I go to netif.h file where #define NETIF_INIT_SNMP is present. I can't find where(in which file) this function is actually defined. I tried searching in all the files but couldn't get it. What should i do ? 

Please let me know . 

Thank you!

0 Kudos

1,032 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Dear vishakhadakhane@gmail.com‌,

I found the definition of this variable - \webserver\lwip\inc\lwip\snmp.h - snmp_ifType_ethernet_csmacd

Also the definition of this function is in the next path - \webserver\lwip\inc\lwip\netif.h - NETIF_INIT_SNMP(netif, type, speed)

Let me know if this helps you.

Best Regards,

Alexis Andalon

1,032 Views
vishakhadakhane
Contributor III

Hello sir, Thanks for your reply! I know these paths already. but have you done  #define LWIP_SNMP   1 in lwipopts.h file? And after compiling this do you get the errors?

If yes then please lemme know.

0 Kudos

1,032 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi Vishakha,

You're right, if you enable this macro the project will have many errors, this is due to this example isn't constructed to work with SNMP. If you check and substitute this macros for the its values, will appear many errors regarding the functions missing in this example.

Unfortunately there isn't any example that use SNMP. Sorry for the inconveniences this may cause you.

Best Regards,

Alexis Andalon

1,032 Views
vishakhadakhane
Contributor III

Hello Sir,

             As you said this example is not constructed to work with SNMP . So is there a solution on this problem? Actually there are  few files of SNMP available in this example such as snmp.h, snmp_asn1.h, snmp_msg.h, snmp_structs.h etc. But there are so many files available on the internet regarding lwip+SNMP on this website https://www.nongnu.org/lwip/2_0_x/group__netif__cd.html#ga4bce01ddbf0fd70cb88431f773c91bc5(You can't download the files from here, you can just see which functions are used in which files. you have to download t from this website: https://savannah.nongnu.org/forum/forum.php?forum_id=9248 ) I have downloaded the latest version i.e. 2.1.2.

 So my question is what if we merge the files requires for SNMP in this webserver example. I have been trying to implement lwip+snmp for almost a month  but getting a lots of errors. I don't even know if this path is correct or not. 

     I have asked about the version of lwip used in lpcxpresso on this community and i got to know that version is 1.4.1. So can we use the 2.1.2 version in the webserver ?

Sir I request you to suggest me any way to implement this project.

Thank you Sir!

0 Kudos