1
0
mirror of https://passt.top/passt synced 2024-07-02 07:52:41 +00:00
passt/icmp.h
Stefano Brivio d303cfdd55 icmp: Implement ping tracking based on echo identifiers
Open and bind a socket for each possible ICMP/ICMPv6 echo identifier,
and add a tracking mechanism. Otherwise, multiple pings in parallel
won't work, and a single ping to a different destination would make
an existing ping sequence stop working.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2021-05-21 11:14:50 +02:00

23 lines
577 B
C

#ifndef ICMP_H
#define ICMP_H
struct ctx;
void icmp_sock_handler(struct ctx *c, int s, uint32_t events, char *pkt_buf,
struct timespec *now);
int icmp_tap_handler(struct ctx *c, int af, void *addr,
struct tap_msg *msg, int count, struct timespec *now);
int icmp_sock_init(struct ctx *c);
/**
* struct icmp_ctx - Execution context for ICMP routines
* @fd_min: Lowest file descriptor number for ICMP/ICMPv6 ever used
* @fd_max: Highest file descriptor number for ICMP/ICMPv6 ever used
*/
struct icmp_ctx {
int fd_min;
int fd_max;
};
#endif /* ICMP_H */