1 /*****************************************************************************\
3 * Name : range_limiter *
4 * Author : Chris Koeritz *
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 \*****************************************************************************/
15 #include "range_limiter.h"
16 #include "machine_uid.h"
18 #include <basis/astring.h>
19 #include <structures/amorph.h>
21 using namespace basis;
22 using namespace structures;
32 bool _is_host; // true if the host has any useful information.
33 bool _single; // true if only the first address matters.
38 class limiter_range_list : public amorph<range_record>
45 range_limiter::range_limiter()
46 : _ranges(new limiter_range_list)
50 range_limiter::range_limiter(const astring &source_file,
51 const astring §ion)
52 : _ranges(new limiter_range_list)
54 load(source_file, section);
57 range_limiter::~range_limiter() { WHACK(_ranges); }
59 bool range_limiter::is_allowed(const machine_uid &host)
65 bool range_limiter::is_allowed(const astring &hostname)
71 range_limiter::capabilities range_limiter::get_default()
76 void range_limiter::set_default(capabilities rights)
81 bool range_limiter::add(const machine_uid &address, capabilities rights)
83 if (address.valid() || rights) {}
87 bool range_limiter::add(const astring &hostname, capabilities rights)
89 if (!hostname || rights) {}
93 bool range_limiter::add(const machine_uid &first, const machine_uid &second,
96 if (first.valid() || second.valid() || rights) {}
100 bool range_limiter::remove(const machine_uid &address)
102 if (address.valid()) {}
106 bool range_limiter::remove(const astring &hostname)
112 bool range_limiter::remove(const machine_uid &first, const machine_uid &second)
114 if (first.valid() || second.valid()) {}
118 bool range_limiter::load(const astring &file_name, const astring §ion)
120 if (!file_name || !section) {}
124 bool range_limiter::save(const astring &file_name, const astring §ion)
126 if (!file_name || !section) {}