define Raindrops::TCP hash for TCP statesfreebsd
commitbf2fb0a16091201a9b2798ebdea54e03c1c3e61b
authorEric Wong <e@80x24.org>
Thu, 16 Mar 2017 03:16:52 +0000 (16 03:16 +0000)
committerEric Wong <e@80x24.org>
Fri, 17 Mar 2017 22:39:12 +0000 (17 22:39 +0000)
treea3cd9a2713024e87633908d59d545a07827f3b9a
parent17d57231c4d9d3dfb486b6d37b85d57e6065958e
define Raindrops::TCP hash for TCP states

FreeBSD not only uses different values than Linux for TCP
states, but different names, too.  To ease writing portable code
between the OSes, do more CPP metaprogramming via extconf.rb
and define a common hash supported on both OSes.

Putting all this in a hash allows for easy dumping and mapping
in an OS-neutral way, since the actual TCP states are
OS-independent.
ext/raindrops/extconf.rb
ext/raindrops/tcp_info.c
test/test_tcp_info.rb