diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2018-07-23 21:44:07 +0200 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2018-07-25 18:07:49 +0200 |
commit | 9f2fccfdc2eae83efbde1e3ae94a2cc220537983 (patch) | |
tree | 16a19a1877d7cfdd39767de0cfaf312adc398d1b /client.c | |
parent | b582cce69853d0a562dd0171914426887e854966 (diff) |
Better ICMP code encapsulation
Diffstat (limited to 'client.c')
-rw-r--r-- | client.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -6,22 +6,24 @@ #include <netinet/ip_icmp.h> #include <arpa/inet.h> #include <unistd.h> -#include "icmp.h" +#include "icmp_client.h" #include "util.h" int main(void) { - int sock = icmp_open_socket(); + int sock = icmp_client_open_socket(); if (sock < 0) { - perror("icmp_open_socket"); + perror("icmp_client_open_socket"); return 1; } const char *ip_address = "127.0.0.1"; // const char *ip_address = "192.168.43.220"; + // const char *ip_address = "198.211.118.67"; // tomsmeding.com - struct icmp_reply reply = icmp_communicate(sock, ip_address, 1234, "kaashandel", 10); + struct icmp_client_incoming reply = + icmp_client_communicate(sock, ip_address, 42, 1234, "kaashandel", 10); if (reply.data == NULL) { - perror("icmp_communicate"); + perror("icmp_client_communicate"); return 1; } |