---
name: "rte_byteorder.h"
section: "3"
platform: "linux"
package: "dpdk-doc"
version: "24.11.4-0+deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rte_byteorder.h"
---

# rte\_byteorder.h(3)

## NAME

rte\_byteorder.h

## SYNOPSIS

`#include <stdint.h>`\
 `#include <rte_common.h>`\
 `#include <rte_config.h>`\

### Typedefs

**typedef** uint16\_t **rte\_be16\_t**\
 **typedef** uint32\_t **rte\_be32\_t**\
 **typedef** uint64\_t **rte\_be64\_t**\
 **typedef** uint16\_t **rte\_le16\_t**\
 **typedef** uint32\_t **rte\_le32\_t**\
 **typedef** uint64\_t **rte\_le64\_t**\

### Functions

static uint16\_t **rte\_bswap16** (uint16\_t \_x)\
 static uint32\_t **rte\_bswap32** (uint32\_t x)\
 static uint64\_t **rte\_bswap64** (uint64\_t x)\
 static **rte\_le16\_t** **rte\_cpu\_to\_le\_16** (uint16\_t x)\
 static **rte\_le32\_t** **rte\_cpu\_to\_le\_32** (uint32\_t x)\
 static **rte\_le64\_t** **rte\_cpu\_to\_le\_64** (uint64\_t x)\
 static **rte\_be16\_t** **rte\_cpu\_to\_be\_16** (uint16\_t x)\
 static **rte\_be32\_t** **rte\_cpu\_to\_be\_32** (uint32\_t x)\
 static **rte\_be64\_t** **rte\_cpu\_to\_be\_64** (uint64\_t x)\
 static uint16\_t **rte\_le\_to\_cpu\_16** (**rte\_le16\_t** x)\
 static uint32\_t **rte\_le\_to\_cpu\_32** (**rte\_le32\_t** x)\
 static uint64\_t **rte\_le\_to\_cpu\_64** (**rte\_le64\_t** x)\
 static uint16\_t **rte\_be\_to\_cpu\_16** (**rte\_be16\_t** x)\
 static uint32\_t **rte\_be\_to\_cpu\_32** (**rte\_be32\_t** x)\
 static uint64\_t **rte\_be\_to\_cpu\_64** (**rte\_be64\_t** x)\

## Detailed Description

Byte Swap Operations

This file defines a generic API for byte swap operations. Part of the implementation is architecture-specific.

Definition in file **rte\_byteorder.h**.

## Typedef Documentation

### typedef uint16\_t rte\_be16\_t

16-bit big-endian value.

Definition at line **116** of file **rte\_byteorder.h**.

### typedef uint32\_t rte\_be32\_t

32-bit big-endian value.

Definition at line **117** of file **rte\_byteorder.h**.

### typedef uint64\_t rte\_be64\_t

64-bit big-endian value.

Definition at line **118** of file **rte\_byteorder.h**.

### typedef uint16\_t rte\_le16\_t

16-bit little-endian value.

Definition at line **119** of file **rte\_byteorder.h**.

### typedef uint32\_t rte\_le32\_t

32-bit little-endian value.

Definition at line **120** of file **rte\_byteorder.h**.

### typedef uint64\_t rte\_le64\_t

64-bit little-endian value.

Definition at line **121** of file **rte\_byteorder.h**.

## Function Documentation

### static uint16\_t rte\_bswap16 (uint16\_t \_x)` [static]`

Swap bytes in a 16-bit value.

### static uint32\_t rte\_bswap32 (uint32\_t x)` [static]`

Swap bytes in a 32-bit value.

### static uint64\_t rte\_bswap64 (uint64\_t x)` [static]`

Swap bytes in a 64-bit value.

### static rte\_le16\_t rte\_cpu\_to\_le\_16 (uint16\_t x)` [static]`

Convert a 16-bit value from CPU order to little endian.

### static rte\_le32\_t rte\_cpu\_to\_le\_32 (uint32\_t x)` [static]`

Convert a 32-bit value from CPU order to little endian.

### static rte\_le64\_t rte\_cpu\_to\_le\_64 (uint64\_t x)` [static]`

Convert a 64-bit value from CPU order to little endian.

### static rte\_be16\_t rte\_cpu\_to\_be\_16 (uint16\_t x)` [static]`

Convert a 16-bit value from CPU order to big endian.

### static rte\_be32\_t rte\_cpu\_to\_be\_32 (uint32\_t x)` [static]`

Convert a 32-bit value from CPU order to big endian.

### static rte\_be64\_t rte\_cpu\_to\_be\_64 (uint64\_t x)` [static]`

Convert a 64-bit value from CPU order to big endian.

### static uint16\_t rte\_le\_to\_cpu\_16 (rte\_le16\_t x)` [static]`

Convert a 16-bit value from little endian to CPU order.

### static uint32\_t rte\_le\_to\_cpu\_32 (rte\_le32\_t x)` [static]`

Convert a 32-bit value from little endian to CPU order.

### static uint64\_t rte\_le\_to\_cpu\_64 (rte\_le64\_t x)` [static]`

Convert a 64-bit value from little endian to CPU order.

### static uint16\_t rte\_be\_to\_cpu\_16 (rte\_be16\_t x)` [static]`

Convert a 16-bit value from big endian to CPU order.

### static uint32\_t rte\_be\_to\_cpu\_32 (rte\_be32\_t x)` [static]`

Convert a 32-bit value from big endian to CPU order.

### static uint64\_t rte\_be\_to\_cpu\_64 (rte\_be64\_t x)` [static]`

Convert a 64-bit value from big endian to CPU order.

## Author

Generated automatically by Doxygen for DPDK from the source code.
