uip协议栈的疑问

siasjack 2014-05-05 03:25:29
我看了uip1.0的源码,有个问题请教大家

uip协议栈中是否只能使用app,比如在例程app文件夹中有dhcpc,helloworld,我是否可以同时启用这两个app?还是在udp和tcp分别只能有一个应用?
之所以这样问是因为在搜索UIP_UDP_APPCALL时出现重复定义

---- UIP_UDP_APPCALL Matches (4 in 3 files) ----
Dhcpc.h (apps\dhcpc):#define UIP_UDP_APPCALL dhcpc_appcall
Resolv.h (apps\resolv):#define UIP_UDP_APPCALL resolv_appcall
Uip.c (uip): UIP_UDP_APPCALL();
Uip.c (uip): UIP_UDP_APPCALL();

在搜素UIP_APPCALL 时也出现了很多哦重复定义,这些定义肯定只能使用一个

---- UIP_APPCALL Matches (32 in 9 files) ----
Hello-world.c (apps\hello-world): * In hello-world.h we have defined the UIP_APPCALL macro to
Hello-world.h (apps\hello-world):#ifndef UIP_APPCALL
Hello-world.h (apps\hello-world):#define UIP_APPCALL hello_world_appcall
Hello-world.h (apps\hello-world):#endif /* UIP_APPCALL */
Smtp.h (apps\smtp):#ifndef UIP_APPCALL
Smtp.h (apps\smtp):#define UIP_APPCALL smtp_appcall
Telnetd.h (apps\telnetd):#ifndef UIP_APPCALL
Telnetd.h (apps\telnetd):#define UIP_APPCALL telnetd_appcall
Uip-doc.txt (doc):The application must be implemented as a C function, UIP_APPCALL(),
Uip-doc.txt (doc):configuration variable UIP_APPCALL should be defined to be
Uip-doc.txt (doc):#define UIP_APPCALL example2_app
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): /* We call UIP_APPCALL() with uip_flags set to
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uip.c (uip): UIP_APPCALL();
Uipopt.h (uip): * using the UIP_APPCALL definition.
Uipopt.h (uip):#define UIP_APPCALL httpd_appcall
Uipopt.h (uip): * \var #define UIP_APPCALL
Webclient.h (apps\webclient):#define UIP_APPCALL webclient_appcall
Webserver.h (apps\webserver):/* UIP_APPCALL: the name of the application function. This function
Webserver.h (apps\webserver):#ifndef UIP_APPCALL
Webserver.h (apps\webserver):#define UIP_APPCALL httpd_appcall

我看到了uip-con.h中使用头文件包含的方法来确定使用哪个app,请问是否可以两个以上app同时使用?比如同时使用dhcpc和helloworld?如何做?


...全文
426 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
happyming0809 2014-08-29
  • 打赏
  • 举报
回复
前年我也搞,搞不定,之后换工作就没搞了
fxh13579 2014-08-29
  • 打赏
  • 举报
回复
根据端口号加以区别
ForestDB 2014-05-15
  • 打赏
  • 举报
回复
LZ并没有理解什么叫“重复”定义。
johnnypei5 2014-05-15
  • 打赏
  • 举报
回复
我最近也在搞uIP,基础不好,很费力,希望交个朋友一起研究一下。对于你遇到的问题,我来尝试回答一下,希望对你能有点帮助。 uIP中面向应用层的只有一个接口函数UIP_APPCALL ,也就是说所有的应用都要通过宏定义#define UIP_APPCALL xxx_appcall之后才能被调用; 当一个应用,比如dhcpc_APPCALL需要使用时,会用#ifndef UIP_APPCALL #define UIP_APPCALL dhcpc_APPCALL将dhcpc_APPCALL定义为UIP_APPCALL,使用完之后,会用#undef取消宏定义。 以上是我的拙见,真的不一定准确,仅供你参考。希望可以一起学习,一起探讨。(QQ905417671)
siasjack 2014-05-05
  • 打赏
  • 举报
回复
同学帮忙啊! 不要沉下去!

69,369

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧