Functions
|
Compute a column of hostmasks for a column of IP addresses. |
|
Convert integer column to IP addresses. |
|
Convert string column of IP addresses to integer values. |
|
Indicates whether each address is global. |
|
Indicates whether each address is an ip string. |
|
Indicates whether each address is link local. |
|
Indicates whether each address is loopback. |
|
Indicates whether each address is multicast. |
|
Indicates whether each address is private. |
|
Indicates whether each address is reserved. |
|
Indicates whether each address is unspecified. |
|
Apply a mask to a column of IP addresses. |
|
Compute a column of netmasks for a column of IP addresses. |
- hostmask(ips, prefixlen=16)[source]
Compute a column of hostmasks for a column of IP addresses. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
- prefixlen: integer
IPv4 addresses to be checked
Length of the network prefix, in bits, for IPv4 addresses
- Returns:
- rtypecudf.Series
Hostmask ouput from set of IP address
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.hostmask(cudf.Series(["192.168.0.1","10.0.0.1"]), prefixlen=16) 0 0.0.255.255 1 0.0.255.255 Name: hostmask, dtype: object
- int_to_ip(values)[source]
Convert integer column to IP addresses. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- valuescudf.Series
Integer representations of IP addresses
- Returns:
- rtypecudf.Series
IPv4 addresses
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.int_to_ip(cudf.Series([3232235521, 167772161])) 0 192.168.0.1 1 10.0.0.1 dtype: object
- ip_to_int(values)[source]
Convert string column of IP addresses to integer values. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- valuescudf.Series
IPv4 addresses to be converted
- Returns:
- rtypecudf.Series
Integer representations of IP addresses
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.ip_to_int(cudf.Series(["192.168.0.1","10.0.0.1"])) 0 3232235521 1 167772161 dtype: int64
- is_global(ips)[source]
Indicates whether each address is global. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_global(cudf.Series(["127.0.0.1","207.46.13.151"])) 0 False 1 True dtype: bool
- is_ip(ips)[source]
Indicates whether each address is an ip string. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_ip(cudf.Series(["192.168.0.1","10.123.0"])) 0 True 1 False dtype: bool
- is_link_local(ips)[source]
Indicates whether each address is link local. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_link_local(cudf.Series(["127.0.0.1","169.254.123.123"])) 0 False 1 True dtype: bool
- is_loopback(ips)[source]
Indicates whether each address is loopback. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_loopback(cudf.Series(["127.0.0.1","10.0.0.1"])) 0 True 1 False dtype: bool
- is_multicast(ips)[source]
Indicates whether each address is multicast. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_multicast(cudf.Series(["127.0.0.1","224.0.0.0"])) 0 False 1 True dtype: bool
- is_private(ips)[source]
Indicates whether each address is private. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_private(cudf.Series(["127.0.0.1","207.46.13.151"])) 0 True 1 False dtype: bool
- is_reserved(ips)[source]
Indicates whether each address is reserved. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_reserved(cudf.Series(["127.0.0.1","10.0.0.1"])) 0 False 1 False dtype: bool
- is_unspecified(ips)[source]
Indicates whether each address is unspecified. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
IPv4 addresses to be checked
- Returns:
- rtypecudf.Series
Boolean values true or false
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.is_unspecified(cudf.Series(["127.0.0.1","10.0.0.1"])) 0 False 1 False dtype: bool
- mask(ips, masks)[source]
Apply a mask to a column of IP addresses. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
- masks: cudf.Series
IPv4 addresses to be checked
The host or subnet masks to be applied
- Returns:
- rtypecudf.Series
Masked IP address from list of IPs
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> input_ips = cudf.Series(["192.168.0.1","10.0.0.1"]) >>> input_masks = cudf.Series(["255.255.0.0", "255.255.0.0"]) >>> ip.mask(input_ips, input_masks) 0 192.168.0.0 1 10.0.0.0 Name: mask, dtype: object
- netmask(ips, prefixlen=16)[source]
Compute a column of netmasks for a column of IP addresses. Addresses must be IPv4. IPv6 not yet supported.
- Parameters:
- ipscudf.Series
- prefixlen: int
IPv4 addresses to be checked
Length of the network prefix, in bits, for IPv4 addresses
- Returns:
- rtypecudf.Series
Netmask ouput from set of IP address
Examples
>>> import morpheus.parsers.ip as ip >>> import cudf >>> ip.netmask(cudf.Series(["192.168.0.1","10.0.0.1"]), prefixlen=16) 0 255.255.0.0 1 255.255.0.0 Name: net_mask, dtype: object