struct lttng_payload_view;
struct lttng_notification {
- struct lttng_condition *condition;
+ struct lttng_trigger *trigger;
struct lttng_evaluation *evaluation;
};
struct lttng_notification_comm {
/* Size of the payload following this field. */
uint32_t length;
- /* Condition and evaluation objects follow. */
+ /* Trigger and evaluation objects follow. */
char payload[];
} LTTNG_PACKED;
LTTNG_HIDDEN
struct lttng_notification *lttng_notification_create(
- struct lttng_condition *condition,
+ struct lttng_trigger *trigger,
struct lttng_evaluation *evaluation);
LTTNG_HIDDEN
};
return notification_client_list_send_evaluation(client_list,
- lttng_trigger_get_const_condition(trigger), evaluation,
- lttng_trigger_get_credentials(trigger),
+ trigger, evaluation,
&creds,
client_handle_transmission_status_wrapper, state);
}
LTTNG_HIDDEN
int notification_client_list_send_evaluation(
struct notification_client_list *client_list,
- const struct lttng_condition *condition,
+ const struct lttng_trigger *trigger,
const struct lttng_evaluation *evaluation,
- const struct lttng_credentials *trigger_creds,
const struct lttng_credentials *source_object_creds,
report_client_transmission_result_cb client_report,
void *user_data)
struct lttng_payload msg_payload;
struct notification_client_list_element *client_list_element, *tmp;
const struct lttng_notification notification = {
- .condition = (struct lttng_condition *) condition,
+ .trigger = (struct lttng_trigger *) trigger,
.evaluation = (struct lttng_evaluation *) evaluation,
};
struct lttng_notification_channel_message msg_header = {
.type = (int8_t) LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION,
};
+ const struct lttng_credentials *trigger_creds =
+ lttng_trigger_get_credentials(trigger);
lttng_payload_init(&msg_payload);
#include <lttng/condition/evaluation-internal.h>
#include <lttng/condition/condition.h>
#include <lttng/condition/evaluation.h>
+#include <lttng/trigger/trigger-internal.h>
#include <common/payload.h>
#include <common/payload-view.h>
#include <assert.h>
LTTNG_HIDDEN
struct lttng_notification *lttng_notification_create(
- struct lttng_condition *condition,
+ struct lttng_trigger *trigger,
struct lttng_evaluation *evaluation)
{
struct lttng_notification *notification = NULL;
- if (!condition || !evaluation) {
+ if (!trigger || !evaluation) {
goto end;
}
goto end;
}
- notification->condition = condition;
+ notification->trigger = trigger;
notification->evaluation = evaluation;
end:
return notification;
}
size_before_payload = payload->buffer.size;
- ret = lttng_condition_serialize(notification->condition,
+ ret = lttng_trigger_serialize(notification->trigger,
payload);
if (ret) {
goto end;
struct lttng_notification **notification)
{
ssize_t ret, notification_size = 0, condition_size, evaluation_size;
- struct lttng_condition *condition;
+ struct lttng_trigger *trigger;
struct lttng_evaluation *evaluation;
const struct lttng_notification_comm *notification_comm;
const struct lttng_payload_view notification_comm_view =
lttng_payload_view_from_view(src_view,
notification_size, -1);
- condition_size = lttng_condition_create_from_payload(
- &condition_view, &condition);
+ condition_size = lttng_trigger_create_from_payload(
+ &condition_view, &trigger);
}
if (condition_size < 0) {
notification_size, -1);
evaluation_size = lttng_evaluation_create_from_payload(
- condition, &evaluation_view, &evaluation);
+ lttng_trigger_get_const_condition(trigger),
+ &evaluation_view, &evaluation);
}
if (evaluation_size < 0) {
goto error;
}
- *notification = lttng_notification_create(condition, evaluation);
+ *notification = lttng_notification_create(trigger, evaluation);
if (!*notification) {
ret = -1;
goto error;
end:
return ret;
error:
- lttng_condition_destroy(condition);
+ lttng_trigger_destroy(trigger);
lttng_evaluation_destroy(evaluation);
return ret;
}
return;
}
- lttng_condition_destroy(notification->condition);
+ lttng_trigger_destroy(notification->trigger);
lttng_evaluation_destroy(notification->evaluation);
free(notification);
}
const struct lttng_condition *lttng_notification_get_condition(
struct lttng_notification *notification)
{
- return notification ? notification->condition : NULL;
+ return notification ? lttng_trigger_get_const_condition(notification->trigger) : NULL;
}
const struct lttng_evaluation *lttng_notification_get_evaluation(