简体   繁体   中英

porting network application from pc posix (linux) to STM32 / lwip

I want to port my pc based source code which is a network application that uses posix standard to a cortex M4 microcontroller using LWIP stack. I have found the sockets related APIs but I am stuck in the following includes:

#include <arpa/inet.h>
#include <netinet/in.h>       ==> I have not found the equivalent in LWIP
#include <netinet/in_systm.h> ==> I have not found the equivalent in LWIP
#include <netinet/ip.h>       ==> I have not found the equivalent in LWIP
#include <netinet/tcp.h>      ==> I have not found the equivalent in LWIP
#include <sys/socket.h> ==> I have found the equivalent in LWIP
#include <sys/sysctl.h> ==> I have found the equivalent in LWIP

So where can I find the source code in c language of the missed files? Are they aiavable on PC or on web...? Is it possible to rewrite them?

Thank you in advance.

lwip does not have the same include file structure as typical BSD sockets.

Here's what I'd do:

  1. comment or ifdef out standard networking include files,
  2. include lwip's "api.h" instead
  3. try to compile.
  4. See what compiler complains about and grep for particular type in lwip's src/include and include appropriate LwIP's file.
  5. Repeat 3-5 until compiler is happy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM