eui64.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
eui64.h - EUI64 routines for IPv6CP.
Copyright (C) 1999 Tommi Komulainen <Tommi.Komulainen@iki.fi>
Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by Tommi Komulainen. The name of the author may not be used
to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
$Id: eui64.h,v 1.3 1999/09/30 19:56:37 masputra Exp $
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#ifndef __EUI64_H__
#define __EUI64_H__
#if !defined(INET6)
#error "this file should only be included when INET6 is defined"
#endif /* not defined(INET6) */
#if defined(SOL2)
typedef union {
} eui64_t;
/*
* Declare the two below, since in.h only defines them when _KERNEL
* is declared - which shouldn't be true when dealing with user-land programs
*/
#else /* else if not defined(SOL2) */
/*
* TODO:
*
* Maybe this should be done by processing struct in6_addr directly...
*/
typedef union
{
} eui64_t;
#endif /* defined(SOL2) */
#define eui64_magic(e) ( \
(e).e8[0] &= ~2 \
)
#define eui64_magic_nz(x) do { \
eui64_magic(x); \
} while (eui64_iszero(x))
#define eui64_magic_ne(x, y) do { \
eui64_magic(x); \
} while (eui64_equals(x, y))
)
)
#define eui64_set32(e, l) ( \
(e).e32[0] = 0, \
)
#define eui64_setlo32(e, l) eui64_set32(e, l)
/*
* Returns ascii representation of ID. This is at most 20 bytes long;
* 19 characters plus one NUL.
*/
#endif /* __EUI64_H__ */