def _io_worker_receive_handler(self, io_worker):
    message = io_worker.peek_receive_buf()
    # Create an ethernet packet
    # TODO(cs): this assumes that the raw socket returns exactly one ethernet
    # packet. Since ethernet frames do not include length information, the
    # only way to correctly handle partial packets would be to get access to
    # framing information. Should probably look at what Mininet does.
    packet = ethernet(raw=message)
    if not packet.parsed:
      return
    io_worker.consume_receive_buf(packet.hdr_len + packet.payload_len)
    self.log.info("received packet from netns %s: " % str(packet))
    super(NamespaceHost, self).send(self.interfaces[0], packet)
Read a packet from the Namespace and inject it into the network.
dataset/ETHPy150Open ucb-sts/sts/sts/entities/hosts.py/NamespaceHost._io_worker_receive_handler