Loading...
Searching...
No Matches
eui64.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
23
24#include <stdint.h>
25#include "byteorder.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
37
41#define EUI64_LOCAL_FLAG 0x02
42
46#define EUI64_GROUP_FLAG 0x01
48
58
66static inline void eui64_set_local(eui64_t *addr)
67{
68 addr->uint8[0] |= EUI64_LOCAL_FLAG;
69}
70
79static inline void eui64_clear_group(eui64_t *addr)
80{
81 addr->uint8[0] &= ~EUI64_GROUP_FLAG;
82}
83
84#ifdef __cplusplus
85}
86#endif
87
Functions to work with different byte orders.
be_uint32_t network_uint32_t
A 32 bit integer in network byte order.
Definition byteorder.h:109
be_uint16_t network_uint16_t
A 16 bit integer in network byte order.
Definition byteorder.h:104
be_uint64_t network_uint64_t
A 64 bit integer in network byte order.
Definition byteorder.h:114
static void eui64_set_local(eui64_t *addr)
Set the locally administrated bit in the EUI-64 address.
Definition eui64.h:66
#define EUI64_LOCAL_FLAG
Locally administered address.
Definition eui64.h:41
static void eui64_clear_group(eui64_t *addr)
Clear the group address bit to signal the address as individual address.
Definition eui64.h:79
#define EUI64_GROUP_FLAG
Group type address.
Definition eui64.h:46
Data type to represent an EUI-64.
Definition eui64.h:52
network_uint16_t uint16[4]
split into 4 16-bit words.
Definition eui64.h:55
network_uint32_t uint32[2]
split into 2 32-bit words.
Definition eui64.h:56
uint8_t uint8[8]
split into 8 8-bit words.
Definition eui64.h:54
network_uint64_t uint64
represented as 64 bit value
Definition eui64.h:53