ipv3

package
v0.0.0-...-a740dba Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_envoy_extensions_matching_input_matchers_ip_v3_ip_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Ip

type Ip struct {

	// Match if the IP belongs to any of these CIDR ranges.
	CidrRanges []*v3.CidrRange `protobuf:"bytes,1,rep,name=cidr_ranges,json=cidrRanges,proto3" json:"cidr_ranges,omitempty"`
	// The human readable prefix to use when emitting statistics for the IP input
	// matcher. Names in the table below are concatenated to this prefix.
	//
	// .. csv-table::
	//
	//	:header: Name, Type, Description
	//	:widths: 1, 1, 2
	//
	//	ip_parsing_failed, Counter, Total number of IP addresses the matcher was unable to parse
	StatPrefix string `protobuf:"bytes,2,opt,name=stat_prefix,json=statPrefix,proto3" json:"stat_prefix,omitempty"`
	// contains filtered or unexported fields
}

This input matcher matches IPv4 or IPv6 addresses against a list of CIDR ranges. It returns true if and only if the input IP belongs to at least one of these CIDR ranges. Internally, it uses a Level-Compressed trie, as described in the paper `IP-address lookup using LC-tries <https://www.nada.kth.se/~snilsson/publications/IP-address-lookup-using-LC-tries/>`_ by S. Nilsson and G. Karlsson. For "big" lists of IPs, this matcher is more efficient than multiple single IP matcher, that would have a linear cost.

func (*Ip) Descriptor deprecated

func (*Ip) Descriptor() ([]byte, []int)

Deprecated: Use Ip.ProtoReflect.Descriptor instead.

func (*Ip) GetCidrRanges

func (x *Ip) GetCidrRanges() []*v3.CidrRange

func (*Ip) GetStatPrefix

func (x *Ip) GetStatPrefix() string

func (*Ip) ProtoMessage

func (*Ip) ProtoMessage()

func (*Ip) ProtoReflect

func (x *Ip) ProtoReflect() protoreflect.Message

func (*Ip) Reset

func (x *Ip) Reset()

func (*Ip) String

func (x *Ip) String() string

func (*Ip) Validate

func (m *Ip) Validate() error

Validate checks the field values on Ip with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*Ip) ValidateAll

func (m *Ip) ValidateAll() error

ValidateAll checks the field values on Ip with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in IpMultiError, or nil if none found.

type IpMultiError

type IpMultiError []error

IpMultiError is an error wrapping multiple validation errors returned by Ip.ValidateAll() if the designated constraints aren't met.

func (IpMultiError) AllErrors

func (m IpMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (IpMultiError) Error

func (m IpMultiError) Error() string

Error returns a concatenation of all the error messages it wraps.

type IpValidationError

type IpValidationError struct {
	// contains filtered or unexported fields
}

IpValidationError is the validation error returned by Ip.Validate if the designated constraints aren't met.

func (IpValidationError) Cause

func (e IpValidationError) Cause() error

Cause function returns cause value.

func (IpValidationError) Error

func (e IpValidationError) Error() string

Error satisfies the builtin error interface

func (IpValidationError) ErrorName

func (e IpValidationError) ErrorName() string

ErrorName returns error name.

func (IpValidationError) Field

func (e IpValidationError) Field() string

Field function returns field value.

func (IpValidationError) Key

func (e IpValidationError) Key() bool

Key function returns key value.

func (IpValidationError) Reason

func (e IpValidationError) Reason() string

Reason function returns reason value.

Jump to

Keyboard shortcuts

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