Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Raw Sockets QNX: (8 Items)
   
Raw Sockets QNX  
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
Re: Raw Sockets QNX  
On 07/05/10 09:03 AM, Pedro Silva wrote:
> 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).
>
>    
Try using BPF instead.

Good luck, and please share your results if you can!
/P

> 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
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post53748
>
>    
Re: Raw Sockets QNX  
I'm sorry for the ignorance, but where you suggest to start to make this using BPF.
What syscalls I have to use?

Pedro Silva
Re: Raw Sockets QNX  
Try this reference...

bpf ioctl reference (BSD) - http://www.gsp.com/cgi-bin/man.cgi?section=4&topic=bpf

QNX stack is netBSD (not feeeBSD)  but the details are pretty much the same.
Re: Raw Sockets QNX  
BPF is Berkley Packet Filter and it's a well known interface in the UNIX 
world.

Have a look around our wiki here, e.g.:
http://community.qnx.com/sf/wiki/do/viewPage/projects.networking/wiki/Filtering_wiki_page

There are also lots of resources online about it, e.g.:
http://www.rawether.net/support/bpfhelp.htm
http://www.tcpdump.org/papers/bpf-usenix93.pdf
http://netbsd.gw.com/cgi-bin/man-cgi?bpf
http://canmore.annwfn.net/howtos/bpf/

You essentially use regular file operations open/read/write() on the bpf 
device, and ioctl_socket() to configure it. Which QNX version are you using?

Cheers!
/P

On 07/05/10 09:25 AM, Pedro Silva wrote:
> I'm sorry for the ignorance, but where you suggest to start to make this using BPF.
> What syscalls I have to use?
>
> Pedro Silva
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post53755
>
>    
Re: Raw Sockets QNX  
Thanks. I will read your suggestions...
I'm using QNX Neutrino 6.4.1.

Pedro
Re: Raw Sockets QNX  
Hi Pedro,

raw sockets are available for IPv6.

Have a look to: 
http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/lib_ref/i/inet6_proto.html

--Armin

http://www.steinhoff-automation.com



Pedro Silva wrote:
> 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
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post53748
>
>
>   
Re: Raw Sockets QNX  
Hi,

did you look into 
/home/_QNX-trunk_network6.4.1/lib/io-pkt/dist/wpa/hostapd ?
May be you can find here an answer for question ...

--Armin




Pedro Silva wrote:
> 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
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post53748
>
>
>