Loading...
Searching...
No Matches
eui64.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
26
27#include <stdint.h>
28#include "byteorder.h"
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
40
44#define EUI64_LOCAL_FLAG 0x02
45
49#define EUI64_GROUP_FLAG 0x01
51
61
69static inline void eui64_set_local(eui64_t *addr)
70{
71 addr->uint8[0] |= EUI64_LOCAL_FLAG;
72}
73
82static inline void eui64_clear_group(eui64_t *addr)
83{
84 addr->uint8[0] &= ~EUI64_GROUP_FLAG;
85}
86
87#ifdef __cplusplus
88}
89#endif
90
Functions to work with different byte orders.
be_uint32_t network_uint32_t
A 32 bit integer in network byte order.
Definition byteorder.h:112
be_uint16_t network_uint16_t
A 16 bit integer in network byte order.
Definition byteorder.h:107
be_uint64_t network_uint64_t
A 64 bit integer in network byte order.
Definition byteorder.h:117
static void eui64_set_local(eui64_t *addr)
Set the locally administrated bit in the EUI-64 address.
Definition eui64.h:69
#define EUI64_LOCAL_FLAG
Locally administered address.
Definition eui64.h:44
static void eui64_clear_group(eui64_t *addr)
Clear the group address bit to signal the address as individual address.
Definition eui64.h:82
#define EUI64_GROUP_FLAG
Group type address.
Definition eui64.h:49
Data type to represent an EUI-64.
Definition eui64.h:55
network_uint16_t uint16[4]
split into 4 16-bit words.
Definition eui64.h:58
network_uint32_t uint32[2]
split into 2 32-bit words.
Definition eui64.h:59
uint8_t uint8[8]
split into 8 8-bit words.
Definition eui64.h:57
network_uint64_t uint64
represented as 64 bit value
Definition eui64.h:56