View topic - Using raw socket with io-pkt in 6.4

Using raw socket with io-pkt in 6.4

anything that doesn't fit to other groups.

Using raw socket with io-pkt in 6.4

Postby yjiangw » Sat Mar 20, 2010 9:49 am

Hello,

I am trying to use raw socket with io-pkt in qnx 6.4, does any one know how to bind the socket to the specific interface? for example in linux we can use the "sll_ifindex" field in the structure "sockaddr_ll" for the bind() api to bind the socket to the specific interface, how do we do this in qnx? I can't find any document about doing this in qnx. Does any one know the qnx way?

Thanks in advance for your help!
Yong

example in linux:
int send_packet(struct interface_info *iff)
{
int ssock_fd;
int numc, len;
struct sockaddr_ll send_info;

/* PF_PACKET requires generic sockaddr_ll structure */

memset(&send_info, 0, sizeof(send_info));
send_info.sll_family = AF_PACKET;
send_info.sll_ifindex = iff->ifindex;

/* ... omitted... */

ssock_fd = socket(PF_PACKET, SOCK_RAW, 0);

if (bind(ssock_fd, (struct sockaddr *)&send_info, len) < 0) {
yjiangw
New Member
 
Posts: 6
Joined: Wed Apr 02, 2008 8:32 pm

Return to General Programming

Who is online

Users browsing this forum: No registered users and 2 guests