package devices // [impllnx dsn~low-level-abstraction~0] import "golang.org/x/sys/unix" // TransmitterLinux is the Linux implementation for the Transmitter interface type TransmitterLinux struct { socket int } // Send implements sending packets on Linux func (tl TransmitterLinux) Send(data []byte) error { return nil } // Close closes the transmitter socket func (tl TransmitterLinux) Close() error { return unix.Close(tl.socket) } // CreateTransmitter creates the Transmitter object func CreateTransmitter(device string) (Transmitter, error) { ret := TransmitterLinux{} var err error ret.socket, err = unix.Socket(unix.AF_PACKET, unix.SOCK_RAW, unix.ETH_P_ALL) if err != nil { panic(err) } return ret, err } // CreateReceiver creates and starts the Receiver instance func CreateReceiver(device string) (Receiver, error) { return nil, nil }