mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
rename vtable field arp->mac
This commit is contained in:
parent
4f524abbea
commit
c7fc2cee22
@ -17,7 +17,7 @@ QueryData genArp() {
|
||||
int ret;
|
||||
|
||||
char ip[32];
|
||||
char arp[64];
|
||||
char mac[64];
|
||||
char iface[32];
|
||||
|
||||
// We are already calling 'popen', let's give it some more work with sed to clean.
|
||||
@ -28,10 +28,10 @@ QueryData genArp() {
|
||||
|
||||
ret = getline(&line, &length, arp_cmd_output);
|
||||
while (ret > 0) {
|
||||
sscanf(line, "%s %s %s", ip, arp, iface);
|
||||
sscanf(line, "%s %s %s", ip, mac, iface);
|
||||
|
||||
r["ip"] = ip;
|
||||
r["arp"] = arp;
|
||||
r["mac"] = mac;
|
||||
r["iface"] = iface;
|
||||
|
||||
results.push_back(r);
|
||||
|
@ -17,9 +17,9 @@ QueryData genArp() {
|
||||
int ret;
|
||||
|
||||
char ip[32];
|
||||
char arp[64];
|
||||
char mac[64];
|
||||
char iface[32];
|
||||
char foo[128];
|
||||
char ignore_field[128];
|
||||
|
||||
// We are already calling 'popen', let's give it some more work with sed to clean.
|
||||
proc_arp_fd = fopen("/proc/net/arp" , "r");
|
||||
@ -31,10 +31,10 @@ QueryData genArp() {
|
||||
ret = getline(&line, &length, proc_arp_fd);
|
||||
while (ret > 0) {
|
||||
// IP address HW type Flags HW address Mask Device
|
||||
sscanf(line, "%s %s %s %s %s %s", ip, foo, foo, arp, foo, iface);
|
||||
sscanf(line, "%s %s %s %s %s %s", ip, ignore_field, ignore_field, mac, ignore_field, iface);
|
||||
|
||||
r["ip"] = ip;
|
||||
r["arp"] = arp;
|
||||
r["mac"] = mac;
|
||||
r["iface"] = iface;
|
||||
|
||||
results.push_back(r);
|
||||
|
@ -1,7 +1,7 @@
|
||||
table_name("arp")
|
||||
schema([
|
||||
Column(name="ip", type="std::string"),
|
||||
Column(name="arp", type="std::string"),
|
||||
Column(name="mac", type="std::string"),
|
||||
Column(name="iface", type="std::string"),
|
||||
])
|
||||
implementation("arp@genArp")
|
||||
|
Loading…
Reference in New Issue
Block a user