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、實現

    -


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM