+ /* Network sequence number. Indicating on which relayd socket it goes. */
+ int net_seq_idx;
+ /* Identify if the stream is the metadata */
+ unsigned int metadata_flag;
+ /* Used when the stream is set for network streaming */
+ uint64_t relayd_stream_id;
+ /* Next sequence number to use for trace packet */
+ uint64_t next_net_seq_num;
+};
+
+/*
+ * Internal representation of a relayd socket pair.
+ */
+struct consumer_relayd_sock_pair {
+ /* Network sequence number. */
+ int net_seq_idx;
+ /* Number of stream associated with this relayd */
+ unsigned int refcount;
+
+ /*
+ * This flag indicates whether or not we should destroy this object. The
+ * destruction should ONLY occurs when this flag is set and the refcount is
+ * set to zero.
+ */
+ unsigned int destroy_flag;
+
+ /*
+ * Mutex protecting the control socket to avoid out of order packets
+ * between threads sending data to the relayd. Since metadata data is sent
+ * over that socket, at least two sendmsg() are needed (header + data)
+ * creating a race for packets to overlap between threads using it.
+ */
+ pthread_mutex_t ctrl_sock_mutex;
+
+ /* Control socket. Command and metadata are passed over it */
+ struct lttcomm_sock control_sock;
+
+ /*
+ * We don't need a mutex at this point since we only splice or write single
+ * large chunk of data with a header appended at the begining. Moreover,
+ * this socket is for now only used in a single thread.
+ */
+ struct lttcomm_sock data_sock;
+ struct lttng_ht_node_ulong node;