LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-23-2004, 10:21 AM   #1
mprabhu
LQ Newbie
 
Registered: Jul 2004
Location: bangalore
Posts: 2

Rep: Reputation: 0
Question catch the tcp header for modification from the kernel


hi,
i am using the debian linux and am working on the 2.6.6 kernel.
i want to access the tcp header, modify it (by passing it through my function) and then
put it back for the regular flow to continue.
can somebody tell me where i can access TCP header....
this is what i think is right

1.will using (struct sk_buff*)skb->h.th be sufficient
2.using hook to divert the regular flow.
3.passing it to my function.
4.putting it back.

am i right???

the other question is i tried writing a small module with the init and exit
fucntions for the module. It complies correctly...but when i do a

insmod module.o....i get an error saying -1 invalid module format.

Is this because the module is not complied as module.ko???

thanx in advance,
 
Old 07-23-2004, 11:17 AM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
i think just use a raw socket
SOCK_RAW
and forget the kernel altogether
 
Old 07-24-2004, 04:46 AM   #3
mprabhu
LQ Newbie
 
Registered: Jul 2004
Location: bangalore
Posts: 2

Original Poster
Rep: Reputation: 0
If i am writing my own program in the user space then it can think of using the raw sockets.
what i am looking at is ......

all TCP packets(from http application etc) passing through the transport layer are to be tracked in the stack. My modified header is to be added to it instead of the regular header and only then the packet flows down the stack.

raw sockets may not be relevant here...may be i have to pass through the kernel...
hope you can suggest something else....
thanx
 
  


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
finding out TCP header details at socket level hari121 Linux - Networking 0 10-25-2005 01:54 AM
TCP header checksum live_dont_exist Programming 16 04-13-2005 12:45 PM
Kernel 2.4.26 / xfsprogs 2.6.x - Catch 22 KDoc Linux - Software 0 08-11-2004 10:04 AM
TCP code modification enjoyzj Linux - Networking 2 04-23-2004 06:43 PM
modification in tcp code vishal-isro Programming 2 12-23-2002 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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