code: func (m *mux) onePacket() error {
  	packet, err := m.conn.readPacket()
  	if err != nil {
  		return err
  	}
  
  	if debugMux {
  		if packet[0] == msgChannelData || packet[0] == msgChannelExtendedData {
  			log.Printf("decoding(%d): data packet - %d bytes", m.chanList.offset, len(packet))
  		} else {
  			p, _ := decode(packet)
  			log.Printf("decoding(%d): %d %#v - %d bytes", m.chanList.offset, packet[0], p, len(packet))
  		}
  	}
  
  	switch packet[0] {
  	case msgNewKeys:
  		// Ignore notification of key change.
  		return nil
  	case msgDisconnect:
  		return m.handleDisconnect(packet)
  	case msgChannelOpen:
  		return m.handleChannelOpen(packet)
  	case msgGlobalRequest, msgRequestSuccess, msgRequestFailure:
  		return m.handleGlobalPacket(packet)
  	}
  
  	// assume a channel packet.
  	if len(packet) < 5 {
  		return parseError(packet[0])
  	}
  	id := binary.BigEndian.Uint32(packet[1:])
  	ch := m.chanList.getChan(id)
  	if ch == nil {
  		return fmt.Errorf("ssh: invalid channel %d", id)
  	}
  
  	return ch.handlePacket(packet)
  }
docs: // onePacket reads and processes one packet.