Documentation ¶
Index ¶
- Constants
- Variables
- func DropReason(reason uint8) string
- func MessageTypeName(typ int) string
- func TraceObservationPoint(obsPoint uint8) string
- type AgentNotification
- type AgentNotify
- type AgentNotifyMessage
- func EndpointCreateMessage(e notifications.RegenNotificationInfo) AgentNotifyMessage
- func EndpointDeleteMessage(e notifications.RegenNotificationInfo) AgentNotifyMessage
- func EndpointRegenMessage(e notifications.RegenNotificationInfo, err error) AgentNotifyMessage
- func IPCacheDeletedMessage(cidr string, id uint32, oldID *uint32, hostIP net.IP, oldHostIP net.IP, ...) AgentNotifyMessage
- func IPCacheUpsertedMessage(cidr string, id uint32, oldID *uint32, hostIP net.IP, oldHostIP net.IP, ...) AgentNotifyMessage
- func PolicyDeleteMessage(deleted int, labels []string, revision uint64) AgentNotifyMessage
- func PolicyUpdateMessage(numRules int, labels []string, revision uint64) AgentNotifyMessage
- func ServiceDeleteMessage(id uint32) AgentNotifyMessage
- func ServiceUpsertMessage(id uint32, frontend ServiceUpsertNotificationAddr, ...) AgentNotifyMessage
- func StartMessage(t time.Time) AgentNotifyMessage
- type EndpointNotification
- type EndpointRegenNotification
- type IPCacheNotification
- type MessageTypeFilter
- type PolicyMatchType
- type PolicyUpdateNotification
- type ServiceDeleteNotification
- type ServiceUpsertNotification
- type ServiceUpsertNotificationAddr
- type TimeNotification
Constants ¶
const ( // 0-128 are reserved for BPF datapath events MessageTypeUnspec = iota // MessageTypeDrop is a BPF datapath notification carrying a DropNotify // which corresponds to drop_notify defined in bpf/lib/drop.h MessageTypeDrop // MessageTypeDebug is a BPF datapath notification carrying a DebugMsg // which corresponds to debug_msg defined in bpf/lib/dbg.h MessageTypeDebug // MessageTypeCapture is a BPF datapath notification carrying a DebugCapture // which corresponds to debug_capture_msg defined in bpf/lib/dbg.h MessageTypeCapture // MessageTypeTrace is a BPF datapath notification carrying a TraceNotify // which corresponds to trace_notify defined in bpf/lib/trace.h MessageTypeTrace // MessageTypePolicyVerdict is a BPF datapath notification carrying a PolicyVerdictNotify // which corresponds to policy_verdict_notify defined in bpf/lib/policy_log.h MessageTypePolicyVerdict // MessageTypeRecCapture is a BPF datapath notification carrying a RecorderCapture // which corresponds to capture_msg defined in bpf/lib/pcap.h MessageTypeRecCapture // MessageTypeAccessLog contains a pkg/proxy/accesslog.LogRecord MessageTypeAccessLog = 129 // MessageTypeAgent is an agent notification carrying a AgentNotify MessageTypeAgent = 130 )
Must be synchronized with <bpf/lib/common.h>
const ( MessageTypeNameDrop = "drop" MessageTypeNameDebug = "debug" MessageTypeNameCapture = "capture" MessageTypeNameTrace = "trace" MessageTypeNameL7 = "l7" MessageTypeNameAgent = "agent" MessageTypeNamePolicyVerdict = "policy-verdict" MessageTypeNameRecCapture = "recorder" )
const ( TraceToLxc = iota TraceToProxy TraceToHost TraceToStack TraceToOverlay TraceFromLxc TraceFromProxy TraceFromHost TraceFromStack TraceFromOverlay TraceFromNetwork TraceToNetwork )
Must be synchronized with <bpf/lib/trace.h>
const ( // PolicyIngress is the value of Flags&PolicyNotifyFlagDirection for ingress traffic PolicyIngress = 1 // PolicyEgress is the value of Flags&PolicyNotifyFlagDirection for egress traffic PolicyEgress = 2 // PolicyMatchNone is the value of MatchType indicatating no policy match PolicyMatchNone = 0 // PolicyMatchL3Only is the value of MatchType indicating a L3-only match PolicyMatchL3Only = 1 // PolicyMatchL3L4 is the value of MatchType indicating a L3+L4 match PolicyMatchL3L4 = 2 // PolicyMatchL4Only is the value of MatchType indicating a L4-only match PolicyMatchL4Only = 3 // PolicyMatchAll is the value of MatchType indicating an allow-all match PolicyMatchAll = 4 )
Variables ¶
var AgentNotifications = map[AgentNotification]string{ AgentNotifyUnspec: "unspecified", AgentNotifyGeneric: "Message", AgentNotifyStart: "Cilium agent started", AgentNotifyEndpointRegenerateSuccess: "Endpoint regenerated", AgentNotifyEndpointCreated: "Endpoint created", AgentNotifyEndpointDeleted: "Endpoint deleted", AgentNotifyEndpointRegenerateFail: "Failed endpoint regeneration", AgentNotifyIPCacheDeleted: "IPCache entry deleted", AgentNotifyIPCacheUpserted: "IPCache entry upserted", AgentNotifyPolicyUpdated: "Policy updated", AgentNotifyPolicyDeleted: "Policy deleted", AgentNotifyServiceDeleted: "Service deleted", AgentNotifyServiceUpserted: "Service upserted", }
AgentNotifications is a map of all supported agent notification types.
var DropInvalid uint8 = 2
DropInvalid is the Invalid packet reason.
var DropMin uint8 = 130
DropMin numbers less than this are non-drop reason codes
var ( // MessageTypeNames is a map of all type names MessageTypeNames = map[string]int{ MessageTypeNameDrop: MessageTypeDrop, MessageTypeNameDebug: MessageTypeDebug, MessageTypeNameCapture: MessageTypeCapture, MessageTypeNameTrace: MessageTypeTrace, MessageTypeNameL7: MessageTypeAccessLog, MessageTypeNameAgent: MessageTypeAgent, MessageTypeNamePolicyVerdict: MessageTypePolicyVerdict, MessageTypeNameRecCapture: MessageTypeRecCapture, } )
var TraceObservationPoints = map[uint8]string{ TraceToLxc: "to-endpoint", TraceToProxy: "to-proxy", TraceToHost: "to-host", TraceToStack: "to-stack", TraceToOverlay: "to-overlay", TraceToNetwork: "to-network", TraceFromLxc: "from-endpoint", TraceFromProxy: "from-proxy", TraceFromHost: "from-host", TraceFromStack: "from-stack", TraceFromOverlay: "from-overlay", TraceFromNetwork: "from-network", }
TraceObservationPoints is a map of all supported trace observation points
Functions ¶
func DropReason ¶
DropReason prints the drop reason in a human readable string
func MessageTypeName ¶
MessageTypeName returns the name for a message type or the numeric value if the name can't be found
func TraceObservationPoint ¶
TraceObservationPoint returns the name of a trace observation point
Types ¶
type AgentNotification ¶
type AgentNotification uint32
AgentNotification specifies the type of agent notification
const ( AgentNotifyUnspec AgentNotification = iota AgentNotifyGeneric AgentNotifyStart AgentNotifyEndpointRegenerateSuccess AgentNotifyEndpointRegenerateFail AgentNotifyPolicyUpdated AgentNotifyPolicyDeleted AgentNotifyEndpointCreated AgentNotifyEndpointDeleted AgentNotifyIPCacheUpserted AgentNotifyIPCacheDeleted AgentNotifyServiceUpserted AgentNotifyServiceDeleted )
type AgentNotify ¶
type AgentNotify struct { Type AgentNotification Text string }
AgentNotify is a notification from the agent. The notification is stored in its JSON-encoded representation
func (*AgentNotify) DumpInfo ¶
func (n *AgentNotify) DumpInfo()
DumpInfo dumps an agent notification
func (*AgentNotify) DumpJSON ¶
func (n *AgentNotify) DumpJSON()
DumpJSON prints notification in json format
type AgentNotifyMessage ¶
type AgentNotifyMessage struct { Type AgentNotification Notification interface{} }
AgentNotifyMessage is a notification from the agent. It is similar to AgentNotify, but the notification is an unencoded struct. See the *Message constructors in this package for possible values.
func EndpointCreateMessage ¶
func EndpointCreateMessage(e notifications.RegenNotificationInfo) AgentNotifyMessage
EndpointCreateMessage constructs an agent notification message for endpoint creation
func EndpointDeleteMessage ¶
func EndpointDeleteMessage(e notifications.RegenNotificationInfo) AgentNotifyMessage
EndpointDeleteMessage constructs an agent notification message for endpoint deletion
func EndpointRegenMessage ¶
func EndpointRegenMessage(e notifications.RegenNotificationInfo, err error) AgentNotifyMessage
EndpointRegenMessage constructs an agent notification message for endpoint regeneration
func IPCacheDeletedMessage ¶
func IPCacheDeletedMessage(cidr string, id uint32, oldID *uint32, hostIP net.IP, oldHostIP net.IP, encryptKey uint8, namespace, podName string) AgentNotifyMessage
IPCacheDeletedMessage constructs an agent notification message for ipcache deletions
func IPCacheUpsertedMessage ¶
func IPCacheUpsertedMessage(cidr string, id uint32, oldID *uint32, hostIP net.IP, oldHostIP net.IP, encryptKey uint8, namespace, podName string) AgentNotifyMessage
IPCacheUpsertedMessage constructs an agent notification message for ipcache upsertions
func PolicyDeleteMessage ¶
func PolicyDeleteMessage(deleted int, labels []string, revision uint64) AgentNotifyMessage
PolicyDeleteMessage constructs an agent notification message for policy deletion
func PolicyUpdateMessage ¶
func PolicyUpdateMessage(numRules int, labels []string, revision uint64) AgentNotifyMessage
PolicyUpdateMessage constructs an agent notification message for policy updates
func ServiceDeleteMessage ¶
func ServiceDeleteMessage(id uint32) AgentNotifyMessage
ServiceDeleteMessage constructs an agent notification message for service deletions
func ServiceUpsertMessage ¶
func ServiceUpsertMessage( id uint32, frontend ServiceUpsertNotificationAddr, backends []ServiceUpsertNotificationAddr, svcType, svcTrafficPolicy, svcName, svcNamespace string, ) AgentNotifyMessage
ServiceUpsertMessage constructs an agent notification message for service upserts
func StartMessage ¶
func StartMessage(t time.Time) AgentNotifyMessage
StartMessage constructs an agent notification message when the agent starts
func (*AgentNotifyMessage) ToJSON ¶
func (m *AgentNotifyMessage) ToJSON() (AgentNotify, error)
ToJSON encodes a AgentNotifyMessage to its JSON-based AgentNotify representation
type EndpointNotification ¶
type EndpointNotification struct { EndpointRegenNotification PodName string `json:"pod-name,omitempty"` Namespace string `json:"namespace,omitempty"` }
EndpointNotification structures the endpoint create or delete notification
type EndpointRegenNotification ¶
type EndpointRegenNotification struct { ID uint64 `json:"id,omitempty"` Labels []string `json:"labels,omitempty"` Error string `json:"error,omitempty"` }
EndpointRegenNotification structures regeneration notification
type IPCacheNotification ¶
type IPCacheNotification struct { CIDR string `json:"cidr"` Identity uint32 `json:"id"` OldIdentity *uint32 `json:"old-id,omitempty"` HostIP net.IP `json:"host-ip,omitempty"` OldHostIP net.IP `json:"old-host-ip,omitempty"` EncryptKey uint8 `json:"encrypt-key"` Namespace string `json:"namespace,omitempty"` PodName string `json:"pod-name,omitempty"` }
IPCacheNotification structures ipcache change notifications
type MessageTypeFilter ¶
type MessageTypeFilter []int
func (*MessageTypeFilter) Contains ¶
func (m *MessageTypeFilter) Contains(typ int) bool
func (*MessageTypeFilter) Set ¶
func (m *MessageTypeFilter) Set(value string) error
func (*MessageTypeFilter) String ¶
func (m *MessageTypeFilter) String() string
func (*MessageTypeFilter) Type ¶
func (m *MessageTypeFilter) Type() string
type PolicyMatchType ¶
type PolicyMatchType int
func (PolicyMatchType) String ¶
func (m PolicyMatchType) String() string
type PolicyUpdateNotification ¶
type PolicyUpdateNotification struct { Labels []string `json:"labels,omitempty"` Revision uint64 `json:"revision,omitempty"` RuleCount int `json:"rule_count"` }
PolicyUpdateNotification structures update notification
type ServiceDeleteNotification ¶
type ServiceDeleteNotification struct {
ID uint32 `json:"id"`
}
ServiceDeleteNotification structures service delete notifications
type ServiceUpsertNotification ¶
type ServiceUpsertNotification struct { ID uint32 `json:"id"` Frontend ServiceUpsertNotificationAddr `json:"frontend-address"` Backends []ServiceUpsertNotificationAddr `json:"backend-addresses"` Type string `json:"type,omitempty"` TrafficPolicy string `json:"traffic-policy,omitempty"` Name string `json:"name,omitempty"` Namespace string `json:"namespace,,omitempty"` }
ServiceUpsertNotification structures service upsert notifications
type ServiceUpsertNotificationAddr ¶
ServiceUpsertNotificationAddr is part of ServiceUpsertNotification
type TimeNotification ¶
type TimeNotification struct {
Time string `json:"time"`
}
TimeNotification structures agent start notification