summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-07-23 21:44:07 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-07-25 18:07:49 +0200
commit9f2fccfdc2eae83efbde1e3ae94a2cc220537983 (patch)
tree16a19a1877d7cfdd39767de0cfaf312adc398d1b /client.c
parentb582cce69853d0a562dd0171914426887e854966 (diff)
Better ICMP code encapsulation
Diffstat (limited to 'client.c')
-rw-r--r--client.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/client.c b/client.c
index 1f8663f..4c1a32f 100644
--- a/client.c
+++ b/client.c
@@ -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;
}