X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fcmd-2-4.c;h=a3290cb259cc28fd31cb2087391800b571200876;hb=49e614cb2878f0664c9f44f9f24cb1d81116de21;hp=f199b8396707746bb1144ef7f8f2b7c1d321f89a;hpb=7d2f74525fbda4dcc744f33ea26c911545b5df13;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/cmd-2-4.c b/src/bin/lttng-relayd/cmd-2-4.c index f199b8396..a3290cb25 100644 --- a/src/bin/lttng-relayd/cmd-2-4.c +++ b/src/bin/lttng-relayd/cmd-2-4.c @@ -1,6 +1,7 @@ /* * Copyright (C) 2013 - Julien Desfossez * David Goulet + * 2015 - Mathieu Desnoyers * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License, version 2 only, as @@ -17,36 +18,37 @@ */ #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include #include +#include + #include "cmd-generic.h" #include "lttng-relayd.h" -int cmd_create_session_2_4(struct relay_command *cmd, - struct relay_session *session) +int cmd_create_session_2_4(struct relay_connection *conn, + char *session_name, char *hostname, + uint32_t *live_timer, bool *snapshot) { int ret; struct lttcomm_relayd_create_session_2_4 session_info; - assert(cmd); - assert(session); - - ret = cmd_recv(cmd->sock, &session_info, sizeof(session_info)); + ret = cmd_recv(conn->sock, &session_info, sizeof(session_info)); if (ret < 0) { ERR("Unable to recv session info version 2.4"); goto error; } - strncpy(session->session_name, session_info.session_name, - sizeof(session->session_name)); - strncpy(session->hostname, session_info.hostname, - sizeof(session->hostname)); - session->live_timer = be32toh(session_info.live_timer); - session->snapshot = be32toh(session_info.snapshot); + strncpy(session_name, session_info.session_name, + sizeof(session_info.session_name)); + strncpy(hostname, session_info.hostname, + sizeof(session_info.hostname)); + *live_timer = be32toh(session_info.live_timer); + *snapshot = be32toh(session_info.snapshot); ret = 0;