|
|
|
@ -37,15 +37,15 @@ int open_ping_socket_ipv4();
|
|
|
|
|
int open_ping_socket_ipv6();
|
|
|
|
|
void socket_set_src_addr_ipv4(int s, FPING_INADDR src_addr);
|
|
|
|
|
void socket_set_src_addr_ipv6(int s, FPING_INADDR src_addr);
|
|
|
|
|
int socket_sendto_ping_ipv4(int s, struct sockaddr *saddr, socklen_t saddr_len, size_t ping_pkg_size, uint16_t icmp_seq_nr, uint16_t icmp_id_nr);
|
|
|
|
|
int socket_sendto_ping_ipv6(int s, struct sockaddr *saddr, socklen_t saddr_len, size_t ping_pkg_size, uint16_t icmp_seq_nr, uint16_t icmp_id_nr);
|
|
|
|
|
int socket_sendto_ping_ipv4(int s, struct sockaddr *saddr, socklen_t saddr_len, uint16_t icmp_seq_nr, uint16_t icmp_id_nr);
|
|
|
|
|
int socket_sendto_ping_ipv6(int s, struct sockaddr *saddr, socklen_t saddr_len, uint16_t icmp_seq_nr, uint16_t icmp_id_nr);
|
|
|
|
|
|
|
|
|
|
int open_ping_socket()
|
|
|
|
|
int open_ping_socket(size_t ping_data_size)
|
|
|
|
|
{
|
|
|
|
|
#ifndef IPV6
|
|
|
|
|
return open_ping_socket_ipv4();
|
|
|
|
|
return open_ping_socket_ipv4(ping_data_size);
|
|
|
|
|
#else
|
|
|
|
|
return open_ping_socket_ipv6();
|
|
|
|
|
return open_ping_socket_ipv6(ping_data_size);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -58,11 +58,11 @@ void socket_set_src_addr(int s, FPING_INADDR src_addr)
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int socket_sendto_ping(int s, struct sockaddr *saddr, socklen_t saddr_len, size_t ping_pkt_size, uint16_t icmp_seq_nr, uint16_t icmp_id_nr)
|
|
|
|
|
int socket_sendto_ping(int s, struct sockaddr *saddr, socklen_t saddr_len, uint16_t icmp_seq_nr, uint16_t icmp_id_nr)
|
|
|
|
|
{
|
|
|
|
|
#ifndef IPV6
|
|
|
|
|
return socket_sendto_ping_ipv4(s, saddr, saddr_len, ping_pkt_size, icmp_seq_nr, icmp_id_nr);
|
|
|
|
|
return socket_sendto_ping_ipv4(s, saddr, saddr_len, icmp_seq_nr, icmp_id_nr);
|
|
|
|
|
#else
|
|
|
|
|
return socket_sendto_ping_ipv6(s, saddr, saddr_len, ping_pkt_size, icmp_seq_nr, icmp_id_nr);
|
|
|
|
|
return socket_sendto_ping_ipv6(s, saddr, saddr_len, icmp_seq_nr, icmp_id_nr);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|