pasring start

This commit is contained in:
2025-04-25 19:35:48 +02:00
parent e622d9d175
commit 77668368ab
4 changed files with 59 additions and 16 deletions

View File

@ -6,7 +6,7 @@
/* By: tomoron <tomoron@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/04/24 22:49:22 by tomoron #+# #+# */
/* Updated: 2025/04/24 22:52:09 by tomoron ### ########.fr */
/* Updated: 2025/04/25 19:14:34 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/ft_ping.h"
@ -16,7 +16,6 @@ static void set_packet_data(uint8_t *packet_data)
int i;
i = 0;
while(i < PACKET_DATA_LENGTH)
{
packet_data[i] = i;
@ -57,8 +56,6 @@ t_icmp_echo prepare_icmp_echo(uint16_t sequence, uint16_t identifier)
packet.sequence = htons(sequence);
set_packet_data(packet.data);
gettimeofday(&packet.time, 0);
packet.time.tv_sec = bswap_64(packet.time.tv_sec);
packet.time.tv_usec = bswap_64(packet.time.tv_usec);
packet.checksum = 0;
packet.checksum = calc_checksum(&packet, sizeof(t_icmp_echo));