程序中使用的ARP [英] Programmatic use of ARP

查看:164
本文介绍了程序中使用的ARP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一些C或C ++ code,Linux下编译,以便能够采取远程主机计算机的一些任意数目的IP地址的列表,并获得一个以太网MAC地址作为每一个。这些主机上可能是在同一个子网或他们可能是在路由器后面的不同的子网。其确定,如果部分或全部远程主机的MAC地址是路由器的接口的地址。最后,我想手头宽裕的IP地址和MAC地址,谁将会使用这些信息来格式化,并通过以太网发送UDP / IP数据包的主机的FPGA。显然,FPGA也将得到自己的MAC地址和IP地址源,以填补MAC和源IP地址的数据包。

I have a need for some C or C++ code, compilable under Linux, to be able to take a list of IP addresses of some arbitrary number of remote hosts machines and obtain a ethernet MAC address for each one. These host machines may be on the same subnet or they could be on a different subnet behind a router. Its OK if the MAC address of some or all of the remote hosts is the address of the interface on the router. Ultimately, I want to hand off the IP address and MAC address to an FPGA who will use these pieces of information to format and send UDP/IP packets over ethernet to the hosts. Obviously, the FPGA will also be given its own MAC address and IP address to fill in the source MAC and source IP addresses in the packets.

有一些code我可以指出,可以创建和广播ARP报文,这些远程机器和接收返回的ARP响应数据包,这样的目的MAC地址可以提取?

Is there some code I can be pointed to that can create and broadcast ARP packets to these remote machines and receive back the ARP response packets such that the destination MAC addresses can be extracted?

推荐答案

我建议寻找到的arping这是做一个有点相同的作业。它采用IP和MAC和试图获得额外的信息详细信息。或甫一坪他们。

I recommend looking into arping which is doing a somewhat identical job. It takes IPs and MACs and tries to receive additional informationen. Or justs pings them.

http://freshmeat.net/projects/arping/

这篇关于程序中使用的ARP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆