+
+static inline
+const struct bt_clock_snapshot *
+borrow_packet_message_default_clock_snapshot_const(
+ const struct bt_message *message)
+{
+ struct bt_message_packet *packet_msg = (void *) message;
+
+ BT_ASSERT(message);
+ BT_ASSERT_PRE(packet_msg->packet->stream->class->default_clock_class,
+ "Message's stream's class has no default clock class: "
+ "%![msg-]+n, %![sc-]+S",
+ message, packet_msg->packet->stream->class);
+ return packet_msg->default_cs;
+}
+
+const struct bt_clock_snapshot *
+bt_message_packet_beginning_borrow_default_clock_snapshot_const(
+ const struct bt_message *msg)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
+ return borrow_packet_message_default_clock_snapshot_const(msg);
+}
+
+const struct bt_clock_snapshot *
+bt_message_packet_end_borrow_default_clock_snapshot_const(
+ const struct bt_message *msg)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
+ return borrow_packet_message_default_clock_snapshot_const(msg);
+}
+
+static inline
+const struct bt_clock_class *
+borrow_packet_message_stream_class_default_clock_class(
+ const struct bt_message *msg)
+{
+ struct bt_message_packet *packet_msg = (void *) msg;
+
+ BT_ASSERT(msg);
+ return packet_msg->packet->stream->class->default_clock_class;
+}
+
+const struct bt_clock_class *
+bt_message_packet_beginning_borrow_stream_class_default_clock_class_const(
+ const struct bt_message *msg)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_BEGINNING);
+ return borrow_packet_message_stream_class_default_clock_class(msg);
+}
+
+const struct bt_clock_class *
+bt_message_packet_end_borrow_stream_class_default_clock_class_const(
+ const struct bt_message *msg)
+{
+ BT_ASSERT_PRE_NON_NULL(msg, "Message");
+ BT_ASSERT_PRE_MSG_IS_TYPE(msg, BT_MESSAGE_TYPE_PACKET_END);
+ return borrow_packet_message_stream_class_default_clock_class(msg);
+}