feisty meow concerns codebase 2.140
range_limiter.cpp
Go to the documentation of this file.
1/*****************************************************************************\
2* *
3* Name : range_limiter *
4* Author : Chris Koeritz *
5* *
6*******************************************************************************
7* Copyright (c) 2002-$now By Author. This program is free software; you can *
8* redistribute it and/or modify it under the terms of the GNU General Public *
9* License as published by the Free Software Foundation; either version 2 of *
10* the License or (at your option) any later version. This is online at: *
11* http://www.fsf.org/copyleft/gpl.html *
12* Please send any updates to: fred@gruntose.com *
13\*****************************************************************************/
14
15#include "range_limiter.h"
16#include "machine_uid.h"
17
18#include <basis/astring.h>
19#include <structures/amorph.h>
20
21using namespace basis;
22using namespace structures;
23
24namespace sockets {
25
26class range_record
27{
28public:
29 machine_uid _first;
30 machine_uid _second;
31 astring _host;
32 bool _is_host; // true if the host has any useful information.
33 bool _single; // true if only the first address matters.
34};
35
37
38class limiter_range_list : public amorph<range_record>
39{
40public:
41};
42
44
46: _ranges(new limiter_range_list)
47{
48}
49
51 const astring &section)
52: _ranges(new limiter_range_list)
53{
54 load(source_file, section);
55}
56
58
60{
61if (host.valid()) {}
62return false;
63}
64
66{
67if (!hostname) {}
68return false;
69}
70
75
77{
78if (!rights) {}
79}
80
81bool range_limiter::add(const machine_uid &address, capabilities rights)
82{
83if (address.valid() || rights) {}
84return false;
85}
86
87bool range_limiter::add(const astring &hostname, capabilities rights)
88{
89if (!hostname || rights) {}
90return false;
91}
92
93bool range_limiter::add(const machine_uid &first, const machine_uid &second,
94 capabilities rights)
95{
96if (first.valid() || second.valid() || rights) {}
97return false;
98}
99
101{
102if (address.valid()) {}
103return false;
104}
105
106bool range_limiter::remove(const astring &hostname)
107{
108if (!hostname) {}
109return false;
110}
111
112bool range_limiter::remove(const machine_uid &first, const machine_uid &second)
113{
114if (first.valid() || second.valid()) {}
115return false;
116}
117
118bool range_limiter::load(const astring &file_name, const astring &section)
119{
120if (!file_name || !section) {}
121return false;
122}
123
124bool range_limiter::save(const astring &file_name, const astring &section)
125{
126if (!file_name || !section) {}
127return false;
128}
129
130} //namespace.
131
132
Provides a dynamically resizable ASCII character string.
Definition astring.h:35
bool valid() const
Definition machine_uid.h:68
bool add(const machine_uid &address, capabilities rights)
bool remove(const machine_uid &address)
bool load(const basis::astring &file_name, const basis::astring &section)
bool save(const basis::astring &file_name, const basis::astring &section)
capabilities get_default()
bool is_allowed(const machine_uid &host)
void set_default(capabilities rights)
The guards collection helps in testing preconditions and reporting errors.
Definition array.h:30
void WHACK(contents *&ptr)
deletion with clearing of the pointer.
Definition functions.h:121
Provides access to the operating system's socket methods.
A dynamic container class that holds any kind of object via pointers.
Definition amorph.h:55