Documentation
¶
Index ¶
- Constants
- Variables
- type AggregationStats
- type IPPrefix
- type MemoryStats
- type PrefixAggregator
- func (pa *PrefixAggregator) AddFromFile(path string) error
- func (pa *PrefixAggregator) AddFromReader(reader io.Reader) error
- func (pa *PrefixAggregator) AddPrefix(prefixStr string) error
- func (pa *PrefixAggregator) AddPrefixes(prefixes []string) error
- func (pa *PrefixAggregator) Aggregate() error
- func (pa *PrefixAggregator) GetIPv4Prefixes() []string
- func (pa *PrefixAggregator) GetIPv6Prefixes() []string
- func (pa *PrefixAggregator) GetMemoryStats() MemoryStats
- func (pa *PrefixAggregator) GetPrefixes() []string
- func (pa *PrefixAggregator) GetStats() AggregationStats
- func (pa *PrefixAggregator) GetWarnings() []string
- func (pa *PrefixAggregator) Reset() error
- func (pa *PrefixAggregator) SetExcludePrefixes(prefixes []string) error
- func (pa *PrefixAggregator) SetIncludePrefixes(prefixes []string) error
- func (pa *PrefixAggregator) SetMinPrefixLength(ipv4Len, ipv6Len int) error
- func (pa *PrefixAggregator) SetWarningHandler(handler func(string))
- func (pa *PrefixAggregator) WriteToFile(path string) error
- func (pa *PrefixAggregator) WriteToWriter(writer io.Writer) error
Constants ¶
View Source
const ( MinExclusionLenIPv4 = 32 // Allow /32 for IPv4 (single IPs) MinExclusionLenIPv6 = 128 // Allow /128 for IPv6 (single IPs) // Recommended minimum exclusion prefix lengths for optimal aggregation RecommendedMinExclusionIPv4 = 30 // /30 for IPv4 RecommendedMinExclusionIPv6 = 64 // /64 for IPv6 )
Minimum exclusion prefix lengths Note: While we allow /32 and /128 for compatibility, it's recommended to use larger exclusion prefixes for better performance
Variables ¶
View Source
var ( ErrInvalidPrefix = errors.New("invalid IP prefix") ErrInvalidMinPrefixLen = errors.New("invalid minimum prefix length") ErrUnsupportedIPVersion = errors.New("unsupported IP version") ErrNilPointer = errors.New("nil pointer reference") ErrFileNotFound = errors.New("file not found") ErrInvalidFormat = errors.New("invalid file format") )
Functions ¶
This section is empty.
Types ¶
type AggregationStats ¶
type MemoryStats ¶
type PrefixAggregator ¶
type PrefixAggregator struct {
IPv4Prefixes []*IPPrefix
IPv6Prefixes []*IPPrefix
IncludeIPv4 []*IPPrefix
IncludeIPv6 []*IPPrefix
ExcludeIPv4 []*IPPrefix
ExcludeIPv6 []*IPPrefix
MinPrefixLenIPv4 int
MinPrefixLenIPv6 int
// contains filtered or unexported fields
}
func NewPrefixAggregator ¶
func NewPrefixAggregator() *PrefixAggregator
func (*PrefixAggregator) AddFromFile ¶
func (pa *PrefixAggregator) AddFromFile(path string) error
func (*PrefixAggregator) AddFromReader ¶
func (pa *PrefixAggregator) AddFromReader(reader io.Reader) error
func (*PrefixAggregator) AddPrefix ¶
func (pa *PrefixAggregator) AddPrefix(prefixStr string) error
func (*PrefixAggregator) AddPrefixes ¶
func (pa *PrefixAggregator) AddPrefixes(prefixes []string) error
func (*PrefixAggregator) Aggregate ¶
func (pa *PrefixAggregator) Aggregate() error
func (*PrefixAggregator) GetIPv4Prefixes ¶
func (pa *PrefixAggregator) GetIPv4Prefixes() []string
func (*PrefixAggregator) GetIPv6Prefixes ¶
func (pa *PrefixAggregator) GetIPv6Prefixes() []string
func (*PrefixAggregator) GetMemoryStats ¶
func (pa *PrefixAggregator) GetMemoryStats() MemoryStats
func (*PrefixAggregator) GetPrefixes ¶
func (pa *PrefixAggregator) GetPrefixes() []string
func (*PrefixAggregator) GetStats ¶
func (pa *PrefixAggregator) GetStats() AggregationStats
func (*PrefixAggregator) GetWarnings ¶ added in v1.1.2
func (pa *PrefixAggregator) GetWarnings() []string
GetWarnings returns all warnings generated during processing
func (*PrefixAggregator) Reset ¶
func (pa *PrefixAggregator) Reset() error
func (*PrefixAggregator) SetExcludePrefixes ¶
func (pa *PrefixAggregator) SetExcludePrefixes(prefixes []string) error
func (*PrefixAggregator) SetIncludePrefixes ¶
func (pa *PrefixAggregator) SetIncludePrefixes(prefixes []string) error
func (*PrefixAggregator) SetMinPrefixLength ¶
func (pa *PrefixAggregator) SetMinPrefixLength(ipv4Len, ipv6Len int) error
func (*PrefixAggregator) SetWarningHandler ¶ added in v1.1.2
func (pa *PrefixAggregator) SetWarningHandler(handler func(string))
SetWarningHandler sets a custom handler for warnings
func (*PrefixAggregator) WriteToFile ¶
func (pa *PrefixAggregator) WriteToFile(path string) error
func (*PrefixAggregator) WriteToWriter ¶
func (pa *PrefixAggregator) WriteToWriter(writer io.Writer) error
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ipaggregator
command
|
|
|
examples
|
|
|
advanced
command
|
|
|
bare_ip
command
|
|
|
basic
command
|
|
|
largescale
command
|
Click to show internal directories.
Click to hide internal directories.