int tos = 0;
HOST_ENTRY *cursor;
- s = open_ping_socket();
+ s = open_ping_socket(ping_data_size);
if((uid = getuid())) {
/* drop privileges */
printf( "sending [%d] to %s\n", h->num_sent, h->host );
#endif /* DEBUG || _DEBUG */
- n = socket_sendto_ping(s, (struct sockaddr *) &h->saddr, h->saddr_len, ping_pkt_size, myseq, ident);
+ n = socket_sendto_ping(s, (struct sockaddr *) &h->saddr, h->saddr_len, myseq, ident);
if(
(n < 0 || n != ping_pkt_size)
int in_cksum( unsigned short *p, int n );
/* socket.c */
-int open_ping_socket();
+int open_ping_socket(size_t ping_data_size);
void socket_set_src_addr(int s, FPING_INADDR src_addr);
-int socket_sendto_ping(int s, struct sockaddr *saddr, socklen_t saddr_len, size_t ping_pkg_size, uint16_t icmp_seq, uint16_t icmp_id);
+int socket_sendto_ping(int s, struct sockaddr *saddr, socklen_t saddr_len, uint16_t icmp_seq, uint16_t icmp_id);
#endif
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
}
#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
}
errno_crash_and_burn( "cannot bind source address" );
}
-int socket_sendto_ping_ipv4(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_ipv4(int s, struct sockaddr *saddr, socklen_t saddr_len, uint16_t icmp_seq_nr, uint16_t icmp_id_nr)
{
struct icmp *icp;
int n;