summaryrefslogtreecommitdiff
path: root/man/ip6.3
blob: f3f5cb147ecf339fcb1ea19238210f61f39e9a13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
.TH qlibs: ipv6
.SH NAME
ipv6 \- IPv6 address evaluation and conversion
.SH SYNOPSIS 
.B #include \(dqip.h\(dq

unsigned int \fBip6_fmt\fP(char *\fIs\fR,char \fIip[16]\fR);
.br
unsigned int \fBip6_fmt_flat\fP(char *\fIs\fR,char \fIip[16]\fR);
.br
unsigned int \fBip6_scan_flat\fP(const char *\fIs\fR,char \fIip[16]\fR);
.br
unsigned int \fBip6_scan\fP(const char *\fIs\fR,char \fIip[16]\fR);
.br
unsigned int \fBip6_scanbracket\fP(const char *\fIs\fR,char \fIip[16]\fR);
.br
unsigned int \fBip6_ifscan\fP(char *\fIs\fR,char \fIip[16]\fR,stralloc *\fIifname\fR);
.br
unsigned int \fBip6_cidr\fP(char *\fIs\fR,char \fIip[16]\fR,unsigned long *\fIplen\fR);
.br
unsigned int \fBip6_bytestring\fP(stralloc *\fIip6string\fR,char \fIip[16]\fR,int \fIplen\fR);
.SH DESCRIPTION
.B ip6_fmt
reads the
.I char[16]
IPv6 address and returns a compactified hexadecimal IPv6 address string
.IR fe80::fefe .

.B ip6_fmt_flat
reads the
.I char[16]
IPv6 address and returns all hexadecimal IPv6 address labels as string 
.IR fe80:0000:....:fefe .

.B ip6_scan
reads a compactified IPv6 address string
.I fe80::fefe
and converts it to the
.I char[16]
IPv6 address.

.B ip6_scan_flat
reads an uncompressed IPv6 address als hexadecimal string
and returns it's
.I char[16]
IPv6 address.

.B ip6_scanbracket
reads a compactified IPv6 address string enclosed in brackets
.I [fe80::fefe]
removes the brackets and calls
.B ip6_scan
on the result.

.B ip6_ifscan
reads the compactified IPv6 address string appended with the
interface_name
.I fe80::fefe%eth0
returns 
.I ifname 
and calls 
.B ip6_scan
for the (stripped) IPv6 address.

.B ip6_cidr
reads the compactified CIDR IPv6 address string
.I fe80::fefe/64
determines the prefix as integer
.I plen
and calls
.BR ip6_scan .
If no prefix is identfied, it returns 128.

.B ip6_bytestring
reads the IPv6 address given as
.I char[16]
while returning a 0-terminated 'bytestring' representation
.I 1001001....
up to the given prefix length
.IR plen .

The macro
.B ipv6_v4mapped
reads the IPv6 addresses given as
.I char[16]
and returns
.I 0
in case the given IPv6 address is not 
a IPv4 mapped address.
.SH "RETURN CODES"
The
.B ip(6)*
programs return the number of bytes processed.
.B ip6_bytestring
returns negative numbers on failure.
.SH "SEE ALSO"
ip4(3), 
socket_if(3)