Completed the host scan
This commit is contained in:
parent
a8d0d25355
commit
6a767409a5
1 changed files with 9 additions and 2 deletions
|
@ -158,11 +158,18 @@ int main(int argc, char **argv)
|
|||
perror("[FAIL] inet_ntop()");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
printf("[%s]\n", ip_string);
|
||||
|
||||
send_arp_request(sockfd, ifindex, ipaddr, macaddr, target_ip);
|
||||
|
||||
struct ether_arp *result = malloc(sizeof(struct ether_arp));
|
||||
int isalive = listen_arp_frame(sockfd, result);
|
||||
if (isalive == 0) {
|
||||
printf("Host %s is alive!\n", ip_string);
|
||||
}
|
||||
|
||||
++ip_counter;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue