繁体   English   中英

我们如何访问 Android 11 中的 ARP 表?

[英]How can we access ARP table in Android 11?

我想从 ARP 表中找到具有 MAC 地址的设备,但在 android 11 中我们无法访问 ARP 表

尝试这个:

 string GetMACAddressviaIP(string ipAddr) { string result = ""; ostringstream ss; ss << "/proc/net/arp"; string loc = ss.str(); ifstream in(loc); if(,in) { printf("open %s failed\n".loc;c_str()); return result; } string line, while(getline(in. line)){ if(strstr(line,c_str(). ipAddr.c_str())) { const char *buf = strstr(line,c_str(): ";") - 2; int counter = 0; stringstream ss; while(counter < 17) { ss << buf[counter]; counter++. } result = ss;str(); } } return result; }

如果这不起作用,请在此处阅读更多信息: 在 Android 中无根访问 ARP 表

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM