VirtualBox

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

Last change on this file was 106061, checked in by vboxsync, 2 months ago

Copyright year updates by scm.

  • 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 106061 2024-09-16 14:03:52Z 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/**
62 * Converts a UTS packet header from network to host byte order.
63 *
64 * @param pPktHdr The packet header to convert.
65 */
66DECLINLINE(void) utsProtocolPktHdrN2H(PUTSPKTHDR pPktHdr)
67{
68 pPktHdr->cb = RT_N2H_U32(pPktHdr->cb);
69 pPktHdr->uCrc32 = RT_N2H_U32(pPktHdr->uCrc32);
70}
71
72
73/**
74 * Converts a UTS status header from host to network byte order.
75 *
76 * @param pPktHdr The packet header to convert.
77 */
78DECLINLINE(void) utsProtocolStsHdrH2N(PUTSPKTSTS pPktHdr)
79{
80 utsProtocolPktHdrH2N(&pPktHdr->Hdr);
81 pPktHdr->rcReq = RT_H2N_U32(pPktHdr->rcReq);
82 pPktHdr->cchStsMsg = RT_H2N_U32(pPktHdr->cchStsMsg);
83}
84
85
86/**
87 * Converts a UTS status header from network to host byte order.
88 *
89 * @param pPktHdr The packet header to convert.
90 */
91DECLINLINE(void) utsProtocolStsHdrN2H(PUTSPKTSTS pPktHdr)
92{
93 utsProtocolPktHdrN2H(&pPktHdr->Hdr);
94 pPktHdr->rcReq = RT_N2H_U32(pPktHdr->rcReq);
95 pPktHdr->cchStsMsg = RT_N2H_U32(pPktHdr->cchStsMsg);
96}
97
98
99DECLHIDDEN(void) utsProtocolReqH2N(PUTSPKTHDR pPktHdr)
100{
101 utsProtocolPktHdrH2N(pPktHdr);
102}
103
104
105DECLHIDDEN(void) utsProtocolReqN2H(PUTSPKTHDR pPktHdr)
106{
107 RT_NOREF1(pPktHdr);
108}
109
110
111DECLHIDDEN(void) utsProtocolRepH2N(PUTSPKTSTS pPktHdr)
112{
113 RT_NOREF1(pPktHdr);
114}
115
116
117DECLHIDDEN(void) utsProtocolRepN2H(PUTSPKTSTS pPktHdr)
118{
119 RT_NOREF1(pPktHdr);
120}
Note: See TracBrowser for help on using the repository browser.

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