Raw sockets QNX 6.4.1

Hi for all!
I’m making an assessment about the temporal behavior of the standard Protocol Stacks of different operating systems and I’m trying to send Ethernet Raw packets in the QNX Netrino OS. I want send only the most basic packet:
destination MAC (6 bytes) + source MAC (6 bytes) + Ethernet Type (2 bytes) + Payload (46 to 1500 bytes).

In other versions of Linux (eg Ubuntu) I use:

SocketFD = socket(AF_PACKET,SOCK_RAW,htons(ETH_P_ALL));

and I pass the sockaddr_ll struct to the sendto syscall. But on QNX I don’t know what domain and protocol I have to use on socket syscall neither what is the struct that I have to pass to the sendto syscall.

Can you help me with this please?
Thanks in advance!
Pedro Silva

Check out BPF / libpcap. They’re the ‘BSD’ way to
implement AF_PACKET.


Where I can find this information?
I checked the canmore.annwfn.net/howtos/bpf/ webpage, which is very good, but I still had very problems because I’m not comfortable with the BPF interface.

When I try to change the length of the buffer to where the read call will store my packet (e.g. 1500 bytes), with the

if ( ioctl(buf, BIOCSBLEN, 1500) == -1) {

I get a error “BIOCSBLEN: Bad Address”.

I really need help to handle with this…
Thanks in advance for all!

Any help?

I solved the BIOCSBLEN question…

[size=75]int bufsize = PACKET_SIZE;
if ( ioctl(buf, BIOCSBLEN, &bufsize ) == -1) {