0

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 值而编写的。使用原始套接字。

4

1 回答 1

0

看起来 iphrd 结构尚未在任何地方定义。是iphdr的错字吗?您的问题看起来没有名为 iphrd 的结构...

于 2012-02-05T17:42:36.337 回答