struct ip_globals
{
/** The interface that accepted the packet for the current callback invocation. */
struct netif *current_netif;
/** The interface that received the packet for the current callback invocation. */
struct netif *current_input_netif;
#if LWIP_IPV4
/** Header of the input packet currently being processed. */
struct ip_hdr *current_ip4_header;
#endif /* LWIP_IPV4 */
#if LWIP_IPV6
/** Header of the input IPv6 packet currently being processed. */
struct ip6_hdr *current_ip6_header;
#endif /* LWIP_IPV6 */
/** Total header length of current_ip4/6_header (i.e. after this, the UDP/TCP header starts) */
u16_t current_ip_header_tot_len;
/** Source IP address of current_header */
ip_addr_t current_iphdr_src;
/** Destination IP address of current_header */
ip_addr_t current_iphdr_dest;
};
extern struct ip_globals ip_data;
#define IP_IS_ANY_TYPE_VAL(ipaddr) 0
#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr) 1
#define ip_current_dest_addr() (&ip_data.current_iphdr_dest)
struct ip_globals ip_data;
#define IPADDR_ANY ((u32_t)0x00000000UL)
#define ip4_addr_isany_val(addr1) ((addr1).addr == IPADDR_ANY)
#define ip4_addr_isany(addr1) ((addr1) == NULL || ip4_addr_isany_val(*(addr1)))
#define ip_addr_isany(ipaddr) ip4_addr_isany(ipaddr)
#define ip4_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr)
#define ip_addr_cmp(addr1, addr2) ip4_addr_cmp(addr1, addr2)
static u8_t
udp_input_local_match(struct udp_pcb *pcb
LwIP UDP部分常见函数精简
最新推荐文章于 2024-09-03 09:00:00 发布
本文简要介绍了LwIP轻量级TCP/IP协议栈中UDP协议的常用函数,包括创建UDP连接、发送数据、接收数据及关闭连接等核心操作。通过这些函数,开发者可以更好地理解和应用LwIP在UDP通信场景下的功能。
摘要由CSDN通过智能技术生成