- /***************************************************************************
- server - description
- -------------------
- begin : jeu oct 28 2004
- copyright : (C) 2004 by neoTHGLF
- email : neoTHGLF.neoTHGLF@laposte.net
- ***************************************************************************/
-
- /***************************************************************************
- * *
- * 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 CLIENT_H
- #define CLIENT_H
-
- #include <iostream>
- #include <string>
- #include <openssl/ssl.h>
-
- #ifdef WIN32
- #include <winsock2.h>
- typedef int socklen_t;
- #pragma comment(lib,"ws2_32.lib")
- #pragma comment(lib,"ssleay32.lib")
- #pragma comment(lib,"libeay32.lib")
- #else
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <netdb.h>
- #include <netinet/in.h>
- #endif
-
-
- using std::cout;
- using std::cin;
- using std::endl;
- using std::flush;
- using std::string;
-
- /**
- @author neoTHGLF
- */
- class client{
- public:
-
- int client_set(short client_sin_family,char *adresse,int port,bool ssl_server); //Make the skeleton of the client
- int client_connect();
- int client_write(char *msg);
- int client_read(char *msg);
- int client_get_fd();
- SSL *client_get_SSL_fd();
-
- char *convert(string str);
-
- private:
-
- #ifdef WIN32
- SOCKET fd;
- #else
- int fd;
- #endif
-
- SSL *SSL_fd; /* SSL socket */
-
- struct sockaddr_in server_addr;
- int client_len;
- int SSL_error_code; /* SSL functions returns*/
- bool server_ssl_state;
-
- };
-
- #endif
/***************************************************************************
server - description
-------------------
begin : jeu oct 28 2004
copyright : (C) 2004 by neoTHGLF
email : neoTHGLF.neoTHGLF@laposte.net
***************************************************************************/
/***************************************************************************
* *
* 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 CLIENT_H
#define CLIENT_H
#include <iostream>
#include <string>
#include <openssl/ssl.h>
#ifdef WIN32
#include <winsock2.h>
typedef int socklen_t;
#pragma comment(lib,"ws2_32.lib")
#pragma comment(lib,"ssleay32.lib")
#pragma comment(lib,"libeay32.lib")
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <netinet/in.h>
#endif
using std::cout;
using std::cin;
using std::endl;
using std::flush;
using std::string;
/**
@author neoTHGLF
*/
class client{
public:
int client_set(short client_sin_family,char *adresse,int port,bool ssl_server); //Make the skeleton of the client
int client_connect();
int client_write(char *msg);
int client_read(char *msg);
int client_get_fd();
SSL *client_get_SSL_fd();
char *convert(string str);
private:
#ifdef WIN32
SOCKET fd;
#else
int fd;
#endif
SSL *SSL_fd; /* SSL socket */
struct sockaddr_in server_addr;
int client_len;
int SSL_error_code; /* SSL functions returns*/
bool server_ssl_state;
};
#endif