1 // Copyright Leandro Lucarella 2008 - 2010.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file COPYING or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef POSIXX_LINUX_TIPC_OPT_HPP_
8 #define POSIXX_LINUX_TIPC_OPT_HPP_
10 #include <linux/tipc.h>
14 namespace posixx { namespace linux { namespace tipc {
17 * Specific options for TIPC sockets.
19 * @see tipc::socket::opt() and setsockopt(2) in TIPC documentation for more
24 #define MKSOLOPT(O, T) \
28 optname = TIPC_ ## O, \
34 * How to handle messages sent by the socket if link congestion occurs.
36 * If enabled, the message is discarded; otherwise the system queues the
37 * message for later transmission.
39 * By default, this option is disabled for socket::SEQPACKET, socket::STREAM,
40 * and socket::RDM socket types (resulting in "reliable" data transfer), and
41 * enabled for socket::DGRAM (resulting in "unreliable" data transfer).
43 MKSOLOPT(SRC_DROPPABLE, int);
46 * How to handle messages sent by the socket if they cannot be delivered.
48 * This option governs the handling of messages sent by the socket if the
49 * message cannot be delivered to its destination, either because the receiver
50 * is congested or because the specified receiver does not exist. If enabled,
51 * the message is discarded; otherwise the message is returned to the sender.
53 * By default, this option is disabled for socket::SEQPACKET and socket::STREAM
54 * socket types, and enabled for socket::RDM and socket::DGRAM, This
55 * arrangement ensures proper teardown of failed connections when
56 * connection-oriented data transfer is used, without increasing the complexity
57 * of connectionless data transfer.
59 MKSOLOPT(DEST_DROPPABLE, int);
62 * Number of ms connect() will wait before aborting a connection attempt.
64 * This option specifies the number of milliseconds socket::connect() will wait
65 * before aborting a connection attempt because the destination has not
66 * responded. By default, 8000 (i.e. 8 seconds) is used.
68 * This option has no effect when establishing connections using
71 MKSOLOPT(CONN_TIMEOUT, int);
78 LOW = TIPC_LOW_IMPORTANCE, ///< Low importance
79 MEDIUM = TIPC_MEDIUM_IMPORTANCE, ///< Medium importance
80 HIGH = TIPC_HIGH_IMPORTANCE, ///< High importance
81 CRITICAL = TIPC_CRITICAL_IMPORTANCE ///< Critical importance
85 * How likely a message sent by the socket is to be affected by congestion.
87 * A message with higher importance is less likely to be delayed or dropped due
88 * to link congestion, and also less likely to be rejected due to receiver
89 * congestion. The following values are defined: ::LOW, ::MEDIUM, ::HIGH, and
92 * By default, ::LOW is used for all TIPC socket types.
96 typedef importance type;
100 optname = TIPC_IMPORTANCE,
106 } } } } // namespace posixx::linux::tipc::opt
108 #endif // POSIXX_LINUX_TIPC_OPT_HPP_