Re: Reversed MAC lookup inside FreeBSD kernel?

From: Bruce M Simpson (bms_at_spc.org)
Date: 08/29/03

  • Next message: Danny Horne: "Re: IPv6 headaches"
    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"


  • Next message: Danny Horne: "Re: IPv6 headaches"

    Relevant Pages

    • Re: Manually controlling ARP requests
      ... > the arp cache prior to querying; the other thing I found was some source ... > address, and the program either retrieves the MAC from cache, or instructs ... > the kernel to send an ARP query and serves the result back through my ...
      (comp.os.linux.development.system)
    • Reversed MAC lookup inside FreeBSD kernel?
      ... and don't understand the structure of ARP table very ... I need to get a translation of MAC addresses to IP addresses in the kernel. ... other ways that also require the host to actually send some request packets ...
      (freebsd-net)
    • Re: ARP Spoofing
      ... kernel such as in the tcp/ip layer or in the ethernet driver itself. ... You can use static arp entries on all the involved hosts/routers, to hardwire a MAC-address to an IP-address. ... Such static arp entries will not be overridden by incoming arp replies and will ensure that outgoing IP packets are sent to the right mac address. ...
      (freebsd-hackers)
    • Re: problem installing YDL Yellow Dog Linux on Oldworld Mac
      ... > I rebooted into OS 9.2.1 and inserted the first YDL CD. ... > presume, the kernel loaded. ... > Any suggestions for getting this install to work would be appreciated. ... I'm not a Mac pro, but the below is how I got my ...
      (comp.os.linux.powerpc)
    • Re: New Patch Fixes 43 Flaws In OS X, Many Serious
      ... one used for security checks. ... As compared to windows, UNIX has an excellent track record. ... Mac OS X would then become higher ... So it is with any kernel, ...
      (comp.sys.mac.advocacy)