// NewPacketFilter creates a packet filter object wrapping the given packet
// connection.
188457
func NewPacketFilter(conn net.PacketConn) *PacketFilter {
	d := &PacketFilter{
		PacketConn: conn,
	}
	return d
}
916841
func NewPacketFlow(smac string, dmac string, sip string, dip string, sport layers.TCPPort, dport layers.TCPPort) PacketFlowManipulator {

	initialTupules := &PacketFlow{
		sMAC:  smac,
		dMAC:  dmac,
		sIP:   sip,
		dIP:   dip,
		sPort: sport,
		dPort: dport,
		flow:  make([]PacketManipulator, 0),
	}

	return initialTupules
}
1158285
func (s *ListPoliciesForTargetInput) SetFilter(v string) *ListPoliciesForTargetInput {
	s.Filter = &v
	return s
}
619324
func NewJWTFilter(publicKey []byte, loginPath string) *jwtFilter {
	return &jwtFilter{
		publicKey: publicKey,
		loginPath: loginPath,
	}
}
870343
func (rpc *EthRPC) EthNewPendingTransactionFilter() (string, error) {
	var filterID string
	err := rpc.call("eth_newPendingTransactionFilter", &filterID)
	return filterID, err
}
933203
func (rpc *EthRPC) EthNewFilter(params FilterParams) (string, error) {
	var filterID string
	err := rpc.call("eth_newFilter", &filterID, params)
	return filterID, err
}
968907
func NewWrapper(wrappedFilter Filter) *Wrapper {
	f, err := wrappedFilter.ConstructPBFilter()
	if err != nil {
		panic(err)
	}
	return &Wrapper{
		Filter: f,
	}
}
1163911
func NewFilterBuffer(buf []byte, k uint64) (*Filter, error) {
	m := pow2(uint64(len(buf)) * 8)
	if m != uint64(len(buf))*8 {
		return nil, fmt.Errorf("bloom.Filter: buffer bit count must a power of two: %d/%d", len(buf)*8, m)
	}
	return &Filter{k: k, b: buf, mask: m - 1}, nil
}
809563
func NewPacketConn(s *stack.Stack, addr tcpip.FullAddress, network tcpip.NetworkProtocolNumber) (*PacketConn, error) {
	// Create UDP endpoint and bind it.
	var wq waiter.Queue
	ep, err := s.NewEndpoint(udp.ProtocolNumber, network, &wq)
	if err != nil {
		return nil, errors.New(err.String())
	}

	if err := ep.Bind(addr); err != nil {
		ep.Close()
		return nil, &net.OpError{
			Op:   "bind",
			Net:  "udp",
			Addr: fullToUDPAddr(addr),
			Err:  errors.New(err.String()),
		}
	}

	c := &PacketConn{
		stack: s,
		ep:    ep,
		wq:    &wq,
	}
	c.deadlineTimer.init()
	return c, nil
}
562908
func (client *BaseClient) SetFilter(filter ...Filter) Client {
	client.filterManager.SetFilter(filter...)
	return client
}
639803
function FilterLoadPacket(filter) {
  if (!(this instanceof FilterLoadPacket))
    return new FilterLoadPacket(filter);

  Packet.call(this);

  this.filter = filter || new Bloom();
}
694182
func (s *CreateReceiptFilterInput) SetFilter(v *ReceiptFilter) *CreateReceiptFilterInput {
	s.Filter = v
	return s
}
605758
func networkFilter(name string, external bool) *neutron.Filter {
	filter := neutron.NewFilter()
	filter.Set(neutron.FilterNetwork, fmt.Sprintf("%s", name))
	filter.Set(neutron.FilterRouterExternal, fmt.Sprintf("%t", external))
	return filter
}
185435
func NewFilter(ps PrioritySelector, ef ExclusionFilter) Filter {
	return &filter{
		ef: ef,
		ps: ps,
	}
}
1369471
func NewBadFilterErr(filter string, err error) error {
	return &types.ErrBadFilter{Goof: goof.WithFieldE(
		"filter", filter, "bad filter", err)}
}
233378
func NetworkingFilter(fn FilterRequestFunc) {
	mutex.Lock()
	defer mutex.Unlock()
	config.NetworkingFilters = append(config.NetworkingFilters, fn)
}
779463
func NewFromBytes(fixedHeader FixedHeader, remaining []byte) (Packet, error) {
	// Extract the MQTT Control Packet type from the fixed header.
	ptype, err := fixedHeader.ptype()
	if err != nil {
		return nil, err
	}

	// Create and return a Packet.
	switch ptype {
	case TypeCONNACK:
		return NewCONNACKFromBytes(fixedHeader, remaining)
	case TypePUBLISH:
		return NewPUBLISHFromBytes(fixedHeader, remaining)
	case TypePUBACK:
		return NewPUBACKFromBytes(fixedHeader, remaining)
	case TypePUBREC:
		return NewPUBRECFromBytes(fixedHeader, remaining)
	case TypePUBREL:
		return NewPUBRELFromBytes(fixedHeader, remaining)
	case TypePUBCOMP:
		return NewPUBCOMPFromBytes(fixedHeader, remaining)
	case TypeSUBACK:
		return NewSUBACKFromBytes(fixedHeader, remaining)
	case TypeUNSUBACK:
		return NewUNSUBACKFromBytes(fixedHeader, remaining)
	case TypePINGRESP:
		return NewPINGRESPFromBytes(fixedHeader, remaining)
	default:
		return nil, ErrInvalidPacketType
	}
}