LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-09-2017, 06:31 AM   #1
Welloworld
LQ Newbie
 
Registered: Oct 2017
Posts: 2

Rep: Reputation: Disabled
C - Trying to sniff ARP packets through a kernel module with Netfilter


In order to complete my project I have to sniff ARP packets and then do some statistics on them. I'm using netfilter nf_hook_ops to capture only ARP data as follow:

Code:
nfho is the nf_hook_ops
nfho.hook = arp_filter;
nfho.hooknum = NF_ARP_IN;
nfho.pf = PF_ARP;
nf_register_hook(&nfho);
And the code runs and inside arp_filter I am printing something but that's never happens because of some reason I don't know. Also to be sure, I sniffed with wireshark when I first inserted the module to the kernel and I saw that I do get some ARP packets. Please help me! Thanks.
 
Old 10-18-2017, 02:32 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,505
Blog Entries: 6

Rep: Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421Reputation: 2421
Please see the Site FAQ for guidance asking a complete question. Especially read the linked page, How to ask questions the smart way.

You have not provided any information useful to those willing to help. Please try to reduce your code to a minimal but complete example which demonstrates your difficulty. Often, while doing that you will also find a the error and a solution.

When asking for help always try to provide such a minimal example of what you are trying to accomplish, along with any resulting error messages that will allow others reproduce and understand the problem.
 
  


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
Hi to Linux Kernel Module programming using netfilter kalloc LinuxQuestions.org Member Intro 1 02-28-2011 09:41 AM
dsniff cannot sniff packets bzlaskar Linux - Security 2 08-16-2007 02:36 AM
Ability to sniff, process and drop packets kidskc Linux - Networking 1 08-18-2005 02:40 AM
Can't sniff packets using libpcap masterm Linux - Networking 0 05-17-2005 06:58 PM
netfilter/iptables in kernel: module vs static -Nw- neX Linux - Security 5 03-25-2005 07:44 PM

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

All times are GMT -5. The time now is 03:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration