Add base support for event rule hit
[lttng-tools.git] / include / lttng / event-rule / event-rule-internal.h
index 9fb115caf670bd5b924c112be6369ec003361911..ea0f46e480ec3f2d1454de147708a4607092d49e 100644 (file)
@@ -9,6 +9,7 @@
 #define LTTNG_EVENT_RULE_INTERNAL_H
 
 #include <common/macros.h>
+#include <common/credentials.h>
 #include <lttng/domain.h>
 #include <lttng/event-rule/event-rule.h>
 #include <lttng/lttng-error.h>
@@ -32,7 +33,8 @@ typedef ssize_t (*event_rule_create_from_payload_cb)(
                struct lttng_payload_view *view,
                struct lttng_event_rule **event_rule);
 typedef enum lttng_error_code (*event_rule_generate_filter_bytecode_cb)(
-               struct lttng_event_rule *event_rule, uid_t uid, gid_t gid);
+               struct lttng_event_rule *event_rule,
+               const struct lttng_credentials *creds);
 typedef const char *(*event_rule_get_filter_cb)(
                const struct lttng_event_rule *event_rule);
 typedef const struct lttng_filter_bytecode *(
@@ -40,6 +42,8 @@ typedef const struct lttng_filter_bytecode *(
                const struct lttng_event_rule *event_rule);
 typedef struct lttng_event_exclusion *(*event_rule_generate_exclusions_cb)(
                const struct lttng_event_rule *event_rule);
+typedef unsigned long (*event_rule_hash_cb)(
+               const struct lttng_event_rule *event_rule);
 
 struct lttng_event_rule {
        struct urcu_ref ref;
@@ -52,6 +56,7 @@ struct lttng_event_rule {
        event_rule_get_filter_cb get_filter;
        event_rule_get_filter_bytecode_cb get_filter_bytecode;
        event_rule_generate_exclusions_cb generate_exclusions;
+       event_rule_hash_cb hash;
 };
 
 struct lttng_event_rule_comm {
@@ -92,7 +97,8 @@ enum lttng_domain_type lttng_event_rule_get_domain_type(
 
 LTTNG_HIDDEN
 enum lttng_error_code lttng_event_rule_generate_filter_bytecode(
-               struct lttng_event_rule *rule, uid_t uid, gid_t gid);
+               struct lttng_event_rule *rule,
+               const struct lttng_credentials *creds);
 
 /*
  * If not present/implemented returns NULL.
@@ -120,4 +126,7 @@ struct lttng_event_exclusion *lttng_event_rule_generate_exclusions(
 LTTNG_HIDDEN
 const char *lttng_event_rule_type_str(enum lttng_event_rule_type type);
 
+LTTNG_HIDDEN
+unsigned long lttng_event_rule_hash(const struct lttng_event_rule *rule);
+
 #endif /* LTTNG_EVENT_RULE_INTERNAL_H */
This page took 0.023498 seconds and 4 git commands to generate.