Commit e276c279 authored by Seblu's avatar Seblu

Utilisation de sll au lieu de classe local

parent 5c4a6fdc
......@@ -16,29 +16,33 @@
bin_PROGRAMS= sls
sls_SOURCES= src/sls.hh \
src/sls.cc \
sls_SOURCES= src/sls.cc \
src/option.cc \
src/database.cc \
src/cron.cc \
src/server.cc \
src/client.cc \
src/client_console.cc \
src/client_daemon.cc \
src/sll/error.cc \
src/sll/connection.cc
noinst_HEADERS= src/sls.hh \
src/error.hh \
src/error.cc \
src/option.hh \
src/option.cc \
src/database.hh \
src/database.cc \
src/cron.hh \
src/cron.cc \
src/server.hh \
src/server.cc \
src/connection.hh \
src/connection.hxx \
src/connection.cc \
src/client.hh \
src/client.cc \
src/client_console.hh \
src/client_console.cc \
src/client_daemon.hh \
src/client_daemon.cc
src/sll/slm.hh \
src/sll/error.hh \
src/sll/connection.hh \
src/sll/connection.hxx
CLEANFILES= *~ '\#*'
CLEANFILES= '*~' '#*#' '*.swp'
EXTRA_DIST= COPYING README
......
......@@ -24,7 +24,7 @@ AC_INIT([sls],[1.0],[contact@seblu.net],[sls])
AC_CONFIG_AUX_DIR([build])
# Auto Make init
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip])
AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip subdir-objects])
# Check platform
AC_CANONICAL_HOST
......
......@@ -19,7 +19,7 @@
#ifndef CLIENT_HH
# define CLIENT_HH
# include "connection.hh"
# include "sll/connection.hh"
/**
* Client
......
......@@ -17,7 +17,6 @@
*/
#include "sls.hh"
#include "error.hh"
#include "option.hh"
#include "client_console.hh"
......@@ -75,13 +74,15 @@ bool Console::trust(const char *login, const char *pass) {
assert(pass);
// check login and password in DB
c_.sendln("User always trusted !!");
// store username
login_ = login;
// register as logged in DB
// send validation
c_.sendln("OK");
return true;
}
......
......@@ -57,12 +57,14 @@ bool Daemon::trust(const char *login, const char *pass) {
assert(pass);
// check login and password in DB
c_.sendln("Daemon always untrusted !!");
// store username
login_ = login;
// register as logged in DB
// Send
c_.sendln("KO");
return false;
}
......@@ -18,7 +18,6 @@
#include "sls.hh"
#include "database.hh"
#include "error.hh"
// *****************************************************************************
// Public Method
......
......@@ -18,8 +18,6 @@
#include "sls.hh"
#include "server.hh"
#include "error.hh"
#include "connection.hh"
#include "client.hh"
#include <unistd.h>
......
......@@ -19,7 +19,7 @@
#ifndef SERVER_HH
# define SERVER_HH
# include "connection.hh"
# include "sll/connection.hh"
# include <set>
# include <pthread.h>
......
/*
This file is part of SLS.
This file is part of SLL.
Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
SLS is free software; you can redistribute it and/or modify
SLL 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; version 2 of the License.
SLS is distributed in the hope that it will be useful,
SLL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SLS; if not, write to the Free Software
along with SLL; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "sls.hh"
#include "slm.hh"
#include "connection.hh"
#include "error.hh"
......
/*
This file is part of SLS.
This file is part of SLL.
Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
SLS is free software; you can redistribute it and/or modify
SLL 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; version 2 of the License.
SLS is distributed in the hope that it will be useful,
SLL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SLS; if not, write to the Free Software
along with SLLo; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
......
/*
This file is part of SLS.
This file is part of SLL.
Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
SLS is free software; you can redistribute it and/or modify
SLL 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; version 2 of the License.
SLS is distributed in the hope that it will be useful,
SLL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SLS; if not, write to the Free Software
along with SLL; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
......
/*
This file is part of SLS.
This file is part of SLL.
Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
SLS is free software; you can redistribute it and/or modify
SLL 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; version 2 of the License.
SLS is distributed in the hope that it will be useful,
SLL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SLS; if not, write to the Free Software
along with SLL; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ERROR_HH
# define ERROR_HH
# include <ios>
# include <iostream>
# include <sstream>
typedef std::string string;
typedef std::stringstream sstream;
typedef std::ostream ostream;
# include "slm.hh"
class Error
{
......
/*
This file is part of SLL.
Copyright (C) 2008 Sebastien LUTTRINGER <contact@seblu.net>
SLL 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; version 2 of the License.
SLL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SLL; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef SLM_HH
# define SLM_HH
# define _REENTRANT
# include <cassert>
# include <ios>
# include <iostream>
# include <fstream>
# include <sstream>
typedef std::string string;
typedef std::stringstream sstream;
typedef std::ostream ostream;
typedef std::ifstream ifstream;
typedef std::ofstream ofstream;
enum {
ERR_NO = 0,
ERR_USAGE = 1,
ERR_BADPARAM = 2,
ERR_FILE = 3,
ERR_NET = 4,
ERR_PROTO = 5,
ERR_AUTH = 6,
ERR_DB = 7,
ERR_SRV = 8,
ERR_THREAD = 9,
ERR_PARSE = 10,
ERR_NOMEM = 41,
ERR_UNKNOWN = 42
};
// -----------------------------------------------------------------------------
// Gonstant
// -----------------------------------------------------------------------------
static const string VERSION = (string) "testing.\nCompiled: " + __DATE__ + " " + __TIME__ + ".";
//static const string VERSION = "1.0";
static const int MAX_LINE_SIZE = 512;
#endif
......@@ -21,7 +21,6 @@
#include "database.hh"
#include "cron.hh"
#include "server.hh"
#include "error.hh"
#include <unistd.h>
#include <sys/types.h>
......
......@@ -19,47 +19,13 @@
#ifndef SLS_HH
# define SLS_HH
# define _REENTRANT
# include <cassert>
# include <ios>
# include <iostream>
# include <fstream>
# include <sstream>
typedef std::string string;
typedef std::stringstream sstream;
typedef std::ostream ostream;
typedef std::ifstream ifstream;
typedef std::ofstream ofstream;
enum {
ERR_NO = 0,
ERR_USAGE = 1,
ERR_BADPARAM = 2,
ERR_FILE = 3,
ERR_NET = 4,
ERR_PROTO = 5,
ERR_AUTH = 6,
ERR_DB = 7,
ERR_SRV = 8,
ERR_THREAD = 9,
ERR_PARSE = 10,
ERR_NOMEM = 41,
ERR_UNKNOWN = 42
};
// -----------------------------------------------------------------------------
// Gonstant
// -----------------------------------------------------------------------------
static const string VERSION = (string) "testing.\nBuild: " + __DATE__ + " " + __TIME__ + ".";
//static const string VERSION = "1.0";
static const int MAX_LINE_SIZE = 512;
# include "sll/slm.hh"
# include "sll/error.hh"
// -----------------------------------------------------------------------------
// global variables
// -----------------------------------------------------------------------------
class Option;
extern Option O;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment