void parse_message(char *buffer, int len) {
struct iphrd *ip_header = (struct iphrd *)buffer;
int recv_hopcount = (unsigned int)(ip_header->ttl);
//hops[recv_hopcount]++;
}
错误:取消引用指向不完整类型的指针
我在头文件中包含了 netinet/ip.h。上面的代码是为了访问 IP 头中包含的 ttl 值而编写的。使用原始套接字。