… | |
… | |
73 | |
73 | |
74 | Tries to parse the given IPv6 address and return it in |
74 | Tries to parse the given IPv6 address and return it in |
75 | octet form (or undef when it isn't in a parsable format). |
75 | octet form (or undef when it isn't in a parsable format). |
76 | |
76 | |
77 | Should support all forms specified by RFC 2373 (and additionally all IPv4 |
77 | Should support all forms specified by RFC 2373 (and additionally all IPv4 |
78 | formst supported by parse_ipv4). |
78 | forms supported by parse_ipv4). |
|
|
79 | |
|
|
80 | This function works similarly to C<inet_pton AF_INET6, ...>. |
79 | |
81 | |
80 | =cut |
82 | =cut |
81 | |
83 | |
82 | sub parse_ipv6($) { |
84 | sub parse_ipv6($) { |
83 | # quick test to avoid longer processing |
85 | # quick test to avoid longer processing |
… | |
… | |
128 | |
130 | |
129 | =item $text = format_ip $ipn |
131 | =item $text = format_ip $ipn |
130 | |
132 | |
131 | Takes either an IPv4 address (4 octets) or and IPv6 address (16 octets) |
133 | Takes either an IPv4 address (4 octets) or and IPv6 address (16 octets) |
132 | and converts it into textual form. |
134 | and converts it into textual form. |
|
|
135 | |
|
|
136 | This function works similarly to C<inet_ntop AF_INET || AF_INET6, ...>, |
|
|
137 | except it automatically detects the address type. |
133 | |
138 | |
134 | =cut |
139 | =cut |
135 | |
140 | |
136 | sub format_ip; |
141 | sub format_ip; |
137 | sub format_ip($) { |
142 | sub format_ip($) { |