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> | |
a58c490f JG |
13 | #include <stdint.h> |
14 | #include <stdbool.h> | |
72756a3f | 15 | #include <sys/types.h> |
a58c490f | 16 | |
7966af57 SM |
17 | #ifdef __cplusplus |
18 | extern "C" { | |
19 | #endif | |
20 | ||
c0a66c84 JG |
21 | struct lttng_payload; |
22 | struct lttng_payload_view; | |
23 | ||
a58c490f | 24 | struct lttng_notification { |
52d55cf9 | 25 | struct lttng_trigger *trigger; |
a58c490f | 26 | struct lttng_evaluation *evaluation; |
a58c490f JG |
27 | }; |
28 | ||
29 | struct lttng_notification_comm { | |
30 | /* Size of the payload following this field. */ | |
31 | uint32_t length; | |
52d55cf9 | 32 | /* Trigger and evaluation objects follow. */ |
a58c490f JG |
33 | char payload[]; |
34 | } LTTNG_PACKED; | |
35 | ||
a58c490f | 36 | struct lttng_notification *lttng_notification_create( |
52d55cf9 | 37 | struct lttng_trigger *trigger, |
a58c490f JG |
38 | struct lttng_evaluation *evaluation); |
39 | ||
9b63a4aa | 40 | int lttng_notification_serialize(const struct lttng_notification *notification, |
c0a66c84 | 41 | struct lttng_payload *payload); |
a58c490f | 42 | |
c0a66c84 JG |
43 | ssize_t lttng_notification_create_from_payload( |
44 | struct lttng_payload_view *view, | |
a58c490f JG |
45 | struct lttng_notification **notification); |
46 | ||
7966af57 SM |
47 | #ifdef __cplusplus |
48 | } | |
49 | #endif | |
50 | ||
a58c490f | 51 | #endif /* LTTNG_NOTIFICATION_INTERNAL_H */ |