+static
+bool ds_index_entries_equal(
+ const struct ctf_fs_ds_index_entry *left,
+ const struct ctf_fs_ds_index_entry *right)
+{
+ if (left->packet_size != right->packet_size) {
+ return false;
+ }
+
+ if (left->timestamp_begin != right->timestamp_begin) {
+ return false;
+ }
+
+ if (left->timestamp_end != right->timestamp_end) {
+ return false;
+ }
+
+ if (left->packet_seq_num != right->packet_seq_num) {
+ return false;
+ }
+
+ return true;
+}
+
+/*
+ * Insert `entry` into `index`, without duplication.
+ *
+ * The entry is inserted only if there isn't an identical entry already.
+ *
+ * In any case, the ownership of `entry` is transferred to this function. So if
+ * the entry is not inserted, it is freed.
+ */
+