Class: SimpleCapture::Capture
- Inherits:
-
Object
- Object
- SimpleCapture::Capture
- Defined in:
- lib/simple_capture/capture.rb
Constant Summary collapse
- SOL_PACKET =
bits/socket.h
0x0107- IFINDEX_SIZE =
sizeof(ifreq.ifr_ifindex) on 64bit
0x0004- IFREQ_SIZE =
sizeof(ifreq) on 64bit
0x0028- SIOCGIFINDEX =
bits/ioctls.h
0x8933- PACKET_MR_PROMISC =
netpacket/packet.h
0x0001- PACKET_MREQ_SIZE =
sizeof(packet_mreq) on 64bit
0x0010- PACKET_ADD_MEMBERSHIP =
netpacket/packet.h
0x0001- ETH_P_ALL =
htons(ETH_P_ALL), linux/if_ether.h
768
Instance Method Summary collapse
-
#initialize(interface_name) ⇒ Capture
constructor
A new instance of Capture.
-
#run ⇒ Object
Run Capture.
Constructor Details
#initialize(interface_name) ⇒ Capture
Returns a new instance of Capture.
15 16 17 |
# File 'lib/simple_capture/capture.rb', line 15 def initialize(interface_name) @interface_name = interface_name end |
Instance Method Details
#run ⇒ Object
Run Capture
20 21 22 23 |
# File 'lib/simple_capture/capture.rb', line 20 def run socket = generate_socket(@interface_name) cap_loop(socket) end |