![]() |
SolarCapture C Bindings User Guide
SF-115721-CD
Draft 2A
|
A node used to pass sc_packet objects between two SolarCapture sessions via a TCP socket.
This node establishes a TCP connection between two SolarCapture node graphs so that you can pass packets between them. Packets arriving on an input link are forwarded over the connection to an output link on the other side that has the same name. Each sc_tunnel can support multiple input and output links, so that multiple separate channels are created.
Argument | Optional? | Default | Type | Description |
---|---|---|---|---|
connect_to | Yes | SC_PARAM_STR | Connect to specified "host:port". | |
server_name | Yes | SC_PARAM_STR | Hostname or IP address of the server interface to connect to if active, or to bind to if passive. | |
server_port | Yes | SC_PARAM_STR | The TCP port number of the server to connect to if active, or to bind to if passive. | |
socket_fd | Yes | SC_PARAM_INT | A file descriptor that is a connected stream socket (in which case server_name, server_port, passive_open and connect_to are not used). | |
remote_args | Yes | SC_PARAM_STR | Opaque message to send to remote side prior to starting sc_tunnel protocol. | |
passive_open | Yes | SC_PARAM_INT | Should this node be opened in passive mode? Defaults to passive mode unless connect_to is set. | |
recv_buf_size | Yes | 32k | SC_PARAM_INT | Socket receive buffer size (note: does not constrain message size) |
max_msg_size | Yes | > 1514 | SC_PARAM_INT | Maximum supported message size; by default is large enough ot hold any non-jumbo frame |
To make an active connection: Set connect_to=host:port or set passive_open=0, server_name=host and server_port=port.
To make a passive connection: Set server_port=port and optionally server_host=host if you want to bind to a specific IP interface.
The remote_args
feature is typically used on the client side when connecting to a server process. The specified message (not including nul) is sent to the server immediately after the connection is established, preceded by its length encoded as a 32-bit integer in network byte order. It can be used to give information to the server about the service required, which the server can then use when setting up the node graph that the client will interact with. Note that sc_tunnel does not itself consume this message: It must be consumed by the application prior to passing the socket to an sc_tunnel instance using the socket_fd argument.
Packets arriving on an input link named "foo" are forwarded to an output link named "foo" on the other side.
Link | Description |
---|---|
"#exit" | Receives an end-of-stream indication once end of stream is signalled on all inputs and outputs and outstanding data is sent. |