Documentation ¶
Index ¶
Constants ¶
View Source
const IPSetEntrySize = 20
WARNING: must be kept in sync with the definitions in bpf/polprog/pol_prog_builder.go. WARNING: must be kept in sync with the definitions in bpf/include/policy.h. uint32 prefixLen HE 4 uint64 set_id BE +8 = 12 uint32 addr BE +4 = 16 uint16 port HE +2 = 18 uint8 proto +1 = 19 uint8 pad +1 = 20
Variables ¶
View Source
var DummyValue = []byte{1, 0, 0, 0}
View Source
var MapParameters = maps.MapParameters{ Type: "lpm_trie", KeySize: IPSetEntrySize, ValueSize: 4, MaxEntries: 1024 * 1024, Name: "cali_v4_ip_sets", Flags: unix.BPF_F_NO_PREALLOC, }
Functions ¶
func NewBPFIPSets ¶
func NewBPFIPSets( ipVersionConfig *ipsets.IPVersionConfig, ipSetIDAllocator *idalloc.IDAllocator, ipSetsMap maps.Map, opRecorder logutils.OpRecorder, ) *bpfIPSets
func SetMapSize ¶
func SetMapSize(size int)
Types ¶
type IPSetEntry ¶
type IPSetEntry [IPSetEntrySize]byte
func MakeBPFIPSetEntry ¶
func ProtoIPSetMemberToBPFEntry ¶
func ProtoIPSetMemberToBPFEntry(id uint64, member string) *IPSetEntry
func (IPSetEntry) Addr ¶
func (e IPSetEntry) Addr() net.IP
func (IPSetEntry) Port ¶
func (e IPSetEntry) Port() uint16
func (IPSetEntry) PrefixLen ¶
func (e IPSetEntry) PrefixLen() uint32
func (IPSetEntry) Protocol ¶
func (e IPSetEntry) Protocol() uint8
func (IPSetEntry) SetID ¶
func (e IPSetEntry) SetID() uint64
Click to show internal directories.
Click to hide internal directories.