xref: /haiku/headers/private/firewire/eui64.h (revision 2ff0a95e11057b43698cc20894d39a62f0499d35)
1*2ff0a95eSJérôme Duval /*-
2*2ff0a95eSJérôme Duval  * Copyright 2004 The Aerospace Corporation.  All rights reserved.
3*2ff0a95eSJérôme Duval  *
4*2ff0a95eSJérôme Duval  * Redistribution and use in source and binary forms, with or without
5*2ff0a95eSJérôme Duval  * modification, are permitted provided that the following conditions
6*2ff0a95eSJérôme Duval  * are met:
7*2ff0a95eSJérôme Duval  *
8*2ff0a95eSJérôme Duval  * 1.  Redistributions of source code must retain the above copyright
9*2ff0a95eSJérôme Duval  *     notice, this list of conditions, and the following disclaimer.
10*2ff0a95eSJérôme Duval  * 2.  Redistributions in binary form must reproduce the above copyright
11*2ff0a95eSJérôme Duval  *     notice, this list of conditions, and the following disclaimer in the
12*2ff0a95eSJérôme Duval  *     documentation and/or other materials provided with the distribution.
13*2ff0a95eSJérôme Duval  * 3.  The name of The Aerospace Corporation may not be used to endorse or
14*2ff0a95eSJérôme Duval  *     promote products derived from this software.
15*2ff0a95eSJérôme Duval  *
16*2ff0a95eSJérôme Duval  * THIS SOFTWARE IS PROVIDED BY THE AEROSPACE CORPORATION "AS IS" AND
17*2ff0a95eSJérôme Duval  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18*2ff0a95eSJérôme Duval  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19*2ff0a95eSJérôme Duval  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AEROSPACE CORPORATION BE LIABLE
20*2ff0a95eSJérôme Duval  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21*2ff0a95eSJérôme Duval  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22*2ff0a95eSJérôme Duval  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23*2ff0a95eSJérôme Duval  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24*2ff0a95eSJérôme Duval  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*2ff0a95eSJérôme Duval  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*2ff0a95eSJérôme Duval  * SUCH DAMAGE.
27*2ff0a95eSJérôme Duval  *
28*2ff0a95eSJérôme Duval  * $FreeBSD: src/sys/sys/eui64.h,v 1.2 2005/01/07 02:29:23 imp Exp $
29*2ff0a95eSJérôme Duval  */
30*2ff0a95eSJérôme Duval #ifndef _SYS_EUI64_H
31*2ff0a95eSJérôme Duval #define _SYS_EUI64_H
32*2ff0a95eSJérôme Duval 
33*2ff0a95eSJérôme Duval /*
34*2ff0a95eSJérôme Duval  * Size of the ASCII representation of an EUI-64.
35*2ff0a95eSJérôme Duval  */
36*2ff0a95eSJérôme Duval #define EUI64_SIZ	24
37*2ff0a95eSJérôme Duval 
38*2ff0a95eSJérôme Duval /*
39*2ff0a95eSJérôme Duval  * The number of bytes in an EUI-64.
40*2ff0a95eSJérôme Duval  */
41*2ff0a95eSJérôme Duval #define EUI64_LEN	8
42*2ff0a95eSJérôme Duval 
43*2ff0a95eSJérôme Duval /*
44*2ff0a95eSJérôme Duval  * Structure of an IEEE EUI-64.
45*2ff0a95eSJérôme Duval  */
46*2ff0a95eSJérôme Duval struct	eui64 {
47*2ff0a95eSJérôme Duval 	u_char octet[EUI64_LEN];
48*2ff0a95eSJérôme Duval };
49*2ff0a95eSJérôme Duval 
50*2ff0a95eSJérôme Duval #ifndef _KERNEL
51*2ff0a95eSJérôme Duval int	eui64_aton(const char *, struct eui64 *);
52*2ff0a95eSJérôme Duval int	eui64_ntoa(const struct eui64 *, char *, size_t);
53*2ff0a95eSJérôme Duval int	eui64_ntohost(char *, size_t, const struct eui64 *);
54*2ff0a95eSJérôme Duval int	eui64_hostton(const char *, struct eui64 *);
55*2ff0a95eSJérôme Duval #endif /* !_KERNEL */
56*2ff0a95eSJérôme Duval 
57*2ff0a95eSJérôme Duval #endif /* !_SYS_EUI64_H */
58