Skip to contentSkip to conversation

How to send an IP packet from the kernel

DISCUSSION Dmytro Bablinyuk 3 participants 4 messages Dec 15, 2003 – Dec 16, 2003

lore
Share & tools
lore
#0 lore raw

I have a dstaddr, srcaddr and the actual data(payload). I need to load IP packet with data(payload) and send the packet out to the net through eth0 . How do I do this from the kernel?

Thank you

#1 lore raw

Good morning, Dmytro,

Quoted 4 lines · Dmytro Bablinyuk

I have a dstaddr, srcaddr and the actual data(payload). I need to load IP packet with data(payload) and send the packet out to the net through eth0 .
How do I do this from the kernel?

	Why not do it from userspace, with lots of available tools ( 

http://www.stearns.org/doc/pcap-apps.html ,
http://www.stearns.org/netreply )?
Cheers,
- Bill

---------------------------------------------------------------------------
"Vi has two modes; the one in which it beeps and the one in
which it doesn't."
-- Alan Cox
--------------------------------------------------------------------------
William Stearns ([email protected]). Mason, Buildkernel, freedups, p0f,
rsync-backup, ssh-keyinstall, dns-check, more at: http://www.stearns.org
Linux articles at: http://www.opensourcedigest.com
--------------------------------------------------------------------------

#2 lore raw
Quoted 10 lines
Quoted 5 lines

I have a dstaddr, srcaddr and the actual data(payload). I need to load IP packet with data(payload) and send the packet out to the net through eth0 . How do I do this from the kernel?

	Why not do it from userspace, with lots of available tools ( 

http://www.stearns.org/doc/pcap-apps.html , http://www.stearns.org/netreply )?

For reasons that the driver will do extra stuff on this data and this data not always will be/must be available to a user space app. Some data will be available only inside of the driver. No other processing out of the driver for that data is allowed.

#3 lore raw
Quoted 12 lines · Dmytro Bablinyuk
Quoted 7 lines
Quoted 6 lines

I have a dstaddr, srcaddr and the actual data(payload). I need to load IP packet with data(payload) and send the packet out to the net through eth0 .
How do I do this from the kernel?

Quoted 5 lines
	Why not do it from userspace, with lots of available tools ( 

http://www.stearns.org/doc/pcap-apps.html ,
http://www.stearns.org/netreply )?

Quoted 4 lines

For reasons that the driver will do extra stuff on this data and this data not always will be/must be available to a user space app. Some data will be available only inside of the driver. No other processing out of the driver for that data is allowed.

You trying to back door a driver or something? You might look at AFS
kernel modules. http://www.openafs.org. They do many things in the kernel, and i think that some IP communications is one of them. [But don't quote me]

js