L2Ethernet class

Class for accessing a raw socket

Constructors

L2Ethernet(String interfaceName, dynamic _ethlib)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
socketData ↔ SocketStruct
getter/setter pair

Methods

close() int
Close the socket again Returns 0 when all is good, else it's an error
getMACAddress() int
Get the original source MAC address We might need it later
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open() int
Open the raw socket Get ifrindex and source MAC address Return 0 in case of error, otherwise the original socket
send(int src_mac, int dest_mac, int ether_type, Pointer<Uint8> data, int len, int flags) int
Send a Layer 2 Ethernet frame src_mac might be 0 and then use the NIC's MAC address Return number of bytes sent (len+14 typically)
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

getSharedLibLocation() Future<String>
setup(String interfaceName) Future<L2Ethernet>
Needs only interfaceName (e.g. "eth0")