---
title: "htons, ntohs, htonl, ntohl for W5500"
url: "https://maker.wiznet.io/forum/14980"
markdown_url: "https://maker.wiznet.io/forum/14980/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "Vien Huy Nguyen"
created: "2023-07-23T03:32:42+09:00"
last_activity: "2023-07-23T17:08:23+09:00"
language: "en"
views: 179
replies: 3
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# htons, ntohs, htonl, ntohl for W5500

## Question

Asked by Vien Huy Nguyen on 2023-07-23 in Ethernet Chips.

Hi,

I am using some third party libraries that call these functions. I download the driver source code from WIZnet for W5500 and I cannot find these functions. Could anyone point me to where I can find them? Thanks.

## Replies

### Reply 1 by Eugeny, 2023-07-23

In the Linux source tree? These functions are not W5500 specific.

### Reply 2 by Vien Huy Nguyen, 2023-07-23 (in reply to reply 1)

Do you know how to create them? I did some research and looks like they just re-arrange the bytes for little-endian and big-endian data types. How do I determine if I need little-endian or big-endian type? Does it depend on the application that uses Ethernet or on the processor that I use (in my case a microcontroller)?

### Reply 3 by Eugeny, 2023-07-23

The compiler and those functions (basing on compiler/platform settings) know how to convert (and if to convert at all). Look into their code.

---

Source: https://maker.wiznet.io/forum/14980
