-#ifndef BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H
-#define BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H
+#ifndef BABELTRACE_GRAPH_NOTIFICATION_PACKET_INTERNAL_H
+#define BABELTRACE_GRAPH_NOTIFICATION_PACKET_INTERNAL_H
/*
* BabelTrace - Packet-related Notifications
* SOFTWARE.
*/
+#include <babeltrace/compiler-internal.h>
#include <babeltrace/ctf-ir/packet.h>
#include <babeltrace/graph/notification-internal.h>
+#include <babeltrace/assert-internal.h>
struct bt_notification_packet_begin {
struct bt_notification parent;
- struct bt_ctf_packet *packet;
+ struct bt_packet *packet;
};
struct bt_notification_packet_end {
struct bt_notification parent;
- struct bt_ctf_packet *packet;
+ struct bt_packet *packet;
};
-#endif /* BABELTRACE_COMPONENT_NOTIFICATION_PACKET_INTERNAL_H */
+static inline
+struct bt_packet *bt_notification_packet_begin_borrow_packet(
+ struct bt_notification *notif)
+{
+ struct bt_notification_packet_begin *notif_packet_begin =
+ container_of(notif,
+ struct bt_notification_packet_begin, parent);
+
+ BT_ASSERT(notif_packet_begin);
+ return notif_packet_begin->packet;
+}
+
+static inline
+struct bt_packet *bt_notification_packet_end_borrow_packet(
+ struct bt_notification *notif)
+{
+ struct bt_notification_packet_end *notif_packet_end =
+ container_of(notif,
+ struct bt_notification_packet_end, parent);
+
+ BT_ASSERT(notif_packet_end);
+ return notif_packet_end->packet;
+}
+
+#endif /* BABELTRACE_GRAPH_NOTIFICATION_PACKET_INTERNAL_H */