1fmt_ip6c(3) Library Functions Manual fmt_ip6c(3)
2
3
4
6 fmt_ip6c - write a formatted ASCII representation of an IPv6 number
7
9 #include <ip6.h>
10
11 unsigned int fmt_ip6c(char *dest,const char ip[16]);
12
14 fmt_ip6c formats an IPv6 number in ASCII representation from ip and
15 writes the result into dest. It returns the number of bytes written.
16
17 fmt_ip6c will apply "::" compression to the output.
18
19 If ip is an IPv4-mapped IPv6 address, fmt_ip6c will output it as IPv4
20 address.
21
22 If dest equals FMT_LEN (i.e. is zero), fmt_ip6c returns the number of
23 bytes it would have written.
24
25 fmt_ip6c does not append \0.
26
27 For convenience, ip6.h defines the integer IP6_FMT to be big enough to
28 contain every possible fmt_ip6c output plus \0.
29
31 #include <ip6.h>
32
33 char buf[IP6_FMT];
34 char ip[16];
35 buf[fmt_ip6c(buf,ip)]=0;
36
38 fmt_ip6(3), fmt_ip6ifc(3), scan_ip6(3), fmt_ip4(3)
39
40
41
42 fmt_ip6c(3)