我在 DPDK 应用程序中使用 pcap_pmd,它不会packet_type
自动设置字段。从接口接收到数据包后,如何确定正确的数据包类型?
编辑:以太网头结构:
/**
* Ethernet header: Contains the destination address, source address
* and frame type.
*/
struct ether_hdr {
struct ether_addr d_addr; /**< Destination address. */
struct ether_addr s_addr; /**< Source address. */
uint16_t ether_type; /**< Frame type. */
} __attribute__((__packed__));
没有给出在哪里搜索 L3 协议标识符的线索。