LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2005, 08:27 AM   #1
linux_lover2005
Member
 
Registered: Dec 2004
Posts: 44

Rep: Reputation: 15
access IP header in packet


hello,
Does skbuffs provide facility to access other layers headers at any layer? I want to access IP addresses(SRC & DST) of packets is readable at Link layer that mean before IP header is removed from skbuff packet structure? I am doing this in kernel source code.
 
Old 04-10-2005, 09:59 AM   #2
live_dont_exist
Member
 
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257

Rep: Reputation: 30
hey mate,
I believe u should find your answer in the structures listed in /usr/include/netinet/ip.h..if I am not mistaken .It either ip.h or ipv4.h..You hve the entire structure of the IP headers there which you can actually manipulate to suit your code. Is this what you are referring to?..please post back if understanding is incorrect.
thnx
Arvind
 
Old 04-10-2005, 09:15 PM   #3
linux_lover2005
Member
 
Registered: Dec 2004
Posts: 44

Original Poster
Rep: Reputation: 15
hello,
There is no problem to include those header files in source program that contains the headers structures. What i want in linux kernel source of network stack is that to access IP header fields before that header is removed. Remember i want to access skbuff structure's field ip header before ip header is removed.
 
Old 04-11-2005, 01:02 AM   #4
alred
Member
 
Registered: Mar 2005
Location: singapore
Distribution: puppy and Ubuntu and ... erh ... redhat(sort of) :( ... + the venerable bsd and solaris ^_^
Posts: 658
Blog Entries: 8

Rep: Reputation: 31
might be from nh

there is a similar problem in somewhere else
below are links to the question and reply showing IP addresses in their code :

problems :
http://mail.nl.linux.org/kernelnewbi.../msg00054.html

reply :
http://mail.nl.linux.org/kernelnewbi.../msg00077.html

just for extra reference :
http://gnumonks.org/ftp/pub/doc/skb-doc.html

is it the skbuff that you mentioned ?
never try skbuff before but looks interesting and really hopes these can help you



regards

Last edited by alred; 04-11-2005 at 01:14 AM.
 
  


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
Packet Filter to redirect a packet to a user level process akawale Linux - Networking 3 09-01-2006 12:06 PM
how do i read the data in the packet that i have captured after packet capture? gajaykrishnan Programming 23 04-19-2006 05:09 AM
does each header fields in packet sent on network uses htons? b123coder Programming 3 04-06-2005 08:36 AM
How to get the IP header of packet going through an interface thanh Programming 1 06-12-2004 12:26 PM
Edit packet header? mudvayne Linux - Networking 4 03-28-2003 01:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:59 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