* Display an individual neighbor cache entry */
| 531 | * Display an individual neighbor cache entry |
| 532 | */ |
| 533 | static void |
| 534 | get(char *host) |
| 535 | { |
| 536 | struct sockaddr_in6 *sin = &sin_m; |
| 537 | struct addrinfo hints, *res; |
| 538 | int gai_error; |
| 539 | |
| 540 | sin_m = blank_sin; |
| 541 | bzero(&hints, sizeof(hints)); |
| 542 | hints.ai_family = AF_INET6; |
| 543 | gai_error = getaddrinfo(host, NULL, &hints, &res); |
| 544 | if (gai_error) { |
| 545 | fprintf(stderr, "ndp: %s: %s\n", host, |
| 546 | gai_strerror(gai_error)); |
| 547 | return; |
| 548 | } |
| 549 | sin->sin6_addr = ((struct sockaddr_in6 *)res->ai_addr)->sin6_addr; |
| 550 | sin->sin6_scope_id = |
| 551 | ((struct sockaddr_in6 *)res->ai_addr)->sin6_scope_id; |
| 552 | dump(sin, 0); |
| 553 | if (found_entry == 0) { |
| 554 | #ifndef FSTACK |
| 555 | getnameinfo((struct sockaddr *)sin, sin->sin6_len, host_buf, |
| 556 | sizeof(host_buf), NULL ,0, |
| 557 | (nflag ? NI_NUMERICHOST : 0)); |
| 558 | #else |
| 559 | inet_ntop(AF_INET6_LINUX, &sin->sin6_addr, host_buf, sizeof(host_buf)); |
| 560 | #endif |
| 561 | printf("%s (%s) -- no entry\n", host, host_buf); |
| 562 | exit(1); |
| 563 | } |
| 564 | } |
| 565 | |
| 566 | /* |
| 567 | * Delete a neighbor cache entry |
no test coverage detected