]> git.ozlabs.org Git - ppp.git/blob - pppd/eui64.c
added files for IPV6
[ppp.git] / pppd / eui64.c
1 /*
2  * eui64.c - EUI64 routines for IPv6CP.
3  *
4  * (c) 1999 Tommi Komulainen <Tommi.Komulainen@iki.fi>
5  *
6  * Redistribution and use in source and binary forms are permitted
7  * provided that the above copyright notice and this paragraph are
8  * duplicated in all such forms and that any documentation,
9  * advertising materials, and other materials related to such
10  * distribution and use acknowledge that the software was developed
11  * by Carnegie Mellon University.  The name of the
12  * University may not be used to endorse or promote products derived
13  * from this software without specific prior written permission.
14  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  *
18  * $Id: eui64.c,v 1.1 1999/08/13 01:58:42 paulus Exp $
19  */
20 #ifndef lint
21 static char rcsid[] = "$Id: eui64.c,v 1.1 1999/08/13 01:58:42 paulus Exp $";
22 #endif
23
24 #include "pppd.h"
25
26 /*
27  * eui64_ntoa - Make an ascii representation of an interface identifier
28  */
29 char *
30 eui64_ntoa(e)
31     eui64_t e;
32 {
33     static char buf[32];
34
35     snprintf(buf, 32, "%02x%02x:%02x%02x:%02x%02x:%02x%02x",
36              e.e8[0], e.e8[1], e.e8[2], e.e8[3], 
37              e.e8[4], e.e8[5], e.e8[6], e.e8[7]);
38     return buf;
39 }