Confdump Agent
1.4.0
|
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 extern "C" 00019 { 00020 #include <sys/utsname.h> 00021 } 00022 00023 #include "Confdump/System/Linux/OperatingSystem.hpp" 00024 00025 namespace Confdump 00026 { 00027 00028 namespace System 00029 { 00030 00031 namespace Linux 00032 { 00033 00034 OperatingSystem::OperatingSystem( boost::shared_ptr<const LinuxDumper> driver ) 00035 { 00036 struct utsname info; 00037 uname( &info ); 00038 00039 sysname_ = QString::fromLocal8Bit( info.sysname ); 00040 nodename_ = QString::fromLocal8Bit( info.nodename ); 00041 release_ = QString::fromLocal8Bit( info.release ); 00042 version_ = QString::fromLocal8Bit( info.version ); 00043 machine_ = QString::fromLocal8Bit( info.machine ); 00044 } 00045 00046 OperatingSystem::~OperatingSystem() 00047 { 00048 } 00049 00050 QString OperatingSystem::osTypeName() const 00051 { 00052 return "LINUX"; 00053 } 00054 00055 QString OperatingSystem::sysname() const 00056 { 00057 return sysname_; 00058 } 00059 00060 QString OperatingSystem::nodename() const 00061 { 00062 return nodename_; 00063 } 00064 00065 QString OperatingSystem::release() const 00066 { 00067 return release_; 00068 } 00069 00070 QString OperatingSystem::version() const 00071 { 00072 return version_; 00073 } 00074 00075 QString OperatingSystem::machine() const 00076 { 00077 return machine_; 00078 } 00079 00080 } 00081 } 00082 }