Commit | Line | Data |
---|---|---|
f20baf8e DG |
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 | ||
022d91ba DG |
18 | #ifndef AGENT_COMM |
19 | #define AGENT_COMM | |
f20baf8e | 20 | |
f20baf8e DG |
21 | #include <stdint.h> |
22 | ||
23 | #include <lttng/lttng.h> | |
24 | ||
25 | /* | |
2f2540d7 | 26 | * Command value passed in the header. |
f20baf8e | 27 | */ |
022d91ba DG |
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. */ | |
f20baf8e DG |
33 | }; |
34 | ||
35 | /* | |
56cc432e | 36 | * Return codes from the agent. |
f20baf8e | 37 | */ |
022d91ba | 38 | enum lttcomm_agent_ret_code { |
aa277e3e | 39 | /* Success, assumed to be the first entry */ |
022d91ba | 40 | AGENT_RET_CODE_SUCCESS = 1, |
aa277e3e | 41 | /* Invalid command */ |
022d91ba | 42 | AGENT_RET_CODE_INVALID = 2, |
aa277e3e | 43 | /* Unknown logger name */ |
022d91ba | 44 | AGENT_RET_CODE_UNKNOWN_NAME = 3, |
23c2bd47 | 45 | AGENT_RET_CODE_NR, |
f20baf8e DG |
46 | }; |
47 | ||
48 | /* | |
022d91ba | 49 | * Agent application communication header. |
f20baf8e | 50 | */ |
022d91ba | 51 | struct lttcomm_agent_hdr { |
f20baf8e | 52 | uint64_t data_size; /* data size following this header */ |
022d91ba | 53 | uint32_t cmd; /* Enum of agent command. */ |
f20baf8e DG |
54 | uint32_t cmd_version; /* command version */ |
55 | } LTTNG_PACKED; | |
56 | ||
57 | /* | |
a0ba721c AM |
58 | * Enable event command payload. Will be immediately followed by the |
59 | * variable-length string representing the filter expression. | |
f20baf8e | 60 | */ |
022d91ba | 61 | struct lttcomm_agent_enable { |
2106efa0 | 62 | uint32_t loglevel_value; |
b2064f54 | 63 | uint32_t loglevel_type; |
f20baf8e | 64 | char name[LTTNG_SYMBOL_NAME_LEN]; |
a0ba721c | 65 | uint32_t filter_expression_length; |
f20baf8e DG |
66 | } LTTNG_PACKED; |
67 | ||
68 | /* | |
69 | * Disable event command payload. | |
70 | */ | |
022d91ba | 71 | struct lttcomm_agent_disable { |
f20baf8e DG |
72 | char name[LTTNG_SYMBOL_NAME_LEN]; |
73 | } LTTNG_PACKED; | |
74 | ||
75 | /* | |
56cc432e | 76 | * Generic reply coming from the agent. |
f20baf8e | 77 | */ |
022d91ba | 78 | struct lttcomm_agent_generic_reply { |
f20baf8e DG |
79 | uint32_t ret_code; |
80 | } LTTNG_PACKED; | |
81 | ||
82 | /* | |
83 | * List command reply header. | |
84 | */ | |
022d91ba | 85 | struct lttcomm_agent_list_reply_hdr { |
f20baf8e DG |
86 | uint32_t ret_code; |
87 | uint32_t data_size; | |
88 | } LTTNG_PACKED; | |
89 | ||
90 | /* | |
56cc432e | 91 | * List command reply payload coming from the agent. |
f20baf8e | 92 | */ |
022d91ba | 93 | struct lttcomm_agent_list_reply { |
f20baf8e DG |
94 | uint32_t nb_event; |
95 | /* List of event name each of them ending by a NULL byte. */ | |
96 | char payload[]; | |
97 | } LTTNG_PACKED; | |
98 | ||
022d91ba | 99 | #endif /* AGENT_COMM */ |