Documentation ¶
Index ¶
- func BigIntToIPv6(b *big.Int) net.IP
- func GetHostIPs() ([]net.IP, error)
- func HLintToIPv6(high uint64, low uint64) net.IP
- func IPv6ToBigInt(ip net.IP) *big.Int
- func IPv6ToHLint(ip net.IP) (uint64, uint64)
- func IntToIPv4(ip uint32) net.IP
- func IpInMasks(ip net.IP, masks []net.IPNet) bool
- func Ipv4ToInt(ip net.IP) (uint32, error)
- func IsCIDR(s string) bool
- func IsIPv4(str string) bool
- func IsIPv6(str string) bool
- func IsMAC(str string) bool
- func IsPublicIP(ip net.IP, privateMasks []net.IPNet) bool
- func LastAddress(n *net.IPNet) net.IP
- func ToMasks(lancidrs []string) (masks []net.IPNet, err error)
- type IPFilter
- func (f *IPFilter) AllowArea(code string)
- func (f *IPFilter) AllowIP(ip string) bool
- func (f *IPFilter) Allowed(ip string) bool
- func (f *IPFilter) AreaAllowed(code string) bool
- func (f *IPFilter) AreaBlocked(code string) bool
- func (f *IPFilter) BlockArea(code string)
- func (f *IPFilter) BlockIP(ip string) bool
- func (f *IPFilter) Blocked(ip string) bool
- func (f *IPFilter) NetAllowed(ip net.IP) bool
- func (f *IPFilter) NetBlocked(ip net.IP) bool
- func (f *IPFilter) RemoveCountry(code string)
- func (f *IPFilter) RemoveIP(str string) bool
- func (f *IPFilter) ToggleDefault(allowed bool)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHostIPs ¶
GetHostIPs returns a list of IP addresses of all host's interfaces.
func IsPublicIP ¶
IsPublicIP returns true if the given IP can be routed on the Internet.
func LastAddress ¶
Return the final address of a net range. Convert to IPv4 if possible, otherwise return an ipv6
Types ¶
type IPFilter ¶
type IPFilter struct {
// contains filtered or unexported fields
}
func (*IPFilter) AreaAllowed ¶
func (*IPFilter) AreaBlocked ¶
func (*IPFilter) RemoveCountry ¶
func (*IPFilter) ToggleDefault ¶
Click to show internal directories.
Click to hide internal directories.