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 07-17-2008, 02:50 PM   #1
joblack
LQ Newbie
 
Registered: May 2008
Posts: 5

Rep: Reputation: 0
How to create an icmp request call in the kernel?


I'm experimenting with two experimental icmp messages.

I want to create an icmp_request in the kernel, but I have only found icmp replies (icmp_reply in icmp.c) and icmp error messages.

How can I create an icmp request without using external userspace programs (in fact I can't use the icmp_send function)? Does the icmp_reply function has some side effects?

My kernel is the 2.6.25.2 ...

Greetings and thanks
Tobias
 
Old 07-18-2008, 04:34 AM   #2
storkus
Member
 
Registered: Jun 2008
Location: Phoenix, Arizona, USA
Distribution: Slackware
Posts: 329

Rep: Reputation: 51
Wow, you're talking kernel programming, which is known to be something of a black art! Instead of Linux Questions, you should probably try places like:

www.kerneltrap.org Kernel news
www.osdever.net General kernel development
www.kernelnewbies.org Maybe t00 n00bish for you
www.linuxfoundation.org The authoritative source, but maybe not technical enough for you--I just skimmed it
www.linuxchix.org What it says. You might find something useful there...

There are undoubtedly more. In addition, talking to the people who develop the code you're trying to hook into is probably a really good idea as well.

Mike
 
Old 07-19-2008, 04:36 AM   #3
resetreset
Senior Member
 
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
i maybe completely wrong about all this, but from what i remember from a long time ago, you'd have to do that in userspace. icmp uses udp. linux itself has only the tcp/udp layer of things, anything else, your program would have to make up.
 
Old 07-19-2008, 11:48 AM   #4
joblack
LQ Newbie
 
Registered: May 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by resetreset View Post
i maybe completely wrong about all this, but from what i remember from a long time ago, you'd have to do that in userspace. icmp uses udp. linux itself has only the tcp/udp layer of things, anything else, your program would have to make up.
ICMP is a L4 layer protocol. It uses IP in the network layer (UDP is also a L4 layer protocol so you can't use it). In fact the kernel reacts to icmp requests and you can create icmp error messages as well.
 
Old 07-19-2008, 03:08 PM   #5
joblack
LQ Newbie
 
Registered: May 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Talking

Quote:
Originally Posted by storkus View Post
Wow, you're talking kernel programming, which is known to be something of a black art! Instead of Linux Questions, you should probably try places like:

www.kerneltrap.org Kernel news
www.osdever.net General kernel development
www.kernelnewbies.org Maybe t00 n00bish for you
www.linuxfoundation.org The authoritative source, but maybe not technical enough for you--I just skimmed it
www.linuxchix.org What it says. You might find something useful there...

There are undoubtedly more. In addition, talking to the people who develop the code you're trying to hook into is probably a really good idea as well.

Mike
Thanks for the links.

There is no function for that. I have to adjust the icmp_send function for it.

Well as far as I see it kernel development is not a black art. It depends on your frustration threshold. The source code is fine but there is not enough documentation / comments included. The result is that you have to crawl through the code to get what they are doing.

I would need a black arts teacher .. if you know any?
 
Old 07-24-2008, 08:18 AM   #6
storkus
Member
 
Registered: Jun 2008
Location: Phoenix, Arizona, USA
Distribution: Slackware
Posts: 329

Rep: Reputation: 51
LOL, no I don't! I may be looking for one myself next year as I intend to go back to school. I'm not sure yet exactly what I'll be doing (net admin maybe?) but I'd love to be able to learn kernel hacking.

BTW, I just looked at the comments between your reply and mine: I thought ICMP was its own Layer 4 protocol alongside UDP and TCP and above IP? (At least for IPv4--I haven't remotely begun to study IPv6 yet!)

Mike

Last edited by storkus; 07-24-2008 at 08:20 AM.
 
Old 07-25-2008, 05:37 AM   #7
joblack
LQ Newbie
 
Registered: May 2008
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by storkus View Post
LOL, no I don't! I may be looking for one myself next year as I intend to go back to school. I'm not sure yet exactly what I'll be doing (net admin maybe?) but I'd love to be able to learn kernel hacking.

BTW, I just looked at the comments between your reply and mine: I thought ICMP was its own Layer 4 protocol alongside UDP and TCP and above IP? (At least for IPv4--I haven't remotely begun to study IPv6 yet!)

Mike
Yes, itīs an own L4 protocol, but still depends on IPv4. I think it works the same way with IPv6, but I havenīt checked that out yet.

If youīre intested in networking read the books from OīReilly 'Internet Core Protocols' and every book about the kernel code you can get. After a while itīs fun to see how the system really works.
 
  


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
issues reg ICMP timestamp and address mask request bzlaskar Linux - Networking 0 09-12-2007 12:13 AM
what is a ICMP echo request? tjyorkshire Linux - Networking 4 07-03-2007 11:12 AM
tracing 'create' system call called by any process to kernel viv_nan Linux - General 3 03-07-2007 11:09 AM
how to drop incomming icmp request sunlinux Linux - Networking 5 12-01-2006 06:26 AM

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

All times are GMT -5. The time now is 04:45 PM.

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