View topic - Raw sockets QNX 6.4.1
Raw sockets QNX 6.4.1
5 posts
• Page 1 of 1
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:
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
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:
- Code: Select all
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
- psns
- New Member
- Posts: 4
- Joined: Mon May 10, 2010 10:22 am
Where I can find this information?
I checked the http://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) {
perror("BIOCSBLEN");
}
I get a error "BIOCSBLEN: Bad Address".
I really need help to handle with this...
Thanks in advance for all!
I checked the http://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) {
perror("BIOCSBLEN");
}
I get a error "BIOCSBLEN: Bad Address".
I really need help to handle with this...
Thanks in advance for all!
- psns
- New Member
- Posts: 4
- Joined: Mon May 10, 2010 10:22 am
5 posts
• Page 1 of 1
Return to Realtime and Embedded
Who is online
Users browsing this forum: No registered users and 2 guests