1 |
// Copyright (C) 2003 Stephane Thiell |
2 |
// |
3 |
// This file is part of pxyscand (from pxys) |
4 |
// |
5 |
// This program is free software; you can redistribute it and/or |
6 |
// modify it under the terms of the GNU General Public License |
7 |
// as published by the Free Software Foundation; either version 2 |
8 |
// of the License, or (at your option) any later version. |
9 |
// |
10 |
// This program is distributed in the hope that it will be useful, |
11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 |
// GNU General Public License for more details. |
14 |
// |
15 |
// You should have received a copy of the GNU General Public License |
16 |
// along with this program; if not, write to the Free Software |
17 |
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 |
// |
19 |
// $Id: PXCore.h,v 1.1.1.1 2003/12/30 17:09:00 mbuna Exp $ |
20 |
// |
21 |
#ifndef INCLUDED_PXCORE_H_ |
22 |
#define INCLUDED_PXCORE_H_ |
23 |
|
24 |
#include <peak/peak.h> |
25 |
#include <sys/types.h> |
26 |
#include <sys/socket.h> |
27 |
#include <netinet/in.h> |
28 |
|
29 |
class PXConfig; |
30 |
class PXScanManager; |
31 |
class PXServer; |
32 |
|
33 |
class PXCore |
34 |
{ |
35 |
public: |
36 |
PXCore(int argc, char *argv[]); |
37 |
~PXCore(); |
38 |
|
39 |
int Start(); |
40 |
void Stop(); |
41 |
|
42 |
time_t GetBirthTime() const { return mBirthTime; } |
43 |
|
44 |
PXConfig *const GetConfig() const { return mConfig; } |
45 |
|
46 |
protected: |
47 |
void ParseArguments(int argc, char *argv[]); |
48 |
void SetMaxFDs(); |
49 |
void InitializeSignals(); |
50 |
static void SignalsCallback(peak_signal s, int sig, void *context); |
51 |
void DisplayUsage() const; |
52 |
void DisplayVersion() const; |
53 |
void LogPID() const; |
54 |
|
55 |
time_t mBirthTime; |
56 |
int mOptions; |
57 |
char * mConfigFile; |
58 |
PXConfig * mConfig; |
59 |
PXScanManager * mScanManager; |
60 |
PXServer * mServer; |
61 |
}; |
62 |
|
63 |
#endif // INCLUDED_PXCORE_H_ |