Documentation ¶
Overview ¶
Package Sockmap represents the map from 5-tuple to the socket. It is primarily managed from the datapath using a sockops program. Cilium side is primarily for pretty printing. +groupName=maps
Index ¶
Constants ¶
const (
// MaxEntries represents the maximum number of endpoints in the map
MaxEntries = 65535
)
Variables ¶
var ( // SockMap represents the BPF map for sockets SockMap = bpf.NewMap(mapName, bpf.MapTypeSockHash, &SockmapKey{}, int(unsafe.Sizeof(SockmapKey{})), &SockmapValue{}, 4, MaxEntries, 0, 0, bpf.ConvertKeyValue, ) )
Functions ¶
Types ¶
type SockmapKey ¶
type SockmapKey struct { DIP types.IPv6 `align:"$union0"` SIP types.IPv6 `align:"$union1"` Family uint8 `align:"family"` Pad7 uint8 `align:"pad7"` Pad8 uint16 `align:"pad8"` SPort uint32 `align:"sport"` DPort uint32 `align:"dport"` }
SockmapKey is the 5-tuple used to lookup a socket +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapKey
func NewSockmapKey ¶
func NewSockmapKey(dip, sip net.IP, sport, dport uint32) SockmapKey
NewSockmapKey returns a new key using 5-tuple input.
func (*SockmapKey) DeepCopy ¶
func (in *SockmapKey) DeepCopy() *SockmapKey
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SockmapKey.
func (*SockmapKey) DeepCopyInto ¶
func (in *SockmapKey) DeepCopyInto(out *SockmapKey)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SockmapKey) DeepCopyMapKey ¶
func (in *SockmapKey) DeepCopyMapKey() bpf.MapKey
DeepCopyMapKey is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapKey.
func (*SockmapKey) GetKeyPtr ¶
func (k *SockmapKey) GetKeyPtr() unsafe.Pointer
GetKeyPtr returns the unsafe pointer to the BPF key
func (SockmapKey) NewValue ¶
func (k SockmapKey) NewValue() bpf.MapValue
NewValue returns a new empty instance of the structure representing the BPF map value
func (SockmapKey) String ¶
func (v SockmapKey) String() string
String pretty print the 5-tuple as sip:sport->dip:dport
type SockmapValue ¶
type SockmapValue struct {
// contains filtered or unexported fields
}
SockmapValue is the fd of a socket +k8s:deepcopy-gen=true +k8s:deepcopy-gen:interfaces=github.com/cilium/cilium/pkg/bpf.MapValue
func (*SockmapValue) DeepCopy ¶
func (in *SockmapValue) DeepCopy() *SockmapValue
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SockmapValue.
func (*SockmapValue) DeepCopyInto ¶
func (in *SockmapValue) DeepCopyInto(out *SockmapValue)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*SockmapValue) DeepCopyMapValue ¶
func (in *SockmapValue) DeepCopyMapValue() bpf.MapValue
DeepCopyMapValue is an autogenerated deepcopy function, copying the receiver, creating a new bpf.MapValue.
func (*SockmapValue) GetValuePtr ¶
func (v *SockmapValue) GetValuePtr() unsafe.Pointer
GetValuePtr returns the unsafe pointer to the BPF value.
func (SockmapValue) String ¶
func (v SockmapValue) String() string
String pretty print the file descriptor value, note this is local to agent.