00001 #ifndef RANGE_LIMITER_IMPLEMENTATION_FILE 00002 #define RANGE_LIMITER_IMPLEMENTATION_FILE 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : range_limiter * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2002-$now By Author. This program is free software; you can * 00011 * redistribute it and/or modify it under the terms of the GNU General Public * 00012 * License as published by the Free Software Foundation; either version 2 of * 00013 * the License or (at your option) any later version. This is online at: * 00014 * http://www.fsf.org/copyleft/gpl.html * 00015 * Please send any updates to: fred@gruntose.com * 00016 \*****************************************************************************/ 00017 00018 #include "range_limiter.h" 00019 #include "machine_uid.h" 00020 00021 #include <basis/istring.h> 00022 #include <data_struct/amorph.cpp> 00023 00024 class range_record 00025 { 00026 public: 00027 machine_uid _first; 00028 machine_uid _second; 00029 istring _host; 00030 bool _is_host; // true if the host has any useful information. 00031 bool _single; // true if only the first address matters. 00032 }; 00033 00035 00036 class limiter_range_list : public amorph<range_record> 00037 { 00038 public: 00039 }; 00040 00042 00043 range_limiter::range_limiter() 00044 : _ranges(new limiter_range_list) 00045 { 00046 } 00047 00048 range_limiter::range_limiter(const istring &source_file, 00049 const istring §ion) 00050 : _ranges(new limiter_range_list) 00051 { 00052 load(source_file, section); 00053 } 00054 00055 range_limiter::~range_limiter() { WHACK(_ranges); } 00056 00057 bool range_limiter::is_allowed(const machine_uid &host) 00058 { 00059 if (host.valid()) {} 00060 return false; 00061 } 00062 00063 bool range_limiter::is_allowed(const istring &hostname) 00064 { 00065 if (!hostname) {} 00066 return false; 00067 } 00068 00069 range_limiter::capabilities range_limiter::get_default() 00070 { 00071 return DENY; 00072 } 00073 00074 void range_limiter::set_default(capabilities rights) 00075 { 00076 if (!rights) {} 00077 } 00078 00079 bool range_limiter::add(const machine_uid &address, capabilities rights) 00080 { 00081 if (address.valid() || rights) {} 00082 return false; 00083 } 00084 00085 bool range_limiter::add(const istring &hostname, capabilities rights) 00086 { 00087 if (!hostname || rights) {} 00088 return false; 00089 } 00090 00091 bool range_limiter::add(const machine_uid &first, const machine_uid &second, 00092 capabilities rights) 00093 { 00094 if (first.valid() || second.valid() || rights) {} 00095 return false; 00096 } 00097 00098 bool range_limiter::remove(const machine_uid &address) 00099 { 00100 if (address.valid()) {} 00101 return false; 00102 } 00103 00104 bool range_limiter::remove(const istring &hostname) 00105 { 00106 if (!hostname) {} 00107 return false; 00108 } 00109 00110 bool range_limiter::remove(const machine_uid &first, const machine_uid &second) 00111 { 00112 if (first.valid() || second.valid()) {} 00113 return false; 00114 } 00115 00116 bool range_limiter::load(const istring &file_name, const istring §ion) 00117 { 00118 if (!file_name || !section) {} 00119 return false; 00120 } 00121 00122 bool range_limiter::save(const istring &file_name, const istring §ion) 00123 { 00124 if (!file_name || !section) {} 00125 return false; 00126 } 00127 00128 00129 #endif //RANGE_LIMITER_IMPLEMENTATION_FILE 00130
1.5.1