From 9f2fccfdc2eae83efbde1e3ae94a2cc220537983 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 23 Jul 2018 21:44:07 +0200 Subject: Better ICMP code encapsulation --- icmp.h | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'icmp.h') diff --git a/icmp.h b/icmp.h index 3557fc3..4cccb95 100644 --- a/icmp.h +++ b/icmp.h @@ -22,23 +22,3 @@ struct __attribute__((packed)) icmp_echo { #define ICMP_MAX_PAYLOAD_LENGTH (MAX_DATAGRAM_SIZE - ICMP_PAYLOAD_OFFSET) #define ICMP_SAFE_PAYLOAD_LENGTH (MIN_MTU - IP_HEADER_SIZE - ICMP_PAYLOAD_OFFSET) - - -struct icmp_reply { - const uint8_t *data; // points to internal buffer - size_t length; // length of 'data' - - int seqnum; -}; - -// Returns -1 on error with errno. -int icmp_open_socket(void); - -// Only actual IPv4 addresses allowed. Sends data in 'data' with length 'length', and -// returns pointer to internal buffer with reply data. Buffer is invalidated on next -// call to the function. -// Returns {.data=NULL} on error with errno. -struct icmp_reply icmp_communicate(int sock, const char *ip_address, int seqnum, const void *data, size_t length); - -// Returns -1 on error with errno. -int icmp_send_echo_reply(const char *ip_address, int id, int seqnum, const void *data, size_t length); -- cgit v1.2.3-70-g09d2