2
2
* Interface MIB architecture support
4
* $Id: arp_linux.c 16381 2007-05-17 21:53:28Z hardaker $
4
* $Id: arp_linux.c 17892 2009-12-09 14:37:16Z jsafranek $
6
6
#include <net-snmp/net-snmp-config.h>
7
7
#include <net-snmp/net-snmp-includes.h>
80
83
while (fgets(line, sizeof(line), in)) {
82
int za, zb, zc, zd, ze, zf, zg, zh, zi, zj;
87
"%d.%d.%d.%d 0x%*x 0x%x %x:%x:%x:%x:%x:%x %*[^ ] %20s\n",
88
&za, &zb, &zc, &zd, &tmp_flags, &ze, &zf, &zg, &zh, &zi,
90
"%d.%d.%d.%d 0x%*x 0x%x %96s %*[^ ] %20s\n",
91
&za, &zb, &zc, &zd, &tmp_flags, arp, ifname);
91
93
snmp_log(LOG_ERR, PROCFILE " data format error (%d!=12)\n", rc);
92
94
snmp_log(LOG_ERR, " line ==|%s|\n", line);
95
97
DEBUGMSGTL(("access:arp:container",
96
98
"ip addr %d.%d.%d.%d, flags 0x%X, hw addr "
97
"%x:%x:%x:%x:%x:%x, name %s\n",
98
za,zb,zc,zd, tmp_flags, ze,zf,zg,zh,zi,zj, ifname ));
100
za,zb,zc,zd, tmp_flags, arp, ifname ));
137
entry->arp_physaddress[0] = ze;
138
entry->arp_physaddress[1] = zf;
139
entry->arp_physaddress[2] = zg;
140
entry->arp_physaddress[3] = zh;
141
entry->arp_physaddress[4] = zi;
142
entry->arp_physaddress[5] = zj;
143
entry->arp_physaddress_len = 6;
139
for (arp_token = strtok(arp, ":"), i=0; arp_token != NULL; arp_token = strtok(NULL, ":"), i++) {
140
entry->arp_physaddress[i] = strtol(arp_token, NULL, 16);
142
entry->arp_physaddress_len = i;
146
145
* what can we do with hw? from arp manpage: