Extend API and remove lttng_uri from lttng.h
[lttng-tools.git] / src / common / sessiond-comm / sessiond-comm.h
index 580beec32b74953a4f08099220837183edb40b1e..e544bf5458870e880a40c20fdab61c71c51bca69 100644 (file)
@@ -29,6 +29,7 @@
 #include <limits.h>
 #include <lttng/lttng.h>
 #include <common/compat/socket.h>
+#include <common/uri.h>
 
 #include <arpa/inet.h>
 #include <netinet/in.h>
@@ -61,7 +62,6 @@ enum lttcomm_sessiond_command {
        LTTNG_ENABLE_ALL_EVENT,
        /* Session daemon command */
        LTTNG_CREATE_SESSION,
-       LTTNG_CREATE_SESSION_URI,
        LTTNG_DESTROY_SESSION,
        LTTNG_LIST_CHANNELS,
        LTTNG_LIST_DOMAINS,
@@ -72,6 +72,7 @@ enum lttcomm_sessiond_command {
        LTTNG_START_TRACE,
        LTTNG_STOP_TRACE,
        LTTNG_LIST_TRACEPOINT_FIELDS,
+
        /* Consumer */
        LTTNG_DISABLE_CONSUMER,
        LTTNG_ENABLE_CONSUMER,
@@ -83,6 +84,9 @@ enum lttcomm_sessiond_command {
        RELAYD_UPDATE_SYNC_INFO,
        RELAYD_VERSION,
        RELAYD_SEND_METADATA,
+       RELAYD_CLOSE_STREAM,
+       LTTNG_SET_FILTER,
+       LTTNG_HEALTH_CHECK,
 };
 
 /*
@@ -181,11 +185,15 @@ enum lttcomm_return_code {
        LTTCOMM_NO_USTCONSUMERD,        /* No UST consumer detected */
        LTTCOMM_NO_KERNCONSUMERD,       /* No Kernel consumer detected */
        LTTCOMM_EVENT_EXIST_LOGLEVEL,   /* Event already enabled with different loglevel */
-       LTTCOMM_URI_DATA_MISS,          /* Missing network data URI */
-       LTTCOMM_URI_CTRL_MISS,          /* Missing network control URI */
+       LTTCOMM_URL_DATA_MISS,          /* Missing network data URL */
+       LTTCOMM_URL_CTRL_MISS,          /* Missing network control URL */
        LTTCOMM_ENABLE_CONSUMER_FAIL,   /* Enabling consumer failed */
        LTTCOMM_RELAYD_SESSION_FAIL,    /* lttng-relayd create session failed */
        LTTCOMM_RELAYD_VERSION_FAIL,    /* lttng-relayd not compatible */
+       LTTCOMM_FILTER_INVAL,           /* Invalid filter bytecode */
+       LTTCOMM_FILTER_NOMEM,           /* Lack of memory for filter bytecode */
+       LTTCOMM_FILTER_EXIST,           /* Filter already exist */
+       LTTCOMM_NO_CONSUMER,            /* No consumer exist for the tracing session */
 
        /* MUST be last element */
        LTTCOMM_NR,                                             /* Last element */
@@ -201,8 +209,8 @@ enum lttcomm_sock_proto {
  * Index in the net_families array below. Please keep in sync!
  */
 enum lttcomm_sock_domain {
-       LTTCOMM_INET      = 1,
-       LTTCOMM_INET6     = 2,
+       LTTCOMM_INET      = 0,
+       LTTCOMM_INET6     = 1,
 };
 
 struct lttcomm_sockaddr {
@@ -273,16 +281,33 @@ struct lttcomm_session_msg {
                        char channel_name[NAME_MAX];
                } list;
                struct lttng_calibrate calibrate;
-               /* Used by the set_consumer_uri call */
-               struct lttng_uri uri;
+               /* Used by the set_consumer_url and used by create_session also call */
+               struct {
+                       /* Number of lttng_uri following */
+                       uint32_t size;
+               } uri;
                struct {
-                       uint32_t enable_consumer;
-                       struct lttng_uri ctrl_uri;
-                       struct lttng_uri data_uri;
-               } create_uri;
+                       char channel_name[NAME_MAX];
+                       char event_name[NAME_MAX];
+                       /* Length of following bytecode */
+                       uint32_t bytecode_len;
+               } filter;
        } u;
 };
 
+#define LTTNG_FILTER_MAX_LEN   65336
+
+/*
+ * Filter bytecode data. The reloc table is located at the end of the
+ * bytecode. It is made of tuples: (uint16_t, var. len. string). It
+ * starts at reloc_table_offset.
+ */
+struct lttng_filter_bytecode {
+       uint16_t len;   /* len of data */
+       uint16_t reloc_table_offset;
+       char data[0];
+};
+
 /*
  * Data structure for the response from sessiond to the lttng client.
  */
@@ -295,6 +320,15 @@ struct lttcomm_lttng_msg {
        char payload[];
 };
 
+struct lttcomm_health_msg {
+       uint32_t component;
+       uint32_t cmd;
+};
+
+struct lttcomm_health_data {
+       uint32_t ret_code;
+};
+
 /*
  * lttcomm_consumer_msg is the message sent from sessiond to consumerd
  * to either add a channel, add a stream, update a stream, or stop
@@ -330,6 +364,9 @@ struct lttcomm_consumer_msg {
                        /* Open socket to the relayd */
                        struct lttcomm_sock sock;
                } relayd_sock;
+               struct {
+                       uint64_t net_seq_idx;
+               } destroy_relayd;
        } u;
 };
 
This page took 0.026034 seconds and 4 git commands to generate.