Hiya,
I am running some network simulation under Redhat9.0 with tun.c
ver1.5.
I opened 6 vitual tun devices under /net/dev/tun1~6.
Because of simulation request, I need to know which tun device has
packets in its output queue (buffer) waiting to be sent. How can I get
this information by writing a function in tun.c. I know how to do
under FreeBSD tun device as following:
j = 0;
for (i=0; i<=6; i++) {
if (tunctl[i].tun_if.if_snd.ifq_len > 0)
ThisTunHasPacketInQueue[j++] = i;
}
return(j);
But how can I do the same job under Linux? Thanks
Calvin
|