MCPcopy Index your code
hub / github.com/F-Stack/f-stack / get

Function get

tools/arp/arp.c:464–493  ·  view source on GitHub ↗

* Display an individual arp entry */

Source from the content-addressed store, hash-verified

462 * Display an individual arp entry
463 */
464static int
465get(char *host)
466{
467 struct sockaddr_in *addr;
468 int found;
469
470 addr = getaddr(host);
471 if (addr == NULL)
472 return (1);
473
474 xo_set_version(ARP_XO_VERSION);
475 xo_open_container("arp");
476 xo_open_list("arp-cache");
477
478 found = search(addr->sin_addr.s_addr, print_entry);
479
480 if (found == 0) {
481 xo_emit("{d:hostname/%s} ({d:ip-address/%s}) -- no entry",
482 host, inet_ntoa(addr->sin_addr));
483 if (rifname)
484 xo_emit(" on {d:interface/%s}", rifname);
485 xo_emit("\n");
486 }
487
488 xo_close_list("arp-cache");
489 xo_close_container("arp");
490 xo_finish();
491
492 return (found == 0);
493}
494
495/*
496 * Delete an arp entry

Callers 1

mainFunction · 0.70

Calls 9

xo_set_versionFunction · 0.85
xo_open_containerFunction · 0.85
xo_open_listFunction · 0.85
searchFunction · 0.85
xo_emitFunction · 0.85
xo_close_listFunction · 0.85
xo_close_containerFunction · 0.85
xo_finishFunction · 0.85
getaddrFunction · 0.70

Tested by

no test coverage detected