version 1.1.2.1, 2011/06/07 11:37:13
|
version 1.4, 2012/03/29 01:31:34
|
Line 12 terms:
|
Line 12 terms:
|
All of the documentation and software included in the ELWIX and AITNET |
All of the documentation and software included in the ELWIX and AITNET |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
Releases is copyrighted by ELWIX - Sofia/Bulgaria <info@elwix.org> |
|
|
Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 | Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
by Michael Pounov <misho@elwix.org>. All rights reserved. |
|
|
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
Line 151 static char *prefix_toa2x(prefix_t *prefix, char *buff
|
Line 151 static char *prefix_toa2x(prefix_t *prefix, char *buff
|
assert (prefix->bitlen <= 32); |
assert (prefix->bitlen <= 32); |
a = prefix_touchar(prefix); |
a = prefix_touchar(prefix); |
if (with_len) |
if (with_len) |
sprintf(buff, "%d.%d.%d.%d/%d", a[0], a[1], a[2], a[3], prefix->bitlen); | snprintf(buff, with_len, "%d.%d.%d.%d/%d", a[0], a[1], a[2], |
| a[3], prefix->bitlen); |
else |
else |
sprintf(buff, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); | snprintf(buff, 16, "%d.%d.%d.%d", a[0], a[1], a[2], a[3]); |
return buff; |
return buff; |
} |
} |
#ifdef HAVE_IPV6 |
#ifdef HAVE_IPV6 |
Line 162 static char *prefix_toa2x(prefix_t *prefix, char *buff
|
Line 163 static char *prefix_toa2x(prefix_t *prefix, char *buff
|
a = (char*) inet_ntop(AF_INET6, &prefix->add.sin6, buff, 48 /* a guess value */); |
a = (char*) inet_ntop(AF_INET6, &prefix->add.sin6, buff, 48 /* a guess value */); |
if (a && with_len) { |
if (a && with_len) { |
assert(prefix->bitlen <= 128); |
assert(prefix->bitlen <= 128); |
sprintf(buff + strlen(buff), "/%d", prefix->bitlen); | snprintf(buff + strlen(buff), with_len - strlen(buff), |
| "/%d", prefix->bitlen); |
} |
} |
return buff; |
return buff; |
} |
} |