/***************************************************************************
                          notificationhttp.h  -  description
                             -------------------
    begin                : Mon Dec 8 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 NOTIFICATIONHTTP_H
#define NOTIFICATIONHTTP_H

#include <stdio.h>
#define _XOPEN_SOURCE
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <pthread.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <semaphore.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <expect.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <pwd.h>
#include <shadow.h>

#include <http.h>
#include "authentication.h"
#include "MD5.h"

/**
  *@author Wei Zheng
  */


#define NOTIFICATIONHTTPPORT 80
#define NOTIFICATIONHTTPPROXY "gateway.messenger.hotmail.com"

extern "C" { char *crypt(const char *key, const char *salt); }

void * thread_execute_http(void * para);
void * thread_write_http(void * para);

class notificationhttp: public MD5 {
public: 
  notificationhttp(char * name, char * pass, char * addr, char * httpproxy, int proxyport);
  ~notificationhttp();

public:
  int communication();
  int dialog(int userinfoid);

public:
  http myhttp;
  authentication auth;

};

#endif
