'Tool for testing connectivity on transport layer using netcat
executable.
The processes are spawned lazily.
:param client_namespace: Namespace in which netcat process that
connects to other netcat will be spawned
:param server_namespace: Namespace in which listening netcat process
will be spawned
:param address: Server address from client point of view
:param dst_port: Port on which netcat listens
:param protocol: Transport protocol, either \'tcp\', \'udp\' or \'sctp\'
:param server_address: Address in server namespace on which netcat
should listen
:param src_port: Source port of netcat process spawned in client
namespace - packet will have src_port in TCP/UDP
header with this value'

def __init__(self, client_namespace, server_namespace, address, dst_port, protocol, server_address=None, src_port=None):

    self.client_namespace = client_namespace
    self.server_namespace = server_namespace
    self._client_process = None
    self._server_process = None
    self.address = address
    self.dst_port = str(dst_port)
    self.src_port = (str(src_port) if src_port else None)
    if (protocol not in TRANSPORT_PROTOCOLS):
        raise ValueError(('Unsupported    protocol    %s' % protocol))
    self.protocol = protocol
    ip_version = netaddr.IPAddress(address).version
    self.server_address = (server_address or self.VERSION_TO_ALL_ADDRESS[ip_version])
