'Synchroneous receive.
Receives one packet from the interface and returns its content
in a string. Wait up to timeout for the packet if timeout is
not 0. This function filters out all the packets that are
less than the minimum ethernet packet size (60+crc).
Args:
timeout: max time in seconds to wait for the read to complete.
\'0\', wait for ever until a valid packet is received
Returns:
packet:    None no packet was received
a binary string containing the received packet.
time_left: amount of time left in timeout'

def recv(self, timeout):

    if (self._socket is None):
        raise error.TestError('Raw    socket    not    open')
    time_left = timeout
    packet = None
    while (time_left or (timeout == 0)):
        try:
            packet = self._socket.recv(ethernet.ETH_PACKET_MAX_SIZE)
            if (len(packet) >= (ethernet.ETH_PACKET_MIN_SIZE - 4)):
                break
            packet = None
            if (timeout and time_left):
                time_left -= raw_socket.SOCKET_TIMEOUT
        except socket.timeout:
            packet = None
            if (timeout and time_left):
                time_left -= raw_socket.SOCKET_TIMEOUT
    return (packet, time_left)
