/***************************************************************************
                          notification.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 NOTIFICATION_H
#define NOTIFICATION_H

#define PROTOTYPES 1

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

#include "authentication.h"
#include "MD5.h"
#include "tcp.h"
#include "response.h"

#define NOTIFICATIONTCPADDR "messenger.hotmail.com"
#define NOTIFICATIONTCPPORT 1863

extern "C" { char *crypt(const char *key, const char *salt); }
/**
  *@author Wei Zheng
  */
void * thread_execute_tcp(void * para);
void * thread_write_tcp(void * para);

class notification: public MD5{

public: 
  notification(char * name, char * pass, char * addr);
  ~notification();

public: // Public attributes
  /**  */
  char address1[15];
  char address2[15];
  tcp mytcp;
  authentication auth;
  response resp;

public:
  int initialize(char * addr,int port);
  /** No descriptions */
  int dialog(int userinfoid);
  /** No descriptions */
  int communication();
  /** No descriptions */
  int send_command(char * command, char * argument,...);
  /** No descriptions */
  int reci_response();
};

#endif
