LinuxQuestions.org
Visit Jeremy's Blog.
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 08-29-2017, 08:06 PM   #16
bayarealad
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Rep: Reputation: Disabled

Hi Ikshudm, I linked libnl using -lnl in gcc command line. However I still do not know how to parse the message and extract ip address, mac address, device name, state of arp entry. Please let me know ASAP if you have figured it out. I look forward to hearing from you.
 
Old 08-30-2017, 05:50 AM   #17
bayarealad
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Rep: Reputation: Disabled
Hi Ikshudm, I am able to receive the events when arp is added or deleted. Also nl_object_dump does print the arp entry.

Hi Ikshudm/rigor, However I still do not know how to parse and extract ip address, mac address, device, state of the arp entry from the netlink message. Please let me know if you have any information about that.
 
Old 08-31-2017, 07:55 PM   #18
bayarealad
LQ Newbie
 
Registered: Aug 2017
Posts: 8

Rep: Reputation: Disabled
Hi, I am able to successfully parse the netlink message. Is there a way to know if the arp update I received is due to arp add, or arp delete or arp replace ?
 
Old 09-01-2017, 01:11 AM   #19
justmy2cents
Member
 
Registered: May 2017
Location: U.S.
Distribution: Un*x
Posts: 237
Blog Entries: 2

Rep: Reputation: Disabled
Theres a tool called Arpwatch which keep track of ethernet/ip address pairings. It syslogs activity and reports certain changes via email. Arpwatch uses pcap to listen for arp packets on a local ethernet interface..

Last edited by justmy2cents; 09-01-2017 at 01:13 AM.
 
Old 11-10-2020, 10:04 AM   #20
shadowsong
LQ Newbie
 
Registered: Nov 2020
Posts: 2

Rep: Reputation: Disabled
Talking can not got all the ARPS

hi rigor,
I compile you code, and can be run. But this is a problem that it can not got all the arp.
and I found the code:

rtatp = ( struct rtattr * ) IFA_RTA( rtmp ) ;
rtattrlen = IFA_PAYLOAD( nlmp ) ;

is not right!

I modity to:
#define _IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
#define _IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))

rtatp = ( struct rtattr * ) _IFA_RTA( rtmp ) ;
rtattrlen = _IFA_PAYLOAD( nlmp ) ;

and it is good to get most all ARPS
 
  


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
ARP table or routing table consulted first? YaMaHaBoB Linux - Networking 4 07-15-2011 04:56 PM
a question about netlink socket? b0207191 Linux - Kernel 0 12-16-2010 08:56 PM
netlink socket 91change Linux - Newbie 1 07-09-2009 10:38 AM
NETLINK SOCKET Error thegreatest Programming 2 12-14-2005 11:06 PM
How to create an proxyarp entry in arp table by using arp command? himalayas Linux - Networking 0 06-04-2003 04:14 AM

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

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