ChinaUnix.net
相关文章推荐:

android 获取Mac

AIX中如何获取mac地址

by dragonlrx - AIX - 2012-10-16 10:02:22 阅读(1925) 回复(7)

相关讨论

现在远程有台电脑。ssh连接不上。我想知道那台电脑的mac地址。有什么办法吗?那台电脑有一个固定的ip的。

MAC地址

by daqing0909 - Linux新手园地 - 2011-12-09 16:28:32 阅读(3285) 回复(10)

#include stdio.h> #include stdlib.h> #include string.h> #include errno.h> #include unistd.h> #include sys/socket.h> #include sys/ioctl.h> #include net/if.h> #include net/if_arp.h> #include arpa/inet.h> #define inaddrr( x ) ( *( struct in_addr * )&ifr->x[ sizeof( sa.sin_port ) ] ) #define IFRSIZE ( ( int )( size * sizeof( struct ifreq ) ) ) int main ( void ) { unsigned char * u; int sockfd...

by 一鸿秋水 - Linux文档专区 - 2009-07-28 09:49:21 阅读(761) 回复(0)

一个示例脚本: import os import re def Getmac(): if os.name == 'nt': try: ret = '' CmdLine = 'ipconfig /all' r = os.popen(CmdLine).read() if r: L = re.findall('Physical Address.*?([0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2}-[0-9,A-F]{2})', r) if len(L) > 0: ret =...

by zhaohang3031 - Python文档中心 - 2009-07-20 12:09:37 阅读(2753) 回复(1)

/** * 获取网卡mac地址 */ public static String getmacOnWindow() { try { String mac = null; Process process = Runtime.getRuntime().exec("ipconfig /all"); BufferedReader buffer = new BufferedReader(new InputStreamReader(process.getInputStream())); for (String line = buffer.readLine(); line != null; line = buf...

by sunwei0325 - Java文档中心 - 2008-07-30 11:18:35 阅读(1371) 回复(0)

获取主机mac地址的代码: #include #include #include #include #include #include #include int main() { struct ifreq ifr; int sock; unsigned char *ptr; int status; strcpy (ifr.ifr_name , "eth0"); sock = socket (PF_PACKET, SOCK_RAW, htons(ETH_P_ALL)); if (sock == -1) { perror ("socket error "); return -1; } status = ioctl (sock, SIOCGIFHWA...

by fytzzh - Linux文档专区 - 2006-10-18 12:59:08 阅读(645) 回复(0)

在同一子网内获取另一台主机的mac地址较为容易,发送arp请求并接收应答就可以得到,如果跨网段的话(路由器或者3层交换机划分的vlan),有没有一种方法获取对方的mac地址?

by Thinkor - 网络技术 - 2006-05-26 17:54:06 阅读(2497) 回复(9)

在同一子网内获取另一台主机的mac地址较为容易,发送arp请求并接收应答就可以得到,如果跨网段的话(路由器或者3层交换机划分的vlan),有没有一种方法获取对方的mac地址?

by Thinkor - 企业网管技术交流区 - 2006-05-26 17:54:06 阅读(3654) 回复(7)

获取mac: # fping -g 192.168.0.1 192.168.0.255 # 指定一个地址范围 # arp -na # ip跟mac 就是这么简单. :m01:

by congli - BSD - 2005-10-30 00:12:41 阅读(1796) 回复(7)
by knox - PHP - 2005-08-08 16:20:46 阅读(786) 回复(0)

请问,如何在程序当中获取局域网里机器的所有ip地址与其对应的mac地址. OS : RedHat Linux9.0 我下载了一些本论坛的代码, 没有一个可以编译过去的, 提示都是些宏找不到, 我就搜索/usr/include/下的所有文件,唉,好难找啊. 有些头文件都找不到. 郁闷 啊, 那位有写好的代码给share一下咯. 小弟感谢了. 谢谢!

by regedit - Linux论坛 - 2005-09-03 16:08:18 阅读(2029) 回复(7)