Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Raw Socket support in IO-PKT: (8 Items)
   
Raw Socket support in IO-PKT  
HI All,

Is Raw socket supported in Io-Pkt . If yes, is the procedure to open raw socket same as Netbsd socket types. Please 
point me some sample program to open raw socket in QNX Io-Pkt.

Thanks,
Re: Raw Socket support in IO-PKT  
On Mon, Mar 23, 2009 at 11:06:06PM -0400, sathish kumar wrote:
> HI All,
> 
> Is Raw socket supported in Io-Pkt . If yes, is the procedure to open raw socket same as Netbsd socket types. Please 
point me some sample program to open raw socket in QNX Io-Pkt.

Yes they're supported and the same as NetBSD. Please see the
'ping' and 'traceroute' utilities for examples.

-seanb
Re: Raw Socket support in IO-PKT  
Hi ,
The raw socket used in Ping and traceroute utilities send IP packets as a whole without data link level headers. My 
requirement is to give the entire packet including the data link level headers, ip header and other headers/data. Can i 
use SOCK_PACKET socket type for this in QNX. Please advise.
Re: Raw Socket support in IO-PKT  
On Fri, Mar 27, 2009 at 06:41:41AM -0400, sathish kumar wrote:
> Hi ,
> The raw socket used in Ping and traceroute utilities send IP packets as a whole without data link level headers. My 
requirement is to give the entire packet including the data link level headers, ip header and other headers/data. Can i 
use SOCK_PACKET socket type for this in QNX. Please advise.

We've no SOCK_PACKET.  To do what you describe BPF would have to
be used.

Regards,

-seanb
Re: Raw Socket support in IO-PKT  
Hi,

Can i send and receive raw ethernet packets using BPF??

Thanks,
Re: Raw Socket support in IO-PKT  
On Tue, Mar 31, 2009 at 05:04:20AM -0400, sathish kumar wrote:
> Hi,
> 
> Can i send and receive raw ethernet packets using BPF??

Yes.  Please see tcpdump for an example of receiving them.
For sending you always need to leave space for the ethernet
header which by default will be filled in for you.  If you
want to pre-fill it and send it out as is the BIOCSHDRCMPLT
ioctl must be used on the bpf descriptor.

-seanb
Re: Raw Socket support in IO-PKT  
> On Tue, Mar 31, 2009 at 05:04:20AM -0400, sathish kumar wrote:
> > Hi,
> > 
> > Can i send and receive raw ethernet packets using BPF??
> 
> Yes.  Please see tcpdump for an example of receiving them.
> For sending you always need to leave space for the ethernet
> header which by default will be filled in for you.  If you
> want to pre-fill it and send it out as is the BIOCSHDRCMPLT
> ioctl must be used on the bpf descriptor.

Slight clarification.  By default the ethernet destination
address and ether type is always taken from the header you
provide and the source it taken from the interface you're
sending on.  If BIOCSHDRCMPLT is used the source is also
taken from the header you provide.

-seanb
RE: Raw Socket support in IO-PKT  
There's also example code here:

http://community.qnx.com/sf/go/projects.networking/discussion.general.to
pc6288

(See my post just before the last one which contains icmp.c) 


   R.

-----Original Message-----
From: Sean Boudreau [mailto:community-noreply@qnx.com] 
Sent: Tuesday, March 31, 2009 10:09 AM
To: drivers-networking
Subject: Re: Raw Socket support in IO-PKT

> On Tue, Mar 31, 2009 at 05:04:20AM -0400, sathish kumar wrote:
> > Hi,
> > 
> > Can i send and receive raw ethernet packets using BPF??
> 
> Yes.  Please see tcpdump for an example of receiving them.
> For sending you always need to leave space for the ethernet header 
> which by default will be filled in for you.  If you want to pre-fill 
> it and send it out as is the BIOCSHDRCMPLT ioctl must be used on the 
> bpf descriptor.

Slight clarification.  By default the ethernet destination address and
ether type is always taken from the header you provide and the source it
taken from the interface you're sending on.  If BIOCSHDRCMPLT is used
the source is also taken from the header you provide.

-seanb

_______________________________________________
Networking Drivers
http://community.qnx.com/sf/go/post25648