f3564550b746b47d4c00954545f86a4df7f70e20
[lttng-tools.git] / src / common / sessiond-comm / agent.h
1 /*
2 * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 */
17
18 #ifndef AGENT_COMM
19 #define AGENT_COMM
20
21 #include <stdint.h>
22
23 #include <lttng/lttng.h>
24
25 /*
26 * Command value passed in the header.
27 */
28 enum lttcomm_agent_command {
29 AGENT_CMD_LIST = 1,
30 AGENT_CMD_ENABLE = 2,
31 AGENT_CMD_DISABLE = 3,
32 AGENT_CMD_REG_DONE = 4, /* End registration process. */
33 };
34
35 /*
36 * Return codes from the agent.
37 */
38 enum lttcomm_agent_ret_code {
39 /* Success, assumed to be the first entry */
40 AGENT_RET_CODE_SUCCESS = 1,
41 /* Invalid command */
42 AGENT_RET_CODE_INVALID = 2,
43 /* Unknown logger name */
44 AGENT_RET_CODE_UNKNOWN_NAME = 3,
45 AGENT_RET_CODE_NR,
46 };
47
48 /*
49 * Agent application communication header.
50 */
51 struct lttcomm_agent_hdr {
52 uint64_t data_size; /* data size following this header */
53 uint32_t cmd; /* Enum of agent command. */
54 uint32_t cmd_version; /* command version */
55 } LTTNG_PACKED;
56
57 /*
58 * Enable event command payload.
59 */
60 struct lttcomm_agent_enable {
61 uint32_t loglevel_value;
62 uint32_t loglevel_type;
63 char name[LTTNG_SYMBOL_NAME_LEN];
64 } LTTNG_PACKED;
65
66 /*
67 * Disable event command payload.
68 */
69 struct lttcomm_agent_disable {
70 char name[LTTNG_SYMBOL_NAME_LEN];
71 } LTTNG_PACKED;
72
73 /*
74 * Generic reply coming from the agent.
75 */
76 struct lttcomm_agent_generic_reply {
77 uint32_t ret_code;
78 } LTTNG_PACKED;
79
80 /*
81 * List command reply header.
82 */
83 struct lttcomm_agent_list_reply_hdr {
84 uint32_t ret_code;
85 uint32_t data_size;
86 } LTTNG_PACKED;
87
88 /*
89 * List command reply payload coming from the agent.
90 */
91 struct lttcomm_agent_list_reply {
92 uint32_t nb_event;
93 /* List of event name each of them ending by a NULL byte. */
94 char payload[];
95 } LTTNG_PACKED;
96
97 #endif /* AGENT_COMM */
This page took 0.031655 seconds and 3 git commands to generate.