Beispiel #1
0
 def run(self):
     self.dev.unmask_interrupts()
     print "[+] waiting for interrupts..."
     read_fds = [self.dev.interface.eventfd, self.tfd]
     while True:
         ready, _, _ = select.select(read_fds, [], [])
         for i in ready:
             if i == self.dev.interface.eventfd:
                 os.read(i, 8)
                 self._handle_interrupt()
             elif i == self.tfd:
                 b = self.mm.alloc(0x800)
                 l = c.read(self.tfd, b, 0x800)
                 self._send_b(b, l)
Beispiel #2
0
 def run(self):
     self.dev.unmask_interrupts()
     print "[+] waiting for interrupts..."
     read_fds = [self.dev.interface.eventfd, self.tfd]
     while True:
         ready, _, _ = select.select(read_fds, [], [])
         for i in ready:
             if i == self.dev.interface.eventfd:
                 os.read(i, 8)
                 self._handle_interrupt()
             elif i == self.tfd:
                 b = self.mm.alloc(0x800)
                 l = c.read(self.tfd, b, 0x800)
                 self._send_b(b, l)
Beispiel #3
0
 def _get_packet(self):
     b = self.mm.alloc(0x800)
     l = c.read(self.tfd, b, 0x800)
     return (b, l)
Beispiel #4
0
 def _get_tap_packet(self, buf, buf_len):
     l = c.read(self.tfd, buf, buf_len)
     return (buf, l)
Beispiel #5
0
 def _get_packet(self):
     b = self.mm.alloc(0x800)
     l = c.read(self.tfd, b, 0x800)
     return (b, l)
Beispiel #6
0
 def _get_tap_packet(self, buf, buf_len):
     l = c.read(self.tfd, buf, buf_len)
     return (buf, l)