19bbf0f31b3719931afe071dbec88110b5f6d66b
2 * arp - display ARP cache from the IP stack parameters.
4 * This source code is in the PUBLIC DOMAIN and has NO WARRANTY.
6 * Robert Dickenson <robd@reactos.org>, August 15, 2002.
21 VOID SNMP_FUNC_TYPE
SnmpSvcInitUptime();
22 DWORD SNMP_FUNC_TYPE
SnmpSvcGetUptime();
24 ////////////////////////////////////////////////////////////////////////////////
26 const char szUsage
[] = { "\n" \
27 "Displays and modifies the IP Protocol to physical address translation tables\n" \
28 "used by address resolution protocol (ARP).\n" \
30 "ARP -s inet_addr eth_addr [if_addr]\n" \
31 "ARP -d inet_addr [if_addr]\n" \
32 "ARP -a [inet_addr] [-N if_addr]\n" \
34 " -a Displays the active ARP table by querying the current protocol\n" \
35 " data. If inet_addr is specified, the IP and physical addresses\n" \
36 " for the specified address are displayed. If more than one\n" \
37 " network interface is using ARP, each interfaces ARP table is\n" \
39 " -g Indentical to -a.\n" \
40 " inet_addr Specifies the IP address.\n" \
41 " -N if_addr Displays the ARP table for the specified interface only\n" \
42 " -d Deletes the host entry specified by inet_addr. inet_addr may be\n" \
43 " wildcarded with * to delete all host entries in the ARP table.\n" \
44 " -s Adds the host and associates the IP address inet_addr with the\n" \
45 " physical address eth_addr. The physical address must be specified\n" \
46 " as 6 hexadecimal characters delimited by hyphens. The new entry\n" \
47 " will become permanent in the ARP table.\n" \
48 " eth_addr Specifies the interface physical address.\n" \
49 " if_addr If present, this specifies the IP address of the interface whose\n" \
50 " address translation table should be modified. If not present, the\n" \
51 " first applicable interface will be used.\n" \
53 " > arp -s 192.168.0.12 55-AA-55-01-02-03 .... Static entry creation.\n" \
54 " > arp -a .... ARP table display.\n" \
55 " > arp -d * .... Delete all ARP table entries.\n"
60 // fprintf(stderr,"USAGE:\n");
61 fputs(szUsage
, stderr
);
64 int main(int argc
, char *argv
[])
66 TCHAR szComputerName
[50];
79 GetComputerName(szComputerName
, &dwSize
);
80 _tprintf(_T("ReactOS ARP cache on Computer Name: %s\n"), szComputerName
);
82 pCache
= (BYTE
*)SnmpUtilMemAlloc(nBytes
);
88 DWORD dwUptime
= SnmpSvcGetUptime();
90 _tprintf(_T("SNMP uptime: %ld\n"), dwUptime
);
92 SnmpUtilMemFree(pCache
);
94 _tprintf(_T("ERROR: call to SnmpUtilMemAlloc() failed\n"));