Fix lttng bug having the wrong sessiond path
[lttng-tools.git] / liblttsessiondcomm / liblttsessiondcomm.h
index 5cac0b7982ecef86c52dde2ca69b9ef280ee9e55..4a7fdfcc48155e44c9937dd471649e38bbec5e3e 100644 (file)
@@ -24,6 +24,8 @@
 #include <limits.h>
 #include <uuid/uuid.h>
 
+#include "lttng-share.h"
+
 #define LTTNG_RUNDIR                                           "/var/run/lttng"
 
 /* Default unix socket path */
@@ -109,15 +111,14 @@ enum lttcomm_kconsumerd_fd_state {
 };
 
 /*
- * Data structure for ltt-session received message
+ * Data structure received from lttng client to session daemon.
  */
 struct lttcomm_session_msg {
-       /* Common data to almost all command */
-       enum lttcomm_sessiond_command cmd_type;
-       uuid_t session_id;
+       u32 cmd_type;    /* enum lttcomm_sessiond_command */
+       uuid_t session_uuid;
        char trace_name[NAME_MAX];
        char session_name[NAME_MAX];
-       pid_t pid;
+       u32 pid;    /* pid_t */
        union {
                struct {
                        int auto_session;
@@ -145,19 +146,17 @@ struct lttcomm_session_msg {
 };
 
 /*
- * Data structure for the lttng client response.
- *
- * This data structure is the control struct use in
- * the header of the transmission. NEVER put variable
- * size data in here.
+ * Data structure for the response from sessiond to the lttng client.
  */
-struct lttcomm_lttng_header {
-       enum lttcomm_sessiond_command cmd_type;
-       enum lttcomm_return_code ret_code;
-       uuid_t session_id;
-       pid_t pid;
-       char trace_name[NAME_MAX];
-       unsigned int payload_size;
+struct lttcomm_lttng_msg {
+       u32 cmd_type;   /* enum lttcomm_sessiond_command */
+       u32 ret_code;   /* enum lttcomm_return_code */
+       u32 pid;        /* pid_t */
+       u32 trace_name_offset;
+       u32 data_size;
+       uuid_t session_uuid;
+       /* Contains: trace_name + data */
+       char payload[];
 };
 
 /*
@@ -167,9 +166,9 @@ struct lttcomm_lttng_header {
  * how many lttcomm_kconsumerd_msg it is about to receive
  */
 struct lttcomm_kconsumerd_header {
-       unsigned int payload_size;
-       enum lttcomm_consumerd_command cmd_type;
-       enum lttcomm_return_code ret_code;
+       u32 payload_size;
+       u32 cmd_type;   /* enum lttcomm_consumerd_command */
+       u32 ret_code;   /* enum lttcomm_return_code */
 };
 
 /* lttcomm_kconsumerd_msg represents a file descriptor to consume the
@@ -178,7 +177,7 @@ struct lttcomm_kconsumerd_header {
 struct lttcomm_kconsumerd_msg {
        char path_name[PATH_MAX];
        int fd;
-       enum lttcomm_kconsumerd_fd_state state;
+       u32 state;    /* enum lttcomm_kconsumerd_fd_state */
 };
 
 extern int lttcomm_create_unix_sock(const char *pathname);
This page took 0.024436 seconds and 4 git commands to generate.