Documentation ¶
Index ¶
- Constants
- type DeviceAdapter
- func (a *DeviceAdapter) Close() (err error)
- func (a *DeviceAdapter) Read(ctrl chan goul.Item, message goul.Message) (out chan goul.Item, err error)
- func (a *DeviceAdapter) SetFilter(filter string) error
- func (a *DeviceAdapter) SetOptions(promisc bool, snaplength int, timeout time.Duration) (err error)
- func (a *DeviceAdapter) Write(in chan goul.Item, message goul.Message) (done chan goul.Item, err error)
- type DummyAdapter
- type NetworkAdapter
Constants ¶
const ( ErrDeviceAdapterNotInitialized = "device adapter not initialized" ErrCouldNotActivate = "could not activate capture interface" )
constants...
const ( ErrNetworkWriterNotSupported = "writer not supported for server" ErrNetworkReaderNotSupported = "reader not supported for client" ErrNetworkReadHeader = "could not read header from network" ErrNetworkReadChunk = "could not read chunk from network" )
constants...
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceAdapter ¶
DeviceAdapter is an adapter for the network device interfacing. This is the most important adapter of Goul. It is used as a reader adapter for the sender and a writer adapter for the receiver.
Please note that the adapter MUST be initialized with NewDevice() function so that it can be initialized with initialization of device and automatically inherit the BaseAdapter that implements underlying CommonMixin. Otherwise, it does not work properly.
func NewDevice ¶
func NewDevice(dev string, isTest bool) (*DeviceAdapter, error)
NewDevice returns new device adapter.
func (*DeviceAdapter) Close ¶
func (a *DeviceAdapter) Close() (err error)
Close clean up resources on device adapter.
func (*DeviceAdapter) Read ¶
func (a *DeviceAdapter) Read(ctrl chan goul.Item, message goul.Message) (out chan goul.Item, err error)
Read implements interface Adapter
func (*DeviceAdapter) SetFilter ¶
func (a *DeviceAdapter) SetFilter(filter string) error
SetFilter sets filter string which is applied while capturing.
func (*DeviceAdapter) SetOptions ¶
SetOptions sets capture options to inactive handler.
type NetworkAdapter ¶
NetworkAdapter is normal mode networking adapter.