1 // Copyright (c) 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef QUICHE_SPDY_PLATFORM_API_SPDY_ENDIANNESS_UTIL_H_
6 #define QUICHE_SPDY_PLATFORM_API_SPDY_ENDIANNESS_UTIL_H_
7 
8 #include <stdint.h>
9 
10 #include "net/spdy/platform/impl/spdy_endianness_util_impl.h"
11 
12 namespace spdy {
13 
14 // Converts the bytes in |x| from network to host order (endianness), and
15 // returns the result.
SpdyNetToHost16(uint16_t x)16 inline uint16_t SpdyNetToHost16(uint16_t x) {
17   return SpdyNetToHost16Impl(x);
18 }
19 
SpdyNetToHost32(uint32_t x)20 inline uint32_t SpdyNetToHost32(uint32_t x) {
21   return SpdyNetToHost32Impl(x);
22 }
23 
SpdyNetToHost64(uint64_t x)24 inline uint64_t SpdyNetToHost64(uint64_t x) {
25   return SpdyNetToHost64Impl(x);
26 }
27 
28 // Converts the bytes in |x| from host to network order (endianness), and
29 // returns the result.
SpdyHostToNet16(uint16_t x)30 inline uint16_t SpdyHostToNet16(uint16_t x) {
31   return SpdyHostToNet16Impl(x);
32 }
33 
SpdyHostToNet32(uint32_t x)34 inline uint32_t SpdyHostToNet32(uint32_t x) {
35   return SpdyHostToNet32Impl(x);
36 }
37 
SpdyHostToNet64(uint64_t x)38 inline uint64_t SpdyHostToNet64(uint64_t x) {
39   return SpdyHostToNet64Impl(x);
40 }
41 
42 }  // namespace spdy
43 
44 #endif  // QUICHE_SPDY_PLATFORM_API_SPDY_ENDIANNESS_UTIL_H_
45