+ /* Return session id or negative ret code. */
+ if (reply.generic.ret_code != LTTNG_OK) {
+ ret = -1;
+ ERR("Relayd create session replied error %d",
+ reply.generic.ret_code);
+ goto error;
+ } else {
+ ret = 0;
+ *relayd_session_id = reply.generic.session_id;
+ }
+
+ DBG("Relayd session created with id %" PRIu64, reply.generic.session_id);
+
+error:
+ return ret;
+}
+
+static int relayd_add_stream_2_1(struct lttcomm_relayd_sock *rsock,
+ const char *channel_name, const char *pathname)
+{
+ int ret;
+ struct lttcomm_relayd_add_stream msg;
+
+ memset(&msg, 0, sizeof(msg));
+ if (lttng_strncpy(msg.channel_name, channel_name,
+ sizeof(msg.channel_name))) {
+ ret = -1;
+ goto error;
+ }
+
+ if (lttng_strncpy(msg.pathname, pathname,
+ sizeof(msg.pathname))) {
+ ret = -1;
+ goto error;
+ }
+
+ /* Send command */
+ ret = send_command(rsock, RELAYD_ADD_STREAM, (void *) &msg, sizeof(msg), 0);