+ marker_inf->marker = ustcomm_print_data(marker_inf->data,
+ sizeof(marker_inf->data),
+ &offset,
+ marker);
+
+ if (marker_inf->marker == USTCOMM_POISON_PTR) {
+ return -ENOMEM;
+ }
+
+ header->size = COMPUTE_MSG_SIZE(marker_inf, offset);
+
+ return 0;
+}
+
+int ustcomm_unpack_marker_info(struct ustcomm_marker_info *marker_inf)
+{
+ marker_inf->trace = ustcomm_restore_ptr(marker_inf->trace,
+ marker_inf->data,
+ sizeof(marker_inf->data));
+ if (!marker_inf->trace) {
+ return -EINVAL;
+ }
+
+ marker_inf->channel = ustcomm_restore_ptr(marker_inf->channel,
+ marker_inf->data,
+ sizeof(marker_inf->data));
+ if (!marker_inf->channel) {
+ return -EINVAL;
+ }
+
+ marker_inf->marker = ustcomm_restore_ptr(marker_inf->marker,
+ marker_inf->data,
+ sizeof(marker_inf->data));
+ if (!marker_inf->marker) {
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+int ustcomm_pack_sock_path(struct ustcomm_header *header,
+ struct ustcomm_sock_path *sock_path_inf,
+ const char *socket_path)
+{
+ int offset = 0;
+
+ sock_path_inf->sock_path =
+ ustcomm_print_data(sock_path_inf->data,
+ sizeof(sock_path_inf->data),
+ &offset,
+ socket_path);
+
+ if (sock_path_inf->sock_path == USTCOMM_POISON_PTR) {
+ return -ENOMEM;
+ }
+
+ header->size = COMPUTE_MSG_SIZE(sock_path_inf, offset);
+
+ return 0;
+}
+
+int ustcomm_unpack_sock_path(struct ustcomm_sock_path *sock_path_inf)
+{
+ sock_path_inf->sock_path =
+ ustcomm_restore_ptr(sock_path_inf->sock_path,
+ sock_path_inf->data,
+ sizeof(sock_path_inf->data));
+ if (!sock_path_inf->sock_path) {
+ return -EINVAL;
+ }
+
+ return 0;