LinuxQuestions.org
Help answer threads with 0 replies.
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 01-19-2009, 05:10 PM   #1
ycli
LQ Newbie
 
Registered: Jan 2009
Posts: 2

Rep: Reputation: 0
Question how to get tcp seq from skb


I am trying to write a kernel program which needs to get tcp's seq value from sk_buff struct (skb). I did it with the following code:

struct tcphdr * mytcphdr = (struct tcphdr *) tcp_hdr(skb);
if(mytcphdr)
{
unsigned long tcpseq = ntohl(mytcphdr->seq);
}

However, the tcpseq values obtained this way are incorrect (I got the true values from "wireshark" program). Please let me know where it is wrong with the code? Thank you very much in advance.

By the way, I am with kernel 2.6.27.


ycli
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
how to tcp seq from skb ycli Linux - Software 1 01-19-2009 05:22 PM
touch test{seq 10 10 1000)} lipun4u Programming 10 09-16-2008 04:41 PM
how to put an alphabet in seq command silverhand Programming 3 10-05-2007 03:57 PM
group the outgoing skb's into single skb and then send grouped skb. venkatesh111 Linux - Networking 0 04-27-2006 02:05 AM
snd-seq-oss problem CuteAndFluffy Linux - Hardware 1 01-16-2003 11:11 AM

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

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