Categorygithub.com/projectdiscovery/iputil
modulepackage
0.0.2
Repository: https://github.com/projectdiscovery/iputil.git
Documentation: pkg.go.dev

# README

iputil

The package contains various helpers to interact with ips and cidrs

# Functions

AsIPV4CIDR converts ipv4 ip to cidr string.
AsIPV4CIDR converts ipv4 cidr to net.IPNet pointer.
AsIPV4CIDR converts ipv6 ip to cidr string.
AsIPV6IpNet converts ipv6 cidr to net.IPNet pointer.
GetBindableAddress on port p from a list of ips.
GetSourceIP gets the local ip based the destination ip.
IsCIDR checks if the string is an valid CIDR notiation (IPV4 & IPV6).
IsCIDR checks if the string is an valid CIDR after replacing - with /.
IsIP checks if a string is either IP version 4 or 6.
IsIPv4 checks if the string is an IP version 4.
IsIPv6 checks if the string is an IP version 6.
IsPort checks if a string represents a valid port.
ToCidr converts a cidr string to net.IPNet pointer.
WhatsMyIP attempts to obtain the external ip through public api Copied from https://github.com/projectdiscovery/naabu/blob/master/v2/pkg/scan/externalip.go.