...

Source file src/github.com/mdlayher/packet/packet_others.go

Documentation: github.com/mdlayher/packet

     1  //go:build !linux
     2  // +build !linux
     3  
     4  package packet
     5  
     6  import (
     7  	"fmt"
     8  	"net"
     9  	"runtime"
    10  	"syscall"
    11  	"time"
    12  
    13  	"golang.org/x/net/bpf"
    14  )
    15  
    16  // errUnimplemented is returned by all functions on non-Linux platforms.
    17  var errUnimplemented = fmt.Errorf("packet: not implemented on %s", runtime.GOOS)
    18  
    19  func listen(_ *net.Interface, _ Type, _ int, _ *Config) (*Conn, error) { return nil, errUnimplemented }
    20  
    21  func (*Conn) readFrom(_ []byte) (int, net.Addr, error)  { return 0, nil, errUnimplemented }
    22  func (*Conn) writeTo(_ []byte, _ net.Addr) (int, error) { return 0, errUnimplemented }
    23  func (*Conn) setPromiscuous(_ bool) error               { return errUnimplemented }
    24  func (*Conn) stats() (*Stats, error)                    { return nil, errUnimplemented }
    25  
    26  type conn struct{}
    27  
    28  func (*conn) Close() error                          { return errUnimplemented }
    29  func (*conn) SetDeadline(_ time.Time) error         { return errUnimplemented }
    30  func (*conn) SetReadDeadline(_ time.Time) error     { return errUnimplemented }
    31  func (*conn) SetWriteDeadline(_ time.Time) error    { return errUnimplemented }
    32  func (*conn) SetBPF(_ []bpf.RawInstruction) error   { return errUnimplemented }
    33  func (*conn) SyscallConn() (syscall.RawConn, error) { return nil, errUnimplemented }
    34  

View as plain text