0

我想将我的基于 pc 的源代码移植到使用 posix 标准的网络应用程序到使用 LWIP 堆栈的 cortex M4 微控制器。我找到了与套接字相关的 API,但我被困在以下内容中:

#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

那么在哪里可以找到丢失文件的c语言源代码呢?它们可以在 PC 上还是在网络上...?是否可以重写它们?

先感谢您。

4

1 回答 1

0

lwip 的包含文件结构与典型的 BSD 套接字不同。

这是我要做的:

  1. 注释或 ifdef 输出标准网络包含文件,
  2. 包括 lwip 的“api.h”
  3. 尝试编译。
  4. 查看编译器抱怨什么,并在 lwip 的 src/include 中查找特定类型的 grep 并包含适当的 LwIP 文件。
  5. 重复 3-5 直到编译器满意。
于 2014-04-18T19:01:13.797 回答