IP Functions
Description
The IPv4 function can use an IPv4 address in dotted decimal notation (example: 192.168.0.1) or an IP address in integer format (example: 3232235521). The subnet parameter is an IPv4 subnet in CIDR notation (example: 192.168.0.0/16).
IP Function Statements
Statement |
Description |
Example |
---|---|---|
IPV4_MATCH(address,subnet) |
If subnet belongs to address, true is returned. Otherwise, false is returned. If address is not a valid IPv4 address, false is returned. This function is more efficient if address is an integer rather than a string. |
SELECT IPV4_MATCH (address,subnet) |
IPV4_PARSE(address) |
Parses address into an integer IPv4 address. If address is a valid IPv4 address, it can be parsed. If address is not a valid IPv4 address, null is returned. |
SELECT IPV4_PARSE(address) |
IPV4_STRINGIFY(address) |
Converts an integer address into an IPv4 address in dotted notation. If address is a valid integer IPv4 address, it can be parsed. If address is not an IPv4 address, null is returned. |
SELECT IPV4_STRINGIFY(address) |
Examples
IPV4_MATCH(address, subnet)
If address belongs to subnet, true is returned. Otherwise, false is returned. If address is not a valid IPv4 address, false is returned. This function is more efficient if address is an integer rather than a string.
- Example field
- Query and analysis statement
select IPV4,IPV4_MATCH(Ipv4, '192.168.0.0/16')
- Query and analysis result
Table 1 Query and analysis result IPV4
EXPR$1
192.168.1.18
true
IPV4_PARSE(address)/IPV4_STRINGIFY(address)
Parses address into an integer IPv4 address. If address is a valid IPv4 address, it can be parsed. If address is not a valid IPv4 address, null is returned.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot