X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Frelayd.hpp;h=6a0a79201ca356e0b79a382f951ab4cbf55da109;hb=28f23191dcbf047429d51950a337a57d7a3f866a;hp=0f5adaa94bba32443286bcefe1d99c9f445e96a8;hpb=328c2fe7297c941aa9cbcfa4ce944fca1bd7300f;p=lttng-tools.git diff --git a/src/common/sessiond-comm/relayd.hpp b/src/common/sessiond-comm/relayd.hpp index 0f5adaa94..6a0a79201 100644 --- a/src/common/sessiond-comm/relayd.hpp +++ b/src/common/sessiond-comm/relayd.hpp @@ -9,23 +9,25 @@ #ifndef _RELAYD_COMM #define _RELAYD_COMM -#include -#include - -#include +#include #include #include #include -#include #include +#include -#define RELAYD_VERSION_COMM_MAJOR VERSION_MAJOR -#define RELAYD_VERSION_COMM_MINOR VERSION_MINOR +#include + +#include +#include + +#define RELAYD_VERSION_COMM_MAJOR VERSION_MAJOR +#define RELAYD_VERSION_COMM_MINOR VERSION_MINOR -#define RELAYD_COMM_LTTNG_HOST_NAME_MAX_2_4 64 -#define RELAYD_COMM_LTTNG_NAME_MAX_2_4 255 -#define RELAYD_COMM_LTTNG_PATH_MAX 4096 -#define RELAYD_COMM_DEFAULT_STREAM_NAME_LEN 264 /* 256 + 8 */ +#define RELAYD_COMM_LTTNG_HOST_NAME_MAX_2_4 64 +#define RELAYD_COMM_LTTNG_NAME_MAX_2_4 255 +#define RELAYD_COMM_LTTNG_PATH_MAX 4096 +#define RELAYD_COMM_DEFAULT_STREAM_NAME_LEN 264 /* 256 + 8 */ /* * lttng-relayd communication header. @@ -33,9 +35,9 @@ struct lttcomm_relayd_hdr { /* Circuit ID not used for now so always ignored */ uint64_t circuit_id; - uint64_t data_size; /* data size following this header */ - uint32_t cmd; /* enum lttcomm_relayd_command */ - uint32_t cmd_version; /* command version */ + uint64_t data_size; /* data size following this header */ + uint32_t cmd; /* enum lttcomm_relayd_command */ + uint32_t cmd_version; /* command version */ } LTTNG_PACKED; /* @@ -44,10 +46,10 @@ struct lttcomm_relayd_hdr { struct lttcomm_relayd_data_hdr { /* Circuit ID not used for now so always ignored */ uint64_t circuit_id; - uint64_t stream_id; /* Stream ID known by the relayd */ - uint64_t net_seq_num; /* Network sequence number, per stream. */ - uint32_t data_size; /* data size following this header */ - uint32_t padding_size; /* Size of 0 padding the data */ + uint64_t stream_id; /* Stream ID known by the relayd */ + uint64_t net_seq_num; /* Network sequence number, per stream. */ + uint32_t data_size; /* data size following this header */ + uint32_t padding_size; /* Size of 0 padding the data */ } LTTNG_PACKED; /* @@ -83,7 +85,7 @@ struct lttcomm_relayd_add_stream_2_11 { uint64_t tracefile_size; uint64_t tracefile_count; uint64_t trace_chunk_id; - char names[]; + char names[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; } LTTNG_PACKED; /* @@ -123,7 +125,7 @@ struct lttcomm_relayd_metadata_payload { */ struct lttcomm_relayd_close_stream { uint64_t stream_id; - uint64_t last_net_seq_num; /* sequence number of last packet */ + uint64_t last_net_seq_num; /* sequence number of last packet */ } LTTNG_PACKED; /* @@ -169,13 +171,11 @@ static inline size_t lttcomm_relayd_index_len(uint32_t major, uint32_t minor) if (major == 1) { switch (minor) { case 0: - return offsetof(struct lttcomm_relayd_index, stream_id) - + member_sizeof(struct lttcomm_relayd_index, - stream_id); + return offsetof(struct lttcomm_relayd_index, stream_id) + + member_sizeof(struct lttcomm_relayd_index, stream_id); case 1: - return offsetof(struct lttcomm_relayd_index, packet_seq_num) - + member_sizeof(struct lttcomm_relayd_index, - packet_seq_num); + return offsetof(struct lttcomm_relayd_index, packet_seq_num) + + member_sizeof(struct lttcomm_relayd_index, packet_seq_num); default: abort(); } @@ -209,14 +209,14 @@ struct lttcomm_relayd_create_session_2_11 { uint64_t creation_time; LTTNG_OPTIONAL_COMM(uint64_t) LTTNG_PACKED current_chunk_id; /* Contains the session_name, hostname, base_path. */ - char names[]; + char names[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; } LTTNG_PACKED; struct lttcomm_relayd_create_session_reply_2_11 { struct lttcomm_relayd_status_session generic; /* Includes the '\0' terminator. */ uint32_t output_path_length; - char output_path[]; + char output_path[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; } LTTNG_PACKED; /* @@ -309,7 +309,7 @@ struct lttcomm_relayd_create_trace_chunk { uint64_t creation_timestamp; /* Includes trailing NULL. */ uint32_t override_name_length; - char override_name[]; + char override_name[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; } LTTNG_PACKED; struct lttcomm_relayd_close_trace_chunk { @@ -324,7 +324,7 @@ struct lttcomm_relayd_close_trace_chunk_reply { struct lttcomm_relayd_generic_reply generic; /* Includes trailing NULL. */ uint32_t path_length; - char path[]; + char path[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; } LTTNG_PACKED; struct lttcomm_relayd_trace_chunk_exists { @@ -354,7 +354,7 @@ struct lttcomm_relayd_get_configuration_reply { /* Set of lttcomm_relayd_configuration_flag. */ uint64_t relayd_configuration_flags; /* Optional variable-length payload. */ - char payload[]; + char payload[LTTNG_FLEXIBLE_ARRAY_MEMBER_LENGTH]; } LTTNG_PACKED; -#endif /* _RELAYD_COMM */ +#endif /* _RELAYD_COMM */