VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/utils/usb/UsbTestServiceProtocol.cpp@ 108625

Last change on this file since 108625 was 108625, checked in by vboxsync, 7 weeks ago

ValidationKit/utils/usb/UsbTestServiceProtocol.cpp: clang build fixes, bugref:10391

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/* $Id: UsbTestServiceProtocol.cpp 108625 2025-03-20 10:38:29Z vboxsync $ */
2/** @file
3 * UsbTestService - Remote USB test configuration and execution server, Protocol helpers.
4 */
5
6/*
7 * Copyright (C) 2016-2024 Oracle and/or its affiliates.
8 *
9 * This file is part of VirtualBox base platform packages, as
10 * available from https://www.virtualbox.org.
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation, in version 3 of the
15 * License.
16 *
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, see <https://www.gnu.org/licenses>.
24 *
25 * The contents of this file may alternatively be used under the terms
26 * of the Common Development and Distribution License Version 1.0
27 * (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
28 * in the VirtualBox distribution, in which case the provisions of the
29 * CDDL are applicable instead of those of the GPL.
30 *
31 * You may elect to license modified versions of this file under the
32 * terms and conditions of either the GPL or the CDDL or both.
33 *
34 * SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
35 */
36
37
38/*********************************************************************************************************************************
39* Header Files *
40*********************************************************************************************************************************/
41#define LOG_GROUP RTLOGGROUP_DEFAULT
42#include <iprt/asm.h>
43#include <iprt/cdefs.h>
44
45#include "UsbTestServiceProtocol.h"
46
47
48
49/**
50 * Converts a UTS packet header from host to network byte order.
51 *
52 * @param pPktHdr The packet header to convert.
53 */
54DECLINLINE(void) utsProtocolPktHdrH2N(PUTSPKTHDR pPktHdr)
55{
56 pPktHdr->cb = RT_H2N_U32(pPktHdr->cb);
57 pPktHdr->uCrc32 = RT_H2N_U32(pPktHdr->uCrc32);
58}
59
60
61#if 0 /* unused */
62/**
63 * Converts a UTS packet header from network to host byte order.
64 *
65 * @param pPktHdr The packet header to convert.
66 */
67DECLINLINE(void) utsProtocolPktHdrN2H(PUTSPKTHDR pPktHdr)
68{
69 pPktHdr->cb = RT_N2H_U32(pPktHdr->cb);
70 pPktHdr->uCrc32 = RT_N2H_U32(pPktHdr->uCrc32);
71}
72
73
74/**
75 * Converts a UTS status header from host to network byte order.
76 *
77 * @param pPktHdr The packet header to convert.
78 */
79DECLINLINE(void) utsProtocolStsHdrH2N(PUTSPKTSTS pPktHdr)
80{
81 utsProtocolPktHdrH2N(&pPktHdr->Hdr);
82 pPktHdr->rcReq = RT_H2N_U32(pPktHdr->rcReq);
83 pPktHdr->cchStsMsg = RT_H2N_U32(pPktHdr->cchStsMsg);
84}
85
86
87/**
88 * Converts a UTS status header from network to host byte order.
89 *
90 * @param pPktHdr The packet header to convert.
91 */
92DECLINLINE(void) utsProtocolStsHdrN2H(PUTSPKTSTS pPktHdr)
93{
94 utsProtocolPktHdrN2H(&pPktHdr->Hdr);
95 pPktHdr->rcReq = RT_N2H_U32(pPktHdr->rcReq);
96 pPktHdr->cchStsMsg = RT_N2H_U32(pPktHdr->cchStsMsg);
97}
98#endif
99
100
101DECLHIDDEN(void) utsProtocolReqH2N(PUTSPKTHDR pPktHdr)
102{
103 utsProtocolPktHdrH2N(pPktHdr);
104}
105
106
107DECLHIDDEN(void) utsProtocolReqN2H(PUTSPKTHDR pPktHdr)
108{
109 RT_NOREF1(pPktHdr);
110}
111
112
113DECLHIDDEN(void) utsProtocolRepH2N(PUTSPKTSTS pPktHdr)
114{
115 RT_NOREF1(pPktHdr);
116}
117
118
119DECLHIDDEN(void) utsProtocolRepN2H(PUTSPKTSTS pPktHdr)
120{
121 RT_NOREF1(pPktHdr);
122}
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette