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 DG |
20 | |
21 | #define _GNU_SOURCE | |
22 | #include <stdint.h> | |
23 | ||
24 | #include <lttng/lttng.h> | |
25 | ||
26 | /* | |
27 | * Command value pass in the header. | |
28 | */ | |
022d91ba DG |
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. */ | |
f20baf8e DG |
34 | }; |
35 | ||
36 | /* | |
37 | * Return code from the Java agent. | |
38 | */ | |
022d91ba DG |
39 | enum lttcomm_agent_ret_code { |
40 | AGENT_RET_CODE_SUCCESS = 1, | |
41 | AGENT_RET_CODE_INVALID = 2, | |
42 | AGENT_RET_CODE_UNKNOWN_NAME = 3, | |
23c2bd47 | 43 | AGENT_RET_CODE_NR, |
f20baf8e DG |
44 | }; |
45 | ||
46 | /* | |
022d91ba | 47 | * Agent application communication header. |
f20baf8e | 48 | */ |
022d91ba | 49 | struct lttcomm_agent_hdr { |
f20baf8e | 50 | uint64_t data_size; /* data size following this header */ |
022d91ba | 51 | uint32_t cmd; /* Enum of agent command. */ |
f20baf8e DG |
52 | uint32_t cmd_version; /* command version */ |
53 | } LTTNG_PACKED; | |
54 | ||
55 | /* | |
56 | * Enable event command payload. | |
57 | */ | |
022d91ba | 58 | struct lttcomm_agent_enable { |
b2064f54 DG |
59 | uint32_t loglevel; |
60 | uint32_t loglevel_type; | |
f20baf8e DG |
61 | char name[LTTNG_SYMBOL_NAME_LEN]; |
62 | } LTTNG_PACKED; | |
63 | ||
64 | /* | |
65 | * Disable event command payload. | |
66 | */ | |
022d91ba | 67 | struct lttcomm_agent_disable { |
f20baf8e DG |
68 | char name[LTTNG_SYMBOL_NAME_LEN]; |
69 | } LTTNG_PACKED; | |
70 | ||
71 | /* | |
72 | * Generic reply coming from the Java Agent. | |
73 | */ | |
022d91ba | 74 | struct lttcomm_agent_generic_reply { |
f20baf8e DG |
75 | uint32_t ret_code; |
76 | } LTTNG_PACKED; | |
77 | ||
78 | /* | |
79 | * List command reply header. | |
80 | */ | |
022d91ba | 81 | struct lttcomm_agent_list_reply_hdr { |
f20baf8e DG |
82 | uint32_t ret_code; |
83 | uint32_t data_size; | |
84 | } LTTNG_PACKED; | |
85 | ||
86 | /* | |
87 | * List command reply payload coming from the Java Agent. | |
88 | */ | |
022d91ba | 89 | struct lttcomm_agent_list_reply { |
f20baf8e DG |
90 | uint32_t nb_event; |
91 | /* List of event name each of them ending by a NULL byte. */ | |
92 | char payload[]; | |
93 | } LTTNG_PACKED; | |
94 | ||
022d91ba | 95 | #endif /* AGENT_COMM */ |