[英]Jpcap: IP packet header length
In JPCap i obtain the header length of the IP packet by the following code 在JPCap中,我通过以下代码获得IP数据包的标头长度
IPPacket IP_pac = (IPPacket) packet;
System.out.println(IP_pac.len); // header length
i obtain the data length of the IP packet by 我通过以下方式获取IP数据包的数据长度
System.out.println(IP_pac.data.length);
Now the problem is that the IP packet(IPV4) length should b 20 bytes when the data length of the IP packet is 0.but the results display the header length of the IP packet as 60 and 54. Secondly, do i consider these lengths of IP_pac.data.length as bytes by default? 现在的问题是,当IP数据包的数据长度为0时,IP数据包(IPV4)的长度应为b 20个字节。但是结果显示IP数据包的标头长度为60和54。第二,我是否考虑了这些长度IP_pac.data.length默认为字节数?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.