Clean-up: sessiond: cmd_enable_channel_internal
[lttng-tools.git] / src / common / sessiond-comm / sessiond-comm.h
index ba756f8f197ce8fd4cea1ebf3dc5d36b5080a1c0..e327e014c078a5c8fcee6c7c7f366bc29549b7da 100644 (file)
@@ -1,6 +1,5 @@
 /*
- * Copyright (C) 2011 David Goulet <david.goulet@polymtl.ca>
- * Copyright (C) 2011 Julien Desfossez <julien.desfossez@polymtl.ca>
+ * Copyright (C) 2011 EfficiOS Inc.
  * Copyright (C) 2011 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
  * SPDX-License-Identifier: GPL-2.0-only
@@ -31,6 +30,7 @@
 
 #include <arpa/inet.h>
 #include <netinet/in.h>
+#include <stdint.h>
 #include <sys/un.h>
 
 #include "inet.h"
@@ -374,14 +374,14 @@ struct lttcomm_sockaddr {
                struct sockaddr_in sin;
                struct sockaddr_in6 sin6;
        } addr;
-} LTTNG_PACKED;
+};
 
 struct lttcomm_sock {
        int32_t fd;
        enum lttcomm_sock_proto proto;
        struct lttcomm_sockaddr sockaddr;
        const struct lttcomm_proto_ops *ops;
-} LTTNG_PACKED;
+};
 
 /*
  * Relayd sock. Adds the protocol version to use for the communications with
@@ -391,7 +391,7 @@ struct lttcomm_relayd_sock {
        struct lttcomm_sock sock;
        uint32_t major;
        uint32_t minor;
-} LTTNG_PACKED;
+};
 
 struct lttcomm_net_family {
        int family;
@@ -428,48 +428,20 @@ struct lttcomm_session_msg {
                /* Event data */
                struct {
                        char channel_name[LTTNG_SYMBOL_NAME_LEN];
-                       struct lttng_event event;
-                       /* Length of following filter expression. */
-                       uint32_t expression_len;
-                       /* Length of following bytecode for filter. */
-                       uint32_t bytecode_len;
-                       /* Exclusion count (fixed-size strings). */
-                       uint32_t exclusion_count;
-                       /* Userspace probe location size. */
-                       uint32_t userspace_probe_location_len;
-                       /*
-                        * After this structure, the following variable-length
-                        * items are transmitted:
-                        * - char exclusion_names[LTTNG_SYMBOL_NAME_LEN][exclusion_count]
-                        * - char filter_expression[expression_len]
-                        * - unsigned char filter_bytecode[bytecode_len]
-                        */
+                       uint32_t length;
                } LTTNG_PACKED enable;
                struct {
                        char channel_name[LTTNG_SYMBOL_NAME_LEN];
-                       struct lttng_event event;
-                       /* Length of following filter expression. */
-                       uint32_t expression_len;
-                       /* Length of following bytecode for filter. */
-                       uint32_t bytecode_len;
-                       /*
-                        * After this structure, the following variable-length
-                        * items are transmitted:
-                        * - unsigned char filter_expression[expression_len]
-                        * - unsigned char filter_bytecode[bytecode_len]
-                        */
+                       uint32_t length;
                } LTTNG_PACKED disable;
                /* Create channel */
                struct {
-                       struct lttng_channel chan;
-                       struct lttng_channel_extended extended;
+                       uint32_t length;
                } LTTNG_PACKED channel;
                /* Context */
                struct {
                        char channel_name[LTTNG_SYMBOL_NAME_LEN];
-                       struct lttng_event_context ctx;
-                       uint32_t provider_name_len;
-                       uint32_t context_name_len;
+                       uint32_t length;
                } LTTNG_PACKED context;
                /* Use by register_consumer */
                struct {
@@ -594,18 +566,18 @@ struct lttng_bytecode {
 struct lttng_event_exclusion {
        uint32_t count;
        char padding[LTTNG_EVENT_EXCLUSION_PADDING];
-       char names[0][LTTNG_SYMBOL_NAME_LEN];
+       char names[][LTTNG_SYMBOL_NAME_LEN];
 } LTTNG_PACKED;
 
 #define LTTNG_EVENT_EXCLUSION_NAME_AT(_exclusion, _i) \
-       (&(_exclusion)->names[_i][0])
+       ((_exclusion)->names[_i])
 
 /*
- * Event command header.
+ * Listing command header.
  */
-struct lttcomm_event_command_header {
-       /* Number of events */
-       uint32_t nb_events;
+struct lttcomm_list_command_header {
+       /* Number of elements */
+       uint32_t count;
 } LTTNG_PACKED;
 
 /*
@@ -706,8 +678,9 @@ struct lttcomm_consumer_msg {
                struct {
                        uint64_t net_index;
                        enum lttng_stream_type type;
-                       /* Open socket to the relayd */
-                       struct lttcomm_relayd_sock sock;
+                       uint32_t major;
+                       uint32_t minor;
+                       uint8_t relayd_socket_protocol;
                        /* Tracing session id associated to the relayd. */
                        uint64_t session_id;
                        /* Relayd session id, only used with control socket. */
@@ -953,6 +926,9 @@ int lttcomm_init_inet6_sockaddr(struct lttcomm_sockaddr *sockaddr,
                const char *ip, unsigned int port);
 
 struct lttcomm_sock *lttcomm_alloc_sock(enum lttcomm_sock_proto proto);
+int lttcomm_populate_sock_from_open_socket(struct lttcomm_sock *sock,
+               int fd,
+               enum lttcomm_sock_proto protocol);
 int lttcomm_create_sock(struct lttcomm_sock *sock);
 struct lttcomm_sock *lttcomm_alloc_sock_from_uri(struct lttng_uri *uri);
 void lttcomm_destroy_sock(struct lttcomm_sock *sock);
This page took 0.024973 seconds and 4 git commands to generate.