IPv6 routing number (routing)
Returns the routing part of an IPv6 address.
How does it work in the search window?
Select Create column in the search window toolbar, then select the IPv6 routing number operation. You need to specify one argument:
The data type of the values in the new column is integer.
demo.ecommerce.data table, we want to get the routing part of the clientIpAddress column. To do it, we need to transform it first into IPv6 format using the To IPv6 (ip6) operation. Then, click Create column on the query toolbar and select the IPv6 routing number operation.
The arguments needed to create the new column are:
- IPv6 → clientIpAddressIPv6 column obtained from the previous conversion operation.
Click Create column and you will see the following result:
How does it work in LINQ?
When using the search window interface to manually introduce the argument instead of using a column, the To IPv6 (ip6) operation will be transparently performed to convert the string specified into an ip6 data type. This means that you will not notice that such an intermediate step exists.
Though this conversion is implicit while using the search window interface, it must be explicitly done when writing the query in LINQ, as shown in the second example below.
Use the operator
as... and add the operation syntax to create the new column. This is the syntax for the IPv6 routing number operation:
You can copy the following LINQ script and try the above example on the
from demo.ecommerce.data select ip6(clientIpAddress) as clientIpAddressIPv6, routing(clientIpAddressIPv6) as Ipv6Routing
You can copy the following LINQ script to see how the string conversion must be explicitly performed in LINQ when specifying the argument instead of using a column.
from demo.ecommerce.data select host(ip6("2001:db8:85a3::8a2e:370:7334")) as IPv6Routing