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