Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - ioctl-BIOCSETF for bpf filter in QNX 6.3.0: (3 Items)
   
ioctl-BIOCSETF for bpf filter in QNX 6.3.0  
In QNX version 6.3.0 SP 1 with External Networking TDK for ppc target we are trying to use bpf filter for receiving 
packets. The ioctl operation with BIOCSETF and BIOCIMMEDIATE gives an error. Following are the steps we are following 
and status what we get.

1. open(BPF_DEVICE, O_RDONLY, 0) - success
2. ioctl(iHdl, BIOCSBLEN, &iPktLen) - success
3. ioctl(iHdl, BIOCSETIF, &stIfr) - en0 - success
4. ioctl(iHdl, BIOCIMMEDIATE, &ciImmediate ) - Error - Inappropriate I/O control operation
5. ioctl(iHdl, BIOCSETF, &bpf_program) - Error -> Invalid Argument

We have loaded nfm-bpf.so and also without executing step 4 & 5 we are able to receive packets. This gives us all kind 
of packets on the network. 
Re: ioctl-BIOCSETF for bpf filter in QNX 6.3.0  
First, try using ioctl_socket() from the socket library first and see if 
that makes a difference.

Which driver are you using?

/P

Ashwin Patwekar wrote:
> In QNX version 6.3.0 SP 1 with External Networking TDK for ppc target we are trying to use bpf filter for receiving 
packets. The ioctl operation with BIOCSETF and BIOCIMMEDIATE gives an error. Following are the steps we are following 
and status what we get.
>
> 1. open(BPF_DEVICE, O_RDONLY, 0) - success
> 2. ioctl(iHdl, BIOCSBLEN, &iPktLen) - success
> 3. ioctl(iHdl, BIOCSETIF, &stIfr) - en0 - success
> 4. ioctl(iHdl, BIOCIMMEDIATE, &ciImmediate ) - Error - Inappropriate I/O control operation
> 5. ioctl(iHdl, BIOCSETF, &bpf_program) - Error -> 
Invalid Argument
>
> We have loaded nfm-bpf.so and also without executing step 4 & 5 we are able to receive packets. This gives us all kind of packets on the network. 
>
>
>
> _______________________________________________
>
> Networking Drivers
> http://community.qnx.com/sf/go/post41396
>
>   
Re: ioctl-BIOCSETF for bpf filter in QNX 6.3.0  
Sorry, that's my io-net ignorance... :-)

There is no ioctl_socket() in 6.3. But you can look at 6.4.0 io-pkt's 
lib socket implementation to see how to send a message with embedded 
pointers. There's a special case for two bpf ioctl commands in there - 
BIOCSETF and BIOCGDLTLIST, of which you're using the first so it might 
impact you.

And it doesn't really matter what driver you use since in io-net the 
driver isn't really involved in bpf.

/P