示例#1
0
int
RWho_DB_Manager::get_next_user (Protocol_Record &protocol_record)
{
  // Get the next host file if necessary
  if (this->current_user >= this->number_of_users
      && this->get_next_host () == 0)
    return 0;

  protocol_record.set_login (this->host_data.wd_we[current_user].we_utmp.out_name);
  Drwho_Node *current_node = protocol_record.get_drwho_list ();
  current_node->set_host_name (this->host_data.wd_hostname);
  current_node->set_idle_time (this->host_data.wd_we[current_user].we_idle);
  this->current_user++;

  return 1;
}
示例#2
0
char *
PM_Client::handle_protocol_entries (const char *cp,
                                    const char *login_name,
                                    const char *real_name)
{
  static Protocol_Record protocol_record (1);
  Drwho_Node *current_node = protocol_record.get_drwho_list ();

  protocol_record.set_login (login_name);
  protocol_record.set_real (real_name);
  current_node->set_inactive_count (ACE_OS::atoi (cp));
  current_node->set_active_count (ACE_OS::atoi (cp = ACE_OS::strchr (cp, ' ') + 1));
  current_node->set_host_name (cp = ACE_OS::strchr (cp, ' ') + 1);

  this->insert_protocol_info (protocol_record);

  return (char *) ACE::strend (cp);
}