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