/***************************************************************************
                          authentication.h  -  description
                             -------------------
    begin                : Thu Nov 20 2003
    copyright            : (C) 2003 by Wei Zheng
    email                : v_zheng@yahoo.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef AUTHENTICATION_H
#define AUTHENTICATION_H

#include <net.h>
#include <string.h>

#define PORT 80
#define HOST "login.passport.com"
#define URL "login2.srf"

/**
  *@author Wei Zheng
  */

class authentication : public net  {
public: 
	authentication();
	~authentication();

  /** No descriptions */
  void get_namepass(char * un, char * pw);

  /** No descriptions */
  void get_challenge(char * ch);
  /** No descriptions */
  int do_auth();
  /** No descriptions */
  int do_auth_http();
  /** No descriptions */
  int send_request();
  /** No descriptions */
  int get_response();
  /** No descriptions */
  void renew(char * newaddr,int newport);

public: // Public attributes
  /** seed value */
  char challenge[360];
  /** Username Password storage space*/
  char username[56];
  char password[56];
  char addr[32];
  int port;
  /**  */
  char url[32];
  char host[32];
};

#endif
