Documentation ¶
Overview ¶
Copyright 2016 Authors of Cilium
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2016 Authors of Cilium ¶
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func CreateMap(mapType int, keySize, valueSize, maxEntries uint32) (int, error)
- func CtInfo(arg1 uint32, arg2 uint32) string
- func CtState(state uint32) string
- func DeleteElement(fd int, key unsafe.Pointer) error
- func Dissect(dissect bool, data []byte)
- func DropReason(reason uint8) string
- func GetNextKey(fd int, key, nextKey unsafe.Pointer) error
- func LookupElement(fd int, key, value unsafe.Pointer) error
- func ObjGet(pathname string) (int, error)
- func ObjPin(fd int, pathname string) error
- func OpenOrCreateMap(path string, mapType int, keySize, valueSize, maxEntries uint32) (int, bool, error)
- func UpdateElement(fd int, key, value unsafe.Pointer, flags uint64) error
- type DebugCapture
- type DebugMsg
- type DropNotify
- type EPoll
- type EventMap
- type LostFunc
- type PerCpuEvents
- type PerfEvent
- type PerfEventConfig
- type PerfEventHeader
- type PerfEventLost
- type PerfEventSample
- type ReceiveFunc
Constants ¶
const ( DBG_CAPTURE_UNSPEC = iota DBG_CAPTURE_FROM_LXC DBG_CAPTURE_FROM_NETDEV DBG_CAPTURE_FROM_OVERLAY DBG_CAPTURE_DELIVERY DBG_CAPTURE_FROM_LB )
const ( DBG_UNSPEC = iota DBG_GENERIC DBG_LOCAL_DELIVERY DBG_ENCAP DBG_LXC_FOUND DBG_POLICY_DENIED DBG_CT_LOOKUP DBG_CT_MATCH DBG_CT_CREATED DBG_ICMP6_HANDLE DBG_ICMP6_REQUEST DBG_ICMP6_NS DBG_ICMP6_TIME_EXCEEDED DBG_CT_VERDICT DBG_DECAP DBG_PORT_MAP DBG_ERROR_RET DBG_TO_HOST DBG_TO_STACK DBG_PKT_HASH DBG_LB_SERVICES_LOOKUP_FAIL DBG_LB_STATE_LOOKUP_FAIL )
const ( CT_NEW uint32 = iota CT_ESTABLISHED CT_REPLY CT_RELATED )
must be in sync with <bpf/lib/conntrack.h>
const ( CILIUM_NOTIFY_UNSPEC = iota CILIUM_NOTIFY_DROP CILIUM_DBG_MSG CILIUM_DBG_CAPTURE )
Must be synchronized with <bpf/lib/common.h>
const (
DebugCaptureLen = 20
)
const (
DropNotifyLen = 32
)
const (
MAX_POLL_EVENTS = 32
)
Variables ¶
This section is empty.
Functions ¶
func CreateMap ¶
CreateMap creates a Map of type mapType, with key size keySize, a value size of valueSize and the maximum amount of entries of maxEntries. mapType should be one of the bpf_map_type in "uapi/linux/bpf.h"
func DeleteElement ¶
DeleteElement deletes the map element with the given key.
func DropReason ¶
func GetNextKey ¶
GetNextKey stores, in nextKey, the next key after the key of the map in fd.
func LookupElement ¶
LookupElement looks up for the map value stored in fd with the given key. The value is stored in the value unsafe.Pointer.
func OpenOrCreateMap ¶
func UpdateElement ¶
UpdateElement updates the map in fd with the given value in the given key. The flags can have the following values (if you include "uapi/linux/bpf.h"): C.BPF_ANY to create new element or update existing; C.BPF_NOEXIST to create new element if it didn't exist; C.BPF_EXIST to update existing element.
Types ¶
type DebugCapture ¶
type DropNotify ¶
type LostFunc ¶
type LostFunc func(msg *PerfEventLost, cpu int)
type PerCpuEvents ¶
type PerCpuEvents struct {
// contains filtered or unexported fields
}
func NewPerCpuEvents ¶
func NewPerCpuEvents(config *PerfEventConfig) (*PerCpuEvents, error)
func (*PerCpuEvents) CloseAll ¶
func (e *PerCpuEvents) CloseAll() error
func (*PerCpuEvents) ReadAll ¶
func (e *PerCpuEvents) ReadAll(receive ReceiveFunc, lost LostFunc) error
func (*PerCpuEvents) Stats ¶
func (e *PerCpuEvents) Stats() (uint64, uint64)
type PerfEvent ¶
type PerfEvent struct { Fd int // contains filtered or unexported fields }
func PerfEventOpen ¶
type PerfEventConfig ¶
type PerfEventConfig struct { NumCpus int NumPages int MapPath string Type int Config int SampleType int WakeupEvents int }
func DefaultPerfEventConfig ¶
func DefaultPerfEventConfig() *PerfEventConfig
type PerfEventHeader ¶
Matching 'struct perf_event_header in <linux/perf_event.h>
type PerfEventLost ¶
type PerfEventLost struct { PerfEventHeader Id uint64 Lost uint64 }
Matching 'struct perf_event_lost in kernel sources
type PerfEventSample ¶
type PerfEventSample struct { PerfEventHeader Size uint32 // contains filtered or unexported fields }
Matching 'struct perf_event_sample in kernel sources
func (*PerfEventSample) DataCopy ¶
func (e *PerfEventSample) DataCopy() []byte
func (*PerfEventSample) DataDirect ¶
func (e *PerfEventSample) DataDirect() []byte
type ReceiveFunc ¶
type ReceiveFunc func(msg *PerfEventSample, cpu int)