Commit | Line | Data |
---|---|---|
f20baf8e | 1 | /* |
ab5be9fa MJ |
2 | * Copyright (C) 2013 David Goulet <dgoulet@efficios.com> |
3 | * Copyright (C) 2016 Jérémie Galarneau <jeremie.galarneau@efficios.com> | |
f20baf8e | 4 | * |
ab5be9fa | 5 | * SPDX-License-Identifier: GPL-2.0-only |
f20baf8e | 6 | * |
f20baf8e DG |
7 | */ |
8 | ||
022d91ba DG |
9 | #ifndef AGENT_COMM |
10 | #define AGENT_COMM | |
f20baf8e | 11 | |
f20baf8e DG |
12 | #include <stdint.h> |
13 | ||
40ebe219 | 14 | #include <common/compiler.hpp> |
c9e313bc | 15 | #include <common/macros.hpp> |
f20baf8e DG |
16 | #include <lttng/lttng.h> |
17 | ||
18 | /* | |
2f2540d7 | 19 | * Command value passed in the header. |
f20baf8e | 20 | */ |
022d91ba | 21 | enum lttcomm_agent_command { |
bdf64013 JG |
22 | AGENT_CMD_LIST = 1, |
23 | AGENT_CMD_ENABLE = 2, | |
24 | AGENT_CMD_DISABLE = 3, | |
25 | AGENT_CMD_REG_DONE = 4, /* End registration process. */ | |
26 | AGENT_CMD_APP_CTX_ENABLE = 5, | |
27 | AGENT_CMD_APP_CTX_DISABLE = 6, | |
f20baf8e DG |
28 | }; |
29 | ||
30 | /* | |
56cc432e | 31 | * Return codes from the agent. |
f20baf8e | 32 | */ |
022d91ba | 33 | enum lttcomm_agent_ret_code { |
aa277e3e | 34 | /* Success, assumed to be the first entry */ |
bdf64013 | 35 | AGENT_RET_CODE_SUCCESS = 1, |
aa277e3e | 36 | /* Invalid command */ |
bdf64013 | 37 | AGENT_RET_CODE_INVALID = 2, |
aa277e3e | 38 | /* Unknown logger name */ |
bdf64013 | 39 | AGENT_RET_CODE_UNKNOWN_NAME = 3, |
23c2bd47 | 40 | AGENT_RET_CODE_NR, |
f20baf8e DG |
41 | }; |
42 | ||
43 | /* | |
022d91ba | 44 | * Agent application communication header. |
f20baf8e | 45 | */ |
022d91ba | 46 | struct lttcomm_agent_hdr { |
f20baf8e | 47 | uint64_t data_size; /* data size following this header */ |
022d91ba | 48 | uint32_t cmd; /* Enum of agent command. */ |
f20baf8e DG |
49 | uint32_t cmd_version; /* command version */ |
50 | } LTTNG_PACKED; | |
51 | ||
52 | /* | |
a0ba721c AM |
53 | * Enable event command payload. Will be immediately followed by the |
54 | * variable-length string representing the filter expression. | |
f20baf8e | 55 | */ |
bdf64013 | 56 | struct lttcomm_agent_enable_event { |
2106efa0 | 57 | uint32_t loglevel_value; |
b2064f54 | 58 | uint32_t loglevel_type; |
f20baf8e | 59 | char name[LTTNG_SYMBOL_NAME_LEN]; |
a0ba721c | 60 | uint32_t filter_expression_length; |
f20baf8e DG |
61 | } LTTNG_PACKED; |
62 | ||
63 | /* | |
64 | * Disable event command payload. | |
65 | */ | |
bdf64013 | 66 | struct lttcomm_agent_disable_event { |
f20baf8e DG |
67 | char name[LTTNG_SYMBOL_NAME_LEN]; |
68 | } LTTNG_PACKED; | |
69 | ||
70 | /* | |
56cc432e | 71 | * Generic reply coming from the agent. |
f20baf8e | 72 | */ |
022d91ba | 73 | struct lttcomm_agent_generic_reply { |
f20baf8e DG |
74 | uint32_t ret_code; |
75 | } LTTNG_PACKED; | |
76 | ||
77 | /* | |
78 | * List command reply header. | |
79 | */ | |
022d91ba | 80 | struct lttcomm_agent_list_reply_hdr { |
f20baf8e DG |
81 | uint32_t ret_code; |
82 | uint32_t data_size; | |
83 | } LTTNG_PACKED; | |
84 | ||
85 | /* | |
56cc432e | 86 | * List command reply payload coming from the agent. |
f20baf8e | 87 | */ |
022d91ba | 88 | struct lttcomm_agent_list_reply { |
f20baf8e DG |
89 | uint32_t nb_event; |
90 | /* List of event name each of them ending by a NULL byte. */ | |
40ebe219 | 91 | char payload[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; |
f20baf8e DG |
92 | } LTTNG_PACKED; |
93 | ||
022d91ba | 94 | #endif /* AGENT_COMM */ |