ConfigurationKeyMap getConfigurationKeys() { ConfigurationKeyMap map; ConfigurationKey *tmp; tmp = new ConfigurationKey("TRX.RadioFrequencyOffset","128", "~170Hz steps", ConfigurationKey::FACTORY, ConfigurationKey::VALRANGE, "96:160",// educated guess true, "Fine-tuning adjustment for the transceiver master clock. " "Roughly 170 Hz/step. " "Set at the factory. " "Do not adjust without proper calibration." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("TRX.TxAttenOffset","0", "dB of attenuation", ConfigurationKey::FACTORY, ConfigurationKey::VALRANGE, "0:100",// educated guess true, "Hardware-specific gain adjustment for transmitter, matched to the power amplifier, expessed as an attenuationi in dB. " "Set at the factory. " "Do not adjust without proper calibration." ); map[tmp->getName()] = *tmp; delete tmp; return map; }
ConfigurationKeyMap getConfigurationKeys2() { extern ConfigurationKeyMap getConfigurationKeys(); ConfigurationKeyMap map = getConfigurationKeys(); ConfigurationKey *tmp; tmp = new ConfigurationKey("TRX.RadioFrequencyOffset","128", "~170Hz steps", ConfigurationKey::FACTORY, ConfigurationKey::VALRANGE, "96:160",// educated guess true, "Fine-tuning adjustment for the transceiver master clock. " "Roughly 170 Hz/step. " "Set at the factory. " "Do not adjust without proper calibration." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("TRX.TxAttenOffset","0", "dB of attenuation", ConfigurationKey::FACTORY, ConfigurationKey::VALRANGE, "0:100",// educated guess true, "Hardware-specific gain adjustment for transmitter, matched to the power amplifier, expessed as an attenuationi in dB. " "Set at the factory. " "Do not adjust without proper calibration." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("TRX.RadioNumber","0", "", ConfigurationKey::FACTORY, ConfigurationKey::VALRANGE, "0:9", // Not likely to have 10 radios on the same computer. Not likely to have >1 true, "If non-0, use multiple radios on the same cpu, numbered 1-9. Must change TRX.Port also. Provide a separate config file for each OpenBTS+Radio combination using the environment variable or --config command line option." ); map[tmp->getName()] = *tmp; delete(tmp); return map; }
long ConfigurationTable::key2id(const ConfigurationKey& key) { std::list<long> ids = selectids(condition(key)); if (ids.size() != 1) { std::string msg = stringprintf("%s not found", key.toString().c_str()); throw NoSuchEntry(msg); } return *ids.begin(); }
ConfigurationKeyMap getConfigurationKeys() { ConfigurationKeyMap map; ConfigurationKey *tmp; tmp = new ConfigurationKey("SubscriberRegistry.A3A8","/OpenBTS/comp128", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::FILEPATH, "", false, "Path to the program that implements the A3/A8 algorithm." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.db","/var/lib/asterisk/sqlite3dir/sqlite3.db", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::FILEPATH, "", false, "The location of the sqlite3 database holding the subscriber registry." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.Port","5064", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::PORT, "", false, "Port used by the SIP Authentication Server." ); map[tmp->getName()] = *tmp; delete tmp; return map; }
ConfigurationKeyMap getConfigurationKeys() { ConfigurationKeyMap map; ConfigurationKey *tmp; tmp = new ConfigurationKey("booltest","0", "", ConfigurationKey::DEVELOPER, ConfigurationKey::BOOLEAN, "", false, "" ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("numnumber","42", "", ConfigurationKey::DEVELOPER, ConfigurationKey::VALRANGE, "0-100", false, "" ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("newstring","new string value", "", ConfigurationKey::DEVELOPER, ConfigurationKey::STRING, "", false, "" ); map[tmp->getName()] = *tmp; delete tmp; return map; }
bool TestConfigurationStorageAPI() { #ifdef BZSLIB_WINKERNEL ConfigurationPath root = ConfigurationPath::FromNTRegistryPath(_T("\\Registry\\Machine\\SOFTWARE\\Sysprogs_BazisLibTest")); #elif defined(WIN32) ConfigurationPath root = ConfigurationPath::FromWin32RegistryPath(HKEY_CURRENT_USER, _T("SOFTWARE\\Sysprogs\\BazisLibTest")); #elif defined (BZSLIB_KEXT) ConfigurationPath root = ConfigurationPath::FromFSPath("/tmp/cfgtest.plist"); #else ConfigurationPath root = ConfigurationPath::FromFSPath("/tmp/cfgtest"); #endif ConfigurationKey rootKey(root, true); TEST_ASSERT(rootKey.Valid()); rootKey[_T("key1")] = _T("val1"); rootKey[_T("key2")] = 2; TEST_ASSERT((String)rootKey[_T("key1")] == _T("val1")); TEST_ASSERT((int)rootKey[_T("key2")] == 2); ConfigurationKey subkey = rootKey[_T("subkey1")]; TEST_ASSERT(subkey.Valid()); TEST_ASSERT((int)subkey[_T("DoesNotExist")] == 0); //TEST_ASSERT((int)subkey[_T("key2")] == 0); subkey[_T("key2")] = 7; TEST_ASSERT((int)subkey[_T("key2")] == 7); std::vector<String> subkeys = rootKey.GetAllSubkeys(); TEST_ASSERT(subkeys.size() == 1); TEST_ASSERT(subkeys[0] == _T("subkey1")); #ifdef BZSLIB_KEXT TEST_ASSERT(rootKey.Save().Successful()); #endif return true; }
bool ConfigurationBackend::has(const ConfigurationKey& key) { return _configurationtable.has(key.condition()); }
ConfigurationKeyMap getConfigurationKeys() { ConfigurationKeyMap map; ConfigurationKey *tmp; tmp = new ConfigurationKey("TRX.RadioFrequencyOffset","128", "~170Hz steps", ConfigurationKey::FACTORY, ConfigurationKey::VALRANGE, "96:160",// educated guess true, "Fine-tuning adjustment for the transceiver master clock. " "Roughly 170 Hz/step. " "Set at the factory. " "Do not adjust without proper calibration." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("TRX.TxAttenOffset","0", "dB of attenuation", ConfigurationKey::FACTORY, ConfigurationKey::VALRANGE, "0:100",// educated guess true, "Hardware-specific gain adjustment for transmitter, matched to the power amplifier, expessed as an attenuationi in dB. " "Set at the factory. " "Do not adjust without proper calibration." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("TRX.MinOversampling","1", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::VALRANGE, "1:20",// educated guess true, "Minimum signal oversampling unless overriden by device or ARFCNs. " "This parameter increases computational requirements of the transceiver." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("TRX.IP","127.0.0.1", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::IPADDRESS, "", true, "IP address of the transceiver application." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("TRX.Port","5700", "", ConfigurationKey::FACTORY, ConfigurationKey::PORT, "", true, "IP port of the transceiver application." ); map[tmp->getName()] = *tmp; delete tmp; return map; }
ConfigurationKeyMap getConfigurationKeys() { ConfigurationKeyMap map; ConfigurationKey *tmp; tmp = new ConfigurationKey("SIP.Proxy.Registration","127.0.0.1:5064", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::IPANDPORT, "", false, "The IP host and port of the proxy to be used for registration and authentication. " "This should normally be the subscriber registry SIP interface, not Asterisk." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.A3A8","/OpenBTS/comp128", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::FILEPATH, "", false, "Path to the program that implements the A3/A8 algorithm." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.db","/var/lib/asterisk/sqlite3dir/sqlite3.db", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::FILEPATH, "", false, "The location of the sqlite3 database holding the subscriber registry." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.Manager.Title","Subscriber Registry", "", ConfigurationKey::CUSTOMER, ConfigurationKey::STRING, "^[[:print:]]+$", false, "Title text to be displayed on the subscriber registry manager." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.Manager.VisibleColumns","name username type context host", "", ConfigurationKey::CUSTOMERTUNE, ConfigurationKey::STRING, "^(name){0,1} (username){0,1} (type){0,1} (context){0,1} (host){0,1}$", false, "A space separated list of columns to display in the subscriber registry manager." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.Port","5064", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::PORT, "", false, "Port used by the SIP Authentication Server. NOTE: In some older releases (pre-2.8.1) this is called SIP.myPort." ); map[tmp->getName()] = *tmp; delete tmp; tmp = new ConfigurationKey("SubscriberRegistry.UpstreamServer","", "", ConfigurationKey::CUSTOMERWARN, ConfigurationKey::STRING_OPT,// audited "", false, "URL of the subscriber registry HTTP interface on the upstream server. " "By default, this feature is disabled. " "To enable, specify a server URL eg: http://localhost/cgi/subreg.cgi. " "To disable again, execute \"unconfig SubscriberRegistry.UpstreamServer\"." ); map[tmp->getName()] = *tmp; delete tmp; return map; }
void ConfigurationTable::remove(const ConfigurationKey& key) { TableBase::remove(key.condition()); }