简体   繁体   English

libnet无法写入ip数据包

[英]libnet fails to write ip packets

I'm using a program using libnet, and every time I use it, libnet fails to send any packets. 我正在使用使用libnet的程序,并且每次使用libnet时,它都无法发送任何数据包。

Specifically, the function that fails is : libnet_write_ip. 具体来说,失败的函数是:libnet_write_ip。 It returns -1 on every call. 每次调用返回-1。

Any ideas what may cause that ? 任何想法可能会导致什么? I'm on Mac OS X 10.6.4 我在Mac OS X 10.6.4上

Thanks so much in advance ! 提前非常感谢!

Add the following line after the call to libnet_write_ip. 在调用libnet_write_ip之后添加以下行。 Hopefully, the system itself will tell you what is the cause of the function failure. 希望系统本身会告诉您功能故障的原因。

perror("libnet_write_ip");

According to the libnet manual, the libnet_write_* functions are for internal use only. 根据libnet手册,libnet_write_ *函数仅供内部使用。 What you need to use is libnet_write(). 您需要使用的是libnet_write()。 This function will write your packets after you've called your libnet_build_* functions. 调用libnet_build_ *函数后,此函数将写入数据包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM