Commit | Line | Data |
---|---|---|
f20baf8e DG |
1 | /* |
2 | * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com> | |
bdf64013 | 3 | * Copyright (C) 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com> |
f20baf8e DG |
4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU General Public License, version 2 only, as | |
7 | * published by the Free Software Foundation. | |
8 | * | |
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
12 | * more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License along with | |
15 | * this program; if not, write to the Free Software Foundation, Inc., 51 | |
16 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
17 | */ | |
18 | ||
022d91ba DG |
19 | #ifndef AGENT_COMM |
20 | #define AGENT_COMM | |
f20baf8e | 21 | |
f20baf8e DG |
22 | #include <stdint.h> |
23 | ||
24 | #include <lttng/lttng.h> | |
25 | ||
26 | /* | |
2f2540d7 | 27 | * Command value passed in the header. |
f20baf8e | 28 | */ |
022d91ba | 29 | enum lttcomm_agent_command { |
bdf64013 JG |
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 | AGENT_CMD_APP_CTX_ENABLE = 5, | |
35 | AGENT_CMD_APP_CTX_DISABLE = 6, | |
f20baf8e DG |
36 | }; |
37 | ||
38 | /* | |
56cc432e | 39 | * Return codes from the agent. |
f20baf8e | 40 | */ |
022d91ba | 41 | enum lttcomm_agent_ret_code { |
aa277e3e | 42 | /* Success, assumed to be the first entry */ |
bdf64013 | 43 | AGENT_RET_CODE_SUCCESS = 1, |
aa277e3e | 44 | /* Invalid command */ |
bdf64013 | 45 | AGENT_RET_CODE_INVALID = 2, |
aa277e3e | 46 | /* Unknown logger name */ |
bdf64013 | 47 | AGENT_RET_CODE_UNKNOWN_NAME = 3, |
23c2bd47 | 48 | AGENT_RET_CODE_NR, |
f20baf8e DG |
49 | }; |
50 | ||
51 | /* | |
022d91ba | 52 | * Agent application communication header. |
f20baf8e | 53 | */ |
022d91ba | 54 | struct lttcomm_agent_hdr { |
f20baf8e | 55 | uint64_t data_size; /* data size following this header */ |
022d91ba | 56 | uint32_t cmd; /* Enum of agent command. */ |
f20baf8e DG |
57 | uint32_t cmd_version; /* command version */ |
58 | } LTTNG_PACKED; | |
59 | ||
60 | /* | |
a0ba721c AM |
61 | * Enable event command payload. Will be immediately followed by the |
62 | * variable-length string representing the filter expression. | |
f20baf8e | 63 | */ |
bdf64013 | 64 | struct lttcomm_agent_enable_event { |
2106efa0 | 65 | uint32_t loglevel_value; |
b2064f54 | 66 | uint32_t loglevel_type; |
f20baf8e | 67 | char name[LTTNG_SYMBOL_NAME_LEN]; |
a0ba721c | 68 | uint32_t filter_expression_length; |
f20baf8e DG |
69 | } LTTNG_PACKED; |
70 | ||
71 | /* | |
72 | * Disable event command payload. | |
73 | */ | |
bdf64013 | 74 | struct lttcomm_agent_disable_event { |
f20baf8e DG |
75 | char name[LTTNG_SYMBOL_NAME_LEN]; |
76 | } LTTNG_PACKED; | |
77 | ||
78 | /* | |
56cc432e | 79 | * Generic reply coming from the agent. |
f20baf8e | 80 | */ |
022d91ba | 81 | struct lttcomm_agent_generic_reply { |
f20baf8e DG |
82 | uint32_t ret_code; |
83 | } LTTNG_PACKED; | |
84 | ||
85 | /* | |
86 | * List command reply header. | |
87 | */ | |
022d91ba | 88 | struct lttcomm_agent_list_reply_hdr { |
f20baf8e DG |
89 | uint32_t ret_code; |
90 | uint32_t data_size; | |
91 | } LTTNG_PACKED; | |
92 | ||
93 | /* | |
56cc432e | 94 | * List command reply payload coming from the agent. |
f20baf8e | 95 | */ |
022d91ba | 96 | struct lttcomm_agent_list_reply { |
f20baf8e DG |
97 | uint32_t nb_event; |
98 | /* List of event name each of them ending by a NULL byte. */ | |
99 | char payload[]; | |
100 | } LTTNG_PACKED; | |
101 | ||
022d91ba | 102 | #endif /* AGENT_COMM */ |