eui64(3)

eui643

Ieee eui-64 conversion and lookup routines

Usage

#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);

Library

Standard C Library (libc, -lc)

Overview

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.

Releases

53 releases since FreeBSD 4.11-RELEASE; the text changed 34 times.

  1. 4.11
  2. 5.3–5.5
  3. 6.0–6.3
  4. 6.4
  5. 7.0
  6. 7.1
  7. 7.2
  8. 7.3
  9. 7.4
  10. 8.0
  11. 8.1
  12. 8.2
  13. 8.3
  14. 8.4
  15. 9.0
  16. 9.1
  17. 9.2
  18. 9.3
  19. 10.0
  20. 10.1
  21. 10.2
  22. 10.3
  23. 10.4
  24. 11.0
  25. 11.1
  26. 11.2
  27. 11.3
  28. 11.4
  29. 12.0
  30. 12.1
  31. 12.2
  32. 12.3
  33. 12.4
  34. 13.0–13.2
  35. 13.3–16.0

History

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

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.