Commit | Line | Data |
---|---|---|
a58c490f | 1 | /* |
ab5be9fa | 2 | * Copyright (C) 2017 Jérémie Galarneau <jeremie.galarneau@efficios.com> |
a58c490f | 3 | * |
ab5be9fa | 4 | * SPDX-License-Identifier: LGPL-2.1-only |
a58c490f | 5 | * |
a58c490f JG |
6 | */ |
7 | ||
8 | #ifndef LTTNG_NOTIFICATION_INTERNAL_H | |
9 | #define LTTNG_NOTIFICATION_INTERNAL_H | |
10 | ||
11 | #include <lttng/notification/notification.h> | |
12 | #include <common/macros.h> | |
13 | #include <common/buffer-view.h> | |
3647288f | 14 | #include <common/dynamic-buffer.h> |
a58c490f JG |
15 | #include <stdint.h> |
16 | #include <stdbool.h> | |
72756a3f | 17 | #include <sys/types.h> |
a58c490f JG |
18 | |
19 | struct lttng_notification { | |
20 | struct lttng_condition *condition; | |
21 | struct lttng_evaluation *evaluation; | |
a58c490f JG |
22 | }; |
23 | ||
24 | struct lttng_notification_comm { | |
25 | /* Size of the payload following this field. */ | |
26 | uint32_t length; | |
27 | /* Condition and evaluation objects follow. */ | |
28 | char payload[]; | |
29 | } LTTNG_PACKED; | |
30 | ||
31 | LTTNG_HIDDEN | |
32 | struct lttng_notification *lttng_notification_create( | |
33 | struct lttng_condition *condition, | |
34 | struct lttng_evaluation *evaluation); | |
35 | ||
36 | LTTNG_HIDDEN | |
9b63a4aa | 37 | int lttng_notification_serialize(const struct lttng_notification *notification, |
3647288f | 38 | struct lttng_dynamic_buffer *buf); |
a58c490f JG |
39 | |
40 | LTTNG_HIDDEN | |
41 | ssize_t lttng_notification_create_from_buffer( | |
42 | const struct lttng_buffer_view *view, | |
43 | struct lttng_notification **notification); | |
44 | ||
45 | #endif /* LTTNG_NOTIFICATION_INTERNAL_H */ |