X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Fagent.h;fp=src%2Fcommon%2Fsessiond-comm%2Fagent.h;h=93ef7ac093e2fe241b44d31c5a6a4640ca35911c;hp=0000000000000000000000000000000000000000;hb=022d91ba14053d6093a6d6a1af02a345c6fd42d2;hpb=22fb211b5ad4d39789f782180a5e610b72a20291 diff --git a/src/common/sessiond-comm/agent.h b/src/common/sessiond-comm/agent.h new file mode 100644 index 000000000..93ef7ac09 --- /dev/null +++ b/src/common/sessiond-comm/agent.h @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2013 - David Goulet + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License, version 2 only, as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef AGENT_COMM +#define AGENT_COMM + +#define _GNU_SOURCE +#include + +#include + +/* + * Command value pass in the header. + */ +enum lttcomm_agent_command { + AGENT_CMD_LIST = 1, + AGENT_CMD_ENABLE = 2, + AGENT_CMD_DISABLE = 3, + AGENT_CMD_REG_DONE = 4, /* End registration process. */ +}; + +/* + * Return code from the Java agent. + */ +enum lttcomm_agent_ret_code { + AGENT_RET_CODE_SUCCESS = 1, + AGENT_RET_CODE_INVALID = 2, + AGENT_RET_CODE_UNKNOWN_NAME = 3, +}; + +/* + * Agent application communication header. + */ +struct lttcomm_agent_hdr { + uint64_t data_size; /* data size following this header */ + uint32_t cmd; /* Enum of agent command. */ + uint32_t cmd_version; /* command version */ +} LTTNG_PACKED; + +/* + * Enable event command payload. + */ +struct lttcomm_agent_enable { + uint32_t loglevel; + uint32_t loglevel_type; + char name[LTTNG_SYMBOL_NAME_LEN]; +} LTTNG_PACKED; + +/* + * Disable event command payload. + */ +struct lttcomm_agent_disable { + char name[LTTNG_SYMBOL_NAME_LEN]; +} LTTNG_PACKED; + +/* + * Generic reply coming from the Java Agent. + */ +struct lttcomm_agent_generic_reply { + uint32_t ret_code; +} LTTNG_PACKED; + +/* + * List command reply header. + */ +struct lttcomm_agent_list_reply_hdr { + uint32_t ret_code; + uint32_t data_size; +} LTTNG_PACKED; + +/* + * List command reply payload coming from the Java Agent. + */ +struct lttcomm_agent_list_reply { + uint32_t nb_event; + /* List of event name each of them ending by a NULL byte. */ + char payload[]; +} LTTNG_PACKED; + +#endif /* AGENT_COMM */