Completed the host scan

This commit is contained in:
Dimitri Lozeve 2016-05-27 15:03:57 +02:00
parent a8d0d25355
commit 6a767409a5

View file

@ -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;
}