multicast

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

+groupName=maps

Index

Constants

View Source
const (
	// Pinned outer map name which signals the existence of a multicast group
	// in the control plane.
	GroupOuter4MapName = "cilium_mcast_group_outer_v4_map"
	// Defines total number of multicast groups on a single node.
	MaxGroups = 1024
	// Defines total number of subscribers per multicast group on a single node.
	MaxSubscribers = 1024
)
View Source
const (
	// Multicast is the name of the flag to enable synthetic multicast.
	Multicast = "multicast-enabled"
)

Variables

View Source
var Cell = cell.Module(
	"multicastmaps",
	"Multicast Maps provides interfaces to the multicast data-path maps",
	cell.Provide(NewGroupV4Map),
	cell.Config(Config{}),
)

Functions

This section is empty.

Types

type Config

type Config struct {
	MulticastEnabled bool `mapstructure:"multicast-enabled"`
}

func (Config) Flags

func (cfg Config) Flags(flags *pflag.FlagSet)

Flags implements cell.Flagger interface.

type GroupV4Key

type GroupV4Key struct {
	Group [4]byte
}

GroupV4Key is the key for a GroupV4OuterMap It is a IPv4 multicast group address in big endian format.

func NewGroupV4KeyFromNetIPAddr

func NewGroupV4KeyFromNetIPAddr(ip netip.Addr) (out GroupV4Key, err error)

func (GroupV4Key) ToNetIPAddr

func (k GroupV4Key) ToNetIPAddr() (netip.Addr, bool)

type GroupV4Map

type GroupV4Map interface {
	Lookup(multicastAddr netip.Addr) (SubscriberV4Map, error)
	Insert(multicastAddr netip.Addr) error
	Delete(multicastAddr netip.Addr) error
	List() ([]netip.Addr, error)
}

GroupV4Map provides an interface between the control and data plane, enabling the creation, deletion, and querying of IPv4 multicast groups and subscribers.

type GroupV4OuterMap

type GroupV4OuterMap struct {
	*ebpf.Map
}

GroupV4OuterMap outer map keyed by GroupV4Key multicast group addresses.

func NewGroupV4OuterMap

func NewGroupV4OuterMap(name string) *GroupV4OuterMap

func OpenGroupV4OuterMap

func OpenGroupV4OuterMap(name string) (*GroupV4OuterMap, error)

func (GroupV4OuterMap) Delete

func (m GroupV4OuterMap) Delete(group netip.Addr) error

func (GroupV4OuterMap) Insert

func (m GroupV4OuterMap) Insert(group netip.Addr) error

func (GroupV4OuterMap) List

func (m GroupV4OuterMap) List() ([]netip.Addr, error)

func (GroupV4OuterMap) Lookup

func (m GroupV4OuterMap) Lookup(group netip.Addr) (SubscriberV4Map, error)

type GroupV4Val

type GroupV4Val struct {
	FD uint32
}

GroupV4Val is the value of a GroupV4OuterMap. It is a file descriptor for an inner SubscriberV4InnerMap.

type ParamsIn

type ParamsIn struct {
	cell.In
	Lifecycle cell.Lifecycle
	Logger    logrus.FieldLogger
	Config
}

ParamsIn are parameters provided by the Hive and is the argument for NewGroupV4Map constructor

type ParamsOut

type ParamsOut struct {
	cell.Out
	bpf.MapOut[GroupV4Map]
	defines.NodeOut
}

ParamsOut are the parameters provided to the Hive and is the return argument for NewGroupV4Map

func NewGroupV4Map

func NewGroupV4Map(in ParamsIn) ParamsOut

NewGroupV4Map creates a new GroupV4Map and provides it to the hive dependency injection graph.

Other subsystems can depend on the "multicast.GroupV4Map" type to obtain a handle to the datapath interface.

type SubscriberFlags

type SubscriberFlags uint32

SubscriberFlags are a set of flags used to further define a SubscriberV4

const (
	// Flag used to define a subscriber as remote.
	// If present SubscriberV4Val.Ifindex must represent an egress interface
	// towards the remote host.
	SubscriberRemote SubscriberFlags = (1 << 0)
)

type SubscriberV4

type SubscriberV4 struct {
	// Source address of subscriber in big endian format
	SAddr netip.Addr
	// Interface ID of subscriber, may be a tunnel interface if subscriber
	// is remote.
	Ifindex uint32
	// Specifies if the subscriber is remote or local
	IsRemote bool
}

SubscriberV4 is a multicast subscriber

type SubscriberV4InnerMap

type SubscriberV4InnerMap struct {
	*ebpf.Map
}

SubscriberV4InnerMap is the inner map of a GroupV4OuterMap outer map.

This map inventories all subscribers, both local and remote, for a given multicast group.

func (SubscriberV4InnerMap) Delete

func (m SubscriberV4InnerMap) Delete(Src netip.Addr) error

func (SubscriberV4InnerMap) Insert

func (SubscriberV4InnerMap) List

func (m SubscriberV4InnerMap) List() ([]*SubscriberV4, error)

func (SubscriberV4InnerMap) Lookup

func (m SubscriberV4InnerMap) Lookup(Src netip.Addr) (*SubscriberV4, error)

type SubscriberV4Key

type SubscriberV4Key struct {
	SAddr [4]byte
}

SubscriberV4Key is the IPv4 source address of the multicast subscriber in big endian format.

func NewSubscriberV4KeyFromNetIPAddr

func NewSubscriberV4KeyFromNetIPAddr(ip netip.Addr) (out SubscriberV4Key, err error)

func (SubscriberV4Key) ToNetIPAddr

func (k SubscriberV4Key) ToNetIPAddr() (netip.Addr, bool)

type SubscriberV4Map

type SubscriberV4Map interface {
	Insert(*SubscriberV4) error
	Lookup(Src netip.Addr) (*SubscriberV4, error)
	Delete(Src netip.Addr) error
	List() ([]*SubscriberV4, error)
}

SubscriberV4Map provides an interface between the control and data plane, enabling the creation, deletion, and querying of IPv4 multicast subscribers within a multicast group.

type SubscriberV4Val

type SubscriberV4Val struct {
	// Source address of subscriber in big endian format
	SourceAddr [4]byte `align:"saddr"`
	// Interface ID of subscriber, may be a tunnel interface if subscriber
	// is remote.
	Ifindex uint32 `align:"ifindex"`
	// reserved
	Pad1 uint16 `align:"pad1"`
	// reserved
	Pad2 uint8 `align:"pad2"`
	// SubscriberFlags flag bits which further a subscriber's
	// characteristics.
	Flags uint8 `align:"flags"`
}

SubscriberV4Val is a discrete subscriber value of a multicast group map.

func (*SubscriberV4Val) ToSubsciberV4

func (v *SubscriberV4Val) ToSubsciberV4() (*SubscriberV4, error)

Jump to

Keyboard shortcuts

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