ipnet

package
v0.0.0-...-cd4f2e8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package ipnet provides some useful methods to handle net.IPNet lists

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DedupSorted

func DedupSorted(nets []*net.IPNet) []*net.IPNet

DedupSorted removes all the identical or included-in-bigger-one-presented sublens from the list

func Less

func Less(a, b *net.IPNet) bool

Less is comparing to net.IPNet To be used with Sort()

func MergeByRepeat

func MergeByRepeat(nets []*net.IPNet) []*net.IPNet

MergeByRepeat is a wrapper around MergeSorted

func MergePairs

func MergePairs(nets []*net.IPNet) []*net.IPNet

MergePairs merges all the suitable pairs of subnets in the net.IPNet list

func MergeSorted

func MergeSorted(nets []*net.IPNet) []*net.IPNet

MergeSorted is merging previously sorted and de-duped list of net.IPNet to the smallest possible form

func MergeSortedByRepeat

func MergeSortedByRepeat(nets []*net.IPNet) []*net.IPNet

MergeSortedByRepeat is repeating MergePairs as long as it does merge anything

func Sort

func Sort(nets []*net.IPNet) []*net.IPNet

Sort sorts lust of net.IPNet and return it IPv4 goes first, bigger mask goes first

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL