X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbin%2Flttng-relayd%2Fcmd-2-4.c;fp=src%2Fbin%2Flttng-relayd%2Fcmd-2-4.c;h=f199b8396707746bb1144ef7f8f2b7c1d321f89a;hb=8b833f70b3d3697e74c54f3a2f5efbe5292097ef;hp=0000000000000000000000000000000000000000;hpb=5aaa62a111f332a7c4412558bb9da9b30320eefd;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/cmd-2-4.c b/src/bin/lttng-relayd/cmd-2-4.c new file mode 100644 index 000000000..f199b8396 --- /dev/null +++ b/src/bin/lttng-relayd/cmd-2-4.c @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2013 - Julien Desfossez + * David Goulet + * + * 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 + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#define _GNU_SOURCE +#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 ret; + struct lttcomm_relayd_create_session_2_4 session_info; + + assert(cmd); + assert(session); + + ret = cmd_recv(cmd->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); + + ret = 0; + +error: + return ret; +}