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 10-14-2010, 09:22 PM   #1
Washington Ratso
LQ Newbie
 
Registered: Sep 2010
Posts: 27

Rep: Reputation: 0
Problem getting layer 4 port numbers with libnetfilter_conntrack


I am using libnetfilter_conntrack and trying to get the layer 4 source
and destination port numbers for a connection.

source_ptr = (uint16_t *)nfct_get_attr(conntrack_p, ATTR_ORIG_PORT_SRC);

dest_ptr = (uint16_t *)nfct_get_attr(conntrack_p, ATTR_ORIG_PORT_DST);

In both cases, the address returned by nfct_get_attr is NULL because
"no data available" (errno=61).

There is a valid connection. I am able to get the source and
destination IP addresses.

Why can't I get the layer 4 source and destination ports? Is there
another way to do it? Am I using the wrong attribute in the call to
nfct_get_attr?
 
Old 10-16-2010, 08:39 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


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
Device Driver -- Port numbers ashok449 Linux - Kernel 1 01-04-2008 09:35 PM
Port numbers? diegoandresalvarez Linux - Newbie 2 11-21-2007 07:23 AM
Where are printer port numbers?!? mentalken Linux - Hardware 3 01-27-2005 08:10 PM
need help with port numbers. GEEF Linux - Networking 2 11-08-2004 07:07 PM
how do we find outbound port numbers mahanare Linux - Security 1 10-05-2004 12:32 PM

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

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