Confdump Agent  1.4.0
LinuxDumper.hpp
Go to the documentation of this file.
00001 /* 
00002  * Confdump-Agent - Dump static and runtime system configuration
00003  * Copyright (C) 2009-2012  Straton IT, SAS
00004  * 
00005  * This program is free software: you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License version 3 as
00007  * published by the Free Software Foundation.
00008  * 
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #ifndef INCLUDED_SYSTEM_LINUXDRIVER_HPP
00019 #define INCLUDED_SYSTEM_LINUXDRIVER_HPP
00020 
00021 #include <iosfwd>
00022 
00023 #include "boost/enable_shared_from_this.hpp"
00024 #include "boost/filesystem/path.hpp"
00025 
00026 #include "Confdump/Dumper.hpp"
00027 #include "Confdump/NoSuchTable.hpp"
00028 #include "Confdump/System/Linux/ConfigurationFile.hpp"
00029 
00030 namespace Confdump
00031 {
00032 
00033 namespace System
00034 {
00035 
00044 class LinuxDumper : public Dumper, public boost::enable_shared_from_this<LinuxDumper>
00045 {
00046 public:
00047     class Impl;
00048 
00059     class SystemContext
00060     {
00061     public:
00072         boost::shared_ptr<std::streambuf> openRoFile( const boost::filesystem::path &path ) const;
00073 
00075 
00083         QByteArray slurpConfigurationFile( const boost::filesystem::path &path, QString refersToTable );
00084         QByteArray slurpConfigurationFile( QString path, QString refersToTable );
00086 
00087         SystemContext( boost::shared_ptr<LinuxDumper> driver );
00088         ~SystemContext();
00089         Result allConfigurationFiles() const;
00090 
00091     private:
00092         SystemContext();
00093         Result configurationFiles_;
00094         boost::shared_ptr<LinuxDumper> driver_;
00095     };
00096 
00097     LinuxDumper();
00098     virtual ~LinuxDumper();
00099 
00101     SystemContext& systemContext();
00102 
00103 private:
00104     virtual QStringList doListTables();
00105     virtual Result doQueryTable( QString table );
00106 
00113     virtual QString doComputerIdentifier();
00114 
00115     boost::shared_ptr< Impl > impl_;
00116 
00117     Result allConfigurationFiles();
00118     Result allProcesses();
00119     Result allEnvironmentVariables() const;
00120     Result operatingSystem() const;
00121     Result allSockets();
00122     Result allNetworkInterfaces() const;
00123     Result allMountEntries( const boost::filesystem::path &fstab_path );
00124     Result allInittabEntries();
00125 };
00126 
00133 namespace Linux
00134 {
00135 }
00136 
00137 }
00138 }
00139 
00140 #endif /* INCLUDED_SYSTEM_LINUXDRIVER_HPP */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends