summaryrefslogtreecommitdiff
path: root/icmp_server.h
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2018-08-01 23:12:41 +0200
committerTom Smeding <tom.smeding@gmail.com>2018-08-01 23:12:41 +0200
commita239f9feadd015fa91d391df01365dcade8ce503 (patch)
tree979554817c2069a525e94e2ad5f6346b53e19eb5 /icmp_server.h
parent9f2fccfdc2eae83efbde1e3ae94a2cc220537983 (diff)
Threaded communication (icmpd)
Diffstat (limited to 'icmp_server.h')
-rw-r--r--icmp_server.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/icmp_server.h b/icmp_server.h
index fbf4158..f1f4e9f 100644
--- a/icmp_server.h
+++ b/icmp_server.h
@@ -2,28 +2,13 @@
#include "icmp.h"
-#ifndef ICMP_ECHO
-#define ICMP_ECHO 8
-#endif
-#ifndef ICMP_ECHOREPLY
-#define ICMP_ECHOREPLY 0
-#endif
-
-
-struct icmp_server_incoming {
- const uint8_t *data; // points to internal buffer
- size_t length; // length of 'data'
-
- int type; // ICMP_ECHO or ICMP_ECHOREPLY
- int id, seqnum;
- uint32_t source_addr;
-};
// Returns -1 on error with errno.
int icmp_server_open_socket(void);
// Returns {.data=NULL} on error with errno.
-struct icmp_server_incoming icmp_server_receive(int sock);
+// Receives only ECHO.
+struct icmp_incoming icmp_server_receive(int sock);
// Returns -1 on error with errno.
int icmp_server_send_reply(