Libpcap wrapper

Ethernet packet injections

Hi!

I've a small piece of code that use for injection and dumping of packets on an Ethernet link.

I'm using inject(byte[] buf) to send packets through the link, and everything is running smoothly except for this issue.

For what I can see, the problems arises with the speed of injection of the packets, meaning that
injecting the packets too fast is generating an increment errors that goes unreported (inject() doesn't return -1)

In fact, when inserting a Thread.sleep() in this method, the errors go away. But this approach inserts a latency, is
architecture dependent and is very inaccurate. I'm monitoring the outgoing traffic on wireshark. Without the sleep() call,
some packets disappear on the capture.

The questions are:

- Is there a way to check in advance if the interface is ready for injection?
- Is always ready for injection? (I think not)

Thanks in advance

On Android: "socket: Operation not permitted"

libjnetpcap.so is build by NDK.
In java code :
Pcap pcap = Pcap.openLive("ppp0", snaplen, flags, timeout, errbuf);

The exception will occur: "Error while opening device for capture: socket: Operation not permitted".

Who can help me?? I lost myself!!(the log file and so is attachments.)

My handset is Motorola DroidX(ME811), Android2.2.2
Yes it is rooted by me.

my email is lbonus@163.com.
Thanks a lot!!!