func (p *Probe) addFilter() error {
	// Add qdisc filter
	filter := tc.Object{
		tc.Msg{
			Family:  unix.AF_UNSPEC,
			Ifindex: uint32(p.monitor.Ifindex),
			Handle:  0,
			Parent:  p.QdiscParent,
			Info:    0x300,
		},
		tc.Attribute{
			Kind: "bpf",

			BPF: &tc.Bpf{
				FD:    uint32(p.schedCLSFd),
				Name:  p.SectionName,
				Flags: 0x1,
			},
		},
	}
	if err := p.monitor.rtNetlink.Filter().Add(&filter); err != nil {
		baseLogger.Errorf("couldn't add a %v filter to interface %v: %v", p.QdiscParent, p.monitor.Ifindex, err)
		return err
	}
	return nil
}
// addFilter - Adds a filter on the provided interface
Adds a filter on the provided interface
// addFilter - Adds a filter on the provided interface
func (p *Probe) addFilter() error {
	filter := tc.Object{
		tc.Msg{
			Family:  unix.AF_UNSPEC,
			Ifindex: uint32(p.monitor.Ifindex),
			Handle:  0,
			Parent:  p.QdiscParent,
			Info:    0x300,
		},
		tc.Attribute{
			Kind: "bpf",
			BPF: &tc.Bpf{
				FD:    uint32(p.schedCLSFd),
				Name:  p.SectionName,
				Flags: 0x1,
			},
		},
	}
	if err := p.monitor.rtNetlink.Filter().Add(&filter); err != nil {
		baseLogger.Errorf("couldn't add a %v filter to interface %v: %v", p.QdiscParent, p.monitor.Ifindex, err)
		return err
	}
	return nil
}
func ( p * Probe ) addFilter ( ) error { filter := tc . Object { tc . Msg { Family : unix . AF_UNSPEC , Ifindex : uint32 ( p . monitor . Ifindex ) , Handle : 0 , Parent : p . QdiscParent , Info : 0x300 , } , tc . Attribute { Kind : " " , BPF : & tc . Bpf { FD : uint32 ( p . schedCLSFd ) , Name : p . SectionName , Flags : 0x1 , } , } , } if err := p . monitor . rtNetlink . Filter ( ) . Add ( & filter ) ; err != nil { baseLogger . Errorf ( " " , p . QdiscParent , p . monitor . Ifindex , err ) return err } return nil }
Adds a filter on the provided interface
Adds a filter on the provided interface
// Add qdisc filter