+enum bt_notif_iter_status bt_notif_iter_get_next_notification(
+ struct bt_notif_iter *notit,
+ bt_self_notification_iterator *notif_iter,
+ bt_notification **notification);
+
+/**
+ * Returns the first packet header and context fields. This function
+ * never needs to call the `borrow_stream()` medium operation because
+ * it does not create packet or event objects.
+ *
+ * @param notif_iter CTF notification iterator
+ * @param packet_header_field Packet header field (\c NULL if there's
+ * no packet header field)
+ * @param packet_context_field Packet context field (\c NULL if there's
+ * no packet context field)
+ * @returns One of #bt_notif_iter_status values
+ */
+BT_HIDDEN
+enum bt_notif_iter_status bt_notif_iter_borrow_packet_header_context_fields(
+ struct bt_notif_iter *notit,
+ bt_field **packet_header_field,
+ bt_field **packet_context_field);
+
+struct bt_notif_iter_packet_properties {
+ uint64_t exp_packet_total_size;
+ uint64_t exp_packet_content_size;
+ uint64_t stream_class_id;
+ int64_t data_stream_id;
+
+ struct {
+ uint64_t discarded_events;
+ uint64_t packets;
+ uint64_t beginning_clock;
+ uint64_t end_clock;
+ } snapshots;
+};
+
+BT_HIDDEN
+enum bt_notif_iter_status bt_notif_iter_get_packet_properties(
+ struct bt_notif_iter *notit,
+ struct bt_notif_iter_packet_properties *props);
+
+BT_HIDDEN
+void bt_notif_iter_set_medops_data(struct bt_notif_iter *notit,
+ void *medops_data);
+
+BT_HIDDEN
+enum bt_notif_iter_status bt_notif_iter_seek(
+ struct bt_notif_iter *notit, off_t offset);
+
+/*
+ * Get the current packet's offset in bytes relative to the media's initial
+ * position.
+ */
+BT_HIDDEN
+off_t bt_notif_iter_get_current_packet_offset(
+ struct bt_notif_iter *notit);
+
+/* Get the current packet's size (in bits). */
+BT_HIDDEN
+off_t bt_notif_iter_get_current_packet_size(
+ struct bt_notif_iter *notit);
+
+/*
+ * Resets the iterator so that the next requested medium bytes are
+ * assumed to be the first bytes of a new stream. The first notification
+ * which this iterator emits after calling bt_notif_iter_reset() is a
+ * BT_NOTIFICATION_TYPE_STREAM_BEGINNING one.
+ */
+BT_HIDDEN
+void bt_notif_iter_reset(struct bt_notif_iter *notit);
+
+/*
+ * Notify the iterator that the trace class changed somehow (new
+ * stream/event classes).
+ */
+BT_HIDDEN
+void bt_notif_trace_class_changed(struct bt_notif_iter *notit);
+
+static inline
+const char *bt_notif_iter_medium_status_string(
+ enum bt_notif_iter_medium_status status)
+{
+ switch (status) {
+ case BT_NOTIF_ITER_MEDIUM_STATUS_EOF:
+ return "BT_NOTIF_ITER_MEDIUM_STATUS_EOF";
+ case BT_NOTIF_ITER_MEDIUM_STATUS_AGAIN:
+ return "BT_NOTIF_ITER_MEDIUM_STATUS_AGAIN";
+ case BT_NOTIF_ITER_MEDIUM_STATUS_INVAL:
+ return "BT_NOTIF_ITER_MEDIUM_STATUS_INVAL";
+ case BT_NOTIF_ITER_MEDIUM_STATUS_ERROR:
+ return "BT_NOTIF_ITER_MEDIUM_STATUS_ERROR";
+ case BT_NOTIF_ITER_MEDIUM_STATUS_OK:
+ return "BT_NOTIF_ITER_MEDIUM_STATUS_OK";
+ default:
+ return "(unknown)";
+ }
+}
+
+static inline
+const char *bt_notif_iter_status_string(
+ enum bt_notif_iter_status status)
+{
+ switch (status) {
+ case BT_NOTIF_ITER_STATUS_EOF:
+ return "BT_NOTIF_ITER_STATUS_EOF";
+ case BT_NOTIF_ITER_STATUS_AGAIN:
+ return "BT_NOTIF_ITER_STATUS_AGAIN";
+ case BT_NOTIF_ITER_STATUS_INVAL:
+ return "BT_NOTIF_ITER_STATUS_INVAL";
+ case BT_NOTIF_ITER_STATUS_ERROR:
+ return "BT_NOTIF_ITER_STATUS_ERROR";
+ case BT_NOTIF_ITER_STATUS_OK:
+ return "BT_NOTIF_ITER_STATUS_OK";
+ default:
+ return "(unknown)";
+ }
+}