'Buffer packet and return buffer ID
If no buffer is available, return None.'

def _buffer_packet(self, packet, in_port=None):

    for (i, value) in enumerate(self._packet_buffer):
        if (value is None):
            self._packet_buffer[i] = (packet, in_port)
            return (i + 1)
    if (len(self._packet_buffer) >= self.max_buffers):
        return None
    self._packet_buffer.append((packet, in_port))
    return len(self._packet_buffer)
