Code

liboping.git
7 years agosrc/liboping.c: Improve coding style.
Florian Forster [Fri, 5 May 2017 07:06:17 +0000 (09:06 +0200)]
src/liboping.c: Improve coding style.

Don't have the if-condition and if-body in the same line.

7 years agosrc/liboping.c: Clean up untidy whitespace.
Florian Forster [Fri, 5 May 2017 06:50:50 +0000 (08:50 +0200)]
src/liboping.c: Clean up untidy whitespace.

7 years agoMerge remote-tracking branch 'github/master' into lh/performance
Florian Forster [Fri, 5 May 2017 06:43:52 +0000 (08:43 +0200)]
Merge remote-tracking branch 'github/master' into lh/performance

7 years agoImprove docstring of the history_received field.
Florian Forster [Thu, 4 May 2017 12:08:21 +0000 (14:08 +0200)]
Improve docstring of the history_received field.

7 years agoRefactor context_create().
Florian Forster [Thu, 4 May 2017 12:07:31 +0000 (14:07 +0200)]
Refactor context_create().

7 years agoAssure that no large file descriptors are passed to FD_SET().
Florian Forster [Thu, 4 May 2017 11:57:22 +0000 (13:57 +0200)]
Assure that no large file descriptors are passed to FD_SET().

When passing a large file descriptor, on many systems large means >= 1024,
FD_SET()s behavior is undefined. Mostly, it will corrupt the stack
because an out-of-bounds bit is flipped.

7 years agoMerge commit 'refs/pull/15/head' of github.com:octo/liboping
Florian Forster [Sun, 19 Mar 2017 09:53:40 +0000 (10:53 +0100)]
Merge commit 'refs/pull/15/head' of github.com:octo/liboping

7 years agoMerge commit 'refs/pull/18/head' of github.com:octo/liboping
Florian Forster [Sun, 19 Mar 2017 09:47:41 +0000 (10:47 +0100)]
Merge commit 'refs/pull/18/head' of github.com:octo/liboping

Fixes: #17
7 years agooping: Uset gettimeofday(2) instead of clock_gettime(2).
Florian Forster [Sat, 18 Mar 2017 11:18:14 +0000 (12:18 +0100)]
oping: Uset gettimeofday(2) instead of clock_gettime(2).

clock_gettime is not available on Mac OS X :(

Fixes: #19
7 years agoModified noping to follow terminal emulators color palette
middleO [Sun, 5 Feb 2017 09:05:39 +0000 (11:05 +0200)]
Modified noping to follow terminal emulators color palette

7 years agoconfigure: Make use of ncurses configurable
Thomas Deutschmann [Sun, 15 Jan 2017 06:22:47 +0000 (07:22 +0100)]
configure: Make use of ncurses configurable

When ncurses is found the current build system will use it to build the
"noping" utility. However, that will create an automagic dependencies on
ncurses which is a problem for some distributions.

This commit adds the ability to control the ncurses usage:

 a) If the user calls "configure" like before nothing changes: Configure
    tries to find a suitable ncurses installation to build "noping". If
    not found build system will just skip building of "noping" utility.

 b) If the user calls "configure" with new "--with-ncurses" option,
    configure will now fail if no suitable ncurses installation was
    found.

 c) If the user calls "configure" with new "--without-ncurses" option, the
    build system will now skip building of "noping" utility and ncurses
    will not be used.

In addition, this commit also changes the way configure will detect
ncurses: Configure now tries to use pkg-config to find ncurses but still
falls back to previous legacy checks. This will add support for ncurses
installation built with "--with-termlib" which causes several symbols to
get moved from libncurses.so to libtinfo.so.

8 years agoMerge branch 'pr/6'
Florian Forster [Thu, 18 Aug 2016 04:58:53 +0000 (06:58 +0200)]
Merge branch 'pr/6'

8 years agoadd bell output on successful pings
Antoine Beaupré [Mon, 5 Oct 2015 20:09:38 +0000 (16:09 -0400)]
add bell output on successful pings

the rationale here is that it's actually pretty hard to do this with a
regular ping. you need a silly shell loop and it doesn't always work
right everywhere, because the output of the system ping is
platform-dependant. it also buffers stdout in some weird ways sometimes.

therefore, i think it's a great addition to oping.

the purpose of this is that it can be useful to "hear" ping packets
come back when doing network diagnostics. obviously, this will be
useless in finding out *failed* hosts if multiple hosts are selected,
as any sucessful host will produce a beep. but it can nevertheless be
used to trace network cables or problems without looking at the
console. i also use audible pings to let me know when a hosts returns
after a reboot.

Note that I had to struggle quite a bit to make my terminal bell work,
the following articles were used to generate documentation on how to
make that work reliably:

https://askubuntu.com/questions/228096/terminal-bell-doesnt-ring

also see the following for the original inspiration for this:

http://catb.org/jargon/html/P/ping.html
https://groups.google.com/forum/#!msg/comp.sys.next/JDaeD8oqarU/v8xaDS8kXM0J

8 years agosrc/liboping.c: Simplify packet creation and parsing.
Florian Forster [Tue, 9 Aug 2016 14:35:15 +0000 (16:35 +0200)]
src/liboping.c: Simplify packet creation and parsing.

8 years agosrc/liboping.c: Replace sizeof(struct icmphdr) with ICMP_MINLEN.
Florian Forster [Tue, 9 Aug 2016 14:22:55 +0000 (16:22 +0200)]
src/liboping.c: Replace sizeof(struct icmphdr) with ICMP_MINLEN.

The definitions of struct icmphdr differ between platforms, while
ICMP_MINLEN is always 8, which is what we need here.

8 years agosrc/liboping.c: Performance improvements.
Luke Heberling [Sat, 6 Aug 2016 12:46:30 +0000 (14:46 +0200)]
src/liboping.c: Performance improvements.

I'm finding collectd's ping plugin inadequate for host lists larger than
a few hundred. It consumes an entire 2.8Ghz CPU and reports random false
packet loss (Latest collectd and liboping from git.verplant.org on
debian squeeze and lenny). This seems to be because of some
inefficiencies in liboping. For instance, a FD is created for every
host. Since each raw socket receives all raw packets, only one FD would
be needed for all hosts (of the same addrfamily). Besides consuming all
those additional FD's, each reply packet is received and processed
separately on each FD causing O(n^2) complexity. Also for each packet
processed on each FD, a scan of all hosts is performed causing O(n^3).

So, I implemented some new features for liboping:
   * use icmp ident as "hash" for table lookup on RX
   * allocate one socket FD per addressfamily (not per host)
   * multiplex socket writes in the same select loop as reads
      * This was necessary because sometimes the first reply
         is received before last request is sent.

It's working well for me in testing so far. 1-3% CPU with 1000 hosts,
compared to 100% and useless at 500 hosts before these changes. If
there's interest I'll update this thread with any significant changes.
As always, changes to address style/portability/other issues that
inhibit integration upstream will be my pleasure.

8 years agoFixed wrong icmp header length (20 extra zeros incorrectly appended to header)
Kyle Zhou [Tue, 2 Aug 2016 12:33:03 +0000 (22:33 +1000)]
Fixed wrong icmp header length (20 extra zeros incorrectly appended to header)

8 years agoconfigure: also check for clockgettime()
Yann E. MORIN [Tue, 5 Jul 2016 13:31:28 +0000 (15:31 +0200)]
configure: also check for clockgettime()

clock_gettime() is also in -lrt so we also need to
check for it.

Use AC_SEARCH_LIBS() instead of our canned combo of
AC_CHECK_FUNC() + AC_CHECK_LIB(). AC_SEARCH_LIBS()
will automatically add the necessary -l flags to the
LIBS variable, so we don't need out AM_CONDITIONAL()
construct either, now.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
8 years agosrc/oping.c: Add missing "break" in handling of the "O" option.
Florian Forster [Fri, 1 Jul 2016 14:23:56 +0000 (16:23 +0200)]
src/oping.c: Add missing "break" in handling of the "O" option.

8 years agosrc/oping.c: Actually _comma_ separate output lines.
Florian Forster [Mon, 27 Jun 2016 10:49:52 +0000 (12:49 +0200)]
src/oping.c: Actually _comma_ separate output lines.

8 years agosrc/oping.c: Fix calculation of fractional time.
Florian Forster [Mon, 27 Jun 2016 10:49:32 +0000 (12:49 +0200)]
src/oping.c: Fix calculation of fractional time.

It's "ns", not "us", stoopid!

8 years agoUpdate copyright notices.
Florian Forster [Mon, 27 Jun 2016 06:48:35 +0000 (08:48 +0200)]
Update copyright notices.

8 years agoBump version to 1.9.0; Update ChangeLog.
Florian Forster [Mon, 27 Jun 2016 06:43:44 +0000 (08:43 +0200)]
Bump version to 1.9.0; Update ChangeLog.

8 years agosrc/oping.c: Implement the "-O" option.
Florian Forster [Mon, 27 Jun 2016 06:42:12 +0000 (08:42 +0200)]
src/oping.c: Implement the "-O" option.

This new option allows to write RTT measurements to a CSV file for later
reporting.

9 years agosrc/oping.c: Code style fixes.
Florian Forster [Fri, 13 Feb 2015 13:07:36 +0000 (14:07 +0100)]
src/oping.c: Code style fixes.

9 years agooping(1): Document the "-m <mark>" command line option.
Florian Forster [Fri, 13 Feb 2015 13:07:21 +0000 (14:07 +0100)]
oping(1): Document the "-m <mark>" command line option.

9 years agooping(1): Correct the lower bound of the box plot.
Florian Forster [Fri, 13 Feb 2015 13:01:30 +0000 (14:01 +0100)]
oping(1): Correct the lower bound of the box plot.

9 years agooping(1): Document the "-w timeout" option.
Florian Forster [Fri, 13 Feb 2015 13:00:59 +0000 (14:00 +0100)]
oping(1): Document the "-w timeout" option.

9 years agoMerge branches 'mark' and 'timeout'
Florian Forster [Fri, 13 Feb 2015 12:46:06 +0000 (13:46 +0100)]
Merge branches 'mark' and 'timeout'

9 years agosrc/oping.c: Minor coding style changes.
Florian Forster [Fri, 13 Feb 2015 12:01:13 +0000 (13:01 +0100)]
src/oping.c: Minor coding style changes.

9 years agoImplement the "-w <timeout>" command line option.
Daniel Collins [Thu, 9 Jan 2014 11:38:54 +0000 (11:38 +0000)]
Implement the "-w <timeout>" command line option.

9 years agooping: Add the "-m <mark>" command line option.
Daniel Collins [Thu, 9 Jan 2014 11:38:54 +0000 (11:38 +0000)]
oping: Add the "-m <mark>" command line option.

This exposes the new "MARK" functionatlity to command line users.

9 years agoliboping: Add support for SO_MARK.
Daniel Collins [Thu, 9 Jan 2014 11:38:54 +0000 (11:38 +0000)]
liboping: Add support for SO_MARK.

Marks packets, which can be used for filtering and routing in Linux.

9 years agooping(1): Update fping's URL.
Florian Forster [Fri, 13 Feb 2015 11:39:26 +0000 (12:39 +0100)]
oping(1): Update fping's URL.

Thanks to Vincent Legout for reporting this issue.

9 years agoChange the project's website to http://noping.cc/ everywhere.
Florian Forster [Thu, 27 Nov 2014 07:52:23 +0000 (08:52 +0100)]
Change the project's website to noping.cc/ everywhere.

Also change my preferred email address.

10 years agoBump version to 1.8.0; Update ChangeLog. liboping-1.8.0
Florian Forster [Thu, 20 Nov 2014 14:33:43 +0000 (15:33 +0100)]
Bump version to 1.8.0; Update ChangeLog.

10 years agosrc/oping.c: Fix status output.
Florian Forster [Thu, 20 Nov 2014 13:46:40 +0000 (14:46 +0100)]
src/oping.c: Fix status output.

This is a really dirty hack: If the percentile and/or median output
decreases, the output may have less characters than previously. Add
spaces at the end of the string to clear digits with may have been
there, to avoid the "maximum" value be appear to go through the roof.

10 years agosrc/oping.c: Fix pretty ping graph movement.
Florian Forster [Thu, 20 Nov 2014 13:35:53 +0000 (14:35 +0100)]
src/oping.c: Fix pretty ping graph movement.

Fixed the wrap-around case and adds support for windows larger than the
history size.

10 years agosrc/oping.c: Improve comments.
Florian Forster [Thu, 20 Nov 2014 11:42:03 +0000 (12:42 +0100)]
src/oping.c: Improve comments.

Also remove dead code.

10 years agosrc/oping.c: Change the order of graphs.
Florian Forster [Thu, 20 Nov 2014 11:03:56 +0000 (12:03 +0100)]
src/oping.c: Change the order of graphs.

10 years agosrc/oping.c: Switch graphs when pressing "g".
Florian Forster [Wed, 19 Nov 2014 17:08:14 +0000 (18:08 +0100)]
src/oping.c: Switch graphs when pressing "g".

10 years agosrc/oping.c: Rewrite of the percentile code.
Florian Forster [Wed, 19 Nov 2014 16:59:33 +0000 (17:59 +0100)]
src/oping.c: Rewrite of the percentile code.

Rather than bucketizing RTTs and approximating the percentile, keep the
last 900 replies (15 minutes by default) in memory and calculate the
percentile from that.

This allows the "prettyping" graph to "move to the left", which is a much
nicer user experience IMHO.

10 years agosrc/oping.c: Add median and 'n'th percentile, remove average and stddev.
Florian Forster [Tue, 18 Nov 2014 17:23:56 +0000 (18:23 +0100)]
src/oping.c: Add median and 'n'th percentile, remove average and stddev.

Average and standard deviation are not very useful for network latency.
Median and (95th) percentiles are routinely used to measure network
performance, so provide them instead.

10 years agosrc/oping.c: Exit early if no host could be resolved.
Florian Forster [Tue, 18 Nov 2014 16:43:11 +0000 (17:43 +0100)]
src/oping.c: Exit early if no host could be resolved.

Otherwise "noping" would drop the user into an empty ncurses window,
which is very confusing, annoying and unexpected.

10 years agosrc/oping.c: Define thresholds for coloring green and yellow in a central place.
Florian Forster [Sun, 12 Oct 2014 15:32:47 +0000 (17:32 +0200)]
src/oping.c: Define thresholds for coloring green and yellow in a central place.

10 years agosrc/oping.c: Make sure the reported percentile value doesn't exceed the maximum.
Florian Forster [Sun, 12 Oct 2014 15:32:06 +0000 (17:32 +0200)]
src/oping.c: Make sure the reported percentile value doesn't exceed the maximum.

10 years agonoping: Color response times based on their percentile.
Florian Forster [Sun, 12 Oct 2014 15:31:41 +0000 (17:31 +0200)]
noping: Color response times based on their percentile.

Update the histogram's "ratio" array after ever response and use that to
color the response time in the noping application.

10 years agooping manual page: Document the "-g histogram" option.
Florian Forster [Fri, 10 Oct 2014 10:53:40 +0000 (12:53 +0200)]
oping manual page: Document the "-g histogram" option.

10 years agosrc/oping.c: Add a "-g histrogram" option.
Florian Forster [Thu, 9 Oct 2014 20:50:41 +0000 (22:50 +0200)]
src/oping.c: Add a "-g histrogram" option.

10 years agonoping: Add the "-g" option.
Florian Forster [Thu, 9 Oct 2014 14:39:00 +0000 (16:39 +0200)]
noping: Add the "-g" option.

10 years agoInitial implementation of a box plot.
Florian Forster [Thu, 9 Oct 2014 10:36:09 +0000 (12:36 +0200)]
Initial implementation of a box plot.

Still needs a command line switch and documentation.

10 years agooping, noping: Implement percentile reporting.
Florian Forster [Sun, 28 Sep 2014 09:17:26 +0000 (02:17 -0700)]
oping, noping: Implement percentile reporting.

10 years agoconfigure.ac: Change homepage and bug report address. liboping-1.7.0
Florian Forster [Thu, 25 Sep 2014 19:29:11 +0000 (12:29 -0700)]
configure.ac: Change homepage and bug report address.

10 years agoliboping.pc: Let configure create the pkg-config file.
Florian Forster [Thu, 25 Sep 2014 19:23:10 +0000 (12:23 -0700)]
liboping.pc: Let configure create the pkg-config file.

10 years agoBump version to 1.7.0; Update ChangeLog.
Florian Forster [Thu, 25 Sep 2014 17:39:31 +0000 (10:39 -0700)]
Bump version to 1.7.0; Update ChangeLog.

10 years agoMerge pull request #4 from barak/upstream
Florian Forster [Thu, 25 Sep 2014 00:22:44 +0000 (17:22 -0700)]
Merge pull request #4 from barak/upstream

minor build system tweaks, to generate oping.pc file for pkg-config oping

10 years agoMerge branch 'bp/exit'
Florian Forster [Thu, 25 Sep 2014 00:10:54 +0000 (17:10 -0700)]
Merge branch 'bp/exit'

Conflicts:
src/mans/oping.pod
src/oping.c

10 years agoMerge branch 'ab/prettyping'
Florian Forster [Wed, 24 Sep 2014 23:55:36 +0000 (16:55 -0700)]
Merge branch 'ab/prettyping'

10 years agoMake the prettyping output work with and without colors.
Florian Forster [Wed, 24 Sep 2014 23:44:58 +0000 (16:44 -0700)]
Make the prettyping output work with and without colors.

10 years agosimplify autogen.sh
Barak A. Pearlmutter [Thu, 22 May 2014 22:20:32 +0000 (23:20 +0100)]
simplify autogen.sh

10 years agogenerate and install oping.pc file, for pkg-config oping
Barak A. Pearlmutter [Thu, 22 May 2014 22:12:53 +0000 (23:12 +0100)]
generate and install oping.pc file, for pkg-config oping

10 years agoadd bug email and project url to configure.ac AC_INIT
Barak A. Pearlmutter [Thu, 22 May 2014 22:12:12 +0000 (23:12 +0100)]
add bug email and project url to configure.ac AC_INIT

10 years agoping_receive_all(): Return immediately when select(2) is interrupted.
Florian Forster [Tue, 14 Jan 2014 12:36:33 +0000 (13:36 +0100)]
ping_receive_all(): Return immediately when select(2) is interrupted.

Previously the function would continue and only return when all hosts
were received or a timeout occurred. This meant that hitting ^C would
only stop "oping" after half a second or so. This this, oping also exits
immediately.

10 years agoAdd support for both, ncurses and ncursesw.
Florian Forster [Fri, 10 Jan 2014 11:28:02 +0000 (12:28 +0100)]
Add support for both, ncurses and ncursesw.

10 years agoAdd documentation for the "-u" and "-U" options.
Florian Forster [Fri, 6 Dec 2013 10:02:35 +0000 (11:02 +0100)]
Add documentation for the "-u" and "-U" options.

10 years agosrc/oping.h: Don't use the ncurses internal _nc_unicode_locale() function.
Florian Forster [Fri, 6 Dec 2013 09:52:22 +0000 (10:52 +0100)]
src/oping.h: Don't use the ncurses internal _nc_unicode_locale() function.

The "-u" and "-U" options are now handled in a single variable so that the
last option "wins".

10 years agoadd commandline flag for forcing or disabling unicode
Antoine Beaupré [Fri, 6 Dec 2013 05:16:28 +0000 (00:16 -0500)]
add commandline flag for forcing or disabling unicode

note that "forcing" may not work: ncurses still expects your locale to
be correct, so maybe the force flag should also explicitely set a utf8
locale?

10 years agomove unicode detection to a separate function
Antoine Beaupré [Fri, 6 Dec 2013 05:07:09 +0000 (00:07 -0500)]
move unicode detection to a separate function

this will ease transition to a commandline option override

10 years agoautodetect unicode, and fallback to ACS scancodes on failure
Antoine Beaupré [Fri, 6 Dec 2013 04:35:00 +0000 (23:35 -0500)]
autodetect unicode, and fallback to ACS scancodes on failure

this is fairly ugly - we use a hidden ncurses function to detect
unicode (but at least we don't reimplement it), then we mess around
with the character arrays to display the rights symbols

i am not sure i like this, but i prefer to braindump than to stall, so
let's move forward.

10 years agoRefactor the graph printing into its own function.
Florian Forster [Thu, 5 Dec 2013 17:15:52 +0000 (18:15 +0100)]
Refactor the graph printing into its own function.

This makes it much easier and cleaner to add a second, non-Unicode
implementation and possibly even a non-color version.

10 years agoswitch to ncursesw in the build chain
Antoine Beaupré [Tue, 3 Dec 2013 05:33:39 +0000 (00:33 -0500)]
switch to ncursesw in the build chain

10 years agoMerge remote-tracking branch 'anarcat/autogen'
Florian Forster [Tue, 3 Dec 2013 14:33:18 +0000 (15:33 +0100)]
Merge remote-tracking branch 'anarcat/autogen'

10 years agoignore generated file
Antoine Beaupré [Tue, 3 Dec 2013 05:34:32 +0000 (00:34 -0500)]
ignore generated file

10 years agobetter wrapping: add a cursor and respect inner borders
Antoine Beaupré [Tue, 3 Dec 2013 04:15:13 +0000 (23:15 -0500)]
better wrapping: add a cursor and respect inner borders

10 years agorework scaling algorithm so it covers the whole range
Antoine Beaupré [Tue, 3 Dec 2013 03:57:00 +0000 (22:57 -0500)]
rework scaling algorithm so it covers the whole range

i did this after some stress testing, now it covers the whole range on input

10 years agocleanup safety checks
Antoine Beaupré [Tue, 3 Dec 2013 03:32:46 +0000 (22:32 -0500)]
cleanup safety checks

make sure that if we go beyond the max ratio, we just mark it as one

10 years agowrap around the window once the histogram grows too big
Antoine Beaupré [Tue, 3 Dec 2013 03:32:15 +0000 (22:32 -0500)]
wrap around the window once the histogram grows too big

10 years agoremove a little quirk i introduced by mistake
Antoine Beaupré [Tue, 3 Dec 2013 03:29:53 +0000 (22:29 -0500)]
remove a little quirk i introduced by mistake

this was breaking the border

10 years agomake histogram colors with a nicer background
Antoine Beaupré [Tue, 3 Dec 2013 03:29:24 +0000 (22:29 -0500)]
make histogram colors with a nicer background

10 years agorestore usual ping display, now that histograms are in a different window
Antoine Beaupré [Tue, 3 Dec 2013 03:10:41 +0000 (22:10 -0500)]
restore usual ping display, now that histograms are in a different window

10 years agoput histograms into the independent window, to eventually restore ping times display
Antoine Beaupré [Tue, 3 Dec 2013 03:06:26 +0000 (22:06 -0500)]
put histograms into the independent window, to eventually restore ping times display

10 years agoadd autogen script for clueless people like me
Antoine Beaupré [Tue, 3 Dec 2013 01:51:05 +0000 (20:51 -0500)]
add autogen script for clueless people like me

10 years agoimplement some prettyping-inspired display instead of textual
Antoine Beaupré [Tue, 3 Dec 2013 01:45:58 +0000 (20:45 -0500)]
implement some prettyping-inspired display instead of textual

this is a first stab at porting "prettyping.sh" into noping. the idea
is to show a histogram of ping times instead of numerical values. with
some work, we could actually show both, but this focuses on
implementing the hard part (the histogram) properly.

it is very rudimentary for now:

 * the math may be wrong for the size of the bar, I was mostly in a
   rush to make unicode work and have something pretty quickly.

 * all hosts are on the same line: each should have its own line

 * the histogram should be displayed in a separate window

 * it should use background colors as well

 * it should fallback when the terminal is not unicode-capable

 * the scaling logic is fully automatic, which necessarily gives weird
   results at first

this requires switching to the ncursesw library and other unicode
ncurses hackery described in this post:

http://newsgroups.derkeiler.com/Archive/Rec/rec.games.roguelike.development/2010-09/msg00050.html

pretty ping is a awk/bash script, MIT-licensed, available here:

https://bitbucket.org/denilsonsa/small_scripts/src/tip/prettyping.sh

12 years agoSolaris 10 compatibility patch
Scott Severtson [Mon, 21 May 2012 14:44:02 +0000 (10:44 -0400)]
Solaris 10 compatibility patch

Solaris 10's version of netinet/ip.h doesn't include a definition for
IPTOS_MINCOST, which results in the following build error:

---
libtool: link: ( cd ".libs" && rm -f "liboping.la" && ln -s
"../liboping.la" "liboping.la" )
gcc -DHAVE_CONFIG_H -I.   -D_XPG4_2 -D__EXTENSIONS__ -Wall -Werror -g
-O2 -c oping.c
oping.c: In function `usage_qos_exit':
oping.c:311: error: `IPTOS_MINCOST' undeclared (first use in this function)
oping.c:311: error: (Each undeclared identifier is reported only once
oping.c:311: error: for each function it appears in.)
oping.c: In function `set_opt_send_qos':
oping.c:389: error: `IPTOS_MINCOST' undeclared (first use in this function)
gmake[3]: *** [oping.o] Error 1
---

I've attached a patch to define this value, consistent with how the
Asterisk project resolved this issue:
https://issues.asterisk.org/view.php?id=12050

The patch was developed against liboping 1.6.2; it doesn't appear
there have been any changes in git since this release.

Thanks,
--Scott Severtson

Signed-off-by: Florian Forster <octo@verplant.org>
12 years agoBump ABI version; update ChangeLog. liboping-1.6.2
Florian Forster [Tue, 31 Jan 2012 16:20:15 +0000 (17:20 +0100)]
Bump ABI version; update ChangeLog.

12 years agoMac OX S 10.7 compile fixes.
Clayton O'Neill [Sun, 30 Oct 2011 23:36:46 +0000 (19:36 -0400)]
Mac OX S 10.7 compile fixes.

I've attached a patch that's required to be able to compile liboping on
MacOS 10.7 (Lion).  The issue is that the IPv6 API's are changing from
RFC 2292 to 3542, and Apple's headers require you to state which API you
want to use by defining a constant.  I've changed it to use either based
on the presence of constants, but to prefer 3542 on MacOS.

One problem I see with this is that if you have both multicast and
unicast TTL's set, then this won't report both of them, but I'm not sure
if that's even valid and it would require more significant rework.
Also, I noticed you have fixed the IP_RECVTOS issue in head.  That patch
is also required to be able to compile on Solaris and MacOS.

Signed-off-by: Florian Forster <octo@verplant.org>
13 years agooping: Make the exit status the number of hosts failed.
Florian Forster [Wed, 7 Sep 2011 01:08:32 +0000 (21:08 -0400)]
oping: Make the exit status the number of hosts failed.

As far as I know, EXIT_FAILURE is only portable when used as-is, i.e. without
adding anything to it. Especially with "EXIT_FAILURE == -1" we might run into
trouble. I think it's more convenient to just use the number of failed hosts
rather than 1+<num> (on Linux).

13 years agofiddle with failure threshold messages and comments
Barak A. Pearlmutter [Tue, 6 Sep 2011 07:03:59 +0000 (08:03 +0100)]
fiddle with failure threshold messages and comments

13 years agooping: Implement the "-Z" option.
Florian Forster [Mon, 5 Sep 2011 02:51:14 +0000 (22:51 -0400)]
oping: Implement the "-Z" option.

This makes it possible to configure the threshold for exiting with a non-zero
exit status due to missing replies.

13 years agonon-zero process exit status when too many packets are unreturned
Barak A. Pearlmutter [Thu, 1 Sep 2011 12:22:05 +0000 (13:22 +0100)]
non-zero process exit status when too many packets are unreturned

The number of unreturned packets in excess of 50% is summed over all
hosts.  If this is nonzero, this count plus 1 is the process exit
status.

13 years agoguard use of IP_RECVTOS which is unavailable on kfreebsd
Barak A. Pearlmutter [Thu, 1 Sep 2011 11:48:57 +0000 (12:48 +0100)]
guard use of IP_RECVTOS which is unavailable on kfreebsd

13 years agoconfigure.ac: autoconf 2.65 works just fine, too.
Florian Forster [Sat, 27 Aug 2011 15:12:19 +0000 (17:12 +0200)]
configure.ac: autoconf 2.65 works just fine, too.

13 years agoREADME: Add note about capabilities.
Florian Forster [Fri, 2 Sep 2011 02:55:32 +0000 (22:55 -0400)]
README: Add note about capabilities.

13 years agoManual pages: Update the copyright information.
Florian Forster [Sun, 13 Mar 2011 19:26:43 +0000 (20:26 +0100)]
Manual pages: Update the copyright information.

13 years agoBump version to 1.6.2; Update ChangeLog.
Florian Forster [Sun, 13 Mar 2011 19:18:47 +0000 (20:18 +0100)]
Bump version to 1.6.2; Update ChangeLog.

13 years agoconfigure.ac: autoconf 2.67 works just fine.
Florian Forster [Sat, 27 Aug 2011 15:12:19 +0000 (17:12 +0200)]
configure.ac: autoconf 2.67 works just fine.

13 years agoMerge pull request #1 from barak/master
Florian Forster [Sat, 27 Aug 2011 15:00:37 +0000 (08:00 -0700)]
Merge pull request #1 from barak/master

upstream update + tweaks

13 years agogit ignore more build debris
Barak A. Pearlmutter [Sun, 21 Aug 2011 13:32:21 +0000 (15:32 +0200)]
git ignore more build debris

13 years agoUpdate configure.ac and Makefile.am per autotools
Barak A. Pearlmutter [Sun, 21 Aug 2011 13:03:11 +0000 (15:03 +0200)]
Update configure.ac and Makefile.am per autotools

Tweak configure.ac and Makefile.am per autoreconf instructions.
 libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
 libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
 libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
 libtoolize: `AC_PROG_RANLIB' is rendered obsolete by `LT_INIT'
Accept autoupdate modifications.
Manually integrate portions of autoscan configure.scan.

13 years agosrc/Makefile.am: Make setcap and chmod fault-tolerant.
Florian Forster [Thu, 10 Mar 2011 16:10:16 +0000 (17:10 +0100)]
src/Makefile.am: Make setcap and chmod fault-tolerant.

This is required because this weird Debian fakeroot utility gives the
impression as if the install was run by root, when in fact it isn't.
What good this should do is beyond me.