Files
ft_ping/srcs/ft_ping.c

30 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_ping.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/24 00:03:56 by tomoron #+# #+# */
/* Updated: 2025/04/24 22:50:08 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/ft_ping.h"
int main(int argc, char **argv)
{
(void)argc;
(void)argv;
t_icmp_echo packet;
int fd;
packet = prepare_icmp_echo(0, 1);
fd = open("test", O_WRONLY | O_CREAT, 0700);
write(fd, &packet, sizeof(t_icmp_echo));
printf("checksum : %x\n", packet.checksum);
return(0);
}