xref: /freebsd-13.1/sys/sys/eui64.h (revision c4e20cad)
160727d8bSWarner Losh /*-
2*c4e20cadSPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*c4e20cadSPedro F. Giffuni  *
47387768eSBrooks Davis  * Copyright 2004 The Aerospace Corporation.  All rights reserved.
57387768eSBrooks Davis  *
67387768eSBrooks Davis  * Redistribution and use in source and binary forms, with or without
77387768eSBrooks Davis  * modification, are permitted provided that the following conditions
87387768eSBrooks Davis  * are met:
97387768eSBrooks Davis  *
107387768eSBrooks Davis  * 1.  Redistributions of source code must retain the above copyright
117387768eSBrooks Davis  *     notice, this list of conditions, and the following disclaimer.
127387768eSBrooks Davis  * 2.  Redistributions in binary form must reproduce the above copyright
137387768eSBrooks Davis  *     notice, this list of conditions, and the following disclaimer in the
147387768eSBrooks Davis  *     documentation and/or other materials provided with the distribution.
157387768eSBrooks Davis  * 3.  The name of The Aerospace Corporation may not be used to endorse or
167387768eSBrooks Davis  *     promote products derived from this software.
177387768eSBrooks Davis  *
187387768eSBrooks Davis  * THIS SOFTWARE IS PROVIDED BY THE AEROSPACE CORPORATION "AS IS" AND
197387768eSBrooks Davis  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
207387768eSBrooks Davis  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
217387768eSBrooks Davis  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AEROSPACE CORPORATION BE LIABLE
227387768eSBrooks Davis  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
237387768eSBrooks Davis  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
247387768eSBrooks Davis  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
257387768eSBrooks Davis  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
267387768eSBrooks Davis  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
277387768eSBrooks Davis  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
287387768eSBrooks Davis  * SUCH DAMAGE.
297387768eSBrooks Davis  *
307387768eSBrooks Davis  * $FreeBSD$
317387768eSBrooks Davis  */
327387768eSBrooks Davis #ifndef _SYS_EUI64_H
337387768eSBrooks Davis #define _SYS_EUI64_H
347387768eSBrooks Davis 
357387768eSBrooks Davis /*
367387768eSBrooks Davis  * Size of the ASCII representation of an EUI-64.
377387768eSBrooks Davis  */
387387768eSBrooks Davis #define EUI64_SIZ	24
397387768eSBrooks Davis 
407387768eSBrooks Davis /*
417387768eSBrooks Davis  * The number of bytes in an EUI-64.
427387768eSBrooks Davis  */
437387768eSBrooks Davis #define EUI64_LEN	8
447387768eSBrooks Davis 
457387768eSBrooks Davis /*
467387768eSBrooks Davis  * Structure of an IEEE EUI-64.
477387768eSBrooks Davis  */
487387768eSBrooks Davis struct	eui64 {
497387768eSBrooks Davis 	u_char octet[EUI64_LEN];
507387768eSBrooks Davis };
517387768eSBrooks Davis 
527387768eSBrooks Davis #ifndef _KERNEL
537387768eSBrooks Davis int	eui64_aton(const char *, struct eui64 *);
547387768eSBrooks Davis int	eui64_ntoa(const struct eui64 *, char *, size_t);
557387768eSBrooks Davis int	eui64_ntohost(char *, size_t, const struct eui64 *);
567387768eSBrooks Davis int	eui64_hostton(const char *, struct eui64 *);
577387768eSBrooks Davis #endif /* !_KERNEL */
587387768eSBrooks Davis 
597387768eSBrooks Davis #endif /* !_SYS_EUI64_H */
60