---
name: "eui64"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/eui64"
---

# eui64(3)

IEEE EUI-64 conversion and lookup routines

## NAME

**eui64**, **eui64\_aton**, **eui64\_ntoa**, **eui64\_ntohost**, **eui64\_hostton** – IEEE EUI-64 conversion and lookup routines

## LIBRARY

Standard C Library (libc, -lc)

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<sys/eui64.h\>**

*int*\

**eui64\_aton**(*const char \*a*, *struct eui64 \*e*);

*int*\

**eui64\_ntoa**(*const struct eui64 \*id*, *char \*a*, *size\_t len*);

*int*\

**eui64\_ntohost**(*char \*hostname*, *size\_t len*, *const struct eui64 \*id*);

*int*\

**eui64\_hostton**(*const char \*hostname*, *struct eui64 \*id*);

## DESCRIPTION

These functions operate on IEEE EUI-64s using an *eui64* structure, which is defined in the header file ⟨sys/eui64.h⟩:

```
/*
 * The number of bytes in an EUI-64.
 */
#define EUI64_LEN		8
/*
 * Structure of an IEEE EUI-64.
 */
struct  eui64 {
        u_char octet[EUI64_LEN];
};
```

The **eui64\_aton**() function converts an ASCII representation of an EUI-64 into an *eui64* structure. Likewise, **eui64\_ntoa**() converts an EUI-64 specified as an *eui64* structure into an ASCII string.

The **eui64\_ntohost**() and **eui64\_hostton**() functions map EUI-64s to their corresponding hostnames as specified in the */etc/eui64* database. The **eui64\_ntohost**() function converts from EUI-64 to hostname, and **eui64\_hostton**() converts from hostname to EUI-64.

## RETURN VALUES

On success, **eui64\_ntoa**() returns a pointer to a string containing an ASCII representation of an EUI-64. If it is unable to convert the supplied *eui64* structure, it returns a NULL pointer. Likewise, **eui64\_aton**() returns a pointer to an *eui64* structure on success and a NULL pointer on failure.

The **eui64\_ntohost**() and **eui64\_hostton**() functions both return zero on success or non-zero if they were unable to find a match in the */etc/eui64* database.

## NOTES

The user must ensure that the hostname strings passed to the **eui64\_ntohost**() and **eui64\_hostton**() functions are large enough to contain the returned hostnames.

## NIS INTERACTION

If the */etc/eui64* contains a line with a single ‘+’ in it, the **eui64\_ntohost**() and **eui64\_hostton**() functions will attempt to consult the NIS *eui64.byname* and *eui64.byid* maps in addition to the data in the */etc/eui64* file.

## SEE ALSO

[firewire(4)](/firewire/4.md), [eui64(5)](/eui64/5.md), [yp(8)](/yp/8.md)

## HISTORY

These functions first appears in FreeBSD 5.3. They are derived from the [ethers(3)](/ethers/3.md) family of functions.
