1/*	$NetBSD: eui64.c,v 1.1.1.1 2005/02/20 10:28:43 cube Exp $	*/
2
3/*
4 * eui64.c - EUI64 routines for IPv6CP.
5 *
6 * Copyright (c) 1999 Tommi Komulainen.  All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 *    notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in
17 *    the documentation and/or other materials provided with the
18 *    distribution.
19 *
20 * 3. The name(s) of the authors of this software must not be used to
21 *    endorse or promote products derived from this software without
22 *    prior written permission.
23 *
24 * 4. Redistributions of any form whatsoever must retain the following
25 *    acknowledgment:
26 *    "This product includes software developed by Tommi Komulainen
27 *     <Tommi.Komulainen@iki.fi>".
28 *
29 * THE AUTHORS OF THIS SOFTWARE DISCLAIM ALL WARRANTIES WITH REGARD TO
30 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
31 * AND FITNESS, IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
32 * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
33 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
34 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
35 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
36 *
37 * Id: eui64.c,v 1.6 2002/12/04 23:03:32 paulus Exp
38 */
39
40#include <sys/cdefs.h>
41#ifndef lint
42#if 0
43#define RCSID	"Id: eui64.c,v 1.6 2002/12/04 23:03:32 paulus Exp"
44#else
45__RCSID("$NetBSD: eui64.c,v 1.1.1.1 2005/02/20 10:28:43 cube Exp $");
46#endif
47#endif
48
49#include "pppd.h"
50
51#ifdef RCSID
52static const char rcsid[] = RCSID;
53#endif
54
55/*
56 * eui64_ntoa - Make an ascii representation of an interface identifier
57 */
58char *
59eui64_ntoa(e)
60    eui64_t e;
61{
62    static char buf[32];
63
64    snprintf(buf, 32, "%02x%02x:%02x%02x:%02x%02x:%02x%02x",
65	     e.e8[0], e.e8[1], e.e8[2], e.e8[3],
66	     e.e8[4], e.e8[5], e.e8[6], e.e8[7]);
67    return buf;
68}
69