Port: cleanup and portability fix to configure.ac
[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 #define _GNU_SOURCE
22 #include <stdint.h>
23
24 #include <lttng/lttng.h>
25
26 /*
27 * Command value passed in the header.
28 */
29 enum lttcomm_agent_command {
30 AGENT_CMD_LIST = 1,
31 AGENT_CMD_ENABLE = 2,
32 AGENT_CMD_DISABLE = 3,
33 AGENT_CMD_REG_DONE = 4, /* End registration process. */
34 };
35
36 /*
37 * Return codes from the agent.
38 */
39 enum lttcomm_agent_ret_code {
40 /* Success, assumed to be the first entry */
41 AGENT_RET_CODE_SUCCESS = 1,
42 /* Invalid command */
43 AGENT_RET_CODE_INVALID = 2,
44 /* Unknown logger name */
45 AGENT_RET_CODE_UNKNOWN_NAME = 3,
46 AGENT_RET_CODE_NR,
47 };
48
49 /*
50 * Agent application communication header.
51 */
52 struct lttcomm_agent_hdr {
53 uint64_t data_size; /* data size following this header */
54 uint32_t cmd; /* Enum of agent command. */
55 uint32_t cmd_version; /* command version */
56 } LTTNG_PACKED;
57
58 /*
59 * Enable event command payload.
60 */
61 struct lttcomm_agent_enable {
62 uint32_t loglevel_value;
63 uint32_t loglevel_type;
64 char name[LTTNG_SYMBOL_NAME_LEN];
65 } LTTNG_PACKED;
66
67 /*
68 * Disable event command payload.
69 */
70 struct lttcomm_agent_disable {
71 char name[LTTNG_SYMBOL_NAME_LEN];
72 } LTTNG_PACKED;
73
74 /*
75 * Generic reply coming from the agent.
76 */
77 struct lttcomm_agent_generic_reply {
78 uint32_t ret_code;
79 } LTTNG_PACKED;
80
81 /*
82 * List command reply header.
83 */
84 struct lttcomm_agent_list_reply_hdr {
85 uint32_t ret_code;
86 uint32_t data_size;
87 } LTTNG_PACKED;
88
89 /*
90 * List command reply payload coming from the agent.
91 */
92 struct lttcomm_agent_list_reply {
93 uint32_t nb_event;
94 /* List of event name each of them ending by a NULL byte. */
95 char payload[];
96 } LTTNG_PACKED;
97
98 #endif /* AGENT_COMM */
This page took 0.046213 seconds and 5 git commands to generate.