1 #ifndef POSIXX_LINUX_TIPC_OPT_HPP_
2 #define POSIXX_LINUX_TIPC_OPT_HPP_
4 #include <linux/tipc.h>
8 namespace posixx { namespace linux { namespace tipc {
11 * Specific options for TIPC sockets.
13 * @see tipc::socket::opt() and setsockopt(2) in TIPC documentation for more
18 #define MKSOLOPT(O, T) \
22 optname = TIPC_ ## O, \
28 * How to handle messages sent by the socket if link congestion occurs.
30 * If enabled, the message is discarded; otherwise the system queues the
31 * message for later transmission.
33 * By default, this option is disabled for socket::SEQPACKET, socket::STREAM,
34 * and socket::RDM socket types (resulting in "reliable" data transfer), and
35 * enabled for socket::DGRAM (resulting in "unreliable" data transfer).
37 MKSOLOPT(SRC_DROPPABLE, int);
40 * How to handle messages sent by the socket if they cannot be delivered.
42 * This option governs the handling of messages sent by the socket if the
43 * message cannot be delivered to its destination, either because the receiver
44 * is congested or because the specified receiver does not exist. If enabled,
45 * the message is discarded; otherwise the message is returned to the sender.
47 * By default, this option is disabled for socket::SEQPACKET and socket::STREAM
48 * socket types, and enabled for socket::RDM and socket::DGRAM, This
49 * arrangement ensures proper teardown of failed connections when
50 * connection-oriented data transfer is used, without increasing the complexity
51 * of connectionless data transfer.
53 MKSOLOPT(DEST_DROPPABLE, int);
56 * Number of ms connect() will wait before aborting a connection attempt.
58 * This option specifies the number of milliseconds socket::connect() will wait
59 * before aborting a connection attempt because the destination has not
60 * responded. By default, 8000 (i.e. 8 seconds) is used.
62 * This option has no effect when establishing connections using
65 MKSOLOPT(CONN_TIMEOUT, int);
72 LOW = TIPC_LOW_IMPORTANCE, ///< Low importance
73 MEDIUM = TIPC_MEDIUM_IMPORTANCE, ///< Medium importance
74 HIGH = TIPC_HIGH_IMPORTANCE, ///< High importance
75 CRITICAL = TIPC_CRITICAL_IMPORTANCE ///< Critical importance
79 * How likely a message sent by the socket is to be affected by congestion.
81 * A message with higher importance is less likely to be delayed or dropped due
82 * to link congestion, and also less likely to be rejected due to receiver
83 * congestion. The following values are defined: ::LOW, ::MEDIUM, ::HIGH, and
86 * By default, ::LOW is used for all TIPC socket types.
90 typedef importance type;
94 optname = TIPC_IMPORTANCE,
100 } } } } // namespace posixx::linux::tipc::opt
102 #endif // POSIXX_LINUX_TIPC_OPT_HPP_