File: guidedogdoc.h

package info (click to toggle)
guidedog 1.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 372 kB
  • ctags: 161
  • sloc: cpp: 2,118; sh: 84; makefile: 14
file content (93 lines) | stat: -rw-r--r-- 2,829 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/***************************************************************************
                          guidedogdoc.h  -  description
                             -------------------
    begin                : Thu Sep 27 2001
    copyright            : (C) 2001 by Simon Edwards
    email                : simon@simonzone.com
 ***************************************************************************/
/***************************************************************************
    Converted to a pure Qt5 application
    begin                : December 2014
    by                   : Antonio Martins
    email                : digiplan.pt@gmail.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 GUIDEDOGDOC_H
#define GUIDEDOGDOC_H

#include "iprange.h"

#include <QTextStream>
#include <netinet/in.h>
#include <netinet/tcp.h>


/*!
 * \brief The GuidedogPortForwardRule class
 */
class GuidedogPortForwardRule {
public:
    GuidedogPortForwardRule();

    bool specifyoriginal;
    IPRange originaladdress;
    bool specifynewaddress;
    IPRange newaddress;
    uchar iptype;
    uint originalport;
    uint newport;
    QString comment;
    QString getSummary() const;
};
  

/*!
 * \brief The GuidedogDoc class
 */
class GuidedogDoc {
public: 
    GuidedogDoc();
    ~GuidedogDoc();

    void setDisabled(bool on);
    bool isDisabled();
    void setRouting(bool on);
    bool isRouting();
    void setMasquerade(bool on);
    bool isMasquerade();
    void setMasqueradeFTP(bool on);
    bool isMasqueradeFTP();
    void setMasqueradeIRC(bool on);
    bool isMasqueradeIRC();

    bool writeScript(QTextStream &stream);
    bool readScript(QTextStream &stream, QString &errorstring);
    bool openScript(const QString &filename, QString &errorstring);
    bool saveScript(const QString &filename, QString &errorstring);

    QString description;

    void factoryDefaults();

    // FIXME: Should use function interfaces here, and not direct.
    QList<GuidedogPortForwardRule> forwardrulelist;
    QList<IPRange> nomasqueradelist;
    
private:
    bool disabled;
    bool routing;
    bool masquerade;
    bool masqueradeftp;
    bool masqueradeirc;
};

#endif