Commit 670eae89 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

Merge branch 'trac2536'

parents e200b6ca 5b29cdb4
......@@ -34,9 +34,6 @@
#include <fstream>
using namespace isc::hooks;
using namespace std;
extern "C" {
/// @brief Append digit to marker file
......@@ -51,7 +48,7 @@ extern "C" {
int
appendDigit(const char* name) {
// Open the file and check if successful.
fstream file(name, fstream::out | fstream::app);
std::fstream file(name, std::fstream::out | std::fstream::app);
if (!file.good()) {
return (1);
}
......@@ -70,7 +67,7 @@ version() {
}
int
load(LibraryHandle&) {
load(isc::hooks::LibraryHandle&) {
return (appendDigit(LOAD_MARKER_FILE));
}
......
......@@ -34,9 +34,6 @@
#include <fstream>
using namespace isc::hooks;
using namespace std;
extern "C" {
/// @brief Append digit to marker file
......@@ -51,7 +48,7 @@ extern "C" {
int
appendDigit(const char* name) {
// Open the file and check if successful.
fstream file(name, fstream::out | fstream::app);
std::fstream file(name, std::fstream::out | std::fstream::app);
if (!file.good()) {
return (1);
}
......@@ -70,7 +67,7 @@ version() {
}
int
load(LibraryHandle&) {
load(isc::hooks::LibraryHandle&) {
return (appendDigit(LOAD_MARKER_FILE));
}
......
......@@ -47,6 +47,8 @@
#include <sstream>
using namespace isc;
using namespace isc::data;
using namespace isc::config;
using namespace isc::test;
using namespace isc::asiolink;
using namespace isc::dhcp;
......
......@@ -15,6 +15,9 @@
#include <gtest/gtest.h>
#include <dhcp6/tests/dhcp6_test_utils.h>
using namespace isc::dhcp;
using namespace isc::asiolink;
namespace isc {
namespace test {
......
This diff is collapsed.
......@@ -36,6 +36,8 @@
#include <sstream>
using namespace isc;
using namespace isc::data;
using namespace isc::config;
using namespace isc::test;
using namespace isc::asiolink;
using namespace isc::dhcp;
......
......@@ -38,6 +38,8 @@
/// (Make sure that the packet is expanded in the view. The text file will
/// contain whatever expansion level you have in the graphical tree.)
using namespace isc::dhcp;
using namespace isc::asiolink;
using namespace std;
namespace isc {
......
......@@ -18,14 +18,11 @@
#include <fstream>
#include <string>
using namespace std;
using namespace user_chk;
// The following constants are used throughout the library. They are defined
// in load_unload.cc
/// @brief Pointer to the registry instance.
extern UserRegistryPtr user_registry;
extern user_chk::UserRegistryPtr user_registry;
/// @brief Output filestream for recording user check outcomes.
extern std::fstream user_chk_output;
......
......@@ -35,7 +35,7 @@ UserFile::~UserFile(){
void
UserFile::open() {
if (isOpen()) {
isc_throw (UserFileError, "file is already open");
isc_throw(UserFileError, "file is already open");
}
file_.open(fname_.c_str(), std::ifstream::in);
......
......@@ -23,17 +23,15 @@
#include <fstream>
#include <string>
using namespace std;
namespace user_chk {
/// @brief Thrown a UserFile encounters an error.
/// Note that it derives from UserDataSourceError to comply with the interface.
class UserFileError : public UserDataSourceError {
public:
UserFileError(const char* file, size_t line,
const char* what) :
UserDataSourceError(file, line, what) { };
UserFileError(const char* file, size_t line, const char* what) :
UserDataSourceError(file, line, what)
{}
};
/// @brief Provides a UserDataSource implementation for JSON text files.
......@@ -125,7 +123,7 @@ public:
private:
/// @brief Pathname of the input text file.
string fname_;
std::string fname_;
/// @brief Input file stream.
std::ifstream file_;
......
......@@ -24,16 +24,14 @@
#include <string>
using namespace std;
namespace user_chk {
/// @brief Thrown UserRegistry encounters an error
class UserRegistryError : public isc::Exception {
public:
UserRegistryError(const char* file, size_t line,
const char* what) :
isc::Exception(file, line, what) { };
UserRegistryError(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what)
{}
};
/// @brief Defines a map of unique Users keyed by UserId.
......
......@@ -73,8 +73,8 @@ protected:
/// \param name query name of the message.
/// \param type query type of the message.
/// \return return the hash key.
HashKey getEntryHashKey(const isc::dns::Name& name,
const isc::dns::RRType& type) const;
isc::nsas::HashKey getEntryHashKey(const isc::dns::Name& name,
const isc::dns::RRType& type) const;
// Make these variants be protected for easy unittest.
protected:
......@@ -91,4 +91,3 @@ typedef boost::shared_ptr<MessageCache> MessageCachePtr;
} // namespace isc
#endif // MESSAGE_CACHE_H
......@@ -23,6 +23,7 @@
#include "logger.h"
using namespace isc::dns;
using namespace isc::nsas;
using namespace std;
// Put file scope functions in unnamed namespace.
......
......@@ -22,8 +22,6 @@
#include "rrset_cache.h"
#include "rrset_entry.h"
using namespace isc::nsas;
namespace isc {
namespace cache {
......@@ -33,7 +31,7 @@ class RRsetEntry;
///
/// The object of MessageEntry represents one response message
/// answered to the resolver client.
class MessageEntry : public NsasEntry<MessageEntry> {
class MessageEntry : public isc::nsas::NsasEntry<MessageEntry> {
// Noncopyable
private:
MessageEntry(const MessageEntry& source);
......@@ -92,7 +90,7 @@ public:
/// \brief Get the hash key of the message entry.
///
/// \return return hash key
virtual HashKey hashKey() const {
virtual isc::nsas::HashKey hashKey() const {
return (*hash_key_ptr_);
}
......@@ -173,7 +171,7 @@ protected:
private:
std::string entry_name_; // The name for this entry(name + type)
HashKey* hash_key_ptr_; // the key for messag entry in hash table.
isc::nsas::HashKey* hash_key_ptr_; // the key for messag entry in hash table.
std::vector<RRsetRef> rrsets_;
RRsetCachePtr rrset_cache_; //Normal rrset cache
......
......@@ -20,8 +20,6 @@
#include <util/lru_list.h>
using namespace isc::nsas;
namespace isc {
namespace cache {
......
......@@ -21,6 +21,7 @@
#include "rrset_copy.h"
using namespace isc::dns;
using namespace isc::nsas;
namespace isc {
namespace cache {
......
......@@ -22,8 +22,6 @@
#include <nsas/fetchable.h>
#include "cache_entry_key.h"
using namespace isc::nsas;
namespace isc {
namespace cache {
......@@ -60,7 +58,7 @@ enum RRsetTrustLevel {
/// The object of RRsetEntry represents one cached RRset.
/// Each RRset entry may be refered using shared_ptr by several message
/// entries.
class RRsetEntry : public NsasEntry<RRsetEntry>
class RRsetEntry : public isc::nsas::NsasEntry<RRsetEntry>
{
///
/// \name Constructors and Destructor
......@@ -105,7 +103,7 @@ public:
/// \brief Get the hash key
///
/// \return return hash key
HashKey hashKey() const {
isc::nsas::HashKey hashKey() const {
return (hash_key_);
}
......@@ -124,7 +122,7 @@ private:
time_t expire_time_; // Expiration time of rrset.
RRsetTrustLevel trust_level_; // RRset trustworthiness.
boost::shared_ptr<isc::dns::RRset> rrset_;
HashKey hash_key_; // RRsetEntry hash key
isc::nsas::HashKey hash_key_; // RRsetEntry hash key
};
typedef boost::shared_ptr<RRsetEntry> RRsetEntryPtr;
......
......@@ -17,9 +17,6 @@
#include <util/buffer.h>
#include <dns/message.h>
using namespace isc;
using namespace isc::dns;
namespace {
/// \brief Reads a Message from a data file
......@@ -27,13 +24,12 @@ namespace {
/// \param message Message to put the read data in
/// \param datafile The file to read from
void
messageFromFile(Message& message, const char* datafile) {
messageFromFile(isc::dns::Message& message, const char* datafile) {
std::vector<unsigned char> data;
UnitTestUtil::readWireData(datafile, data);
isc::UnitTestUtil::readWireData(datafile, data);
isc::util::InputBuffer buffer(&data[0], data.size());
message.fromWire(buffer);
}
} // namespace
......@@ -17,9 +17,6 @@
#include <util/buffer.h>
#include <dns/message.h>
using namespace isc;
using namespace isc::dns;
namespace {
/// \brief Counts the number of rrsets in the given section
......@@ -29,9 +26,9 @@ namespace {
///
/// \return The number of RRsets in the given section
int
sectionRRsetCount(Message& msg, Message::Section section) {
sectionRRsetCount(isc::dns::Message& msg, isc::dns::Message::Section section) {
int count = 0;
for (RRsetIterator rrset_iter = msg.beginSection(section);
for (isc::dns::RRsetIterator rrset_iter = msg.beginSection(section);
rrset_iter != msg.endSection(section);
++rrset_iter) {
++count;
......@@ -41,4 +38,3 @@ sectionRRsetCount(Message& msg, Message::Section section) {
}
} // namespace
......@@ -23,6 +23,7 @@
#include "cache_test_messagefromfile.h"
using namespace isc::cache;
using namespace isc::nsas;
using namespace isc;
using namespace isc::dns;
using namespace isc::util;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment