We are currently processing the output of the arp request from the command line.
string cmd = "arp -n "; cmd.append(ipaddress); cmd.append(" | grep "); cmd.append(ipaddress); fgets( line, 130, fp); fgets( line, 130, fp); ret.append(line); ...
It works, but is there a way to do this using a library function that will not depend so much on the command line interface? The project is currently using libpcap.
In general, this will depend on your OS. There is no real standard API for this.
, Linux, /proc/net/arp. arp. , IP-, , , ARP, , , .
IP- - UDP - , - , .
arp, :) , arping ( , git repo ), , , , libpcap ( root)
MAC-
.
, , ARP . , MAC- ARP. , MAC- , ( ).
, , , , , , , arp .
Source: https://habr.com/ru/post/1707825/More articles:Кэшированные или предварительно вычисленные неизменяемые функции в С#/С++ - c++Best modern text parsing? AKA When to use Lex and Yacc? - regexWhy hide DAO behind the service? - javaWhat is wrong with code like User.find (: all) .each? - ruby | fooobar.comIIS Перекомпилируйте веб-сайты ASP NET - compiler-constructionUnresolved characters when compiling with gcc on OpenSolaris 2008.11 - cProblems Finding the Right Bug Tracking Software - bug-trackingКак использовать одну и ту же библиотеку для Silverlight и CLR - clrБорьба с приемлемым использованием переменной Session в ASP.NET - asp.netHow to convert decimal to REAL10 in MASM assembly? - assemblyAll Articles