25 "SOCK_STREAM" Provides sequenced, reliable, full-duplex, connection-based byte streams.
25 "MOS_SOCK_MONITOR_STREAM" Provides a middlebox viewpoint for ongoing connection-oriented flows.
25 "MOS_SOCK_MONITOR_RAW" Provides a middlebox viewpoint for connection-less flows. This can be used as a tap to glean unsynchronized TCP packets (no connection handshakes) or any other IP datagrams.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
The
"protocol" argument represents the specific protocol ID to be used with the
socket. mTCP assumes this argument to be 0 (since it only supports
single-protocol sockets).
Sockets of type
SOCK_STREAM represent full-duplex bytestreams. A stream socket must be in
ESTABLISHED TCP state before data can be sent or received on it. A connection
to another peer endpoint can be created with an
mtcp_connect() call. Once connected, data may be exchanged using
mtcp_read() and
mtcp_write() calls. When a session needs to be terminated,
mtcp_close() can be called. Socket operations can be manipulated using socket
level options via
mtcp_setsockopt() and
mtcp_getsockopt() function calls. mTCP sockets run in non-blocking mode by
default.
Sockets of type
MOS_SOCK_MONITOR_STREAM represent middlebox viewpoint of full-duplex bytestreams. A
monitoring stream socket must be in
ESTABLISHED TCP state before TCP bytestreams can be snooped from the
TCP ring buffers of either client or server TCP emulated stacks
using either
mtcp_peek() or
mtcp_ppeek() functions. A stream monitoring socket can be bound with a
connection filter using
mtcp_bind_monitor_filter() function. The user can use
mtcp_register_callback() function to register the socket with relevant mOS events. These
can either be built-in events or user-defined (custom) events.
Like
SOCK_STREAM sockets, operations can be manipulated using socket level options
via
mtcp_setsockopt() and
mtcp_getsockopt() function calls. A call to
mtcp_close() function unregisters all flow events for the socket, but it does
not terminate the ongoing connection.
Sockets of type
MOS_SOCK_MONITOR_RAW can be used to monitor network traffic without connection
semantics. Only packet-based functions such as
mtcp_getlastpkt() can be utilized using these sockets.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
15 "EACCES" "mctx" is not valid.
15 "EAFNOSUPPORT" "domain" is not supported.
15 "EINVAL" The socket "type" is invalid.
15
"ENFILE" No socket descriptor is available in the pool at the moment.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"""".SH CONFORMING TO
""""POSIX.1-2001.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""