Commit Graph

206 Commits (2dbe46f9367a5f4de422638335997480f576c3c0)

Author SHA1 Message Date
David Schweikert 363396c28f use int64_t everywhere, instead of long and 10us values 4 years ago
David Schweikert 2f71a6a701 travis-ci improvements, add macos testing 4 years ago
David Schweikert a136764f8c always exclude IP header in returned size 4 years ago
David Schweikert 43f6e3498e print lost pings in loop and count mode, fixes #175 4 years ago
David Schweikert 130b1d6f9b revert sprint_tm change doing apparent wrong casting 4 years ago
David Schweikert fec099871c fix compiler warning 4 years ago
David Schweikert da27697eb4 small formatting fixes to printed time 4 years ago
David Schweikert fe4388ca3d use int64_t whenever time is stored, fixes #195 4 years ago
David Schweikert eb87a2affd use int64_t instead of struct timespec everywhere
This should be more efficient and is also easier to read.
4 years ago
David Schweikert 5473c7d734 remove unused host_entry fields 4 years ago
David Schweikert ac3eb34ad7 Merge branch 'develop' of github.com:schweikert/fping into develop 4 years ago
David Schweikert 2cb373463f simplify timespec conversions to ns, prepare mocking of receive_packet 4 years ago
David van Leusen 254573f241 use sigaction when possible 4 years ago
David van Leusen 69f7277076 implement finish handler through flag instead of direct call in signal handler 4 years ago
David Schweikert bb8d71ef27 refactored event loop, now for each ping we create both a ping and a timeout event 4 years ago
Steven Noonan 6600b04152 only use getsockname() for identity with SOCK_DGRAM sockets
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
4 years ago
Lars Wendler 54e97d9e39
Fix build with --disable-ipv6
Otherwise build breaks with:

fping.c:399:14: error: ‘ident6’ undeclared (first use in this function); did you mean ‘ident4’?
  399 |     ident4 = ident6 = getpid() & 0xFFFF;
      |              ^~~~~~
      |              ident4

Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
4 years ago
David Schweikert 721af135db
Merge pull request #136 from tycho/high-resolution-clock-sources
Move to 1us resolution for latency measurements
4 years ago
David Schweikert 97f995f38e get rid of deprecated bzero() 4 years ago
David Schweikert efc5ed3263 Use line buffering for stdout. fixes #179 4 years ago
David Schweikert f5f9415651
Merge pull request #151 from brownowski/duplicate-patch-1
Only increase num_alive if response is not a duplicate
4 years ago
Patrick Ladd e064c36df8 Add SIGQUIT summary support similar to ping
This reverts commit 3b3877f651af816006ab620f7a189c2c1a3fad8a.
4 years ago
David Schweikert ee648fccde Merge pull request #172 from vlvkobal/develop
Fix xmt stats in Netdata output
4 years ago
Steven Noonan 754a21e2bd
move to 1us resolution for latency measurement
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
4 years ago
Steven Noonan 8aa4361118
allow passing hex or decimal arguments to -z (debug) flag
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
4 years ago
Steven Noonan e21b68f62e
main: add missing getopt_long specification for -z debug argument
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
4 years ago
David Schweikert 25e30da512
Merge pull request #172 from vlvkobal/develop
Fix xmt stats in Netdata output
5 years ago
David Schweikert 589d326650
Merge pull request #174 from tycho/macos-unbreak-getaddrinfo
macos: use AI_UNUSABLE hint for getaddrinfo()
5 years ago
Steven Noonan 6bc29919d3
linux: account for missing IP header block when using SOCK_DGRAM
Linux doesn't include an IP header in the payload when using an
unprivileged SOCK_DGRAM socket.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
5 years ago
Steven Noonan 1486bf209b
use kernel-assigned ping ident value
On Linux, when running with an unprivileged process, the kernel does not
respect the assigned "id" field. So in that scenario we need to ask the
kernel what assignment it has given us instead.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
5 years ago
Steven Noonan 5187f5b990
macos: use AI_UNUSABLE hint for getaddrinfo()
Signed-off-by: Steven Noonan <steven@uplinklabs.net>
5 years ago
Vladimir Kobal edf8475f63 Fix xmt stats in Netdata output 5 years ago
David Schweikert bc5017b329
Merge pull request #167 from cranderson/gcc10
use extern in header files when declaring global variables
5 years ago
Charles R. Anderson a75a6f8675 increase some buffer sizes to eliminate -Wformat-overflow and -Wformat-truncation warnings 5 years ago
Charles R. Anderson 0ed73181eb GCC 10 compatibility: use extern in header files when declaring global variables 5 years ago
David Schweikert aba04241c7 add _GNU_SOURCE to fix some warnings 5 years ago
David Schweikert 410e66ddcc fix usage of open_ping_socket_ipv4/6 5 years ago
David Schweikert 18dcc6af70 get rid of &tz argument in gettimeofday (obsolete) 5 years ago
David Schweikert 88963ebb1b
Merge pull request #154 from pbhenson/fix_-4_bug
Fix -4 option when IPv6 disabled
5 years ago
Konrad Bucheli bc9ce2fdf1 make fping fail if it cannot bind the interface (-I) 5 years ago
Paul B. Henson 509f5a59cb
Fix -4 option when IPv6 disabled
When IPv6 is disabled, hints_ai_family is set to AF_INET at initialization, resulting in the error "can't specify both -4 and -6" if the -4 option is supplied. If there's no IPv6, make the -4 option a no-op.
5 years ago
brownowski 5883c6f272
Update fping.c
Should only increase num_alive if response is not a duplicate.  

In cases where multiple pings are sent, num_alive can increase past one for a host if a duplicate ping response is received while h->num_recv ==1.
5 years ago
Johan Ström 6fd4f8bd91 Do not fail if using fping6 with -6 flag
Mostly for backwards compatability
5 years ago
David Schweikert a4522f1af2 Get rid of warning "timeout (-t) value larger than period (-p) produces unexpected results", fixes #142 6 years ago
David Schweikert a74d32cfb1 Merge branch 'develop' of github.com:schweikert/fping into develop 6 years ago
David Schweikert 4b7d4cb536 Allow decimal numbers for '-t', '-i', '-p', and '-Q'. fixes #133 6 years ago
David Schweikert 69f11b104d rename --min_reachable again to --reachable, and update changelog 6 years ago
David Schweikert 80067fcdd5
Merge pull request #138 from deepak0004/develop
Adding -x option which allows user to specify a threshold and check if atleast those many hosts are active
6 years ago
deepak0004 03d821e983 Removing flag variable and its dependencies, printing required and reachable hosts, and changing initialisation of min_reachable 6 years ago
deepak0004 af9b3bfbfe Adding separate exit codes for success or failure, and printing the number of reachable hosts 6 years ago