LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-27-2010, 12:05 PM   #1
coreykasten
LQ Newbie
 
Registered: Aug 2010
Posts: 1

Rep: Reputation: 0
Send/Receive multiple raw packets in one system call


Hello all,

I need to receive a number of raw ethernet packets (say, 100 packets) into a user-mode accessible buffer large enough to hold all the packets. The way I have done this so far is by looping over the recvfrom() system call 100 times, passing an incremented pointer addressing the location in my buffer to store the packet.

Is there a way to receive the 100 packets into my buffer with one system call, perhaps by instructing the kernel to DMA the 100 packets into my buffer?

Thanks in advance!

Corey
 
Old 08-29-2010, 11:52 AM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
Without modifying the kernel, AFAIK no. The socket API is designed under the assumption that you either receive data (then one read() may get data from many packets) or packets one by one.

You can think about writing a syscall that will internally loop and perform more recv() operations.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring Mutt to receive and send from multiple accounts. glore2002 Debian 1 10-23-2009 03:20 AM
Not able to send/receive the data packets through my own Ethernet driver b/w 2 pc jagadisha_bs Linux - Newbie 5 02-26-2009 12:31 AM
Iptables not allowing raw sockets to send IP packets with non local IP vakulgarg Linux - Networking 0 11-09-2007 02:13 AM
FC3 cannot receive any packets from internet, can only send ben_build#2.1.0 Fedora 1 01-15-2005 03:09 PM
is there a system call to send process to run in the background? feetyouwell Programming 4 10-01-2004 04:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration