When a connection is specified in place of a flow error out nicely

When a connection is specified via -f instead of a flow we get:
Traceback (most recent call last):
  File "./captcp.py", line 5210, in <module>
    sys.exit(captcp.run())
  File "./captcp.py", line 5171, in run
    classinstance.initialize()
  File "./captcp.py", line 4197, in initialize
    self.parse_local_options()
  File "./captcp.py", line 4264, in parse_local_options
    (self.connection_id, self.local_flow_id) =
self.opts.connections.split('.')
ValueError: need more than 1 value to unpack

Error out nicely instead:
You specified a connection not a flow

Signed-off-by: Michele Baldessari <michele@acksyn.org>
Fix connection module

Currently "captcp connection" fails with:
Traceback (most recent call last):
  File "/usr/share/captcp/captcp.py", line 5210, in <module>
    sys.exit(captcp.run())
  File "/usr/share/captcp/captcp.py", line 5171, in run
    classinstance.initialize()
  File "/usr/share/captcp/captcp.py", line 2585, in initialize
    self.set_opts_logevel()
  File "/usr/share/captcp/captcp.py", line 874, in set_opts_logevel
    if not self.opts.loglevel:
AttributeError: Values instance has no attribute 'loglevel'

Fix it by adding the proper loglevel parse option in place of 'verbose'

Signed-off-by: Michele Baldessari <michele@acksyn.org>
Remove global -v option as it conflicts with the module one

-v prints out the version of captcp but it is also used for
loglevel/verbose within the modules. Remove the global one
as it is less invasive

Signed-off-by: Michele Baldessari <michele@acksyn.org>
Avoid payloadimport failures on special pcap files

payloadimport can fail if the pcap file contains specially crafted
packets:
Traceback (most recent call last):
  File "/usr/share/captcp/captcp.py", line 5210, in <module>
    sys.exit(captcp.run())
  File "/usr/share/captcp/captcp.py", line 5191, in run
    pcap_parser.run()
  File "/usr/share/captcp/captcp.py", line 562, in run
    self.callback(dt, packet.data)
  File "/usr/share/captcp/captcp.py", line 932, in process_packet
    tcp = packet.data
AttributeError: 'str' object has no attribute 'data'

Simply skip those packets and emit a warning
Simplify calc_rtt and error out in 'animation' when the flow contains no SYN packets

Using 'animation' with a flow that has no SYN packets gives the
following backtrace:
Traceback (most recent call last):
  File "./captcp.py", line 5210, in <module>
    sys.exit(captcp.run())
  File "./captcp.py", line 5191, in run
    pcap_parser.run()
  File "./captcp.py", line 562, in run
    self.callback(dt, packet.data)
  File "./captcp.py", line 4360, in process_packet
    self.process_local_side(ts, packet, tpi)
  File "./captcp.py", line 4302, in process_local_side
    (td, len(packet) / 2, self.rtt_data["twh-delay"] /
self.acceleration))
KeyError: 'twh-delay'

Error out properly in such conditions.
Slightly simplify calc_rtt while we're at it

Fixes Issue #15 - https://github.com/hgn/captcp/issues/15
Fix 'template -l'

'captcp template -l' was broken to the precense of .m files
in data/templates. Just skip those files when listing
templates
Adjust Geoip class so that it works

Currently the geoip module does not work:
$ captcp geoip -h
Traceback (most recent call last):
  File "/usr/share/captcp/captcp.py", line 5210, in <module>
    sys.exit(captcp.run())
  File "/usr/share/captcp/captcp.py", line 5168, in run
    classinstance = globals()[classtring]()
TypeError: __init__() takes exactly 2 arguments (1 given)

Subclass it from mod and also clean up the logging a bit
Fix BACKLOG stat in socketstatistic

Currently socketstatistic cannot parse the backlog attribute of skmem:
$ ./captcp.py socketstatistic -o /tmp/cap3
Unknown socket buffer value: bl0
Unknown socket buffer value: bl0
Unknown socket buffer value: bl0

Add the missing 'continue' to fix this
Fix proper usage name in some modules

spacing, inflight and throughput had still 'show' in their usage help
.stap scripts are executable install them like that

tcp-trace.stp should be marked as an executable as it can be run
directly
core: add GPL3 preambel

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
core: credit other developers too

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
core: add more contributors

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
Captcp Version 1.7

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>