LWIP中的接收数据相关的函数详解(1)

一、在main()函数中

1         /* check if any packet received */
2         if (ETH_CheckFrameReceived())
3         { 
4             /* process received ethernet packet */
5             LwIP_Pkt_Handle();
6         }

二、

 1 /**
 2   * @brief  Called when a frame is received
 3   * @param  None
 4   * @retval None
 5   */
 6 void LwIP_Pkt_Handle(void)
 7 {
 8   /* Read a received packet from the Ethernet buffers and send it to the lwIP for handling */
 9   ethernetif_input(&netif);
10 }

三、在函数ethernetif_input()主要完成两个工作

  1、调用low_level_input();得到实际的接收数据pbuf

  2、调用netif->input();

四、在LwIP_Init()中的调用netif_add(&netif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &ethernet_input);

  可知,当执行到netif->input();时,函数ethernet_input()被调用;

五、ethernet_input()

  1、原型:err_t ethernet_input(struct pbuf *p, struct netif *netif)

  2、功能:处理接收到的网络数据帧;

       这个函数并没有直接调用ip_input;

       在并发访问时,ARP高速缓存被保护 

  3、实现

    -

转载于:https://www.cnblogs.com/Iamchritian--forthegloryofGod/p/5144006.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值