1 | /* $Id: AudioTestServiceProtocol.cpp 89180 2021-05-19 15:46:15Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * AudioTestService - Audio test execution server, Protocol helpers.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2021 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 |
|
---|
19 | /*********************************************************************************************************************************
|
---|
20 | * Header Files *
|
---|
21 | *********************************************************************************************************************************/
|
---|
22 | #define LOG_GROUP RTLOGGROUP_DEFAULT
|
---|
23 | #include <iprt/asm.h>
|
---|
24 | #include <iprt/cdefs.h>
|
---|
25 |
|
---|
26 | #include "AudioTestServiceProtocol.h"
|
---|
27 |
|
---|
28 |
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * Converts a ATS packet header from host to network byte order.
|
---|
32 | *
|
---|
33 | * @returns nothing.
|
---|
34 | * @param pPktHdr The packet header to convert.
|
---|
35 | */
|
---|
36 | DECLINLINE(void) atsProtocolPktHdrH2N(PATSPKTHDR pPktHdr)
|
---|
37 | {
|
---|
38 | pPktHdr->cb = RT_H2N_U32(pPktHdr->cb);
|
---|
39 | pPktHdr->uCrc32 = RT_H2N_U32(pPktHdr->uCrc32);
|
---|
40 | }
|
---|
41 |
|
---|
42 |
|
---|
43 | #if 0 /* Unused */
|
---|
44 | /**
|
---|
45 | * Converts a ATS packet header from network to host byte order.
|
---|
46 | *
|
---|
47 | * @returns nothing.
|
---|
48 | * @param pPktHdr The packet header to convert.
|
---|
49 | */
|
---|
50 | DECLINLINE(void) atsProtocolPktHdrN2H(PATSPKTHDR pPktHdr)
|
---|
51 | {
|
---|
52 | pPktHdr->cb = RT_N2H_U32(pPktHdr->cb);
|
---|
53 | pPktHdr->uCrc32 = RT_N2H_U32(pPktHdr->uCrc32);
|
---|
54 | }
|
---|
55 |
|
---|
56 |
|
---|
57 | /**
|
---|
58 | * Converts a ATS status header from host to network byte order.
|
---|
59 | *
|
---|
60 | * @returns nothing.
|
---|
61 | * @param pPktHdr The packet header to convert.
|
---|
62 | */
|
---|
63 | DECLINLINE(void) atsProtocolStsHdrH2N(PATSPKTSTS pPktHdr)
|
---|
64 | {
|
---|
65 | atsProtocolPktHdrH2N(&pPktHdr->Hdr);
|
---|
66 | pPktHdr->rcReq = RT_H2N_U32(pPktHdr->rcReq);
|
---|
67 | pPktHdr->cchStsMsg = RT_H2N_U32(pPktHdr->cchStsMsg);
|
---|
68 | }
|
---|
69 |
|
---|
70 |
|
---|
71 | /**
|
---|
72 | * Converts a ATS status header from network to host byte order.
|
---|
73 | *
|
---|
74 | * @returns nothing.
|
---|
75 | * @param pPktHdr The packet header to convert.
|
---|
76 | */
|
---|
77 | DECLINLINE(void) atsProtocolStsHdrN2H(PATSPKTSTS pPktHdr)
|
---|
78 | {
|
---|
79 | atsProtocolPktHdrN2H(&pPktHdr->Hdr);
|
---|
80 | pPktHdr->rcReq = RT_N2H_U32(pPktHdr->rcReq);
|
---|
81 | pPktHdr->cchStsMsg = RT_N2H_U32(pPktHdr->cchStsMsg);
|
---|
82 | }
|
---|
83 | #endif
|
---|
84 |
|
---|
85 |
|
---|
86 | DECLHIDDEN(void) atsProtocolReqH2N(PATSPKTHDR pPktHdr)
|
---|
87 | {
|
---|
88 | atsProtocolPktHdrH2N(pPktHdr);
|
---|
89 | }
|
---|
90 |
|
---|
91 |
|
---|
92 | DECLHIDDEN(void) atsProtocolReqN2H(PATSPKTHDR pPktHdr)
|
---|
93 | {
|
---|
94 | RT_NOREF1(pPktHdr);
|
---|
95 | }
|
---|
96 |
|
---|
97 |
|
---|
98 | DECLHIDDEN(void) atsProtocolRepH2N(PATSPKTSTS pPktHdr)
|
---|
99 | {
|
---|
100 | RT_NOREF1(pPktHdr);
|
---|
101 | }
|
---|
102 |
|
---|
103 |
|
---|
104 | DECLHIDDEN(void) atsProtocolRepN2H(PATSPKTSTS pPktHdr)
|
---|
105 | {
|
---|
106 | RT_NOREF1(pPktHdr);
|
---|
107 | }
|
---|