$iptype » History » Version 3
Per Amundsen, 02/23/2023 02:04 PM
| 1 | 1 | Per Amundsen | _Added in 1.9.3_ |
|---|---|---|---|
| 2 | |||
| 3 | *$iptype(text)* |
||
| 4 | |||
| 5 | Returns "ipv4" or "ipv6" if text is is a valid IP address format. |
||
| 6 | |||
| 7 | *Parameters* |
||
| 8 | |||
| 9 | 3 | Per Amundsen | table(ktable). |
| 10 | |*Parameter*|*Description*| |
||
| 11 | | text | The text to validate. | |
||
| 12 | 1 | Per Amundsen | |
| 13 | *Properties* |
||
| 14 | |||
| 15 | 3 | Per Amundsen | table(ktable). |
| 16 | |*Property*|*Description*| |
||
| 17 | | | expand - Expand a ipv6 address. | |
||
| 18 | | .compress | Compress a ipv6 address. | |
||
| 19 | 1 | Per Amundsen | |
| 20 | *Example* |
||
| 21 | |||
| 22 | <pre> |
||
| 23 | ; Check a IPv4 address. |
||
| 24 | //echo -ag 8.8.8.8 is $iptype(8.8.8.8) |
||
| 25 | |||
| 26 | ; Check a IPv6 address. |
||
| 27 | //echo -ag FE80:0000:0000:0000:0202:B3FF:FE1E:8329 is $iptype(FE80:0000:0000:0000:0202:B3FF:FE1E:8329) |
||
| 28 | </pre> |