Re: Reversed MAC lookup inside FreeBSD kernel?
From: Bruce M Simpson (bms_at_spc.org)
Date: 08/29/03
- Previous message: Khoa A. To: "Reversed MAC lookup inside FreeBSD kernel?"
- In reply to: Khoa A. To: "Reversed MAC lookup inside FreeBSD kernel?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Aug 2003 19:02:06 +0100 To: "Khoa A. To" <takhoa@rice.edu>
On Fri, Aug 29, 2003 at 11:17:16AM -0500, Khoa A. To wrote:
> I need to get a translation of MAC addresses to IP addresses in the kernel.
> I saw some postings about how to translate MAC to IP in the user level, but
> they seem to require the host to send a packet to that MAC address and some
> other ways that also require the host to actually send some request packets
> out. All my MAC-IP addresses are already set statically using "arp -s" in
> the ARP table. When I'm in the kernel, how do I get a hold of the ARP table
> and do some kind of reversed search to get the IP address out?
ARP information is held in the routing table.
Look at the output of netstat -arn and look for routes containing the L
flag (LLINFO). If you need to walk through the routing table, look at how
rtalloc() does it. 'struct rtentry' should be pretty self explanatory...
BMS
_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
- Previous message: Khoa A. To: "Reversed MAC lookup inside FreeBSD kernel?"
- In reply to: Khoa A. To: "Reversed MAC lookup inside FreeBSD kernel?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|