#include #include #include #include #include #include #include #include #include "icmp.h" #include "util.h" int main(void) { int sock = icmp_open_socket(); if (sock < 0) { perror("icmp_open_socket"); return 1; } const char *ip_address = "127.0.0.1"; // const char *ip_address = "192.168.43.220"; struct icmp_reply reply = icmp_communicate(sock, ip_address, 1234, "kaashandel", 10); if (reply.data == NULL) { perror("icmp_communicate"); return 1; } printf("Received length: %zd\nPayload:\n", reply.length); xxd(reply.data, reply.length); }