Module socket.raw
RAW AF_PACKET socket operations.
This module provides a higher-level abstraction over the socket module.
See also:
Functions
| bind (proto, ifindex) | Creates and binds a raw packet socket for receiving frames. |
Functions
- bind (proto, ifindex)
-
Creates and binds a raw packet socket for receiving frames.
Parameters:
- proto (number) EtherType (defaults to ETHPALL).
- ifindex (number) [optional] Interface index (defaults to listen all interfaces).
Returns:
-
A new raw packet socket bound for proto and ifindex.
Raises:
Error if socket.new() or socket.bind() fail.See also:
Usage:
local rx <close> = raw.bind(0x0003) local tx <close> = raw.bind(0x88cc, ifindex)