1 |
douglas |
402 |
// Spectre 2 |
2 |
|
|
// |
3 |
|
|
// Douglas Thrift |
4 |
|
|
// |
5 |
|
|
// $Id$ |
6 |
|
|
|
7 |
|
|
#ifndef _Spectre2_hpp_ |
8 |
|
|
#define _Spectre2_hpp_ |
9 |
|
|
|
10 |
|
|
#include <menes/platform.hpp> |
11 |
|
|
|
12 |
|
|
#ifdef MENES_PRAGMA_ONCE |
13 |
|
|
#pragma once |
14 |
|
|
#endif |
15 |
|
|
|
16 |
|
|
#include <menes-api/console.hpp> |
17 |
douglas |
408 |
#include <menes-api/files.hpp> |
18 |
douglas |
428 |
#include <menes-api/locks.hpp> |
19 |
douglas |
418 |
#include <menes-api/path.hpp> |
20 |
douglas |
428 |
#include <menes-api/process.hpp> |
21 |
|
|
#include <menes-ext/scopes.hpp> |
22 |
douglas |
402 |
#include <menes-ext/string.hpp> |
23 |
douglas |
428 |
#include <menes-ios/helpers.hpp> |
24 |
douglas |
418 |
#include <menes-xml/document.hpp> |
25 |
|
|
#include <menes-xml/nodeset.hpp> |
26 |
|
|
#include <menes-xml/parse.hpp> |
27 |
douglas |
402 |
|
28 |
douglas |
414 |
#include <unistd.h> |
29 |
|
|
|
30 |
douglas |
428 |
#include "Matcher/Matcher.hpp" |
31 |
|
|
|
32 |
douglas |
408 |
typedef api::Posix::FileStream<api::Posix::HandleWriter, O_WRONLY | O_CREAT | O_TRUNC, 0600> SecretFileWriter; |
33 |
douglas |
428 |
typedef api::Posix::FileStream<api::Posix::HandleWriter, O_WRONLY | O_APPEND, 0> AppendFileWriter; |
34 |
douglas |
408 |
|
35 |
douglas |
414 |
#ifndef _Spectre2_prefix_ |
36 |
|
|
#define _Spectre2_prefix_ "/usr/local" |
37 |
|
|
#endif |
38 |
douglas |
407 |
|
39 |
douglas |
414 |
#ifndef _Spectre2_root_ |
40 |
|
|
#define _Spectre2_root_ "/smb" |
41 |
|
|
#endif |
42 |
|
|
|
43 |
douglas |
428 |
#ifndef _Spectre2_mount_ |
44 |
|
|
#define _Spectre2_mount_ "/sbin/mount" |
45 |
|
|
#endif |
46 |
|
|
|
47 |
douglas |
432 |
#ifndef _Spectre2_umount_ |
48 |
|
|
#define _Spectre2_umount_ "/sbin/umount" |
49 |
|
|
#endif |
50 |
|
|
|
51 |
douglas |
405 |
class Daemon; |
52 |
|
|
|
53 |
douglas |
402 |
class Spectre2 |
54 |
|
|
{ |
55 |
|
|
private: |
56 |
douglas |
418 |
ext::String pid; |
57 |
douglas |
402 |
public: |
58 |
douglas |
418 |
Spectre2(const api::Path& config); |
59 |
douglas |
402 |
~Spectre2(); |
60 |
douglas |
432 |
static ext::String program, prefix, root, mount, umount; |
61 |
douglas |
402 |
static bool debug; |
62 |
douglas |
429 |
static Daemon* daemon; |
63 |
douglas |
402 |
}; |
64 |
|
|
|
65 |
douglas |
428 |
#endif//_Spectre2_hpp_ |