Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 08-17-2017, 05:38 AM   #1
LQ Newbie
Registered: Aug 2016
Posts: 12

Rep: Reputation: Disabled
Difference between netdev_rx_handler_register() and dev_add_pack()

Can any one explain what is the difference between netdev_rx_handler_register() and dev_add_pack() as both of these two APIs are used to register the handler to handle the received packets??

where and in which context I should used which one??

Thanks in Advance!!
Old 08-18-2017, 05:19 PM   #2
Senior Member
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
iirc netdev_rx_handler_register is registering to handle incoming packets on a specific network device and dev_add_pack() puts the handler in the chain of handlers for the passed in protocol type.

So if you wanted to look at all the incoming on say eth0 then use netdev_rx_handler_register, if you are looking for say udp packets and you don't care what device it's coming from use dev_add_pack
1 members found this post helpful.
Old 08-21-2017, 06:46 AM   #3
LQ Newbie
Registered: Aug 2016
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thnaks estabroo for your kind response.


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
LXer: Making a Difference; Selling a Difference LXer Syndicated Linux News 0 09-23-2010 06:00 AM
shell script to find the difference betwwn two file and place the difference to other kittunot4u Linux - General 3 07-19-2010 05:26 AM
Usage of dev_add_pack() for writing a sniffer application gauravholey Linux - Kernel 2 07-26-2009 05:38 AM
What is the difference between the two? YESnewbie2linux SUSE / openSUSE 4 02-12-2007 07:45 AM
Difference? Jongi Linux - Newbie 4 08-22-2003 03:21 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration