/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* target.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rparodi +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2026/03/30 12:09:48 by rparodi #+# #+# */ /* Updated: 2026/03/30 12:33:54 by rparodi ### ########.fr */ /* */ /* ************************************************************************** */ #include "macro.h" #include #include #include #include #include #include #include void check_target(const char *target) { struct addrinfo hints = {0}, *res; hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_RAW; hints.ai_protocol = IPPROTO_ICMP; int err = getaddrinfo(target, NULL, &hints, &res); if (err != 0) { ERROR_LOG("ft_ping: unknown host"); exit(EXIT_FAILURE); } freeaddrinfo(res); }