File: iprange.h

package info (click to toggle)
guarddog 2.4.0-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 4,672 kB
  • ctags: 720
  • sloc: sh: 11,483; cpp: 6,742; xml: 2,771; perl: 2,717; makefile: 203
file content (45 lines) | stat: -rwxr-xr-x 1,518 bytes parent folder | download | duplicates (3)
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
/***************************************************************************
                          iprange.h  -  description
                             -------------------
    begin                : Thu May 10 08:08:00 EST 2001
    copyright            : (C) 2000-2001 by Simon Edwards
    email                : simon@simonzone.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 IPRANGE_H
#define IPRANGE_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <qstring.h>

enum IPRangeType {invalid,domainname,ip,iprange};
class IPRange {
public:
    IPRange();
    IPRange(const QString &a);
    ~IPRange();
    void setAddress(const QString &a);
    QString getAddress() const;
    IPRangeType getType();
    uint getMask();
    
private:
    QString address;
    bool digested;
    IPRangeType type;
    uint mask;
    void digest();
};

#endif