Documentation ¶
Index ¶
- Variables
- func CleanUpProgramsAndPins()
- func ConfigureProgram(m *libbpf.Map, iface string, globalData *libbpf.TcGlobalData) error
- func EnsureQdisc(ifaceName string) (bool, error)
- func ExecTC(args ...string) (out string, err error)
- func HasQdisc(ifaceName string) (bool, error)
- func RemoveQdisc(ifaceName string) error
- type AttachPoint
- func (ap *AttachPoint) AttachProgram() (bpf.AttachResult, error)
- func (ap *AttachPoint) Config() string
- func (ap *AttachPoint) ConfigureProgram(m *libbpf.Map) error
- func (ap *AttachPoint) DetachProgram() error
- func (ap *AttachPoint) IsAttached() (bool, error)
- func (ap *AttachPoint) Log() *log.Entry
- func (ap *AttachPoint) ProgramID() (int, error)
- func (ap *AttachPoint) ProgramName() string
- type AttachResult
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDeviceNotFound = errors.New("device not found")
View Source
var ErrInterrupted = errors.New("dump interrupted")
View Source
var ErrNoTC = errors.New("no TC program attached")
Functions ¶
func CleanUpProgramsAndPins ¶
func CleanUpProgramsAndPins()
CleanUpProgramsAndPins makes a best effort to remove all our TC BPF programs.
func ConfigureProgram ¶
func EnsureQdisc ¶
EnsureQdisc makes sure that qdisc is attached to the given interface
func RemoveQdisc ¶
RemoveQdisc makes sure that there is no qdisc attached to the given interface
Types ¶
type AttachPoint ¶
type AttachPoint struct { bpf.AttachPoint LogFilter string LogFilterIdx int Type tcdefs.EndpointType ToOrFrom tcdefs.ToOrFromEp HookLayoutV4 hook.Layout HookLayoutV6 hook.Layout HostIPv4 net.IP HostIPv6 net.IP HostTunnelIPv4 net.IP HostTunnelIPv6 net.IP IntfIPv4 net.IP IntfIPv6 net.IP FIB bool ToHostDrop bool DSR bool DSROptoutCIDRs bool TunnelMTU uint16 VXLANPort uint16 WgPort uint16 Wg6Port uint16 ExtToServiceConnmark uint32 PSNATStart uint16 PSNATEnd uint16 RPFEnforceOption uint8 NATin uint32 NATout uint32 UDPOnly bool RedirectPeer bool }
func (*AttachPoint) AttachProgram ¶
func (ap *AttachPoint) AttachProgram() (bpf.AttachResult, error)
AttachProgram attaches a BPF program from a file to the TC attach point
func (*AttachPoint) Config ¶
func (ap *AttachPoint) Config() string
func (*AttachPoint) ConfigureProgram ¶
func (ap *AttachPoint) ConfigureProgram(m *libbpf.Map) error
func (*AttachPoint) DetachProgram ¶
func (ap *AttachPoint) DetachProgram() error
func (*AttachPoint) IsAttached ¶
func (ap *AttachPoint) IsAttached() (bool, error)
func (*AttachPoint) Log ¶
func (ap *AttachPoint) Log() *log.Entry
func (*AttachPoint) ProgramID ¶
func (ap *AttachPoint) ProgramID() (int, error)
TODO: we should try to not get the program ID via 'tc' binary and rather we should use libbpf to obtain it.
func (*AttachPoint) ProgramName ¶
func (ap *AttachPoint) ProgramName() string
ProgramName returns the name of the program associated with this AttachPoint
type AttachResult ¶
type AttachResult struct {
// contains filtered or unexported fields
}
func (AttachResult) Handle ¶
func (ar AttachResult) Handle() int
func (AttachResult) Prio ¶
func (ar AttachResult) Prio() int
func (AttachResult) ProgID ¶
func (ar AttachResult) ProgID() int
Click to show internal directories.
Click to hide internal directories.